In short
The 5-qubit perfect code is the [[5, 1, 3]] stabilizer code. Five physical qubits encode one logical qubit at distance 3, which is enough to correct any single-qubit Pauli error — X, Y, or Z on any of the 5 physical qubits, a total of 15 distinct single-qubit error operators. The code is defined by four commuting stabilizer generators, each a weight-4 Pauli string of the form X Z Z X I cyclically permuted across the 5 qubits:
The 4 stabilizer bits give 2^4 = 16 syndrome outcomes. Exactly 15 of them correspond to the 15 non-trivial single-qubit errors, and the 16th is "no error". Not a single syndrome is wasted — this is why the code is called perfect. The code saturates the quantum Singleton bound n - k \geq 2(d-1): for n = 5, k = 1, d = 3, the bound reads 4 \geq 4, tight. The logical operators are X_L = X_1 X_2 X_3 X_4 X_5 and Z_L = Z_1 Z_2 Z_3 Z_4 Z_5, both weight 5. The code was discovered twice independently in 1996: once by Bennett, DiVincenzo, Smolin, and Wootters, and once by Laflamme, Miquel, Paz, and Zurek. Unlike Shor's and Steane's codes, the 5-qubit code is not a CSS code — its stabilizers mix X and Z on each individual qubit, which is why it achieves Singleton saturation but loses the CSS-friendly classical-code construction.
You now know how to read a stabilizer code's parameters [[n, k, d]]. Shor's 9-qubit code is [[9, 1, 3]] — it takes nine physical qubits to protect one logical qubit against any single-qubit Pauli error. Steane's 7-qubit code is [[7, 1, 3]] — two qubits fewer, same protection. The obvious question: how far can this go? Is there a [[6, 1, 3]] code? A [[5, 1, 3]]? Could a single-error-correcting code exist with fewer than 5 qubits?
The quantum Singleton bound from the previous chapter, n - k \geq 2(d-1), says no. For k = 1, d = 3, the bound gives n \geq 5. Any single-error-correcting code on one logical qubit must spend at least 5 physical qubits. No [[4, 1, 3]] code exists, and the 5-qubit bound is sharp.
The remarkable fact is that the bound is actually achieved. A [[5, 1, 3]] code exists, and it is unique up to local Clifford equivalence. It is called the 5-qubit perfect code, and it is the smallest stabilizer code that corrects any single-qubit Pauli error on a one-logical-qubit encoding. It was discovered independently by two groups in 1996 — Bennett, DiVincenzo, Smolin, and Wootters in one paper, Laflamme, Miquel, Paz, and Zurek in another — each publishing within weeks of the other. The code has been a benchmark ever since: the most compact single-error-correcting stabilizer code, and the go-to example in the theoretical literature when someone needs "a code that does the minimum efficient thing".
This chapter builds the code from first principles. You will see the four stabilizer generators (each a cyclic rotation of a single weight-4 Pauli pattern), verify they commute, identify the logical operators, and work through how a single bit-flip on any qubit produces a unique syndrome that the decoder can read and correct. You will also see why the code is perfect — every one of the 16 possible syndrome outcomes maps to exactly one correctable event, with no syndrome wasted.
The four stabilizer generators
The [[5, 1, 3]] code is defined by four Pauli stabilizer generators on 5 qubits. They are obtained by taking the single weight-4 pattern X Z Z X I and cycling it across the 5 qubits:
Each stabilizer has weight 4 — it acts non-trivially on 4 of the 5 qubits and as identity on the fifth. The "identity position" rotates: S_1 is trivial on qubit 5, S_2 on qubit 1, S_3 on qubit 2, S_4 on qubit 3. Notice there is no S_5 with the identity on qubit 4 — the list of four generators suffices to define the code, and adding a fifth would make one of them redundant (expressible as a product of the other four up to sign). You can check that the fifth cyclic shift X_1 Z_2 I_3 X_4 Z_5 \cdot \text{something} lies in the group generated by S_1, S_2, S_3, S_4.
Verifying that the generators commute
Before this list is a valid stabilizer, all four generators must pairwise commute. Check one pair explicitly; the rest follow by the cyclic symmetry.
Take S_1 = X_1 Z_2 Z_3 X_4 I_5 and S_2 = I_1 X_2 Z_3 Z_4 X_5. Multiply them position by position to see whether each shared non-identity position contributes a commutation or anticommutation.
- Qubit 1: X on S_1, I on S_2. I commutes with everything. Commute.
- Qubit 2: Z on S_1, X on S_2. ZX = -XZ. Anticommute.
- Qubit 3: Z on S_1, Z on S_2. ZZ = ZZ. Commute.
- Qubit 4: X on S_1, Z on S_2. XZ = -ZX. Anticommute.
- Qubit 5: I on S_1, X on S_2. Commute.
Why two anticommutations make the operators commute overall: the full product S_1 S_2 equals (-1)^{(\text{number of anticommuting positions})} S_2 S_1. Two anticommutations give (-1)^2 = +1, so S_1 S_2 = S_2 S_1 and the two operators commute as a whole. This is a general rule for multi-qubit Pauli operators: they commute if and only if the number of positions where they anticommute (i.e. one has X or Y, the other has Z or Y, in an anticommuting combination) is even.
Run the same check on all \binom{4}{2} = 6 pairs of generators. Each pair has exactly two anticommuting positions and three commuting positions, giving an even count. All six pairs commute, so the four-generator set is a valid abelian stabilizer group.
Why 4 generators and 1 logical qubit
The generators are independent (no one is a product of the others up to sign — you can check by comparing patterns). So n - k = 4, and since n = 5, this gives k = 1. One logical qubit. The stabilizer group \mathcal{S} = \langle S_1, S_2, S_3, S_4 \rangle has 2^4 = 16 elements, and its +1-eigenspace inside the 2^5 = 32-dimensional Hilbert space has dimension 32 / 16 = 2 — exactly a one-qubit space.
Logical operators
The logical operators on the encoded qubit are the Pauli operators that commute with all four stabilizers but are not themselves in the stabilizer group. For the 5-qubit perfect code, the canonical choices are:
Both have weight 5 — each acts as a non-identity Pauli on every one of the 5 qubits. Check that X_L = X^{\otimes 5} commutes with every S_i: each generator has some combination of Xs, Zs, and one I. The number of anticommuting positions between X_L and S_i equals the number of Zs in S_i (since X anticommutes with Z but commutes with X and I). Each generator has exactly 2 Zs (check the pattern XZZXI), so each anticommutation count is 2 — even — giving commutation. Same for Z_L = Z^{\otimes 5}: the anticommuting positions are the Xs in each generator, and each generator has 2 of them, giving commutation.
Minimum weight of any non-trivial logical operator = 3. This is what makes the code distance 3. You might suspect the minimum weight is 5 (since X_L, Z_L both have weight 5), but there are weight-3 logical operators too, obtained by multiplying X_L or Z_L by stabilizers. For example:
up to a phase, which has weight 3.
Why this is a logical operator: multiplying X_L (which is logical) by S_1 (which is in the stabilizer) gives another element of the logical-operator coset — i.e. it acts identically to X_L on the code space because the stabilizer factor is +1 there. The coset of X_L contains X_L, X_L \cdot S_1, X_L \cdot S_2, X_L \cdot S_1 S_2, and so on — 16 elements, each equivalent to X_L as a logical operation but different in weight. The weight-3 representatives (like Y_2 Y_3 X_5) are the "tightest" form of the logical X.
The code distance is the minimum weight in this coset, and it is 3. A single weight-2 error could not produce this coset's minimum-weight representative because the coset starts at weight 3. So any single-qubit error (weight 1) is far from any logical operator, and the syndrome can unambiguously identify it.
The perfectness condition
Now the punchline — the feature that gives the code its name.
With 4 stabilizer bits, you get 2^4 = 16 possible syndrome outcomes. One of them is the all-plus-one outcome (+1, +1, +1, +1), meaning "no error was detected" — the state is in the code space and no correction is needed.
The remaining 16 - 1 = 15 syndromes are "error detected" outcomes. Each one corresponds to some Pauli error (or an equivalence class of Paulis that produce the same syndrome).
Now count the single-qubit errors. There are 5 qubits, and on each qubit there are 3 non-trivial Pauli errors (X, Y, or Z). Total: 5 \times 3 = 15.
Exactly 15 single-qubit errors, exactly 15 non-trivial syndromes. The code provides enough syndrome bandwidth to distinguish every single-qubit error uniquely — no two single-qubit errors produce the same syndrome, and no syndrome is "wasted" on something other than a correctable single-qubit error.
This is the perfect property. Mathematically, the code saturates the quantum Hamming bound, which counts correctable patterns against available syndromes:
For n = 5, k = 1, t = 1 (single-error-correcting):
So the 5-qubit code satisfies the Hamming bound with equality — it is a quantum Hamming-perfect code. This is an even tighter claim than saturating the Singleton bound (which is Singleton equality n - k = 2(d-1), i.e. 4 = 4, also true). The 5-qubit code saturates both bounds. Few codes do.
The encoding circuit
Producing the encoded state from a raw logical qubit |\psi\rangle = \alpha|0\rangle + \beta|1\rangle plus four ancilla qubits in |0\rangle requires a specific sequence of Clifford gates. The canonical circuit uses:
- Hadamards on the four ancilla qubits, producing |+\rangle^{\otimes 4}.
- A sequence of controlled-Pauli gates (controlled-X, controlled-Y, controlled-Z) linking each ancilla to multiple data qubits, implementing the stabilizer measurements as conditional operations.
- A final layer of phase and Hadamard gates that match the specific cyclic structure of the stabilizers.
The explicit circuit has roughly 8 CNOTs, 4 controlled-Z gates, 5 Hadamards, and a few S (phase) gates. It does not decompose into the clean two-stage concatenation of Shor's code — the 5-qubit code is not a CSS code, and its encoding circuit has no simple product structure.
The details of the full encoding circuit appear in Laflamme et al.'s 1996 paper and are reproduced in Nielsen and Chuang §10.5.9. For most pedagogical purposes, the stabilizer generators and logical operators are what you need — the encoding circuit is machinery.
Decoding: how the syndrome maps to the error
Given a syndrome (s_1, s_2, s_3, s_4) \in \{+1, -1\}^4, the decoder must identify which single-qubit error (if any) produced it. The procedure:
-
Measure the four stabilizers. This yields 4 classical bits. s_i = +1 means "this stabilizer is still in its +1 eigenstate" (no error seen by this stabilizer). s_i = -1 means "this stabilizer has flipped to -1" (some error anticommutes with S_i).
-
Look up the syndrome pattern in a decoder table. Since every single-qubit error has a unique syndrome, and the code has no syndrome waste, the lookup table is 2^4 = 16 entries long and is deterministic: each syndrome either means "no error" (the all-plus-one outcome) or names a specific X_j, Y_j, or Z_j for some qubit j.
-
Apply the matching Pauli correction to the identified qubit. If the syndrome says "X_3", apply X_3 to the data. This undoes the error, and the state returns to the code space.
The decoder table has 16 rows. You can construct it by computing, for each single-qubit error E, which stabilizers anticommute with E:
- X_j error: flips s_i for every i where S_i has a Z on qubit j.
- Y_j error: flips s_i for every i where S_i has an X or Z on qubit j (i.e. anything non-identity except Y).
- Z_j error: flips s_i for every i where S_i has an X on qubit j.
Because the stabilizers' pattern is cyclic, the syndromes come out with cyclic structure too. A single syndrome (s_1, s_2, s_3, s_4) maps to a single Pauli error E_{s_1 s_2 s_3 s_4} on some qubit j with some Pauli type.
Worked examples
Example 1: verify that S₁ and S₂ commute
Take the first two stabilizer generators of the 5-qubit code:
Compute S_1 S_2 and S_2 S_1 and show they are equal — i.e., the generators commute.
Step 1. Write out the product S_1 S_2 position by position. Two Pauli operators on 5 qubits multiply as the tensor product of the individual 1-qubit products:
Step 2. Evaluate each tensor factor. Use the Pauli multiplication rules: XZ = -iY, ZX = +iY, ZZ = I, XX = I, I \cdot P = P.
- Qubit 1: X \cdot I = X.
- Qubit 2: Z \cdot X = -iY.
- Qubit 3: Z \cdot Z = I.
- Qubit 4: X \cdot Z = -iY. Why XZ = -iY: XZ = \begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}1&0\\0&-1\end{pmatrix} = \begin{pmatrix}0&-1\\1&0\end{pmatrix} = -iY where Y = \begin{pmatrix}0&-i\\i&0\end{pmatrix}.
- Qubit 5: I \cdot X = X.
So S_1 S_2 = X \otimes (-iY) \otimes I \otimes (-iY) \otimes X = (-i)^2 X Y I Y X = -X_1 Y_2 I_3 Y_4 X_5.
Step 3. Write out S_2 S_1 similarly. This time S_2 acts first:
- Qubit 1: I \cdot X = X.
- Qubit 2: X \cdot Z = -iY \cdot (-1) \cdot \ldots wait, let me recompute: XZ = -iY, so X \cdot Z means applying Z first then X, giving XZ = -iY. On the tensor-product multiplication S_2 S_1, the operator on qubit 2 is X \cdot Z = XZ = -iY. Hmm, that gives the same as step 2. Let me redo this carefully. Why I need to be careful: in a product AB on a qubit, AB is interpreted as "apply B first, then apply A" — operator composition. So S_1 S_2 on qubit 2 means apply S_2's qubit-2 factor (X) first, then S_1's qubit-2 factor (Z). That gives Z \cdot X = ZX = +iY. And S_2 S_1 on qubit 2 gives X \cdot Z = XZ = -iY. These differ by a sign. So on qubit 2: S_1 S_2 gives ZX = +iY; S_2 S_1 gives XZ = -iY. Difference: factor of -1.
- Qubit 4: S_1 S_2 gives X \cdot Z = XZ = -iY; S_2 S_1 gives Z \cdot X = ZX = +iY. Another factor of -1.
Step 4. Combine the signs. Compared to S_1 S_2, the product S_2 S_1 picks up (-1) from qubit 2 and another (-1) from qubit 4, for a total factor of (-1)^2 = +1. So S_1 S_2 = S_2 S_1 — they commute.
Step 5. Verify via the commutation count. A faster route: count the number of positions where S_1 and S_2 anticommute (as in the section above): two (qubits 2 and 4). Even count ⇒ commute. Matches step 4.
Result. S_1 and S_2 commute. [S_1, S_2] = 0.
What this shows. The four stabilizer generators of the 5-qubit code are carefully designed so that the number of anticommuting positions between any pair is even. Each pair of generators has exactly 2 anticommuting positions, and the total stabilizer group is abelian. This is the algebraic invariant that makes the code valid.
Example 2: the syndrome of an X₂ error
Suppose an X_2 error happens on the encoded state — a bit-flip on qubit 2. Compute the syndrome that the four stabilizers will read, and verify the syndrome is unique to this error.
Step 1. How does X_2 affect each stabilizer? A Pauli error E flips the eigenvalue of stabilizer S_i from +1 to -1 if and only if E anticommutes with S_i. For E = X_2 (Pauli X on qubit 2, identity elsewhere), check anticommutation with each S_i:
-
S_1 = X_1 Z_2 Z_3 X_4 I_5: on qubit 2, E has X and S_1 has Z. XZ anticommutes. No other qubits have non-identity from E. Anticommute. Syndrome bit: s_1 = -1.
-
S_2 = I_1 X_2 Z_3 Z_4 X_5: on qubit 2, E has X and S_2 has X. XX commutes. Commute. Syndrome bit: s_2 = +1.
-
S_3 = X_1 I_2 X_3 Z_4 Z_5: on qubit 2, E has X and S_3 has I. Trivial. Commute. Syndrome bit: s_3 = +1.
-
S_4 = Z_1 X_2 I_3 X_4 Z_5: on qubit 2, E has X and S_4 has X. XX commutes. Commute. Syndrome bit: s_4 = +1.
Step 2. The syndrome. (s_1, s_2, s_3, s_4) = (-1, +1, +1, +1). In binary form (with -1 \leftrightarrow 1 and +1 \leftrightarrow 0): 1000.
Step 3. Is this syndrome unique to X_2? Check each of the other 14 single-qubit errors. Pattern: a single-qubit error P_j produces a syndrome where bit s_i = -1 iff S_i has a Pauli on qubit j that anticommutes with P. Let me tabulate the syndromes for all 15 single-qubit errors:
| Error | Syndrome (s_1, s_2, s_3, s_4) |
|---|---|
| X_1 | (+1, +1, +1, -1) = 0001 |
| X_2 | (-1, +1, +1, +1) = 1000 |
| X_3 | (-1, -1, +1, +1) = 1100 |
| X_4 | (+1, -1, -1, +1) = 0110 |
| X_5 | (+1, +1, -1, -1) = 0011 |
| Z_1 | (-1, +1, -1, +1) = 1010 |
| Z_2 | (+1, -1, +1, -1) = 0101 |
| Z_3 | (+1, +1, -1, +1) = 0010 |
| Z_4 | (-1, +1, +1, -1) = 1001 |
| Z_5 | (+1, -1, +1, +1) = 0100 |
| Y_1 | (-1, +1, -1, -1) = 1011 |
| Y_2 | (-1, -1, +1, -1) = 1101 |
| Y_3 | (-1, -1, -1, +1) = 1110 |
| Y_4 | (-1, -1, -1, -1) = 1111 |
| Y_5 | (+1, -1, -1, -1) = 0111 |
Why this table fills all 15 non-trivial syndromes exactly: the 15 single-qubit errors and the 15 non-trivial 4-bit syndromes line up bijectively because the code is perfect — by construction. Every row is distinct, covering all 15 non-zero binary patterns, and the all-zero pattern 0000 is reserved for "no error".
Step 4. Confirm the X_2 syndrome. The table entry for X_2 is (-1, +1, +1, +1) = 1000 — exactly what we computed in step 2. No other row has this syndrome, so X_2 is uniquely identified.
Result. A single X error on qubit 2 produces the unique syndrome 1000. The decoder reads the four stabilizer bits, gets 1000, looks up the table, identifies "X_2 error", and applies X_2 to the data. The error is undone, the code is back in its +1-eigenspace, and the logical state \alpha|0\rangle_L + \beta|1\rangle_L is preserved.
What this shows. The 5-qubit code's distinguishing feature is on display here: a four-bit syndrome has 16 possible values, the 15 non-trivial values map one-to-one to the 15 single-qubit errors, and no syndrome is ambiguous or wasted. This one-to-one mapping is what "perfect" means in the code's name, and it is what makes the 5-qubit code the most compact single-error-correcting stabilizer code possible.
Historical significance
The 5-qubit code was discovered twice, independently, in 1996, within weeks of each other:
-
Bennett, DiVincenzo, Smolin, and Wootters (IBM / Los Alamos / Montreal collaboration) published Mixed-state entanglement and quantum error correction in 1996 (arXiv:quant-ph/9604024), which contained the 5-qubit code as a key example of a perfect code.
-
Laflamme, Miquel, Paz, and Zurek (Los Alamos / UCLA / others) published Perfect quantum error correction code in 1996 (arXiv:quant-ph/9602019), focusing specifically on the [[5, 1, 3]] construction and proving its minimality.
The near-simultaneous discovery is not a coincidence — the quantum Singleton bound (known earlier) had told the community that any single-error-correcting code needed n \geq 5, and the search for a code saturating the bound was actively underway. Both groups landed on essentially the same construction through different algebraic approaches. The code is sometimes called the "Laflamme 5-qubit code" in retrospect, and the four-author papers are often co-cited.
Since 1996, the 5-qubit code has served as:
- the canonical example of a perfect stabilizer code in textbooks;
- the smallest single-error-correcting code demonstrated on real hardware (NMR demonstrations from Knill, Laflamme, Martinez, and Tseng in 2001; superconducting demonstrations in the 2010s; trapped-ion demonstrations by Quantinuum in the 2020s);
- a benchmark against which all other small-distance codes are measured.
It is not used in modern fault-tolerant proposals — the surface code has better geometric properties for 2D chips, and Steane's 7-qubit code has cleaner transversal gate sets. But every quantum error correction textbook opens with Shor's 9-qubit code and ends the small-distance section with the 5-qubit perfect code — because the pairing tells the compactness story: Shor used 9, Steane got down to 7, and the 5-qubit code is the fundamental lower bound.
Not a CSS code
One final structural feature worth highlighting: the 5-qubit code is not a CSS code. In a CSS code (Calderbank-Shor-Steane, covered in the next chapter), the stabilizer generators come in two disjoint groups — pure-X stabilizers and pure-Z stabilizers, with no mixing. Steane's 7-qubit code and Shor's 9-qubit code are both CSS: their stabilizers are all either pure Xs or pure Zs.
The 5-qubit code's stabilizers like X_1 Z_2 Z_3 X_4 I_5 mix Xs and Zs on the same generator. That is why the code escapes the CSS framework. It achieves Singleton saturation (which no CSS code with k = 1, d = 3 does), at the cost of losing the simple "one classical code for X, another for Z" construction that CSS codes enjoy. The 5-qubit code therefore requires a non-CSS encoding circuit with intertwined gate layers, and its fault-tolerant operation requires more careful analysis than the CSS codes — which is part of why CSS codes dominate practical fault-tolerance proposals despite their higher qubit overhead.
Common confusions
-
"5-qubit perfect code and 5-qubit bit-flip code are the same." There is no "5-qubit bit-flip code". The bit-flip code uses 3 qubits. The 5-qubit code is the smallest full single-error-correcting quantum code (protecting against X, Y, and Z simultaneously).
-
"Perfect just means smallest." Not quite — "perfect" is a precise technical term meaning saturates the quantum Hamming bound. For (k = 1, d = 3), being Hamming-perfect happens to coincide with being smallest (both give n = 5), but these are separate conditions in general. A code can be minimal in n without being Hamming-perfect if another bound (e.g. the linear-programming bound) is tighter.
-
"The 5-qubit code is a CSS code." No — this is a common misreading. The stabilizers X Z Z X I mix X and Z on individual generators, so the code is explicitly non-CSS. This is why the CSS-codes chapter (next) does not include it in the family.
-
"The stabilizers are all weight-4, so the distance is 4." No. The distance is the minimum weight of a non-trivial logical operator, not a stabilizer. For the 5-qubit code, the minimum-weight logical operators have weight 3 (obtained from X^{\otimes 5} multiplied by stabilizers), so the distance is 3. The weight of the stabilizers is a separate quantity — it affects the complexity of syndrome measurement, not the code distance.
-
"The 5-qubit code is used in modern quantum computers." Rare — modern fault-tolerant proposals use the surface code (for its 2D locality) or concatenated codes based on Steane (for transversal gates). The 5-qubit code is pedagogically central and has been experimentally demonstrated, but it is not typically the code of choice for scaling up.
-
"Every Pauli error of weight > 1 is uncorrectable." The distance is 3, so any error of weight 1 is corrected. Errors of weight 2 may or may not be correctable depending on whether the syndrome matches a weight-1 pattern (in which case the decoder mis-corrects, applying a wrong single-qubit Pauli that combined with the weight-2 error produces a weight-3 Pauli — exactly a logical error). This is why distance-3 codes only correct weight 1, not weight 2.
Going deeper
You now know the 5-qubit perfect code by its stabilizers, its logical operators, and its decoder table. This section gives the full stabilizer-group structure, the encoding circuit in detail, the relation to a pentagon of Pauli operators, and the code's place in the broader landscape of quantum codes.
The 16-element stabilizer group
The stabilizer generators S_1, S_2, S_3, S_4 generate a 16-element abelian group. The full group consists of all products of the generators (with \pm 1 signs absorbed). Explicitly:
- The identity: I^{\otimes 5}.
- The four single generators: S_1, S_2, S_3, S_4.
- The \binom{4}{2} = 6 pairwise products: S_1 S_2, S_1 S_3, \ldots, S_3 S_4.
- The 4 triple products: S_1 S_2 S_3, S_1 S_2 S_4, S_1 S_3 S_4, S_2 S_3 S_4.
- The 1 quadruple product: S_1 S_2 S_3 S_4.
Total: 1 + 4 + 6 + 4 + 1 = 16 = 2^4. Each product is a specific weight-k Pauli string on 5 qubits. Computing them explicitly is tedious but mechanical — each element is a Pauli operator (times \pm 1), and all 16 mutually commute.
The +1-eigenspace of this 16-element group is the 2-dimensional code space, spanned by logical basis states |0\rangle_L and |1\rangle_L.
The pentagon picture
The cyclic structure of the stabilizer pattern X Z Z X I corresponds geometrically to labelling the vertices of a regular pentagon with the Pauli letters X, Z, Z, X, I in order. The four generators S_1, S_2, S_3, S_4 correspond to four cyclic rotations of this labelling around the pentagon.
The logical operators X_L = X^{\otimes 5} and Z_L = Z^{\otimes 5} correspond to the "uniform" labellings where every vertex gets the same Pauli. The pentagon symmetry group (D_5, the dihedral group of order 10) acts on the code, generating the cyclic permutations of the generators and the reflection that swaps X \leftrightarrow Z. The code's invariance under this pentagon symmetry is part of why the 5-qubit code has such clean algebraic structure despite being non-CSS.
Experimental demonstrations
The 5-qubit code has been implemented on several hardware platforms since its 1996 discovery:
- NMR (2001) — Knill, Laflamme, Martinez, and Tseng demonstrated the 5-qubit code using liquid-state NMR on {}^{13}C-labelled molecules. This was the first experimental QEC code to correct arbitrary single-qubit errors.
- Superconducting (2015–present) — IBM and Rigetti teams implemented the code on transmon arrays with 5 physical qubits, showing syndrome-extraction cycles.
- Trapped ions (2021) — Quantinuum demonstrated the 5-qubit code on their H1 trapped-ion processor with high-fidelity encoding and error-correction cycles, including logical gate operations.
- Photonic (several groups, 2010s) — 5-qubit code states have been produced in linear-optical architectures and tested against controllable noise.
Each demonstration confirms the theoretical construction: four stabilizers measured, syndrome read, correction applied, logical state preserved through single-error events.
Place in the code landscape
The 5-qubit code sits at a specific point in the (n, k, d) grid:
- It is the unique (up to local Clifford equivalence) [[5, 1, 3]] stabilizer code.
- It is the smallest stabilizer code correcting any single-qubit Pauli error.
- It saturates both the Singleton and Hamming bounds for k = 1, d = 3.
- It is non-CSS.
- It has no native transversal gates beyond Pauli.
Compared to its neighbours:
- Steane [[7, 1, 3]] costs 2 extra qubits but is CSS and has transversal Clifford gates.
- Shor [[9, 1, 3]] costs 4 extra qubits but has a very simple concatenated structure.
- Surface code [[25, 1, 5]] costs many more qubits but has local stabilizers and better scalability.
If your constraint is "minimum physical qubits for a single-error correcting code", the 5-qubit code is the answer. If your constraint is "best fault-tolerant properties", other codes take over.
Indian experimental QEC
The Indian QEC community has contributed experimentally primarily through NMR — the IIT Kanpur, IISER Pune, and IIT Madras groups have longstanding programmes in NMR quantum information, and implementations of small stabilizer codes including 3-qubit and 5-qubit constructions have appeared in the Indian NMR literature since the 2000s. T. S. Mahesh's group at IISER Pune has published specifically on implementing stabilizer codes and error-correction protocols on NMR systems.
On the theoretical side, Indian contributions to code construction include work on quantum LDPC codes and concatenation from groups at IIT Madras and IIT Bombay. The National Quantum Mission (2023, ₹6000 crore) has listed fault-tolerant QEC as a thematic hub, with the 5-qubit code appearing in proposals for early experimental milestones.
Fault-tolerance considerations
The 5-qubit code, while perfect in the information-theoretic sense, is not fault-tolerant in the practical sense. Fault-tolerance requires that gates (including syndrome-measurement gates) do not themselves spread errors uncontrollably — and the 5-qubit code's stabilizers, being weight-4 and non-CSS, require careful syndrome-extraction protocols to achieve this.
Transversal gates (gates that act independently on each physical qubit within a block) are the standard tool for fault-tolerant operation. The 5-qubit code has a transversal logical Pauli group — X_L = X^{\otimes 5} is trivially transversal — but its logical Hadamard, logical S, and logical CNOT are not transversal in the simple form. Implementing these requires either the use of magic states distilled from separate 5-qubit code instances or a move to a richer code (like the Reed-Muller code or concatenated Steane) where more transversal gates are available.
This is partly why the 5-qubit code, despite its perfect information-theoretic efficiency, is not the default in fault-tolerant computing. The surface code's worse overhead is outweighed by its cleaner fault-tolerant gate structure.
Where this leads next
- Stabilizer codes generally — the [[n, k, d]] framework the 5-qubit code instantiates.
- Pauli group and stabilizers — the algebra underlying the stabilizer generators.
- Shor's 9-qubit code — the earlier, less compact code with simpler CSS structure.
- CSS codes — the family the 5-qubit code is not in, and why.
- Steane 7-qubit code — the smallest CSS single-error-correcting code, with transversal Clifford gates.
- Surface code — the 2D lattice code dominating modern fault-tolerant proposals.
- Threshold theorem — how small codes, concatenated, yield arbitrarily low logical error rates.
References
- Raymond Laflamme, Cesar Miquel, Juan Pablo Paz, Wojciech Zurek, Perfect quantum error correction code (1996) — arXiv:quant-ph/9602019. One of the two original papers introducing the 5-qubit code, focused on the perfectness property.
- Charles Bennett, David DiVincenzo, John Smolin, William Wootters, Mixed-state entanglement and quantum error correction (1996) — arXiv:quant-ph/9604024. The other independent discovery of the 5-qubit code, in the broader context of entanglement-assisted error correction.
- Daniel Gottesman, Stabilizer codes and quantum error correction (PhD thesis, 1997) — arXiv:quant-ph/9705052. Stabilizer-formalism treatment of the 5-qubit code alongside the whole code zoo.
- John Preskill, Lecture Notes on Quantum Computation, Chapter 7 — theory.caltech.edu/~preskill/ph229. Pedagogical derivation and the connection to the Hamming and Singleton bounds.
- Nielsen and Chuang, Quantum Computation and Quantum Information (2010), §10.5.9 — Cambridge University Press. The 5-qubit code with full encoding circuit and decoder table.
- Wikipedia, Five-qubit error correcting code — accessible overview with the stabilizer listing and encoding circuit. </content> </invoke>