Fault tolerance and the threshold theorem
Every lesson so far has made a quiet assumption: noise strikes the data, and then a perfect machine measures the checks and applies the fix. Real machines are not like that. The CNOTs that extract a syndrome are as unreliable as any other gate, the ancillas are as fragile as the data, and the measurements sometimes report the wrong answer. A code with more qubits and more gates has more places for things to go wrong.
So it is fair to ask whether error correction helps at all, or whether the cure is worse than the disease. This lesson explains why it helps, on one condition.
Errors spread through gates
Section titled “Errors spread through gates”The first danger is that a two-qubit gate can turn one error into two. To see how, ask what happens to an error that occurs just before a CNOT.
The circuit was meant to apply a CNOT to , giving . But an unwanted struck the control qubit just before the CNOT. Repair the output.
This puzzle needs JavaScript.
Hint
The unwanted flipped the control, and the control then flipped the target.
This time the target starts in , and an unwanted struck the target just before the CNOT. The output should have been . Repair it.
This puzzle needs JavaScript.
Hint
This is phase kickback. A on the target travels backwards through the CNOT to the control as well.
Each puzzle needed two gates to repair one fault. The rules are:
| Error before the CNOT | Error after the CNOT |
|---|---|
| on the control | on the control and on the target |
| on the target | on the target |
| on the control | on the control |
| on the target | on the control and on the target |
Bit flips are copied forwards, from control to target. Phase flips are copied backwards, from target to control.
Now think about measuring a four-qubit check with one ancilla and four CNOTs. If the ancilla suffers an error halfway through, the remaining CNOTs copy it onto two data qubits. One fault has produced two errors in the same code block, and a distance-3 code cannot correct two. Naively built, the checking circuit is itself the main source of uncorrectable errors.
An unwanted strikes the target of a CNOT just before the gate. Where is the error afterwards?
A CNOT flips the target or leaves it alone, depending on the control. Either way an extra flip of the target beforehand is just an extra flip afterwards, and the control never learns of it. Bit flips spread from control to target only.
Designing for faults
Section titled “Designing for faults”A procedure is fault-tolerant if a small number of faults anywhere in it leads to only a small number of errors in each code block: few enough for the code to correct. For a distance-3 code the rule is that one fault must never cause two errors in one block. Three techniques do most of the work.
Transversal gates. As you saw for the Steane code, a transversal gate acts on each qubit of a block separately. A faulty gate touches one qubit per block, and errors already present cannot spread within a block.
Careful syndrome extraction. The ancilla is the weak point, so it is made harder to corrupt, or its corruption is made harmless. Some schemes replace the single ancilla with several qubits in a checked entangled state, so that each data qubit meets a different ancilla qubit. Others add “flag” qubits that raise an alarm when the ancilla misbehaves. In the surface code it is enough to choose the order of the four CNOTs so that the pair of errors a faulty ancilla can cause does not point along a logical operator.
Repeated measurement. A measurement can simply give the wrong answer. So syndromes are measured many times and no single reading is trusted. The lesson on decoding returns to this.
The threshold theorem
Section titled “The threshold theorem”Suppose all of that has been done for a distance-3 code, so that no single fault can cause a logical error. Then a logical error needs at least two faults. If each operation fails with probability , the chance of a logical error in one round is roughly
where counts the pairs of places where two faults add up to disaster. Encoding helps exactly when this is smaller than the bare error rate :
The number is the threshold. Above it, the extra machinery adds more errors than it removes. Below it, encoding is a net gain.
A gain can be reinvested. Treat each encoded qubit as a better physical qubit, with error rate , and encode those with the same code. This is concatenation, as in the Shor code. The second level has error rate , the third , and so on. Written in terms of the threshold, the pattern is
The exponent doubles at every level. Take and , a tenth of the threshold:
| Level | Logical error rate |
|---|---|
| 0 (bare qubit) | |
| 1 | |
| 2 | |
| 3 |
Three levels take one error in a thousand to one in ten billion. The price is qubits: each level multiplies the count by the size of the code. But because the error rate falls so fast, few levels are needed, and the overhead grows only as a power of the logarithm of the size of the computation.
This is the threshold theorem, proved in the late 1990s by several groups:
If the error rate of every physical operation is below a fixed threshold, an arbitrarily long quantum computation can be carried out to any desired accuracy, with only a modest overhead in qubits and time.
It rests on assumptions: errors must be reasonably independent of one another, fresh ancillas must be available throughout, and operations must be possible in parallel. Given those, noise is not a fundamental barrier to quantum computing. It is an engineering target.
With and a physical error rate of , what is the logical error rate after two levels of concatenation?
Level 2 has exponent : . Being only a factor of two below threshold, the gain per level is small. How far below threshold you operate matters a great deal.
A threshold you can see
Section titled “A threshold you can see”The surface code is not concatenated. It gets stronger by growing: a patch of distance needs about errors lined up to fail, so below threshold its logical error rate behaves like
for some constant . Each step from to multiplies the logical error rate by . Below threshold that is a reduction. Above it, growing the patch makes things worse.
The simulator shows this for the simplest possible noise. Each data qubit suffers an error with the probability you choose, the checks are then measured perfectly, and a minimum-weight decoder picks the correction. The curves show how often that leaves a logical error, for patches of distance 3, 5 and 7. The vertical scale is logarithmic.
Things to try:
- Set the error rate to 2%. Read off the three logical error rates. How much does each step in distance buy?
- Raise it to 15%. Which patch is best now?
- Find the error rate at which the three curves cross. That crossing is the threshold for this model.
- Press the button to run the experiment live in your browser and compare with the curves.
The crossing is near 10%. Do not carry that number away as “the threshold of the surface code”. This model is generous: it has only one kind of error and its measurements are perfect. When every gate, every measurement and every idle moment can fail, as in a real device, the threshold is around 1%, and lower still for some kinds of noise. The shape of the picture is what carries over: a crossing point, with exponential improvement on one side of it.
Computing, not just storing
Section titled “Computing, not just storing”Keeping a logical qubit alive is half the job. We must also apply gates to it without ever decoding, and each logical gate must be fault-tolerant too.
For the codes in this track, the gates , and CNOT are comparatively easy: they are transversal for the Steane code and have efficient constructions on the surface code. But those gates alone can be simulated classically, as the stabilizer lesson noted. A universal quantum computer needs at least one more gate, typically .
Here there is a no-go result, the Eastin–Knill theorem: no error-correcting code has a transversal set of gates that is universal. Every code is missing something, and the missing gate must be obtained another way. The standard way has two parts:
- Magic state distillation. Prepare many noisy copies of the special state . Using only the easy gates, convert many noisy copies into a few much cleaner ones.
- Gate teleportation. Consume one clean copy to apply a gate to a logical qubit, using a circuit closely related to teleportation.
In many designs, the “factories” that distil magic states account for a large share of all the qubits in the machine.
On the surface code, gates between logical qubits are usually done by lattice surgery: two patches are temporarily merged along an edge by measuring checks that span both, then split again. Everything stays local and flat.
What it adds up to
Section titled “What it adds up to”Put together, the overhead is large. Published estimates for factoring a 2048-bit RSA number with a surface-code machine have ranged from about twenty million physical qubits, in 2019, to under a million, in 2025. The fall came from better constructions at every level, not from assuming better hardware: both figures suppose that each physical operation fails about once in a thousand tries. Today’s machines have from a hundred or so to a few thousand physical qubits, and few of them reach that error rate on every operation.
That gap is why error correction is where most of the effort in the field now goes. But it is a gap of engineering. The threshold theorem says there is no wall in the way.
One piece of the machine has been kept in the background throughout: the classical computer that reads the syndromes and decides what to do. The final lesson is about that.
Remember it
Section titled “Remember it”How do errors spread through a CNOT?
An on the control is copied to the target. A on the target is copied to the control. The other two cases do not spread.
What does it mean for a procedure to be fault-tolerant?
A small number of faults anywhere in it causes only a small number of errors in each code block, few enough for the code to correct.
State the threshold theorem.
If every physical operation has an error rate below a fixed threshold, arbitrarily long quantum computations can be done to any accuracy with modest overhead.
With threshold and physical error rate , what is the logical error rate after levels of concatenation?
. Below threshold it falls doubly exponentially in .
What does the Eastin–Knill theorem say, and how is it worked around?
No code has a universal set of transversal gates. The missing gate, usually , is supplied by distilling magic states and teleporting the gate.
Below threshold, how does the surface code's logical error rate change when the distance goes from to ?
It is multiplied by roughly , since .