You've read What is a qubit? and seen that a qubit is “a tiny thing that points in a direction.” That direction story is the right picture, but everyone working with qubits uses a slightly different language: the language of math. This guide is the bridge.
Everything that follows is at a 12th-grade level. If you're comfortable with algebra, a bit of trigonometry, and the Pythagorean theorem, you'll be fine.
Measurement is a choice between two outcomes
Here's the most important thing to know about a qubit: when you measure it, you only ever get one of two answers. That's it. The measurement device always picks one of two outcomes.
We give those two outcomes names. By convention, we call them:
|0⟩
Read it “ket zero.” One of the two outcomes.
|1⟩
Read it “ket one.” The other outcome.
The vertical bar and angle bracket are called ket notation. They're just a label saying “this is a quantum state.” You can think of |0⟩ and |1⟩ as the quantum equivalents of the classical bits 0 and 1.
Try measuring a qubit a few times below. Each measurement gives you exactly one of two outcomes.
The state as a linear combination
Here's the key move. We're going to picture the two possible outcomes as two perpendicular axes on a graph, and the qubit's state as an arrow on that graph.
The arrow above represents a qubit state, which we call |ψ⟩ (“ket psi”). Its projection onto the |0⟩ axis has length α, and its projection onto the |1⟩ axis has length β. We write this as:
|ψ⟩ = α|0⟩ + β|1⟩
That equation is doing exactly what it looks like. We've broken the arrow |ψ⟩ into two pieces: a piece in the |0⟩ direction (with size α) and a piece in the |1⟩ direction (with size β). This is called a linear combination of |0⟩ and |1⟩.
The numbers α and β are called amplitudes. They tell us how much of each outcome is mixed into the state.
A concrete example
If the qubit is sitting exactly along the |0⟩ axis, then α = 1 and β = 0. We write:
|ψ⟩ = 1·|0⟩ + 0·|1⟩ = |0⟩
Likewise, if the qubit points straight up the |1⟩ axis, then α = 0 and β = 1, so |ψ⟩ = |1⟩.
But the interesting case is when both are nonzero: the arrow points between the two axes, and the qubit is in a superposition of both outcomes at once.
Probabilities: the Born rule
When a qubit is in superposition and you measure it, you still only get one of the two outcomes. But which one? The amplitude tells you.
The rule is named after the physicist Max Born. It says:
P(measure |0⟩) = α2
P(measure |1⟩) = β2
The probability of each outcome is the square of its amplitude. That's the Born rule, one of the most important formulas in all of quantum mechanics.
For example, if α = 0.6 and β = 0.8, then measuring the qubit will give you:
|0⟩with probability0.62 = 0.36(36% of the time).|1⟩with probability0.82 = 0.64(64% of the time).
Why the amplitudes must add up
Notice something about the example above: 0.36 + 0.64 = 1. That isn't a coincidence. The probabilities of all possible outcomes have to add up to 100%, because something definitely happens when you measure. Plugging in the Born rule:
α2 + β2 = 1
That equation has a beautiful geometric meaning. Look back at the axes chart: the state |ψ⟩ is an arrow with horizontal component α and vertical component β. By the Pythagorean theorem, the length of that arrow is:
length of |ψ⟩ = √(α2 + β2) = √1 = 1
So a valid qubit state is an arrow of length 1. It can point in any direction, but it always has length 1. In math language, the state is a unit vector.
Measuring in another basis
Here's a strange and important fact: we chose |0⟩ and |1⟩ as our two outcomes by convention, but that's not the only choice. We could just as well pick any two perpendicular directions on the plane and call those our outcomes.
Two of the most common alternative outcomes are |+⟩ (“ket plus”) and |−⟩ (“ket minus”). They're defined as 45° rotations of |0⟩ and |1⟩:
|+⟩ = (1/√2) |0⟩ + (1/√2) |1⟩
|−⟩ = (1/√2) |0⟩ − (1/√2) |1⟩
{|0⟩, |1⟩} projects the state onto the gray axes. Measuring in {|+⟩, |−⟩} projects onto the indigo axes, which are the same plane rotated 45°.When a quantum computer “measures in the X basis,” it's measuring along the |+⟩ / |−⟩ axes instead of the |0⟩ / |1⟩ axes. The same physical qubit gives different probabilities depending on which axes you measure along.
This is one of the most counter-intuitive parts of quantum mechanics. The qubit doesn't have a hidden “true” answer waiting to be revealed. What it tells you depends on the question you ask.
The Born rule still works
To find the probability of measuring |+⟩ instead of |0⟩, we just rewrite the state in the new basis. If we write
|ψ⟩ = γ|+⟩ + δ|−⟩
then the probabilities are γ2 and δ2, and they still add up to 1. The Born rule is the same; only the axes change.
The complex twist
Everything we've done so far works on a 2D plane with real-number amplitudes. But there's one more piece of the puzzle: amplitudes can actually be complex numbers, not just real numbers.
(If you haven't seen complex numbers before: they're numbers of the form a + bi, where i = √−1. They show up all the time in physics and engineering.)
When the amplitudes are complex, the Born rule needs a small adjustment. Instead of squaring the amplitude, we take its squared magnitude:
P(measure |0⟩) = |α|2
P(measure |1⟩) = |β|2
|α|2 + |β|2 = 1
For complex a + bi, the squared magnitude is a2 + b2. If the amplitudes happen to be real, then |α|2 is just α2 and everything from before still works.
The complex part of the amplitude has a name: phase. It doesn't affect the probability of any single measurement, but it absolutely matters when qubits interact, when you apply gates, or when you measure in a different basis. Phase is what makes interference patterns possible, and it's what makes quantum computers more powerful than classical ones.
From a plane to a sphere
We started with a 2D plane: |0⟩ on one axis, |1⟩ on the other. Then we added |+⟩ and |−⟩, which are 45° rotations in that same plane. So far we're still in 2D.
The phase changes everything. Because the amplitudes are complex, the “plane” we've been drawing is actually a slice through a higher-dimensional space. When you fold in the phase, the qubit's state lives on the surface of a 3D sphere: the Bloch sphere.
Z axis
|0⟩, |1⟩
Top and bottom of the sphere.
X axis
|+⟩, |−⟩
Right and left, the 45° rotation.
Y axis
|+i⟩, |−i⟩
Front and back, where the phase becomes visible.
Each pair is a valid pair of measurement outcomes. Whichever pair you pick is the “axes” you measure along. The qubit's state is one specific point on the surface of the sphere, and the probabilities you get depend on the angle between that point and the axis you measured along.
That's the math. Everything else you'll see (gates, entanglement, error correction) is built on top of these ideas.
Where to go from here
Three good next steps:
- What is the Bloch sphere? takes the 3D picture seriously.
- The Hadamard gate is the gate that turns
|0⟩into|+⟩. It's the first thing you do in nearly every quantum algorithm. - What is quantum entanglement? shows what happens when two qubits become connected.