The Nine-Qubit Shor Code (Theory)
Shor's nine-qubit code was the first demonstration that arbitrary single-qubit errors can be corrected. Its design idea is beautifully simple: concatenate the phase-flip and bit-flip repetition codes so that one protects against and the other against , and (because ) the combination handles everything.
The construction
Encode in two layers. First the phase-flip code maps a qubit to three:
Then each of those three qubits is itself protected by the bit-flip code, and . The logical codewords on nine qubits are
This is a code: nine physical qubits, one logical qubit, distance three.
The stabilizer generators
There are independent generators. Six are -type, checking bit parities within each block of three:
Two are -type, checking phase parities between the three blocks:
All eight commute (each -pair overlaps each weight-six -operator on an even number of qubits, so they commute), and together they fix the two-dimensional codespace.
How it catches every single-qubit error
Bit flips (): anticommute with the -type generators inside their block, exactly like the ordinary repetition code — the syndromes localise and correct the flip.
Phase flips (): a on any qubit of a block flips the sign of that block's state, i.e. it acts as a phase flip on the block-level qubit. The two -type generators compare the phase parity across blocks and pin down which block flipped.
: detected and corrected by both mechanisms at once.
Degeneracy
The Shor code is degenerate: distinct phase errors can act identically on the codespace. For instance , , and all flip the sign of the first block's factor in the same way, so is a stabilizer that acts trivially. The code corrects all weight-one phase errors even though it does not assign them distinct syndromes — a hallmark of degeneracy, our next topic.
The takeaway
Shor's code nests a bit-flip code inside a phase-flip code; its six -type and two -type stabilizers detect bit flips within blocks and phase flips between blocks. Because is a product of and , the code corrects any single-qubit error — the first proof that fully quantum error correction is possible.
Sign in on the full site to ask questions and join the discussion.