The surface code can fix errors — but only if your hardware is good enough to begin with. There is a sharp line, the threshold: cross to the good side and making the code bigger crushes the error rate exponentially; stay on the bad side and bigger only makes things worse. Then one last gap: stabilizer codes can’t do every gate for free. The missing piece is magic.
Adding more qubits to a code is a bet. On one side of the threshold the extra qubits help: each step up in distance multiplies your reliability, and the logical error rate plummets. On the other side they hurt: more qubits just means more places to fail, so a bigger code is a worse code. The threshold theorem says this line is sharp and that, once you’re safely below it, arbitrarily reliable computation is possible — you simply pay in qubits.
Think of bailing water from a boat. If you can scoop faster than the leak lets water in, then a bigger bucket (more effort) keeps you ever drier — you’ll never sink. But if the leak outpaces you, a bigger bucket just tires you out faster while the boat fills anyway. The leak rate is your hardware error p; your bailing skill is the threshold. Beat the threshold and effort pays off without limit; fall short and no amount of effort saves you.
Drag your hardware’s physical error rate p. The three curves are surface codes of distance 3, 5 and 7. Watch what happens as you slide past the threshold (the dashed line at 1%): to its left the bigger codes dive toward zero; to its right they fan out and the bigger codes are worse.
The logical error rate of a distance-d surface code follows a clean scaling law:
Because d sits in the exponent, every two steps of distance roughly multiply the suppression again — you buy as many decades of reliability as you like. The bill is the qubit count, which grows as d²:
There’s a catch the threshold can’t fix. A stabilizer code applies Clifford gates (H, S, CNOT) cleanly — but the Gottesman–Knill theorem says Clifford-only circuits are simulable on a laptop. To get real quantum power you need at least one non-Clifford gate, the T gate, and the code refuses to do it transversally.
The fix is magic-state distillation. You can’t apply a T gate directly, but if someone hands you a perfect “magic” qubit |T〉, you can consume it with cheap Clifford gates to enact one T. Real magic states are noisy — so you take many mediocre copies and run a small protocol that outputs fewer, much cleaner ones, repeating until they’re good enough.
“Below the threshold the error is zero.” It is never exactly zero — just suppressed exponentially in d. You pick a d large enough that pₗ is small enough for your whole computation, then stop.
“Error correction makes qubits free.” The opposite — one good logical qubit can cost hundreds to thousands of physical ones, plus separate magic-state factories. The overhead is the central engineering challenge.
“If Cliffords are protected, we’re done.” Clifford-only circuits are classically simulable (Gottesman–Knill). The quantum advantage lives in the T gates — which is exactly why magic states matter.