Skip to content

Five-Qubit Code

The five-qubit code is the smallest qubit stabilizer code that encodes one logical qubit and exactly corrects an arbitrary error on any one physical qubit. In the convention developed here it is a cyclic, non-CSS [[5,1,3]][[5,1,3]] code. Four independent commuting Pauli checks define a two-dimensional logical subspace; the identity and fifteen weight-one Pauli errors occupy all sixteen possible syndrome sectors; and an ideal lookup recovery returns the complete one-qubit operator span to that subspace.

The code is called perfect because it saturates the quantum Hamming bound: its correctable sectors exactly fill the five-qubit Hilbert space. Perfect does not mean unit fidelity under unrestricted noise, a fault-tolerant circuit, or an optimal hardware implementation. Minimum length is also a separate claim. It follows from the quantum Singleton bound, not merely from counting syndromes. Keeping distance, nondegeneracy, perfect packing, and minimum length as distinct statements prevents four useful facts from being collapsed into one slogan.

Required background. Stabilizer Formalism supplies stabilizer groups, projectors, normalizers, logical cosets, distance, and syndrome algebra. Three-Qubit Codes supplies the ideal-recovery and operator-span viewpoint in a simpler setting, while also showing why targeted repetition distance is weaker than full Pauli distance.

Number the physical qubits from one through five and read every tensor string from qubit one on the left to qubit five on the right. The four independent stabilizer generators are

g1=XZZXI,g2=IXZZX,g3=XIXZZ,g4=ZXIXZ.g_1=XZZXI, \qquad g_2=IXZZX, \qquad g_3=XIXZZ, \qquad g_4=ZXIXZ.

Each generator is Hermitian and squares to the identity. Any pair overlaps in an even number of positions at which their nonidentity Pauli factors differ, so all four commute. They are independent: no nonempty product of the four is the identity. The first four cyclic shifts are therefore constraints, while the fifth shift is already fixed by them. Phase-aware multiplication gives

g1g2g3g4=+ZZXIX≡g5.g_1g_2g_3g_4=+ZZXIX\equiv g_5.

The leading plus sign matters. Discarding phases is legitimate when computing commutation signatures, but changing a stabilizer sign changes which eigenspace is called the code. The convention below always means the common +1+1 eigenspace of the printed g1,…,g4g_1,\ldots,g_4. The cyclic pattern is especially compact, but it does not make all cyclic shifts independent.

The pairwise-commutation check can be performed without expanding matrices. For instance, g1g_1 and g2g_2 have unlike nonidentity factors on qubits two and four, giving two local anticommutations and hence one global commutation. The other pairs follow by the same cyclic count. Independence is a different test: commutation says that simultaneous eigenspaces exist, whereas rank says how many constraints those eigenspaces satisfy. Treating g5g_5 as independent would predict a one-dimensional space and contradict both its explicit product relation and the intended encoded qubit. This separation between compatibility, phase, and rank is worth preserving in larger stabilizer ledgers, where visual inspection becomes unreliable.

This presentation is the stabilizer convention used throughout the page. Gottesman (1997) develops the general normalizer, distance, and binary-symplectic language behind it. The essential data are frozen in one ledger before any syndrome or logical calculation is attempted.

FieldFrozen value
Physical qubitsn=5n=5, ordered left to right as 1,2,3,4,51,2,3,4,5
Logical qubitsk=1k=1; the code subspace has dimension 22
Full distanced=3d=3 over the complete five-qubit Pauli group
Four independent generatorsg1=XZZXIg_1=XZZXI, g2=IXZZXg_2=IXZZX, g3=XIXZZg_3=XIXZZ, g4=ZXIXZg_4=ZXIXZ
Redundant cyclic checkg5=+ZZXIX=g1g2g3g4g_5=+ZZXIX=g_1g_2g_3g_4
ProjectorP=2−4∏a=14(I+ga)P=2^{-4}\prod_{a=1}^4(I+g_a)
Convenient logical X‾\overline XXXXXXXXXXX; convenient and non-minimal
Convenient logical Z‾\overline ZZZZZZZZZZZ; convenient and non-minimal
Pauli basis for the correctable error spanE={I,Xj,Yj,Zj:j=1,…,5}\mathcal E=\{I,X_j,Y_j,Z_j:j=1,\ldots,5\}
Ordered syndrome convention(g1,g2,g3,g4)(g_1,g_2,g_3,g_4), with 11 for anticommutation
Structural statusnondegenerate [[5,1,3]][[5,1,3]] code; perfect means Hamming-bound saturation

The original perfect-code construction and the closely related independent five-qubit construction appeared in work by Laflamme, Miquel, Paz, and Zurek (1996) and by Bennett, DiVincenzo, Smolin, and Wootters (1996). Equivalent presentations can differ by qubit permutations, local Clifford transformations, generator changes, and codeword phases. Bennett and collaborators also established the relation between quantum error-correcting codes and one-way entanglement purification. Those equivalences and operational connections do not license mixing a codeword from one presentation with checks from another.

Let

S=⟨g1,g2,g3,g4⟩.\mathcal S=\langle g_1,g_2,g_3,g_4\rangle.

Four independent binary generators produce ∣S∣=24=16|\mathcal S|=2^4=16 elements. Because the generators commute and do not generate −I-I, the simultaneous +1+1 projector is

P=116∏a=14(I+ga)=116∑M∈SM.P = \frac{1}{16} \prod_{a=1}^4(I+g_a) = \frac{1}{16} \sum_{M\in\mathcal S}M.

Each factor (I+ga)/2(I+g_a)/2 is an orthogonal projector. Commutativity makes their product an orthogonal projector as well, so P2=P=P†P^2=P=P^\dagger. Every nonidentity Pauli string is traceless on the 3232-dimensional physical space. Only the identity term contributes to the trace of the group average, giving

Tr⁡P=116Tr⁡I=3216=2.\operatorname{Tr}P = \frac{1}{16}\operatorname{Tr}I = \frac{32}{16} =2.

