In quantum superposition, a qubit’s state is a combination of the outcomes 0 and 1, each weighted by a number called an amplitude. Square the size of an amplitude and you get the probability of that outcome when you measure the qubit.
“Both 0 and 1 at once” is the usual shorthand, and it describes two different states equally well. Each gives 0 half the time and 1 half the time, yet after one standard operation, the Hadamard gate, the first gives 0 every time and the second gives 1 every time. The two states differ in the sign of one amplitude, called its phase, and quantum algorithms depend on it.
Amplitudes and probabilities
A qubit, the quantum counterpart of a bit, is a physical system with two distinguishable states, such as a trapped ion or a superconducting circuit. The states are written |0⟩ and |1⟩, read “ket zero” and “ket one”. Any state of the qubit has the form a|0⟩ + b|1⟩, where a and b are its amplitudes. When both are nonzero, the qubit is in superposition.
Measuring a qubit, which reads it out, always returns 0 or 1. The probability of 0 is the square of a’s size, meaning its value without any minus sign. The probability of 1 is the square of b’s size. The two always add up to 1. Take a = 0.8 and b = −0.6. The squares are 0.64 and 0.36, so this qubit gives 0 with probability 64% and 1 with the remaining 36%. Change b to +0.6 and the odds don’t change, because −0.6 and +0.6 have the same square.
The squaring rule is called the Born rule, after the physicist Max Born, who proposed it in 1926. In the main text of his paper Born linked the probability to the amplitude itself, and the square appears only in a note added in proof.
Measuring also changes the qubit. Afterwards it’s in |0⟩ or |1⟩, whichever it reported, and measuring again gives the same answer. One measurement gives you one bit, so to estimate the sizes of a and b you’d prepare the same state many times and count the results. From those counts you learn the sizes of the amplitudes, never their signs.
Phase and the Hadamard gate
A gate is an operation on qubits, the quantum counterpart of a logic gate in an ordinary processor. Apply the Hadamard gate, written H, to |0⟩ and you get a state called |+⟩. Apply it to |1⟩ and you get |−⟩.
- |+⟩ = (1/√2)|0⟩ + (1/√2)|1⟩
- |−⟩ = (1/√2)|0⟩ − (1/√2)|1⟩
The number 1/√2 is about 0.707 and its square is exactly 1/2, so both states give 0 half the time and 1 half the time. You can’t tell them apart by measuring them directly, however many times you try.
Apply H to them and the results are opposite. H turns |+⟩ into |0⟩ and |−⟩ into |1⟩, so one reads 0 every time and the other reads 1 every time. The minus sign on the second amplitude of |−⟩ is the whole difference, and it’s called the relative phase.
In general, amplitudes are complex numbers, which have an angle as well as a size. The probability depends only on the size. The angle is the phase: 0° for a positive amplitude, 180° for a negative one, and any value up to 360° for a complex one. Only the difference between the two amplitudes’ angles has a measurable effect, so if you flip both signs of |+⟩, nothing you can measure changes.
The Bloch sphere
The Bloch sphere, named after the physicist Felix Bloch, is a map of every state one qubit can be in. Picture a globe with |0⟩ at the north pole and |1⟩ at the south pole. Latitude gives the probabilities: the farther north a state is, the more likely a measurement is to return 0. Every point on the equator is a 50/50 state. Longitude is the relative phase, so |+⟩ and |−⟩ are opposite points on the equator. The states 0.8|0⟩ + 0.6|1⟩ and 0.8|0⟩ − 0.6|1⟩ from the earlier example are both about 16° north of the equator, 180° of longitude apart.
Every single-qubit gate corresponds to a rotation of the globe. H is a half-turn about the axis halfway between the north pole and the point for |+⟩ on the equator. Give the globe that half-turn and the points for |0⟩ and |+⟩ swap places, as do the points for |1⟩ and |−⟩. A second half-turn completes a full turn, and every point is where it started.
The globe describes one qubit. Qubits that are entangled, meaning their measurement results are correlated, can’t be fully described by giving each qubit a point on its own globe.
Two Hadamard gates in a row
Start with |0⟩ and apply H twice. You need one rule to follow the arithmetic: a gate acts on each part of a superposition separately, and the contributions to each amplitude are then added up.
- The first H gives |+⟩, with amplitude 1/√2 on |0⟩ and 1/√2 on |1⟩.
- The second H turns the |0⟩ part into (1/√2)|+⟩. That contributes 1/2 to the |0⟩ amplitude and 1/2 to the |1⟩ amplitude, because 1/√2 × 1/√2 = 1/2.
- The second H turns the |1⟩ part into (1/√2)|−⟩. That contributes 1/2 to the |0⟩ amplitude and −1/2 to the |1⟩ amplitude.
- Add the contributions. The |0⟩ amplitude is 1/2 + 1/2 = 1 and the |1⟩ amplitude is 1/2 − 1/2 = 0, so the qubit is in |0⟩ again and reads 0 every time.
The contributions to |0⟩ add up and the contributions to |1⟩ cancel. Combining amplitudes so that some add and others cancel is called interference.
A coin flip is described by probabilities alone. If H were a randomizer giving 0 or 1 with even odds, two in a row would still give 50/50, because 1/2 × 1/2 + 1/2 × 1/2 = 1/2. Probabilities are never negative, so two routes to the same outcome can only add; amplitudes can be negative, so the two routes to |1⟩ can cancel.
Measure between the two gates and you get the coin-flip result. After that measurement the qubit is in |0⟩ or |1⟩. The second H gives |+⟩ or |−⟩, and the final reading is 50/50. Measured directly, the superposition |+⟩ and a bit you haven’t looked at both give 50/50. After one more H, |+⟩ gives 0 every time and the bit still gives 50/50.
What a speedup requires
Measure 20 qubits that are each in |+⟩ and you get one 20-bit string out of 2^20, or 1,048,576, chosen at random. You can apply gates that act on all 1,048,576 amplitudes, but you can read out only 20 bits.
Algorithm designers get a speedup by arranging the gates so that the amplitudes of wrong answers cancel, as the |1⟩ contributions did above. The same gates increase the amplitude of the right answer until a measurement is likely to return it. That’s possible only for problems with suitable mathematical structure. Factoring is one. Shor’s algorithm, run on a large quantum computer that corrects its own errors, would use that structure to break RSA encryption. The simplest algorithm of this kind, Deutsch’s, is worked through in Quantum Parallelism: What “All at Once” Leaves Out.
Our Quantum Computing Fundamentals course explains how quantum computers work, without the physics degree. It covers qubits, gates and algorithms at a conceptual and practical level, five major hardware modalities, quantum error correction and how to evaluate claims critically.
Three circuits to try
You can check the worked example in any quantum circuit simulator. Build three one-qubit circuits that start in |0⟩ and run each one 1,000 times.
- H, then measure. Expect roughly 500 zeros and 500 ones.
- H, H, then measure. Expect 0 every time.
- H, Z, H, then measure. The Z gate flips the sign of the |1⟩ amplitude, so |+⟩ becomes |−⟩, a change you can’t see by measuring directly. Expect 1 every time.
Circuits 2 and 3 differ only by that sign, and they give opposite answers. On real hardware a small share of runs will return the wrong value, because gates and measurements on physical qubits are imperfect and an ideal simulator treats them as perfect.