The Repetition Code Revisited
We met the three-qubit repetition code informally as a first example of protecting a bit. Now we recast it in the stabilizer formalism, which exposes exactly what it does and does not protect and sets the template for every code that follows.
The bit-flip code as a stabilizer code
The bit-flip repetition code encodes
so a general logical state . This two-dimensional codespace is the simultaneous eigenspace of the two commuting stabilizer generators
Each checks the parity of a pair of qubits without measuring their individual values: returns when qubits 1 and 2 agree and when they differ. Both codewords and have all pairs agreeing, so both are eigenstates — measuring never disturbs the logical superposition.
Syndrome decoding
A single bit-flip anticommutes with whichever generators touch qubit , flipping those syndrome bits:
| Error | | | |---|---|---| | none | | | | | | | | | | | | | | |
The three single-qubit flips give three distinct syndromes, so each is identified and undone. This is a code with respect to bit-flips: , , and a logical operator of weight 3 while has weight 1 — so its distance to phase errors is just 1.
What it cannot do
The repetition code is blind to phase errors. A single commutes with both -type stabilizers, produces no syndrome, and acts as up to a stabilizer — an undetectable logical phase flip.
Try it
Build the encoded of the bit-flip code, the GHZ state , using a Hadamard and two CNOTs. The grader derives the target state vector from the reference circuit and checks yours against it.
Sign in on the full site to ask questions and join the discussion.