Thus the image C=PH2⊗5\mathcal C=P\mathcal H_2^{\otimes5} is two-dimensional and encodes one logical qubit. The same conclusion follows from the stabilizer rank formula 2n−r=25−4=22^{n-r}=2^{5-4}=2. The redundant fifth cyclic check cannot halve the space again because its eigenvalue is already the product of the first four eigenvalues.

The projector also makes sign checks concrete. If a Pauli EE anticommutes with any generator gag_a, then

PEP=PgaEgaP=−PEP=0.PEP = Pg_aEg_aP = -PEP =0.

This elementary identity will certify both detection and off-diagonal Knill–Laflamme matrix elements. It relies on the declared +1+1 code space; using unsigned supports alone would not define PP.

Choose the convenient representatives

X‾=XXXXX,Z‾=ZZZZZ.\overline X=XXXXX, \qquad \overline Z=ZZZZZ.

Each commutes with every gag_a. They anticommute with each other because five single-qubit XX–ZZ overlaps give an odd parity. Neither belongs to S\mathcal S, so their cosets act as the logical Pauli XLX_L and ZLZ_L. They are convenient because they preserve the cyclic appearance, not because they have minimum weight. Multiplying either by a stabilizer produces an equivalent representative with the same action on the code, and some such representatives have weight three.

A logical basis matched to these choices is

∣0L⟩=14∑M∈SM∣00000⟩,∣1L⟩=X‾∣0L⟩.\lvert0_L\rangle = \frac14\sum_{M\in\mathcal S}M\lvert00000\rangle, \qquad \lvert1_L\rangle = \overline X\lvert0_L\rangle.

Expanding the group orbit once fixes every relative sign:

∣0L⟩=14(∣00000⟩+∣10010⟩+∣01001⟩−∣11011⟩+∣10100⟩−∣00110⟩−∣11101⟩−∣01111⟩+∣01010⟩−∣11000⟩−∣00011⟩−∣10001⟩−∣11110⟩−∣01100⟩−∣10111⟩+∣00101⟩).\begin{aligned} \lvert0_L\rangle=\frac14(& \lvert00000\rangle+\lvert10010\rangle +\lvert01001\rangle-\lvert11011\rangle\\ &+\lvert10100\rangle-\lvert00110\rangle -\lvert11101\rangle-\lvert01111\rangle\\ &+\lvert01010\rangle-\lvert11000\rangle -\lvert00011\rangle-\lvert10001\rangle\\ &-\lvert11110\rangle-\lvert01100\rangle -\lvert10111\rangle+\lvert00101\rangle). \end{aligned}

The sixteen computational strings are distinct and have amplitudes of magnitude 1/41/4, so the state is normalized. Acting with any generator merely permutes these terms together with exactly the signs shown; hence ga∣0L⟩=∣0L⟩g_a\lvert0_L\rangle=\lvert0_L\rangle for all four checks. Every listed word has even Hamming parity. Consequently

Z‾∣0L⟩=∣0L⟩.\overline Z\lvert0_L\rangle=\lvert0_L\rangle.

Bitwise complementation by X‾\overline X produces sixteen odd-parity words, orthogonal to the first set, and therefore

Z‾∣1L⟩=−∣1L⟩,X‾∣0L⟩=∣1L⟩.\overline Z\lvert1_L\rangle=-\lvert1_L\rangle, \qquad \overline X\lvert0_L\rangle=\lvert1_L\rangle.

This checks both the stabilizer eigenvalues and the intended logical action. The sixteen-term cyclic basis should not be replaced silently by an eight-term expression from another convention. An eight-term presentation may define an equivalent code, but its local-Clifford, permutation, and sign map must be derived before its formulas are combined with this generator list.

There is no conflict between defining the basis by a projector and displaying it as an amplitude list. The group average is the invariant construction; the expanded vector is a reproducible coordinate fixture. The former proves the stabilizer property in one line, while the latter catches tensor-order and phase errors that can remain invisible in an abstract quotient calculation. It also makes the logical-ZZ action immediate through parity. Both views are needed when a symbolic stabilizer description is compared with a state-vector calculation or an encoded-state preparation experiment.

For a Pauli error EE, define the stored four-bit syndrome in the fixed order (g1,g2,g3,g4)(g_1,g_2,g_3,g_4) by

gaE=(−1)sa(E)Ega,s(E)=s1s2s3s4.g_aE=(-1)^{s_a(E)}Eg_a, \qquad s(E)=s_1s_2s_3s_4.

A zero bit denotes commutation and a one bit denotes anticommutation. On a code state, these are respectively the +1+1 and −1-1 check eigenvalues after EE acts. Reordering generators reorders the printed syndrome; negating a generator changes the chosen stabilized eigenspace and the interpretation of its outcome. A bit string without its ordered signed-check convention is not a complete syndrome specification.

Syndromes add under Pauli multiplication:

s(EF)=s(E)⊕s(F).s(EF)=s(E)\oplus s(F).

This follows because the commutation signs multiply independently for every generator. In particular, since YjY_j is proportional to XjZjX_jZ_j,

s(Yj)=s(Xj)⊕s(Zj).s(Y_j)=s(X_j)\oplus s(Z_j).

That row check catches transcription errors without using any codeword amplitudes. It also emphasizes that syndrome depends on the phase-free commutation class, even though stabilizer signs remain essential for defining the code space.

The complete identity-plus-weight-one ledger is:

ErrorSyndromeChosen correction
II00000000II
X1X_100010001X1X_1
Y1Y_110111011Y1Y_1
Z1Z_110101010Z1Z_1
X2X_210001000X2X_2
Y2Y_211011101Y2Y_2
Z2Z_201010101Z2Z_2
X3X_311001100X3X_3
Y3Y_311101110Y3Y_3
Z3Z_300100010Z3Z_3
X4X_401100110X4X_4
Y4Y_411111111Y4Y_4
Z4Z_410011001Z4Z_4
X5X_500110011X5X_5
Y5Y_501110111Y5Y_5
Z5Z_501000100Z5Z_5

