Skip to content

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 [[3,1,1]][[3,1,1]]. 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

V∣0⟩=∣000⟩=∣0L⟩,V∣1⟩=∣111⟩=∣1L⟩.\begin{aligned} V|0\rangle&=|000\rangle=|0_L\rangle,\\ V|1\rangle&=|111\rangle=|1_L\rangle. \end{aligned}

Starting with ∣ψ⟩∣00⟩|\psi\rangle|00\rangle, two CNOTs with the first qubit as control implement

α∣0⟩+β∣1⟩⟼α∣000⟩+β∣111⟩.\alpha|0\rangle+\beta|1\rangle \longmapsto\alpha|000\rangle+\beta|111\rangle.

This does not make three copies of the input. The reduced state of each carrier is

ρj=∣α∣2∣0⟩⟨0∣+∣β∣2∣1⟩⟨1∣.\rho_j=|\alpha|^2|0\rangle\langle0| +|\beta|^2|1\rangle\langle1|.

It contains no relative phase between α\alpha and β\beta. 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

g1=Z1Z2,g2=Z2Z3.g_1=Z_1Z_2,\qquad g_2=Z_2Z_3.

Their common +1+1 eigenspace is precisely C=span⁡{∣000⟩,∣111⟩}\mathcal C=\operatorname{span}\{|000\rangle,|111\rangle\}. Its projector is

P=14(I+g1)(I+g2),Tr⁡P=2.P=\frac14(I+g_1)(I+g_2), \qquad \operatorname{Tr}P=2.

The product g1g2=Z1Z3g_1g_2=Z_1Z_3 is a redundant third check. The stabilizer is S={I,Z1Z2,Z2Z3,Z1Z3}\mathcal S=\{I,Z_1Z_2,Z_2Z_3,Z_1Z_3\}. Gottesman (1997) places this small example in the general stabilizer construction.

Convenient logical operators are

X‾=X1X2X3,Z‾=Z1.\overline X=X_1X_2X_3,\qquad \overline Z=Z_1.

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, Z1Z_1, Z2Z_2 and Z3Z_3 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 (g1,g2)(g_1,g_2) and assign bit 0 to eigenvalue +1+1 and bit 1 to −1-1. A Pauli EE has syndrome s1s2s_1s_2 when

Egj=(−1)sjgjE.Eg_j=(-1)^{s_j}g_jE.

The corresponding projectors are

Ps1s2=14[I+(−1)s1g1][I+(−1)s2g2].P_{s_1s_2}=\frac14 [I+(-1)^{s_1}g_1][I+(-1)^{s_2}g_2].

Each has rank two; their ranges are orthogonal and together fill the eight-dimensional physical Hilbert space. In particular, P00=PP_{00}=P.

Syndrome Correctable representative EsE_s Same-syndrome X error Correction
00 II X1X2X3X_1X_2X_3 II
10 X1X_1 X2X3X_2X_3 X1X_1
11 X2X_2 X1X3X_1X_3 X2X_2
01 X3X_3 X1X2X_1X_2 X3X_3

For example,

X2∣ψL⟩=α∣010⟩+β∣101⟩.X_2|\psi_L\rangle =\alpha|010\rangle+\beta|101\rangle.

Both strings have syndrome 11. Measuring the checks identifies their shared sector without distinguishing the strings or revealing the amplitudes. Applying X2X_2 restores the original encoded state. Physical implementations of these parity measurements are developed in syndrome measurement.

With Ps=EsPEsP_s=E_sPE_s, the ideal recovery channel is

RX(ρ)=∑sEsPsρPsEs.\mathcal R_X(\rho)=\sum_s E_sP_s\rho P_sE_s.

It is trace preserving because its Kraus operators obey

∑s(EsPs)†(EsPs)=∑sPs=I.\sum_s(E_sP_s)^{\dagger}(E_sP_s)=\sum_sP_s=I.

For any encoded density operator and any Ea∈{I,X1,X2,X3}E_a\in\{I,X_1,X_2,X_3\},

RX(EaρLEa†)=ρL.\mathcal R_X(E_a\rho_LE_a^{\dagger})=\rho_L.

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 X‾\overline X. For instance, X1X2=X3X‾X_1X_2=X_3\overline X. A double flip acting on ∣ψL⟩|\psi_L\rangle is exactly the same physical state as a single X3X_3 acting on X‾∣ψL⟩\overline X|\psi_L\rangle. Any recovery that corrects every single-X3X_3 input must therefore return X‾∣ψL⟩\overline X|\psi_L\rangle 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 Ea∈{I,X1,X2,X3}E_a\in\{I,X_1,X_2,X_3\}, direct calculation gives

