Learn · Quantum error correction
How a surface code spots an error without looking at the data
A distance-3 surface code stores one logical qubit in nine data qubits. Eight checks each measure the parity of two or four neighbouring data qubits. An error flips the parity of the checks around it, and that pattern of fired checks (the syndrome) points to where the error is, without reading the data qubits themselves.
Why the checks do not disturb the data
Each check asks only whether its two or four qubits agree (an even or odd parity), never what any one of them holds. All eight checks commute with each other and with the encoded logical state, so they can be measured over and over while the logical qubit stays intact. In hardware an extra ancilla qubit per check collects the parity through CNOT gates and is then measured.
What happens next: decoding
The syndrome does not name the error directly. Different errors can give the same pattern, and measurements themselves can be wrong, so a decoder (for example minimum-weight perfect matching) picks the most likely correction from syndromes collected over several rounds. Try adding two X errors next to each other on the board: the check they share stays quiet, and only the ends of the chain fire.