For example, X2X_2 anticommutes only with g1g_1, giving 10001000, whereas Z4Z_4 anticommutes only with g1g_1 and g4g_4, giving 10011001. Their product therefore has syndrome 00010001. Every YY row is the XOR of the corresponding XX and ZZ rows: at site three, 1100⊕0010=11101100\oplus0010=1110.

The fifteen weight-one Paulis produce the fifteen distinct nonzero four-bit strings. This is stronger than merely detecting a one-qubit error: within the declared promise it identifies its site and Pauli axis. Outside that promise, many higher-weight operators share each row. The last column is therefore a chosen minimum-weight correction, not an assertion that the syndrome reveals a unique unrestricted physical history.

The lookup also displays why the code is not CSS. Its checks mix XX and ZZ factors, and the syndrome does not separate into an independent classical bit-flip table and phase-flip table. The mixed checks distinguish the full one-qubit Pauli set in only five data qubits.

For every four-bit string ss, define

Πs=116∏a=14[I+(−1)saga].\Pi_s = \frac1{16} \prod_{a=1}^4 \left[I+(-1)^{s_a}g_a\right].

These are the simultaneous eigenspace projectors for the four checks. They obey

Πs†=Πs,ΠsΠt=δstΠs,∑s∈{0,1}4Πs=I.\Pi_s^\dagger=\Pi_s, \qquad \Pi_s\Pi_t=\delta_{st}\Pi_s, \qquad \sum_{s\in\{0,1\}^4}\Pi_s=I.

Every Πs\Pi_s has trace two: when the product is expanded, only its identity term contributes to the trace, independently of the chosen signs. Thus the sixteen sectors have total dimension 16×2=3216\times2=32, exactly the dimension of the physical Hilbert space. The code projector is Π0000=P\Pi_{0000}=P.

If EsE_s is the lookup representative in syndrome ss, then EsCE_s\mathcal C is precisely the image of Πs\Pi_s. Distinct representatives map the entire encoded qubit into orthogonal sectors rather than separating its logical basis states. This complete packing is the geometric content behind the Hamming equality proved later. It says that the declared correctable sector decomposition leaves no unused physical dimension; it says nothing yet about faults in the extraction procedure.

The dimensions also prove that the lookup is exhaustive under its promise. There are sixteen orthogonal images of a two-dimensional code and only thirty-two physical dimensions, so no additional orthogonal one-error sector can be inserted. Conversely, none of the listed sectors can have rank below two, because multiplication by a unitary Pauli maps the whole code isometrically. This argument explains the word packing: code states are not points surrounded by geometric balls in an ordinary metric, but subspaces whose orthogonal images account for the available Hilbert-space dimension.

Exact Correction of Arbitrary One-Qubit Noise

Section titled “Exact Correction of Arbitrary One-Qubit Noise”

Take the ordered Pauli basis

E={I,Xj,Yj,Zj:j=1,…,5}.\mathcal E = \{I,X_j,Y_j,Z_j:j=1,\ldots,5\}.

For any two members Ea,Eb∈EE_a,E_b\in\mathcal E, the projected products satisfy

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

If a=ba=b, the Pauli squares to the identity. If a≠ba\ne b, the product is, up to phase, a Pauli of weight one or two. A same-site product of two distinct axes has weight one. A different-site product has weight two. In either case its syndrome is the XOR of two distinct entries in the complete ledger and is therefore nonzero. It anticommutes with at least one stabilizer, so the projector identity PAP=0PAP=0 applies.

This is the exact code-specific Knill–Laflamme certificate, not a sampling test. Knill and Laflamme (1997) prove that the scalar-matrix condition is necessary and sufficient for exact correctability. Here the matrix is the 16×1616\times16 identity because the code is nondegenerate on this Pauli basis. Equivalently, the sixteen images EaCE_a\mathcal C are mutually orthogonal two-dimensional subspaces.

The certificate protects an arbitrary logical superposition, not only the two logical basis vectors. The scalar on the right is independent of the encoded state, so a syndrome can reveal an error-sector label without revealing a logical amplitude or phase. It also protects entanglement with any reference system that the error and recovery do not touch.

Let E0000=IE_{0000}=I, and for each nonzero syndrome let EsE_s be the unique weight-one Pauli in the table. The ideal recovery channel is

R(ρ)=∑sEs†ΠsρΠsEs.\mathcal R(\rho) = \sum_s E_s^\dagger\Pi_s\rho\Pi_sE_s.

Each term has Kraus operator Ks=Es†ΠsK_s=E_s^\dagger\Pi_s and is completely positive. Since every EsE_s is unitary and the sector projectors are complete,

∑sKs†Ks=∑sΠsEsEs†Πs=∑sΠs=I,\sum_sK_s^\dagger K_s = \sum_s\Pi_sE_sE_s^\dagger\Pi_s = \sum_s\Pi_s =I,

so the map is trace preserving. For a code-supported density operator ρL=PρLP\rho_L=P\rho_LP and a promised Pauli EaE_a, only Πs(Ea)\Pi_{s(E_a)} survives. The chosen inverse then returns

R(EaρLEa†)=ρL.\mathcal R(E_a\rho_LE_a^\dagger)=\rho_L.

The correction can be applied physically or retained as a tracked Pauli frame when later operations permit it. Multiplying a chosen correction by a stabilizer does not change its logical action. Multiplying it by a logical Pauli does. A recovery ledger must therefore fix the logical coset, not only the destination syndrome.

This channel is an algebraic idealization. It assumes exact projectors, a correct four-bit record, instantaneous selection, and noiseless correction. It does not specify ancillas, gate order, repeated measurements, classical latency, or containment of propagated faults. Those omissions are boundaries of the statement, not small perturbations hidden in its notation.

