• Error Correction

Repetition Code

The simplest quantum error correction code, encoding one logical qubit into multiple physical qubits to protect against either bit-flip or phase-flip errors (but not both simultaneously).

The repetition code is the simplest quantum error correcting code and the natural starting point for understanding quantum error correction. A distance-dd repetition code encodes one logical qubit into dd physical qubits. It can correct up to (d1)/2\lfloor(d-1)/2\rfloor errors of a single type (bit-flip or phase-flip), but not both simultaneously. Despite this limitation, the repetition code is the most important pedagogical and experimental testbed for error correction.

Bit-flip repetition code

The distance-3 bit-flip repetition code encodes:

0L=000,1L=111|0\rangle_L = |000\rangle, \quad |1\rangle_L = |111\rangle

A general logical state α0L+β1L=α000+β111\alpha|0\rangle_L + \beta|1\rangle_L = \alpha|000\rangle + \beta|111\rangle is protected against any single bit-flip (XX) error.

Error detection uses d1d - 1 ancilla qubits to measure parity checks between adjacent data qubits. For three data qubits, the two stabilizer generators are:

S1=Z1Z2,S2=Z2Z3S_1 = Z_1 Z_2, \quad S_2 = Z_2 Z_3

Each stabilizer measures whether two adjacent qubits agree (eigenvalue +1+1) or disagree (eigenvalue 1-1). The pair of measurement outcomes forms the syndrome:

ErrorSyndrome (S1S_1, S2S_2)
No error(+1, +1)
X1X_1(-1, +1)
X2X_2(-1, -1)
X3X_3(+1, -1)

The syndrome uniquely identifies which qubit had an error, allowing correction without learning the logical state.

Phase-flip repetition code

By encoding in the Hadamard-rotated basis:

0L=+++,1L=|0\rangle_L = |{+}{+}{+}\rangle, \quad |1\rangle_L = |{-}{-}{-}\rangle

the code protects against single phase-flip (ZZ) errors instead. The stabilizers become X1X2X_1 X_2 and X2X3X_2 X_3.

The fundamental limitation is that no repetition code can correct both XX and ZZ errors. Protecting against both requires codes with more structure, such as the Shor code or the surface code.

Experimental significance

The repetition code is the first error correction code that every major quantum hardware platform demonstrates. Google’s landmark 2023 experiment showed that a distance-5 repetition code outperformed a distance-3 code, confirming below-threshold error correction behavior. IBM has similarly demonstrated repetition codes on their processors as a stepping stone toward surface code demonstrations.

These experiments are important because they validate the full error correction cycle: state preparation, repeated syndrome measurement, classical decoding, and correction, all operating faster than errors accumulate.

Why it matters for learners

The repetition code introduces all the key concepts of quantum error correction (stabilizers, syndromes, code distance, logical operators, thresholds) in the simplest possible setting. Once you understand how the repetition code works, the surface code is a natural generalization that handles both error types simultaneously using the same local measurement structure extended to two dimensions.

See also