PEa†EbP=δabP.PE_a^{\dagger}E_bP=\delta_{ab}P.

For a=ba=b 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 ii is

Ui(θ)=cos⁡(θ/2)I−isin⁡(θ/2)Xi.U_i(\theta)=\cos(\theta/2)I-i\sin(\theta/2)X_i.

The two terms occupy orthogonal syndrome sectors. After the syndrome measurement and matching correction, both branches contain the original logical state, with probabilities cos⁡2(θ/2)\cos^2(\theta/2) and sin⁡2(θ/2)\sin^2(\theta/2). Consequently

RX(UiρLUi†)=ρL\mathcal R_X(U_i\rho_LU_i^{\dagger})=\rho_L

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.

Applying H⊗3H^{\otimes3} to the encoding exchanges XX and ZZ. The phase-code basis becomes

∣0Lph⟩=∣+++⟩,∣1Lph⟩=∣−−−⟩.|0_L^{\rm ph}\rangle=|+++\rangle, \qquad |1_L^{\rm ph}\rangle=|---\rangle.

A physical ZiZ_i exchanges ∣+⟩|+\rangle and ∣−⟩|-\rangle, so it plays the role of the former bit flip. The main quantities transform together:

Quantity Bit-flip code Phase-flip code
Checks Z1Z2Z_1Z_2, Z2Z3Z_2Z_3 X1X2X_1X_2, X2X3X_2X_3
Correctable span I,X1,X2,X3I,X_1,X_2,X_3 I,Z1,Z2,Z3I,Z_1,Z_2,Z_3
Logical X‾\overline X X1X2X3X_1X_2X_3 Z1Z2Z3Z_1Z_2Z_3
Logical Z‾\overline Z Z1Z_1 X1X_1

The phase-code projector is (I+X1X2)(I+X2X3)/4(I+X_1X_2)(I+X_2X_3)/4. The ordered syndromes of I,Z1,Z2,Z3I,Z_1,Z_2,Z_3 are again 00,10,11,0100,10,11,01, with the corresponding Z corrections. The whole recovery is obtained by conjugating input and output of RX\mathcal R_X with H⊗3H^{\otimes3}. 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).

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 Z1Z_1, and the phase-flip code has weight-one logical X1X_1. Therefore both have full parameters [[3,1,1]][[3,1,1]].

Restricted to X products in the bit code, the lightest nontrivial undetected operator is X1X2X3X_1X_2X_3, 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 ZiZ_i on the bit code gives syndrome 00 but changes the relative phase of α∣000⟩+β∣111⟩\alpha|000\rangle+\beta|111\rangle. A Yi=iXiZiY_i=iX_iZ_i produces the syndrome of XiX_i, so the correction leaves

XiYi=iZi,X_iY_i=iZ_i,

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 pp, 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 X‾\overline X. Hence the logical Pauli probability is

pL=3p2(1−p)+p3=3p2−2p3.p_L=3p^2(1-p)+p^3=3p^2-2p^3.

The recovered logical channel is

ρL⟼(1−pL)ρL+pLX‾ρLX‾.\rho_L\longmapsto(1-p_L)\rho_L +p_L\overline X\rho_L\overline X.

Thus pLp_L 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 ∣0L⟩|0_L\rangle is flipped. For unequal independent probabilities,

pL=p1p2+p1p3+p2p3−2p1p2p3.p_L=p_1p_2+p_1p_3+p_2p_3-2p_1p_2p_3.

At p=0.1p=0.1 the equal-rate result is 0.0280.028. Since

pL−p=p(1−p)(2p−1),p_L-p=p(1-p)(2p-1),

the fixed rule improves on an uncorrected carrier for 0<p<1/20<p<1/2. For larger pp, likely high-weight patterns suggest a different decoder. The crossover is a finite ideal comparison, not a fault-tolerance threshold for noisy repeated circuits.

Logical X probability for independent flips, compared with an unencoded carrier and perfectly correlated triple flips

Independent flips give pL=3p2−2p3p_L=3p^2-2p^3 under ideal recovery. If all three qubits flip together with probability pp, each carrier has the same marginal flip probability, but the logical probability is pL=pp_L=p. Equal single-qubit error rates do not determine the benefit of encoding.

For the correlated example, the noise is (1−p)ρ+pX‾ρX‾(1-p)\rho+p\overline X\rho\overline X 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.

Show that P=(I+Z1Z2)(I+Z2Z3)/4P=(I+Z_1Z_2)(I+Z_2Z_3)/4 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 II, so each factor (I+gj)/2(I+g_j)/2 is an orthogonal projector and their product is an orthogonal projector onto the simultaneous +1+1 eigenspace. Expanding gives