The Pauli ledger corrects more than a stochastic choice among sixteen labels. Every operator on one physical qubit lies in the span of I,X,Y,ZI,X,Y,Z. If an operator acts on site jj as

Aj=aI+bXj+cYj+dZj,A_j=aI+bX_j+cY_j+dZ_j,

then AjA_j lies in the linear span of E\mathcal E. The Knill–Laflamme condition is stable under linear combinations. More generally, every A=∑acaEaA=\sum_a c_aE_a in the complete identity-plus-weight-one span is covered, including coherent combinations across Pauli axes or locations. Every channel whose Kraus operators lie in that span is therefore exactly corrected. A coherent rotation about an arbitrary Bloch-sphere axis is included; it need not be converted into a fictitious stochastic Pauli event before the theorem applies.

For a joint logical-reference state ρRL\rho_{RL} supported on the code in the logical factor, the stronger statement is

(IR⊗R)[(IR⊗N)(ρRL)]=ρRL(I_R\otimes\mathcal R) \left[ (I_R\otimes\mathcal N)(\rho_{RL}) \right] = \rho_{RL}

for every trace-preserving channel N\mathcal N with Kraus operators in the declared one-qubit span. Preserving reference entanglement rules out a process that happens to restore ∣0L⟩\lvert0_L\rangle and ∣1L⟩\lvert1_L\rangle while erasing their coherence.

Linearity does not enlarge the spatial promise. A product of two one-qubit rotations contains weight-two terms, and a correlated two-qubit channel can have Kraus operators outside the certified span. “Arbitrary one-qubit noise” means arbitrary operator structure supported on one unknown physical qubit, not arbitrary noise of unrestricted support.

The unknown location causes no extra difficulty because the basis already contains four operators for every site. A channel may even use several Kraus operators with coherent Pauli coefficients at the same location; exact correction follows from their common span and trace-preserving normalization. What is excluded is a single Kraus operator whose support simultaneously reaches two data qubits. This operator-span formulation is more precise than saying the code corrects “small errors,” since a large rotation on one qubit is included while an arbitrarily weak but genuinely two-qubit component is not certified exactly.

Distance, Nondegeneracy, and Minimum Length

Section titled “Distance, Nondegeneracy, and Minimum Length”

The stabilizer-code distance is the minimum Pauli weight in N(S)∖SN(\mathcal S)\setminus\mathcal S. The complete syndrome ledger proves the lower bound d≥3d\ge3. Every weight-one nonidentity Pauli has nonzero syndrome. Every weight-two Pauli is, up to phase, the product of two weight-one Paulis on distinct sites. Those two ledger entries have distinct nonzero syndromes, so their XOR is nonzero. Hence every Pauli of weight one or two anticommutes with some stabilizer and cannot be an undetected logical operator.

The reverse inequality requires one explicit normalizer element. Direct phase-aware multiplication gives

Y1Z2Y3=−g3Z‾.Y_1Z_2Y_3=-g_3\overline Z.

This weight-three Pauli commutes with all stabilizers because it differs from Z‾\overline Z by a stabilizer and a global sign. It lies outside S\mathcal S and acts on the code as −Z‾-\overline Z in the frozen representative. Modulo phase, its logical class is ZLZ_L. Therefore d≤3d\le3, and together the two directions establish full Pauli distance

d=3.d=3.

The weight-five choices XXXXXXXXXX and ZZZZZZZZZZ do not imply distance five. Logical representatives are cosets, and multiplication by stabilizers can lower their physical weight. For example, a weight-three logical-XX member is obtained from g1X‾g_1\overline X up to phase. Distance minimizes over the entire nontrivial normalizer, not over the first convenient representatives printed on a page.

The lower-bound proof uses the completeness of the syndrome ledger in an essential way. Merely checking that all fifteen weight-one errors are detected would not rule out a weight-two logical Pauli. Here any weight-two string factors into Paulis on two distinct sites, and the uniqueness of their nonzero syndromes prevents cancellation. The explicit weight-three element then closes the upper bound. Thus d=3d=3 is established by a finite two-sided argument, rather than inferred from the fact that the code is commonly named a one-error-correcting code.

The stabilizer weight enumerator is especially simple:

A0=1,A4=15.A_0=1, \qquad A_4=15.

The identity has weight zero, and every one of the fifteen nonidentity stabilizers has weight four. In particular, no nonidentity stabilizer has weight at most two. Two members of the correctable Pauli basis could act the same on the code only if their relative product were a stabilizer of weight at most two. That cannot occur, so the basis is nondegenerate and its sixteen sectors are genuinely distinct.

This argument is not the distance proof. Distance asks for the lowest-weight normalizer element outside the stabilizer; nondegeneracy asks whether distinct correctable errors differ by a stabilizer and therefore have the same action on the code. A code may be degenerate and still have useful distance. Here both facts happen to be clean because of the weight-four stabilizer ledger.

For a nondegenerate qubit code correcting one arbitrary unknown-location error, the quantum Hamming bound counts one identity sector and three single-qubit Pauli sectors per site. For this code,

21[1+3(51)]=2(1+15)=32=25.2^1\left[1+3\binom51\right] = 2(1+15) =32 =2^5.

The left side is the logical dimension times the number of distinct correctable error labels; the right side is the physical Hilbert-space dimension. Equality agrees exactly with the sixteen rank-two projectors Πs\Pi_s. No dimension remains outside those sectors.

Gottesman (1996) characterized a class of quantum codes saturating the Hamming bound, including this smallest member. The adjective perfect refers precisely to this packing equality. It does not mean that every physical error is corrected, that recovery has no circuit faults, or that encoded fidelity equals one under an unrestricted noise process.

Minimum length follows independently. The quantum Singleton bound for an [[n,k,d]][[n,k,d]] code is

n−k≥2(d−1).n-k\ge2(d-1).

Setting k=1k=1 and demanding full distance d=3d=3 gives

