Three-Qubit Codes
The three-qubit repetition code protects an unknown qubit against a single bit flip by storing it in correlations among three carriers. Its phase-flip counterpart protects against a single phase flip. Two parity checks distinguish the correctable error sectors without measuring the logical amplitudes. These examples show how quantum recovery works, and why protection against one noise axis does not imply protection against arbitrary single-qubit noise.
Both codes have full quantum distance one, conventionally written . Their often quoted distance three refers to the restricted repetition problem: X errors for the bit-flip code or Z errors for the phase-flip code.
Required background. Why quantum error correction is possible introduces encoding and the Knill–Laflamme criterion. Stabilizer formalism introduces commuting checks, syndrome sectors and logical Pauli operators.
The bit-flip code stores amplitudes in correlations
Section titled “The bit-flip code stores amplitudes in correlations”Define the encoding by
Starting with , two CNOTs with the first qubit as control implement
This does not make three copies of the input. The reduced state of each carrier is
It contains no relative phase between and . For a basis-state input a carrier can equal the input, but an arbitrary superposition resides in the joint state. Reading all three qubits and taking a majority vote would destroy that superposition. Instead, quantum recovery measures whether neighboring bits agree.
The two checks are
Their common eigenspace is precisely . Its projector is
The product is a redundant third check. The stabilizer is . Gottesman (1997) places this small example in the general stabilizer construction.
Convenient logical operators are
The first exchanges the codewords and the second changes their relative phase. They commute with both checks and anticommute with one another. On the code, , and are equivalent because their pairwise products are stabilizers. Logical Pauli classes are understood after ignoring physically irrelevant scalar Pauli phases as well as stabilizer factors.
Four syndromes select four correction branches
Section titled “Four syndromes select four correction branches”Use the check order and assign bit 0 to eigenvalue and bit 1 to . A Pauli has syndrome when
The corresponding projectors are
Each has rank two; their ranges are orthogonal and together fill the eight-dimensional physical Hilbert space. In particular, .
| Syndrome | Correctable representative | Same-syndrome X error | Correction |
|---|---|---|---|
| 00 | |||
| 10 | |||
| 11 | |||
| 01 |
For example,
Both strings have syndrome 11. Measuring the checks identifies their shared sector without distinguishing the strings or revealing the amplitudes. Applying restores the original encoded state. Physical implementations of these parity measurements are developed in syndrome measurement.
With , the ideal recovery channel is
It is trace preserving because its Kraus operators obey
For any encoded density operator and any ,
The same equality holds with an untouched reference system. Thus recovery preserves entanglement with another system, not only the two logical basis states. One may apply the correction or track a Pauli frame when later operations account for it.
The table does not identify every possible physical error. The two X errors in each row differ by . For instance, . A double flip acting on is exactly the same physical state as a single acting on . Any recovery that corrects every single- input must therefore return in the double-flip case.
This ambiguity cannot be repaired by choosing a different action “outside the four sectors”: those sectors already fill the physical space. A decoder favoring high-weight errors must give up exact correction of some low-weight possibilities. That is a change of noise assumptions, not a free extension of this recovery.
Coherent errors and the correctable operator span
Section titled “Coherent errors and the correctable operator span”For , direct calculation gives
For the product is the identity. Otherwise it is a single or double X product, which anticommutes with at least one stabilizer and hence has zero matrix elements within the code. This is the Knill–Laflamme condition (Knill and Laflamme, 1997). It guarantees correction of the entire linear span, not merely a classical random choice of its basis operators.
For example, a coherent rotation on physical qubit is
The two terms occupy orthogonal syndrome sectors. After the syndrome measurement and matching correction, both branches contain the original logical state, with probabilities and . Consequently
for every angle. No assumption that a classical flip “really occurred” is needed. A coherent recovery can instead transfer the syndrome to an ancilla and disentangle it from the logical state.
This reasoning also covers an environment coupled through the correctable operator span. It does not cover arbitrary simultaneous rotations on all carriers: their product contains double and triple X terms. Different terms can then share a syndrome while acting differently on the logical qubit. A stochastic error probability does not generally describe that coherent residual channel.
The phase-flip code exchanges X and Z
Section titled “The phase-flip code exchanges X and Z”Applying to the encoding exchanges and . The phase-code basis becomes
A physical exchanges and , so it plays the role of the former bit flip. The main quantities transform together:
| Quantity | Bit-flip code | Phase-flip code |
|---|---|---|
| Checks | , | , |
| Correctable span | ||
| Logical | ||
| Logical |
The phase-code projector is . The ordered syndromes of are again , with the corresponding Z corrections. The whole recovery is obtained by conjugating input and output of with . It also corrects a single coherent Z rotation.
The duality is mathematical; a device may measure X checks directly instead of applying three physical Hadamards around every round. Changing basis exchanges which axis is protected. Combining protection in complementary bases requires an additional construction, such as the Shor code introduced by Shor (1995).
Why the full quantum distance is one
Section titled “Why the full quantum distance is one”For these codes, ignore scalar Pauli phases when counting nontrivial logical operators. The standard distance is the minimum weight of a Pauli that commutes with every stabilizer but acts nonscalarly on the code. The bit-flip code has the weight-one logical , and the phase-flip code has weight-one logical . Therefore both have full parameters .
Restricted to X products in the bit code, the lightest nontrivial undetected operator is , so the targeted distance is three. It detects a double X error as a nonzero syndrome but cannot distinguish it from the single-X error in the same row. The phase code has the corresponding restricted Z distance.
A single on the bit code gives syndrome 00 but changes the relative phase of . A produces the syndrome of , so the correction leaves
again a logical phase flip up to a scalar. Detecting an error location is not sufficient when the error model omits a complementary component. A five-qubit code can instead correct arbitrary single-qubit operators, including all three Pauli axes.
Independent flips give a quadratic logical error
Section titled “Independent flips give a quadratic logical error”Assume each carrier independently undergoes X with probability , with no other noise and perfect encoding, check measurement and correction. Use the fixed minimum-weight table above. Zero or one flip is corrected; two or three leave . Hence the logical Pauli probability is
The recovered logical channel is
Thus is the probability of a nontrivial logical Pauli, not the infidelity of every individual state. A logical X eigenstate is unchanged by that Pauli, whereas logical is flipped. For unequal independent probabilities,
At the equal-rate result is . Since
the fixed rule improves on an uncorrected carrier for . For larger , likely high-weight patterns suggest a different decoder. The crossover is a finite ideal comparison, not a fault-tolerance threshold for noisy repeated circuits.
Independent flips give under ideal recovery. If all three qubits flip together with probability , each carrier has the same marginal flip probability, but the logical probability is . Equal single-qubit error rates do not determine the benefit of encoding.
For the correlated example, the noise is before recovery, so its nontrivial event has zero syndrome and survives. Correlations require a joint noise model; complementary faults and faulty extraction can introduce other leading errors. The Pauli-noise treatment and decoders explain those extensions.
Exercises
Section titled “Exercises”1. Projector and code dimension
Section titled “1. Projector and code dimension”Show that is an orthogonal projector, find its trace, and identify a basis for its image. Explain why the answer encodes one logical qubit.
Solution
The two checks commute and square to , so each factor is an orthogonal projector and their product is an orthogonal projector onto the simultaneous eigenspace. Expanding gives
All three nonidentity Paulis are traceless, while . Hence . A computational-basis vector is in the image exactly when bit 1 equals bit 2 and bit 2 equals bit 3, so the image is . Its dimension is two, equal to the Hilbert-space dimension of one logical qubit.
2. Verify the Knill–Laflamme matrix
Section titled “2. Verify the Knill–Laflamme matrix”For , prove directly that . State what this matrix says about the encoded amplitudes.
Solution
If , then and the projected product is . If , the product is a single or a two-body . Every such operator anticommutes with at least one generator . Since ,
so the expression vanishes. The scalar matrix is the identity and is independent of the state in the code. Error-sector information can be learned without distinguishing from in .
3. Correct a coherent bit rotation
Section titled “3. Correct a coherent bit rotation”Let act on an encoded density operator. Show from the syndrome projectors and corrections that ideal recovery returns the input for every . Why does this not prove correction of ?
Solution
Write
The identity component lies in sector and the component in sector . The projectors remove cross-sector terms in the unread record. Correction maps the first branch to the input, and correction maps the second branch to the same input. Their weights are and , so they sum to the original density operator.
The three-rotation product also contains terms proportional to and . Those operators lie outside the correctable span and can contribute logical- amplitudes in the same syndrome as lower-weight terms. Those residual branches need not be a classical mixture of logical Paulis.
4. Show that the full Pauli distance is one
Section titled “4. Show that the full Pauli distance is one”Ignoring scalar Pauli phases, use the minimum weight of a nontrivial logical Pauli to prove that both three-qubit repetition codes have full distance one, while retaining targeted distance three.
Solution
For the bit code, has weight one, commutes with both -type checks, is not in the stabilizer, and acts nontrivially as . Thus is a nontrivial logical Pauli and the full distance is at most one; a nontrivial code cannot have distance below one, so . The smallest nontrivial logical operator made only of factors is , which has weight three.
For the phase code, the dual statements use weight-one and weight-three . Therefore both are codes with a restricted targeted-axis repetition distance of three.
5. Compute the independent-noise logical failure
Section titled “5. Compute the independent-noise logical failure”Assume independent targeted faults of probability and the fixed minimum-weight recovery. Derive , determine every equality point of on , and state the interval of strict improvement and all idealizations used.
Solution
Recovery succeeds for weights zero and one and leaves a logical targeted flip for weights two and three. Thus
Subtracting the unencoded probability gives
The equality points are , , and . For the final factor is negative, so . For it is positive, so the fixed encoded rule is worse. The calculation assumes independent targeted-axis faults, ideal encoding, ideal syndrome extraction, ideal recovery, ideal readout, and the fixed minimum-weight rule. It is a finite comparison, not a threshold theorem.
6. Diagnose a Y fault and decoder mismatch
Section titled “6. Diagnose a Y fault and decoder mismatch”A fault acts on the bit-flip code, but the decoder assumes the targeted set . Find the recorded syndrome, selected correction, and residual logical operation. Explain which assumption failed.
Solution
Since and the factor commutes with both -type checks, has the same syndrome as , namely . The decoder applies . The residual is
On the code, is equivalent to the logical , so the output has an undetected logical phase flip up to global phase. The syndrome and lookup were internally consistent; the failed assumption was that the physical error belonged to the targeted -only set. A broader noise model requires a code and decoder that distinguish or otherwise correct the additional logical classes.
References
Section titled “References”- D. Gottesman, Stabilizer Codes and Quantum Error Correction, Ph.D. thesis, California Institute of Technology (1997), arXiv:quant-ph/9705052.
- E. Knill and R. Laflamme, “Theory of Quantum Error-Correcting Codes,” Physical Review A 55, 900–911 (1997), doi:10.1103/PhysRevA.55.900.
- P. W. Shor, “Scheme for Reducing Decoherence in Quantum Computer Memory,” Physical Review A 52, R2493–R2496 (1995), doi:10.1103/PhysRevA.52.R2493.