P=14(I+Z1Z2+Z2Z3+Z1Z3).P = \frac14(I+Z_1Z_2+Z_2Z_3+Z_1Z_3).

All three nonidentity Paulis are traceless, while Tr⁡I=8\operatorname{Tr}I=8. Hence Tr⁡P=8/4=2\operatorname{Tr}P=8/4=2. 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 span⁡{∣000⟩,∣111⟩}\operatorname{span}\{\lvert000\rangle,\lvert111\rangle\}. Its dimension is two, equal to the Hilbert-space dimension of one logical qubit.

For EX={I,X1,X2,X3}\mathcal E_X=\{I,X_1,X_2,X_3\}, prove directly that PEa†EbP=δabPPE_a^\dagger E_bP=\delta_{ab}P. State what this matrix says about the encoded amplitudes.

Solution

If a=ba=b, then Ea†Eb=IE_a^\dagger E_b=I and the projected product is PP. If a≠ba\ne b, the product is a single XiX_i or a two-body XiXjX_iX_j. Every such operator anticommutes with at least one generator gg. Since gP=PgP=P,

PEa†EbP=PgEa†EbgP=−PEa†EbP,\begin{aligned} PE_a^\dagger E_bP &=PgE_a^\dagger E_bgP\\ &=-PE_a^\dagger E_bP, \end{aligned}

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 α\alpha from β\beta in α∣0L⟩+β∣1L⟩\alpha\lvert0_L\rangle+\beta\lvert1_L\rangle.

Let U2(θ)=e−iθX2/2U_2(\theta)=e^{-i\theta X_2/2} act on an encoded density operator. Show from the syndrome projectors and corrections that ideal recovery returns the input for every θ\theta. Why does this not prove correction of U1(θ)U2(θ)U3(θ)U_1(\theta)U_2(\theta)U_3(\theta)?

Solution

Write

U2(θ)=cI−isX2,c=cos⁡(θ/2),s=sin⁡(θ/2).\begin{aligned} U_2(\theta)&=cI-isX_2,\\ c&=\cos(\theta/2),\\ s&=\sin(\theta/2). \end{aligned}

The identity component lies in sector 0000 and the X2X_2 component in sector 1111. The projectors remove cross-sector terms in the unread record. Correction II maps the first branch to the input, and correction X2X_2 maps the second branch to the same input. Their weights are c2c^2 and s2s^2, so they sum to the original density operator.

The three-rotation product also contains terms proportional to XiXjX_iX_j and X1X2X3X_1X_2X_3. Those operators lie outside the correctable span and can contribute logical-X‾\overline X 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, Z1Z_1 has weight one, commutes with both ZZ-type checks, is not in the stabilizer, and acts nontrivially as Z‾\overline Z. Thus Z1Z_1 is a nontrivial logical Pauli and the full distance is at most one; a nontrivial code cannot have distance below one, so d=1d=1. The smallest nontrivial logical operator made only of XX factors is X1X2X3X_1X_2X_3, which has weight three.

For the phase code, the dual statements use weight-one X1=Z‾phX_1=\overline Z_{\mathrm{ph}} and weight-three Z1Z2Z3=X‾phZ_1Z_2Z_3=\overline X_{\mathrm{ph}}. Therefore both are [[3,1,1]][[3,1,1]] 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 pp and the fixed minimum-weight recovery. Derive pLp_L, determine every equality point of pL=pp_L=p on 0≤p≤10\le p\le1, 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

pL=(32)p2(1−p)+p3=3p2−2p3.p_L = \binom{3}{2}p^2(1-p)+p^3 = 3p^2-2p^3.

Subtracting the unencoded probability gives

pL−p=p(1−p)(2p−1).p_L-p=p(1-p)(2p-1).

The equality points are p=0p=0, p=1/2p=1/2, and p=1p=1. For 0<p<1/20<p<1/2 the final factor is negative, so pL<pp_L<p. For 1/2<p<11/2<p<1 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 Y2Y_2 fault acts on the bit-flip code, but the decoder assumes the targeted set {I,X1,X2,X3}\{I,X_1,X_2,X_3\}. Find the recorded syndrome, selected correction, and residual logical operation. Explain which assumption failed.

Solution

Since Y2=iX2Z2Y_2=iX_2Z_2 and the Z2Z_2 factor commutes with both ZZ-type checks, Y2Y_2 has the same syndrome as X2X_2, namely 1111. The decoder applies X2X_2. The residual is

X2Y2=iZ2.X_2Y_2=iZ_2.

On the code, Z2Z_2 is equivalent to the logical Z‾\overline Z, 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 XX-only set. A broader noise model requires a code and decoder that distinguish or otherwise correct the additional logical classes.

  • 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.