n−1≥4,n≥5.n-1\ge4, \qquad n\ge5.

The five-qubit code attains this lower bound, so no qubit code can encode one logical qubit, have distance three, and use fewer than five physical qubits. This proof does not assume nondegeneracy and does not follow from the Hamming equality. Calderbank, Rains, Shor, and Sloane (1997) connect quantum-code bounds to the orthogonal geometry that underlies such parameter constraints.

“Smallest perfect code” consequently packages two separately demonstrated properties: five qubits are minimum for k=1,d=3k=1,d=3, and at that length the nondegenerate one-error spheres saturate the Hamming bound. Neither property specifies an optimal circuit layout, ancilla count, or logical gate set.

Aliasing and Logical Failure Outside the Promise

Section titled “Aliasing and Logical Failure Outside the Promise”

Every weight-two Pauli has nonzero syndrome, so every such error is detected by an ideal syndrome measurement. Detection does not imply correction. There are only sixteen syndrome values, and they are already assigned to the identity and fifteen promised weight-one representatives. Each weight-two error must therefore share its syndrome with one of those representatives.

If the decoder applies the table’s minimum-weight correction, the residual is a zero-syndrome Pauli of weight at most three. Because the actual weight-two error is not in the promised set, that residual need not be a stabilizer. It can be a nontrivial logical operator. Thus “all weight-two errors are detected” and “an arbitrary weight-two error is corrected” are sharply different statements.

Distance three predicts exactly this behavior. Such a code detects all errors of weight below three and corrects arbitrary unknown-location errors only up to ⌊(d−1)/2⌋=1\lfloor(d-1)/2\rfloor=1. A known erasure location changes the information available to recovery and is a different task.

Take the weight-two Pauli X2Z4X_2Z_4. Syndrome linearity and the table give

s(X2Z4)=1000⊕1001=0001=s(X1).s(X_2Z_4) = 1000\oplus1001 =0001 =s(X_1).

Under the declared one-error promise, syndrome 00010001 selects correction X1X_1. The residual is

X1X2Z4.X_1X_2Z_4.

It has zero syndrome but is not a stabilizer: every nonidentity stabilizer has weight four. It commutes with Z‾\overline Z and anticommutes with X‾\overline X, so modulo stabilizer and phase its logical class is ZLZ_L. The syndrome was measured correctly and the lookup was executed correctly; the failed premise was that the physical error belonged to the sixteen-error set.

This alias illustrates why a syndrome labels a coset, not a unique physical event. A decoder with a richer prior may prefer a different logical class, especially when correlated weight-two faults are plausible. The fixed table is exact for its promise, but it is not maximum likelihood under every noise law.

For one finite audit, suppose every physical qubit independently receives II with probability 1−p1-p and each of X,Y,ZX,Y,Z with probability p/3p/3. Apply the fixed minimum-weight lookup above and classify the residual modulo the stabilizer and global phase. Exhaustive enumeration of all 45=10244^5=1024 Pauli strings gives:

Physical Pauli weightTotalILI_LXLX_LYLY_LZLZ_L
001111000000
1115151515000000
22909000303030303030
332702706060707070707070
44405405135135909090909090
552432434545666666666666

The row totals are (5w)3w\binom5w3^w. Each logical class has 256256 strings when all physical Paulis are counted. Summing the three nonidentity logical columns with their independent-noise weights yields

pL=90(p3)2(1−p)3+210(p3)3(1−p)2+270(p3)4(1−p)+198(p3)5=10p2−2009p3+1609p4−12827p5.\begin{aligned} p_L={}& 90\left(\frac p3\right)^2(1-p)^3 +210\left(\frac p3\right)^3(1-p)^2\\ &+270\left(\frac p3\right)^4(1-p) +198\left(\frac p3\right)^5\\ ={}& 10p^2-\frac{200}{9}p^3 +\frac{160}{9}p^4-\frac{128}{27}p^5. \end{aligned}

The table can be reproduced without assigning phases to physical errors. Enumerate each phase-free Pauli string, compute its four-bit syndrome, apply the table representative for that syndrome, and reduce the zero-syndrome residual modulo S\mathcal S. Its commutation with X‾\overline X and Z‾\overline Z identifies the residual logical class. Grouping first by physical weight and then by logical class gives the six rows. Independent depolarizing noise attaches the same probability (p/3)w(1−p)5−w(p/3)^w(1-p)^{5-w} to every string in a weight-ww row, which is why the integer enumerator determines the polynomial without a simulation or a small-pp approximation.

Three checks expose the calculation’s meaning. At p=0p=0, no nonidentity branch occurs and pL(0)=0p_L(0)=0. At p=3/4p=3/4, all 10241024 physical Paulis are equally likely; the four residual logical classes are equally populated, so pL(3/4)=3/4p_L(3/4)=3/4. At p=1p=1, only the 243243 weight-five strings occur and 198198 are logically nontrivial, giving pL(1)=22/27p_L(1)=22/27.

The leading term 10p210p^2 records removal of every weight-one contribution in this ideal model. The polynomial is not a threshold, because there is no code family, growing distance, noisy circuit, repeated record, or decoder-scaling claim. It is not a device forecast either: correlation, leakage, coherent multi-qubit terms, gate faults, and measurement faults all lie outside the fixture. Pauli Noise and Depolarizing Channels owns the probability-law, independence, convention, and pushforward audit needed before such a polynomial is attached to data.

Extraction, Gates, Resources, and Evidence

Section titled “Extraction, Gates, Resources, and Evidence”

The parameter n=5n=5 counts only the data carriers in the encoded block. A physical implementation also needs a preparation method, ancillas or other measurement resources, entangling operations, readout and reset, classical control, routing, and time. Repeated error correction adds check repetitions, detector construction, a decoder, frame tracking, and a latency budget. Connectivity can require swaps or code-specific scheduling, while leakage can require detection and removal mechanisms outside the qubit Pauli model.

