A single qubit is fragile — touch it and the quantum information leaks away. The surface code protects one logical qubit by spreading it across a lattice of physical qubits and constantly measuring parity checks that detect errors without ever reading the data. Click any data qubit to inject an error; watch the stabilizers light up as a syndrome. This is the leading path to a fault-tolerant quantum computer.
how to protect a qubit you're not allowed to look at
The no-cloning theorem forbids copying a qubit, and measuring it destroys its superposition — so classical "repeat the bit 3 times" error correction can't be used directly. The surface code's trick: never measure the data. Instead measure stabilizers — joint parity checks on groups of 4 neighboring qubits that commute with the logical information.
On the lattice above, data qubits sit on the edges. Two kinds of check operators alternate like a checkerboard:
• Z-stabilizers (plaquettes) multiply the Z operators of their 4 surrounding qubits — they detect bit-flip (X) errors.
• X-stabilizers (vertices) multiply the X operators — they detect phase-flip (Z) errors.
A single error flips the two stabilizers at the ends of its error chain, producing a syndrome — a pair of lit-up defects. The decoder (minimum-weight perfect matching, or now a neural net) pairs up defects and infers the most likely error chain, then corrects it. Crucially, the syndrome reveals where errors are without revealing the data.
Logical operators are error chains that stretch all the way across the lattice connecting opposite boundaries — these are undetectable and would corrupt the logical qubit. A distance-d code needs an error chain of length d to cause a logical failure, so it corrects any ⌊(d−1)/2⌋ errors. Bigger lattice = more protection.
The threshold theorem: as long as the physical error rate is below ~1% (the surface-code threshold), increasing d drives the logical error rate down exponentially. In 2023–2024 Google demonstrated a distance-7 surface code that was below threshold — the first time adding qubits made the logical qubit better, not worse. This is the experimental milestone the whole field was waiting for: errors can, in principle, be suppressed arbitrarily. A useful machine needs millions of physical qubits encoding thousands of logical ones.