Learn · 07
How quantum error correction works

The best qubits today make an error about once in every thousand operations. Useful algorithms such as Shor’s need billions of operations in a row. Without a way to catch errors as they happen, a long computation is certain to go wrong.
Ordinary computers have the same problem, on a much smaller scale, and the oldest fix is to repeat yourself. Store 0 as 000 and 1 as 111. If one copy flips and 000 becomes 010, a vote of the three still says 0. If each copy has a 1% chance of flipping, the vote is wrong only when two or more flip at once, which happens about 0.03% of the time.
Qubits block both halves of that plan. An unknown qubit can’t be copied (the no-cloning theorem). And reading the copies to take a vote would be a measurement, which destroys the blend being protected.
The way around both is to spread the qubit out without copying it, and to compare qubits without reading them. Link gates (from the entanglement lesson) spread one qubit’s amplitudes across three: the amplitude for 0 goes on 000 and the amplitude for 1 goes on 111. That isn’t three copies. It’s one entangled state, and none of the three qubits holds the blend on its own.
Then the pairs get checked. An extra qubit, linked to two neighbours, can be measured so that it answers only one question: do these two agree? For 000 and 111 the answer is yes either way, so the check learns nothing about which is stored, and the blend survives. If the middle qubit flips, both checks touching it report a disagreement. That points to the middle qubit whatever the stored value is, and flipping it back restores the state. This is quantum error correction.
The simulation stores one bit on a row of qubits. Each round, every qubit flips with the chance set by the slider. The checks between neighbours light up where they disagree, and the fix flips back the smaller group. The grids record up to 1,000 rounds, for a lone qubit and for the code.
The slider sets the chance that each qubit flips in a round.
The code fails only when more than half its qubits flip in the same round, and that gets rare quickly as the code grows. At 10%, a lone qubit fails one round in ten. A code of 5 fails under 1% of rounds, and a code of 9 about 0.09%.
In the simulation, the code helps whenever each qubit flips less than half the time. Real codes have a much lower cut-off, because the checks and fixes are themselves made of qubits and gates that make mistakes. Below the cut-off, a bigger code removes errors faster than its extra parts add them. Above it, a bigger code makes things worse. For the code most chips use, the cut-off is around 1% per operation, which is why the error rate of each physical qubit matters as much as how many there are.
Qubits also suffer a kind of error that ordinary bits don’t. The sign of the amplitude for 1 can flip, the way Flip does in the interference lesson. A row of qubits can’t see that error, because a sign flip doesn’t turn 000 into anything else. The surface code catches both kinds by laying qubits out in a grid with two sorts of check between them. The group that acts as one reliable qubit is called a logical qubit, and with today’s error rates it takes from a few hundred to about a thousand physical qubits.
In December 2024, Google reported that its Willow chip had crossed the cut-off. It ran surface codes on grids of 3 × 3, 5 × 5 and 7 × 7 qubits holding the data, and each step up cut the error rate roughly in half. The largest used 101 qubits in all and held its information longer than the chip’s best single qubit. Every serious estimate of when quantum computers could break encryption counts logical qubits for this reason. The Q-Day tracker follows those estimates.