Consequently, “five physical qubits per logical qubit” is not a complete resource estimate. It omits spare qubits, rejected preparations, calibration, logical-state injection, logical measurement, and the operations used to keep faults from spreading. Hamming saturation optimizes a Hilbert-space packing question; it is not an engineering optimum over space, time, control lines, or logical error per unit cost.

The contrast with the repetition examples is also exact. The bit- and phase-flip three-qubit codes have full parameters [[3,1,1]][[3,1,1]] and targeted single-axis distance three. The five-qubit code has full Pauli distance three and corrects the entire one-qubit operator span. Because it is non-CSS, this protection is not obtained by two separable classical repetition procedures.

Non-CSS structure affects implementation choices without weakening the algebraic claim. Mixed-Pauli checks may require basis changes or differently oriented ancilla interactions, and schedules must respect the order in which faults can propagate through those interactions. None of that changes the ideal syndrome table. It changes the circuit-level noise channel delivered to the decoder. A resource comparison must therefore hold the protected task and fault model fixed rather than treating the smallest data-block size as the only cost.

The projectors Πs\Pi_s specify what an ideal measurement must resolve, not how to build it. Syndrome Measurement owns ancilla orientation, signed check circuits, gate ordering, propagated faults, repeated outcomes, and detector parities. A circuit that measures the right Pauli products in the absence of faults can still spread one ancilla fault into a damaging data error.

Likewise, the lookup table is a decoder only under the one-error promise. Decoders owns inference with nonuniform priors, noisy histories, correlations, higher-weight aliases, degeneracy, confidence, throughput, and latency. A correction may be tracked rather than applied, but later gates and measurements must interpret the frame consistently.

Logical gates create another boundary. A code subspace and an ideal recovery do not automatically supply a universal protected gate set. DiVincenzo and Shor (1996) analyzed fault-tolerant error correction with efficient quantum codes, making explicit that extraction and recovery circuits need their own propagation guarantees. Fault-Tolerant Gates owns gadget-level correctness, logical operations, and malignant-fault control.

Implementation evidence stays task-bounded

Section titled “Implementation evidence stays task-bounded”

An implementation can test a valuable finite claim without establishing a scalable memory. Knill, Laflamme, Martinez, and Negrevergne (2001) used liquid-state NMR to benchmark an implementation of the five-qubit error-correcting code. That work is evidence about the declared encoded-control and correction task in that platform and experimental model. It is not evidence that the procedure was fault tolerant, that the full resource overhead scales favorably, or that a device threshold was crossed.

An experimental claim should therefore name the input ensemble, injected or ambient errors, encoded operations, recovery rule, measured observable, comparison baseline, uncertainty, and trusted components. It should say whether syndrome information was extracted, whether corrections were applied or compiled into analysis, and which operations were included in the cost. Error-Correction Case Studies is the appropriate home for comparing such demonstrations under their actual tasks and trust boundaries.

The algebra on this page supplies fixtures for those audits: signed checks, logical basis, sixteen syndromes, an ideal recovery, and exact finite enumeration. Agreement with those fixtures can validate an implementation component. It cannot by itself validate the omitted noise mechanisms, fault-tolerance architecture, or scaling claim.

A particularly important denominator is the complete attempted task. If state preparation or readout is trusted, if only selected errors are injected, or if unsuccessful trials are discarded, those choices can be legitimate but must remain explicit. The resulting fidelity answers a narrower question than a continuously operating logical memory. Likewise, reproducing all sixteen ideal syndrome labels tests convention and control; it does not demonstrate that noisy syndrome rounds preserve distance or that recovery improves a matched unencoded baseline.

This page owns one concrete cyclic five-qubit convention: its four signed independent generators and redundant shift, projector, sixteen-term logical basis, convenient logical Paulis, full one-qubit syndrome ledger, ideal lookup recovery, code-specific Knill–Laflamme matrix, distance proof, nondegeneracy, perfect packing, Singleton minimum-length proof, one explicit higher-weight alias, and the finite independent-depolarizing enumerator.

Use the Quantum Error Correction and Fault Tolerance guide to place those objects inside the chapter’s complete protection, operation, resource, and evidence record. Return to Why Quantum Error Correction Is Possible for the general correctability theorem and information-separation argument, and to Stabilizer Formalism for general symplectic algebra, normalizers, Clifford updates, degeneracy, and tableaus.

The Three-Qubit Codes page remains the canonical owner of the bit- and phase-flip repetition constructions, their restricted single-axis distances, and their majority failure polynomial. The present code is not a compressed repetition code: it uses mixed Pauli checks to protect the full one-qubit operator span.

Shor Code owns the concatenated, CSS, degenerate [[9,1,3]][[9,1,3]] construction and its twenty-two one-error syndrome classes; this page retains the perfect, non-CSS [[5,1,3]][[5,1,3]] code and its sixteen-sector lookup.

Steane Code owns the Hamming-derived, weakly self-dual, nondegenerate, nonperfect [[7,1,3]][[7,1,3]] CSS construction; this page retains the perfect, non-CSS [[5,1,3]][[5,1,3]] code and its sixteen-sector lookup.

Move to Syndrome Measurement for physical check extraction, to Decoders for inference outside the fixed sixteen-error promise, and to Fault-Tolerant Gates for protected logical operations. Use Pauli Noise and Depolarizing Channels to audit the finite noise law, and Error-Correction Case Studies to interpret implementation evidence without promoting a task-bounded result into a threshold or scalability claim.

These handoffs are part of the scientific content. The code parameters answer which ideal errors are distinguishable and reversible. Extraction answers how the distinctions become physical records. Decoding answers how an uncertain record and a prior become a logical-class decision. Fault tolerance answers whether faults in those procedures remain controlled, and case studies answer what an experiment actually demonstrated. Combining the layers is necessary for a complete protection claim, but duplicating each layer on the code page would obscure which assumptions belong to which result.

Verify that the four declared generators commute and are independent. Derive the size of S\mathcal S, show that the group average is an orthogonal projector, and compute the dimension of its image.

