The Nine-Qubit Shor Code
Peter Shor's 1995 code nests a bit-flip code inside a phase-flip code to correct any single-qubit error, proving quantum error correction is possible.
Construction by concatenation
The Shor code is built in two layers. The outer layer is the three-qubit phase-flip code, encoding into three blocks. Each block is then protected against bit flips by the three-qubit repetition code, using three physical qubits. The result uses 9 physical qubits for 1 logical qubit.
The logical codewords are |0_L> = ( |000> + |111> )( |000> + |111> )( |000> + |111> ) / (2 sqrt(2)) and |1_L> = ( |000> - |111> )( |000> - |111> )( |000> - |111> ) / (2 sqrt(2)). Each parenthesized block is a GHZ-like state, and the plus/minus between the pairs encodes the phase information.
Correcting all single-qubit errors
Within each block, comparing the three qubits corrects a bit flip. Comparing the relative sign across the three blocks corrects a phase flip. A Y error is XZ, so it is caught by both layers together.
- Bit flip X on any qubit: caught by the intra-block Z Z parities.
- Phase flip Z on any qubit: caught by the inter-block X-type parities.
- Y = iXZ: corrected because both X and Z parts are detected.
- Distance 3: corrects any single-qubit error, detects some two-qubit errors.
Why it matters
The Shor code was the first demonstration that the continuous, non-cloneable, measurement-fragile nature of qubits does not forbid error correction. The key insight, later formalized in the stabilizer formalism, is the discretization of errors: any single-qubit error is a linear combination of I, X, Z, Y, and the syndrome measurement projects it onto one of these discrete cases, which the code then corrects.
The Shor code is a CSS code and a member of the more general family of concatenated codes. Smaller codes with the same distance exist, notably the seven-qubit Steane code and the five-qubit perfect code, but the Shor code remains the clearest conceptual proof of principle.