CSS Codes
Calderbank–Shor–Steane (CSS) codes are quantum stabilizer codes whose checks can be chosen to contain only X operators or only Z operators. Their construction turns a pair of compatible classical binary spaces into a quantum code. The central condition is simple: every X-check support must overlap every Z-check support an even number of times.
The separation makes code construction and syndrome calculations easier, but does not make physical bit and phase errors statistically independent. We will build a small example, use it to explain logical quotient spaces and distance, and then identify which transversal gates follow from CSS structure. These ideas arose in the constructions of Calderbank and Shor (1996) and Steane (1996).
Required background. Stabilizer Formalism supplies Pauli commutation, code projectors, and error syndromes. Helpful background. Steane Code gives a familiar CSS example; Why Quantum Error Correction Is Possible explains exact correctability.
Commuting X and Z checks
Section titled “Commuting X and Z checks”All binary arithmetic below is modulo two. Write length-n support vectors as rows, with qubit 1 on the left in displayed strings. Define and as products of X and Z on the nonzero positions of x and z. Then
A Y at site j has both , since . We ignore global Pauli phases when discussing supports and syndromes, while retaining them when calculating an operator’s action.
Let each row of specify a positive X check, and each row of a positive Z check. Positive means that the code is in the check’s eigenspace. Same-type checks commute automatically. Cross-type checks all commute exactly when
The matrix entry at row a, column b is the overlap parity of X check a and Z check b. If an entry is one, those two proposed checks anticommute and cannot have a common eigenstate.
Let and be the binary ranks of the two matrices. The number of encoded qubits is
There are independent constraints, each halving the Hilbert-space dimension. Ranks, rather than numbers of listed rows, matter. Repeating a check or adding a product of existing checks adds no new constraint. Such extra measurements may still be useful when their outcomes are noisy.
Two nested classical spaces
Section titled “Two nested classical spaces”Define
Commutation is precisely the inclusion . The Z checks restrict computational strings to , while X checks translate strings by elements of . Conversely, any nested pair supplies CSS checks by taking to generate and to generate .
For each coset in , form
A coset is the group of strings reachable from u by adding elements of . Each X check permutes those strings, leaving their equal superposition unchanged. Each Z check gives phase because every string is in . Different cosets are disjoint, so their normalized superpositions are orthogonal. There are
such states: a complete logical basis. This is why classical redundancy can protect quantum amplitudes without copying an unknown state. The amplitudes multiply entire coset superpositions.
The notation is not uniform across sources. The explicit kernel and row-space definitions above determine its meaning here; at the classical level generates , while checks .
A five-qubit example: detecting is easier than correcting
Section titled “A five-qubit example: detecting is easier than correcting”Consider
Every cross-row overlap is two, so the checks commute. Both matrices have rank two, giving . Their generators are , , , and . This example will have distance two; it differs from the non-CSS perfect five-qubit code.
The X-check row space consists of
The kernel of has these four words and the second coset . Thus is the equal superposition of the four C₂ words, and the equal superposition of their sums with . Each amplitude is .
Each column represents a normalized superposition of four strings. Adding an X-check word, such as , only permutes strings within a column. Adding exchanges the columns and acts as . The phase from is constant within each column and opposite between them.
Indeed, exchanges the two cosets, while has even overlap with every word in the first coset and odd overlap with every word in the second. We can choose
Their single overlapping X/Z site makes them anticommute.
For errors, write the Z-check bits first and the X-check bits second. The columns of give X-error syndromes, while the columns of give Z-error syndromes:
| Site j | X-error bits from Z checks | Z-error bits from X checks |
|---|---|---|
| 1 | ||
| 2 | ||
| 3 | ||
| 4 | ||
| 5 |
A Y error has both listed halves. All single-qubit nonidentity Paulis have nonzero syndrome, so each is detected. However,
while . These two errors have the same syndrome and differ by a logical operation. No recovery can correct both for an arbitrary encoded state. The same problem occurs for and , whose product is .
The code detects an unknown one-qubit error, but cannot correct the entire set of such errors. It can correct an arbitrary error at a known single location, as Exercise 8 explains. Knowing where an error occurred changes the correction problem.
Logical operators as quotient spaces
Section titled “Logical operators as quotient spaces”An X operator commutes with all Z checks when its support is in . If its support is also in , it is a stabilizer and does nothing to a code state. Thus
The slash identifies two supports when their difference is an X-stabilizer support. In the example, adding either X-check row to changes the physical representative but preserves its logical action. This quotient is exactly : X logical operators translate logical coset labels.
Similarly,
For , the phase is constant throughout each coset, so
Both logical spaces have binary dimension k. To label k logical qubits, choose representative matrices satisfying
The diagonal ones give anticommutation within each logical X/Z pair; the off-diagonal zeros give commutation between different logical qubits. Such paired bases exist because the induced pairing of quotient spaces is nondegenerate. Exercise 3 proves this without choosing a particular code.
Axis distances and the full distance
Section titled “Axis distances and the full distance”For , define and as minimum weights of nontrivial pure-X and pure-Z logical supports:
Some sources reverse axis labels according to which errors a check detects, so the support-based definitions matter. The full Pauli distance is
To see why mixed Paulis cannot do better, take a zero-syndrome Pauli . If both components are stabilizer supports, their product is a stabilizer up to global phase. Otherwise at least one component is a nontrivial logical support. Its weight is at least the corresponding axis distance, and the union of the X and Z supports cannot be smaller than that component. Pure-axis representatives attain the smaller bound.
In the five-qubit example, neither kernel has a weight-one word because neither check matrix has a zero column. The displayed weight-two logical representatives therefore prove .
Excluding stabilizers in these minima is essential. A low-weight classical kernel word may represent a harmless stabilizer rather than a logical error. For example, a same-block in the Shor code has weight two and zero syndrome but is a stabilizer; the minimum nontrivial logical Z still has weight three. Raw classical distances can therefore underestimate a quantum axis distance.
CSS does not require equal protection along the two axes. The bit-repetition example in Exercise 4 has and . If , both quotients are trivial and the construction gives a stabilizer state; a distance defined by a nontrivial logical operator has no finite minimum.
Syndrome equations and recovery choices
Section titled “Syndrome equations and recovery choices”For a Pauli with binary components ,
The subscript names the check type, not the error type. Z checks detect X components and X checks detect Z components. A Y event contributes to both. Linear addition of supports gives linear addition of syndromes.
Two errors with the same syndrome can differ in two importantly different ways:
- Their component differences lie in and . Their product is a stabilizer up to phase, so a single correction works for both. This is harmless degeneracy.
- At least one difference represents a nonzero logical quotient class. Their product acts on the encoded information, so they cannot both be corrected as part of the same arbitrary-state error set.
This is the Pauli form of the Knill–Laflamme condition, . Different syndromes give a zero projected cross term; a stabilizer product gives a scalar; a nontrivial logical product fails the condition. For the full stabilizer treatment, see Gottesman (1997).
If a decoder chooses correction components , successful recovery requires
Matching the syndrome ensures return to the code space, but the stronger row-space conditions ensure the original logical state is restored.
Separate equations do not imply independent noise
Section titled “Separate equations do not imply independent noise”Suppose the one-qubit Pauli probabilities are
The marginal probabilities for X and Z components are 0.08 and 0.07. Their product is 0.0056, whereas the true probability that both occur—the Y probability—is 0.06. Multiplying the marginals would erase a strong correlation.
Under Pauli noise, a decoder seeking the most likely logical recovery class should add the probabilities of all physical errors in that stabilizer class. Selecting the single most likely physical error need not select the most likely logical class. Separate X/Z decoding can be effective, but its optimality depends on the noise distribution and decision rule; it does not follow from the split syndrome equations. Decoders develops these inference choices. Actual check measurements and noisy repeated outcomes are treated in Syndrome Measurement.
Transversal gates and extra algebraic conditions
Section titled “Transversal gates and extra algebraic conditions”Apply coordinatewise CNOT between two identical CSS blocks. A control X check becomes the product of the matching X checks on both blocks; a target Z check becomes the product of the matching Z checks. The remaining checks are unchanged. Hence the joint stabilizer is preserved for every CSS code.
On coset states the action is
With the same logical coordinates in both blocks, this implements CNOT on each corresponding pair of logical qubits. It follows by relabeling the target summation variable after binary addition, as in the Steane-code derivation.
Hadamard exchanges X and Z supports. Bare preserves the positive CSS code exactly when the two check row spaces agree. Unequal matrices can still describe equal row spaces, so compare spans rather than printed rows. Otherwise the operation maps to the code with the two spaces exchanged; a further permutation may sometimes restore the original code. CSS structure alone does not supply such a permutation.
For ,
For the positive-check convention, bitwise S preserves the code when every X-check generator has weight divisible by four and its support belongs to the Z-check row space. These conditions ensure both the correct support and the correct sign of each image; the Z checks are unchanged. The induced logical phase still needs to be calculated. In the Steane basis, physical bitwise S implements logical .
The five-qubit example fails both bare H and bare S preservation. Its two row spaces differ, and the X check has odd weight and no matching Z-stabilizer support. Specialized CSS families can admit non-Clifford transversal operations, so “CSS means only Clifford gates” is also incorrect.
Transversality limits propagation within a block under an appropriate local fault model; full protection also requires preparation, measurement, and recovery procedures. Fault-Tolerant Gates treats those constructions. The Eastin–Knill theorem rules out a universal entirely transversal unitary set for a nontrivial finite-dimensional code detecting arbitrary errors on each physical subsystem.
A short connection to chain complexes
Section titled “A short connection to chain complexes”Using column coordinates for the linear maps, CSS commutation gives
The composition is zero, so the image of the first map lies inside the kernel of the second. Their quotient at the middle space is : undetectable Z supports, with Z stabilizers identified as trivial. Exchanging X and Z gives the analogous description of .
Here are row counts, including any dependent rows; the dimensions of the images are the ranks. Relations among redundant checks appear at the ends of the sequence and do not add logical qubits. This algebra becomes geometric in the surface code. To obtain a quantum LDPC family one additionally needs uniformly bounded check weights and qubit degrees. Zero composition alone imposes neither locality nor sparsity.
Exercises
Section titled “Exercises”1. Add a redundant check
Section titled “1. Add a redundant check”Repeat the first row of in the five-qubit example. Find the row counts, ranks, and number of logical qubits. Interpret the dependence among the listed checks.
Solution
The row counts become , while . Thus remains unchanged. Multiplying the first and third X checks gives identity, so their ideal outcomes must agree. Measuring them at separate times could supply two noisy observations, but repeating a row does not halve the ideal code space again. Using row counts in place of ranks would incorrectly give .
2. Why is a coset superposition well defined?
Section titled “2. Why is a coset superposition well defined?”Prove that the normalized state for is unchanged when u is replaced by another representative. Show that the coset states form an orthonormal basis of the quantum code.
Solution
Replacing u by , with , changes the summation variable from v to , a permutation of . There are distinct computational basis states in each sum, each with squared amplitude , so its norm is one. Different cosets are disjoint and give zero overlap.
X checks permute terms. Z checks contribute because their supports lie in and every summand is in . The number of orthonormal states is , equal to the common eigenspace dimension. They therefore form a basis of that space.
3. Pair logical X and Z classes
Section titled “3. Pair logical X and Z classes”Prove that is well defined and nondegenerate on the two logical quotients. Verify the pairing for the five-qubit example.
Solution
Adding an X-check row to x leaves the pairing unchanged because . Adding a Z-check row to z also leaves it unchanged because . Thus the pairing depends only on quotient classes.
If x pairs to zero with every z in , then
so its logical class is zero. The reverse argument is identical. The pairing is therefore nondegenerate and admits dual bases with . In the example, , which verifies the logical anticommutation.
4. Find unequal axis distances
Section titled “4. Find unequal axis distances”Take three qubits with no X checks and Z-check rows and . Compute , and d using quotient spaces.
Solution
The ranks are zero and two, so . The kernel of is , and the X-stabilizer space is zero; hence . The kernel of the empty X-check matrix is all . The Z-stabilizer row space consists of the four even-weight words, so a single Z is a nontrivial logical operation and . Thus .
This is bit repetition: it corrects one bit flip but leaves phase information unprotected. A single favorable axis distance does not establish correction of an arbitrary one-qubit error.
5. Detection versus a common recovery
Section titled “5. Detection versus a common recovery”Use the five-qubit columns to count the distinct syndromes of the identity and all single-qubit Paulis. Explain why and obstruct joint correction.
Solution
The X errors occupy three nonzero syndromes in the first half. The Z errors occupy three in the second half. The Y errors occupy five distinct pairs with both halves nonzero. Including identity gives sectors. All 15 nonidentity single-qubit Paulis are detected.
But and have the same syndrome and product . Thus their Knill–Laflamme cross term is a logical X on the code, not a scalar. Choosing correction restores an error but changes the logical state after an error. This is a logical ambiguity, whereas stabilizer-equivalent errors would admit the same correction.
6. Check the statistical assumption
Section titled “6. Check the statistical assumption”For the Pauli probabilities in the text, calculate the X/Z-component covariance and compare the actual Y probability with a product model.
Solution
The binary component means are and . Their product moment is , so
The product model gives , about 10.7 times smaller than the actual value. Both models would use the same exact CSS syndrome equations. Their different joint probabilities can nevertheless lead to different preferred recovery classes.
7. Test three transversal operations
Section titled “7. Test three transversal operations”Show that coordinatewise CNOT preserves two copies of the five-qubit example, and determine whether bare tensorwise H or S preserves one copy.
Solution
Under CNOT, control X checks and target Z checks become matching-check products on the two blocks, so the joint stabilizer is preserved. The two coset labels transform as , giving logical CNOT.
H exchanges the row spaces. They are unequal, so does not preserve the original code. For S, the first X support is a Z-stabilizer support and has weight four. The second support has weight three and is absent from the Z-stabilizer space. Its conjugate is therefore not a stabilizer with the required sign, and also fails to preserve the code. CSS structure guarantees the stated CNOT construction, but the other two gates require extra conditions.
8. Correct one known erasure
Section titled “8. Correct one known erasure”Explain why the distance-two example can recover after loss of one known physical qubit, despite failing to correct an error at an unknown single location. Why can the pair of lost sites not be corrected?
Solution
For a known site j, consider the error basis . Products of two members are either scalar or a Pauli on that same site. Every nonscalar such Pauli has nonzero syndrome, so all projected cross terms satisfy Knill–Laflamme. This correctability criterion also characterizes recovery from erasure of that site after supplying a replacement subsystem. The recovery may depend on the known lost location.
Unknown-location correction must include errors on every site in one common error set, introducing the incompatible pair . For erasure of sites , the entire logical operator is supported on the lost set. The erasure criterion therefore fails: the lost subsystem can carry logical information. The locations and supports matter, not only the number of erased qubits.
References
Section titled “References”- A. R. Calderbank and P. W. Shor, “Good quantum error-correcting codes exist,” Physical Review A 54, 1098–1105, 1996, doi:10.1103/PhysRevA.54.1098, arXiv:quant-ph/9512032.
- B. Eastin and E. Knill, “Restrictions on transversal encoded quantum gate sets,” Physical Review Letters 102, 110502, 2009, doi:10.1103/PhysRevLett.102.110502.
- D. Gottesman, Stabilizer Codes and Quantum Error Correction, Ph.D. thesis, California Institute of Technology, 1997, doi:10.7907/rzr7-dt72, 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.
- A. M. Steane, “Error correcting codes in quantum theory,” Physical Review Letters 77, 793–797, 1996, doi:10.1103/PhysRevLett.77.793.