Solution

Two Pauli strings commute when the number of positions containing distinct nonidentity factors is even. Every pair among g1,…,g4g_1,\ldots,g_4 has two such positions, so the generators commute. Row reduction of their binary symplectic vectors has rank four; equivalently, inspecting their XX supports shows that no nonempty product can be II. Thus ∣S∣=24=16|\mathcal S|=2^4=16.

Because the generators are commuting Hermitian involutions,

P=∏a=14I+ga2P=\prod_{a=1}^4\frac{I+g_a}{2}

is an orthogonal projector onto their common +1+1 eigenspace. In the group average only the identity has nonzero trace, hence Tr⁡P=32/16=2\operatorname{Tr}P=32/16=2. An orthogonal projector’s trace equals its rank, so the code subspace has dimension two and encodes one qubit. The fifth cyclic shift is the product g1g2g3g4g_1g_2g_3g_4 and supplies no additional rank.

2. Projector expansion and the logical basis

Section titled “2. Projector expansion and the logical basis”

Apply all sixteen stabilizers to ∣00000⟩\lvert00000\rangle, expand ∣0L⟩\lvert0_L\rangle, and verify its normalization, all four stabilizer eigenvalues, and its logical-Z‾\overline Z eigenvalue. Then construct ∣1L⟩\lvert1_L\rangle.

Solution

The signed orbit is

4∣0L⟩=∣00000⟩+∣10010⟩+∣01001⟩−∣11011⟩+∣10100⟩−∣00110⟩−∣11101⟩−∣01111⟩+∣01010⟩−∣11000⟩−∣00011⟩−∣10001⟩−∣11110⟩−∣01100⟩−∣10111⟩+∣00101⟩.\begin{aligned} 4\lvert0_L\rangle={}& \lvert00000\rangle+\lvert10010\rangle+\lvert01001\rangle -\lvert11011\rangle+\lvert10100\rangle-\lvert00110\rangle\\ &-\lvert11101\rangle-\lvert01111\rangle+\lvert01010\rangle -\lvert11000\rangle-\lvert00011\rangle-\lvert10001\rangle\\ &-\lvert11110\rangle-\lvert01100\rangle-\lvert10111\rangle +\lvert00101\rangle. \end{aligned}

The strings are distinct, so sixteen squared amplitudes of 1/161/16 give unit norm. Left multiplication by any gag_a permutes the stabilizer group and therefore leaves its group average invariant; hence every stabilizer eigenvalue is +1+1. All strings have even parity, so ZZZZZZZZZZ also has eigenvalue +1+1. Finally, ∣1L⟩=XXXXX∣0L⟩\lvert1_L\rangle=XXXXX\lvert0_L\rangle consists of the complementary odd-parity strings, is orthogonal to ∣0L⟩\lvert0_L\rangle, and has logical Z‾\overline Z eigenvalue −1-1.

3. Logical representatives and minimum weight

Section titled “3. Logical representatives and minimum weight”

Starting from X‾=XXXXX\overline X=XXXXX and Z‾=ZZZZZ\overline Z=ZZZZZ, multiply by stabilizers to find weight-three representatives of the logical XX, ZZ, and YY classes. Explain why their existence is compatible with the weight-five convenient representatives.

Solution

Phase-aware multiplication gives

IYYIX=−g1X‾,YZYII=−g3Z‾.IYYIX=-g_1\overline X, \qquad YZYII=-g_3\overline Z.

The first is a weight-three logical XX representative and the second a weight-three logical ZZ representative. Their product is, up to phase, YXIIXYXIIX, a weight-three logical YY representative. Each commutes with every stabilizer because it differs from a normalizer representative by a stabilizer, and none is itself a stabilizer because every nonidentity stabilizer has weight four.

Logical Paulis are cosets of S\mathcal S, so multiplying by a stabilizer does not change their action on the code. Weight belongs to a physical representative, while distance minimizes weight over the whole nontrivial logical coset. The convenient cyclic weight-five strings and the minimum weight-three strings are therefore compatible descriptions of the same logical operators.

Using only the four printed generators and the ordered-bit convention, derive all fifteen nonzero syndromes. Verify the XOR relation for every YjY_j and prove that no two weight-one Paulis share a syndrome.

Solution

An XjX_j anticommutes with a generator exactly when that generator has ZZ or YY at site jj; a ZjZ_j anticommutes when it has XX or YY; and a YjY_j anticommutes with either XX or ZZ. Reading the four generator columns gives

X:0001,1000,1100,0110,0011,Z:1010,0101,0010,1001,0100,Y:1011,1101,1110,1111,0111.\begin{aligned} X &: 0001,1000,1100,0110,0011,\\ Z &: 1010,0101,0010,1001,0100,\\ Y &: 1011,1101,1110,1111,0111. \end{aligned}

The entries in each list are ordered by sites one through five. Since YjY_j is proportional to XjZjX_jZ_j, its row is the bitwise XOR of the corresponding XX and ZZ rows. The three lists together contain every nonzero four-bit word exactly once. Therefore all weight-one Paulis have distinct syndromes, and along with I↦0000I\mapsto0000 they occupy all sixteen sectors.

For E={I,Xj,Yj,Zj}\mathcal E=\{I,X_j,Y_j,Z_j\}, prove PEa†EbP=δabPPE_a^\dagger E_bP=\delta_{ab}P. Use it to show that the ideal lookup recovery corrects every one-qubit channel, including when the logical qubit is entangled with an untouched reference.

Solution

For a=ba=b, Ea†Eb=IE_a^\dagger E_b=I and the projected product is PP. For a≠ba\ne b, the relative Pauli has weight one or two. Its syndrome is the XOR of two distinct ledger entries and is nonzero, so it anticommutes with some gg. Because gP=PgP=P,

PEa†EbP=PgEa†EbgP=−PEa†EbP=0.PE_a^\dagger E_bP = PgE_a^\dagger E_bgP = -PE_a^\dagger E_bP =0.

Thus the Knill–Laflamme matrix is the identity. Every Kraus operator of a channel supported on one physical qubit is a linear combination of the four Paulis at that site, so linearity extends the certificate to the whole channel. The recovery projects onto the orthogonal error sectors and applies their inverse representatives. Since the scalar matrix is independent of the logical input, the same argument holds after tensoring every operation with IRI_R; all logical-reference correlations are restored.

6. Separate distance, perfection, and minimum length

Section titled “6. Separate distance, perfection, and minimum length”

Give independent arguments for full distance three, Hamming-bound saturation, and minimum length. State why none of these statements establishes a fault-tolerant five-qubit implementation.

Solution

All weight-one syndromes are nonzero and distinct. A weight-two Pauli has the XOR of two distinct weight-one syndromes, hence also has nonzero syndrome. Therefore no nontrivial logical Pauli has weight below three. The operator Y1Z2Y3=−g3Z‾Y_1Z_2Y_3=-g_3\overline Z is a weight-three normalizer element outside the stabilizer, so d=3d=3.

Nondegeneracy and one-error correction give the Hamming count

21[1+3(51)]=32=25,2^1\left[1+3\binom51\right]=32=2^5,

so the correctable sectors perfectly fill the physical space. Independently, the Singleton bound n−k≥2(d−1)n-k\ge2(d-1) gives n≥5n\ge5 for k=1,d=3k=1,d=3; the code is minimum length. These are algebraic and dimensional facts. They do not count ancillas or gates, constrain fault propagation, supply repeated noisy syndromes, implement logical gates, or demonstrate suppression under a circuit-level noise model.

Let a unitary on qubit three be

U3=c0I+cxX3+cyY3+czZ3,∑μ∣cμ∣2=1.U_3=c_0I+c_xX_3+c_yY_3+c_zZ_3, \qquad \sum_\mu|c_\mu|^2=1.

Show that the ideal unread recovery returns every encoded density operator and preserves entanglement with a reference. Explain why the result does not cover U2U3U_2U_3 for arbitrary one-qubit unitaries U2U_2 and U3U_3.

Solution

The four Pauli components occupy sectors 00000000, 11001100, 11101110, and 00100010. Projecting onto a sector removes all cross-sector terms, and the selected Pauli inverse maps that branch back to the same encoded density operator. The unread output is therefore

R(U3ρLU3†)=(∣c0∣2+∣cx∣2+∣cy∣2+∣cz∣2)ρL=ρL.\mathcal R(U_3\rho_LU_3^\dagger) = \left( |c_0|^2+|c_x|^2+|c_y|^2+|c_z|^2 \right)\rho_L =\rho_L.

The calculation never inspects the logical amplitudes, so tensoring it with an untouched identity on a reference restores the complete joint state. By contrast, U2U3U_2U_3 generally contains products such as X2Z3X_2Z_3 of weight two. Those terms lie outside the certified one-qubit operator span and can alias to nontrivial logical residuals under the fixed recovery.

For the actual error X2Z4X_2Z_4, compute the syndrome, the table’s correction, and the residual logical class. Identify precisely which statement remains true and which correction promise has been violated.

Solution

The lookup gives s(X2)=1000s(X_2)=1000 and s(Z4)=1001s(Z_4)=1001, so

s(X2Z4)=1000⊕1001=0001=s(X1).s(X_2Z_4)=1000\oplus1001=0001=s(X_1).

The fixed decoder applies X1X_1, leaving R=X1X2Z4R=X_1X_2Z_4. This residual has zero syndrome. It is not a stabilizer because it has weight three, whereas all nonidentity stabilizers have weight four. It commutes with Z‾=ZZZZZ\overline Z=ZZZZZ and anticommutes with X‾=XXXXX\overline X=XXXXX, so its class is ZLZ_L modulo stabilizer and phase.

The weight-two error was detected: its original syndrome was nonzero. What failed was the promise that the physical fault had weight at most one, under which 00010001 uniquely selects X1X_1. A syndrome identifies a representative only relative to a declared error model; outside it, the same record can contain a logical ambiguity.

  • C. H. Bennett, D. P. DiVincenzo, J. A. Smolin, and W. K. Wootters, “Mixed-state entanglement and quantum error correction,” Physical Review A 54, 3824–3851, 1996, doi:10.1103/PhysRevA.54.3824.
  • A. R. Calderbank, E. M. Rains, P. W. Shor, and N. J. A. Sloane, “Quantum error correction and orthogonal geometry,” Physical Review Letters 78, 405–408, 1997, doi:10.1103/PhysRevLett.78.405.
  • D. P. DiVincenzo and P. W. Shor, “Fault-tolerant error correction with efficient quantum codes,” Physical Review Letters 77, 3260–3263, 1996, doi:10.1103/PhysRevLett.77.3260.
  • D. Gottesman, “Class of quantum error-correcting codes saturating the quantum Hamming bound,” Physical Review A 54, 1862–1868, 1996, doi:10.1103/PhysRevA.54.1862.
  • D. Gottesman, Stabilizer Codes and Quantum Error Correction, Ph.D. thesis, California Institute of Technology, 1997, doi:10.7907/rzr7-dt72.
  • E. Knill and R. Laflamme, “Theory of quantum error-correcting codes,” Physical Review A 55, 900–911, 1997, doi:10.1103/PhysRevA.55.900.
  • E. Knill, R. Laflamme, R. Martinez, and C. Negrevergne, “Benchmarking quantum computers: The five-qubit error correcting code,” Physical Review Letters 86, 5811–5814, 2001, doi:10.1103/PhysRevLett.86.5811.
  • R. Laflamme, C. Miquel, J. P. Paz, and W. H. Zurek, “Perfect quantum error correcting code,” Physical Review Letters 77, 198–201, 1996, doi:10.1103/PhysRevLett.77.198.