Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

CSS codes

A Calderbank-Shor-Steane code is a stabilizer code whose generators can be chosen to contain only X operators or only Z operators.

Edition released Coverage: Overview · Technical · Research
On this page

Explanation and significance

The separation of X and Z checks links quantum coding to classical binary linear codes. It simplifies syndrome extraction, decoding descriptions and many logical operations. The separation is algebraic: a physical Y error still has both X and Z components, and correlations between these components can matter for optimal decoding. CSS structure does not guarantee locality, good distance, a useful threshold or a specific transversal gate set.

Mechanism and mathematical structure

Let H_X and H_Z be binary matrices listing X and Z check support. Commutation requires H_X H_Z^T=0 over F2. With ranks r_X and r_Z, the code encodes k=n-r_X-r_Z qubits. An X error vector e_X produces Z-check syndrome H_Z e_X; a Z error vector e_Z produces X-check syndrome H_X e_Z. Distances are determined by vectors in the appropriate kernel that are not in the corresponding stabilizer row space.

Fully worked reference example

Take H_X=H_Z=H with rows 1111000, 1100110 and 1010101. Each row has weight four and any pair overlaps in two positions, so all binary inner products are zero. H H^T=0. The three rows are independent; hence n=7, r_X=r_Z=3 and k=1. A single X on position 0 gives Z-check syndrome equal to column 0, namely 111. A single X on position 6 gives 001. All seven columns are nonzero and distinct, so single X locations are distinguishable. The same argument handles Z errors, and a Y error produces both syndromes. This matrix construction is a convention for the Steane [[7,1,3]] code.

Limits and misconceptions

Do not add arbitrary classical parity-check matrices and assume they define a quantum code: the orthogonality condition is essential. Row duplication changes a displayed matrix but not its rank or number of encoded qubits. A decoder that separately estimates X and Z faults may lose information if the hardware produces correlated Y faults. State whether the documented code uses binary qubits or a generalization to higher-dimensional systems.

Scientific relationships

Is a type of stabilizer code and a framework for Steane, many surface, color and quantum LDPC codes. Depends on binary linear algebra and Pauli commutation.

Historical context

The Calderbank-Shor paper appeared as a preprint in December 1995 and in Physical Review A on August 1, 1996. The preprint and formal publication dates describe different events.

Deriving the CSS commutation condition

For binary support vectors a and b, define X(a)=tensor_j X_j^(a_j) and Z(b)=tensor_j Z_j^(b_j). At every position where a_j=b_j=1, commuting X past Z contributes a minus sign. Hence X(a)Z(b)=(-1)^(a·b)Z(b)X(a). Requiring every X-check row to commute with every Z-check row is exactly H_X H_Z^T=0 over the binary field. This is a structural constraint, not a numerical approximation.

Error detection follows the same algebra. An X error vector e_X changes a Z-check sign according to the corresponding component of H_Z e_X. A Z error vector e_Z changes X-check signs according to H_X e_Z. A Y error has both components. The two syndrome channels can be processed separately in a simple decoder, but their statistical correlation may contain useful information. For depolarizing noise, a Y fault is not two independent physical events even though it has two binary components.

The rank formula k=n-rank(H_X)-rank(H_Z) assumes the chosen rows define independent stabilizer constraints after removing dependencies and that phases are consistent. A matrix with many repeated or dependent rows can provide redundant measured checks without changing encoded dimension. Scientific records should therefore store both the displayed check count and the algebraic ranks.

Exact code-space and logical-operator reasoning

For the seven-qubit matrix H in the entry, each row has even self-overlap and every pair has even mutual overlap, so H H^T=0. The row space has eight binary vectors because rank(H)=3. Its nonzero vectors all have weight four. The kernel of H has dimension 7-3=4 and therefore sixteen vectors. The row space lies inside the kernel. The quotient kernel/row-space has dimension one, providing one independent logical direction for each Pauli type.

The all-ones vector1111111 lies in the kernel because each row has weight four. It does not lie in the row space because its weight is seven. It therefore supplies a logical representative. Adding row1111000 gives 0000111, a weight-three representative in the same logical class. This small calculation connects rank, quotient spaces and code distance without requiring a full listing of 128 state amplitudes.

A sparse CSS matrix can still require checks connecting distant devices. A short, dense check can be practical on a platform with flexible interactions. Binary matrices determine commutation and logical structure, and a Tanner graph records their incidence. A separately specified physical embedding determines the interaction constraints.

A complete four-qubit CSS example with two logical qubits

Choose H_X=H_Z=[1111]. Each matrix has rank one, and their product is zero over the binary field because the common support has even weight four. The resulting code has n=4 and k=4-1-1=2, with stabilizers XXXX and ZZZZ. One logical pair is X_A=X0X1 and Z_A=Z0Z2. A second is X_B=X0X2 and Z_B=Z0Z1. Each logical operator commutes with both stabilizers.

Within each pair the X and Z representatives overlap at one qubit and anticommute. Between pairs, X_A and Z_B overlap twice, while X_B and Z_A overlap twice, so they commute. The two logical X operators commute with each other, as do the two logical Z operators. This verifies the full two-qubit Pauli algebra, not just an isolated plausible string. Weight-two nontrivial logical operators exist and no weight-one Pauli commutes with both checks, giving distance two.

Every single physical X produces the same Z-check syndrome, and every single physical Z produces the same X-check syndrome. The code detects all single-qubit Pauli errors but cannot locate an arbitrary one from two syndrome bits. If a single erased position is known, the support information resolves the relevant ambiguity and ideal erasure recovery is possible. This construction makes the distinction between encoding rate, detection, correction, and location information explicit in a small exact model.

Why independent component decoding can discard useful evidence

For a single-qubit depolarizing Pauli model, let P(X)=P(Y)=P(Z)=p/3 and P(I)=1-p. Define binary components e_X=1 for X or Y and e_Z=1 for Z or Y. Each component has marginal probability 2p/3, but their joint probability is P(e_X=1,e_Z=1)=p/3. Treating the components as independent would instead assign probability 4p²/9 to their joint occurrence. The difference is first order versus second order in small p.

At p=0.003, the true probability of both components is 0.001. The independent-component approximation gives 0.000004, a factor of 250 smaller. Once evidence points to an X component at a location, the conditional probability of a Z component there is one-half in this symmetric model. A separate decoder that uses only the marginal Z probability 0.002 ignores that strong conditional information. The appropriate correction still depends on the code's degeneracy and the complete syndrome; this single-site calculation only identifies the lost statistical dependence.

CSS check separation remains useful even when decoding is coupled. The quantum circuits can measure X-type and Z-type constraints separately while a classical inference algorithm exchanges probabilities between the two sectors. Algebraic separability of constraints and probabilistic independence of noise are distinct statements. A scientific description should say which is assumed rather than using the word CSS as shorthand for both.

Chain-complex interpretation and its practical boundary

The condition H_X H_Z^T=0 can be viewed as saying that two consecutive boundary maps compose to zero. With C2 mapped to C1 by H_Z^T and C1 mapped to C0 by H_X, the image of the first map lies in the kernel of the second. Logical Z classes are elements of ker(H_X) modulo im(H_Z^T), with the paired logical-X construction obtained from the dual maps. The dimension of this quotient gives the number of encoded Z directions.

This language is useful because many geometric and product-code constructions make the composition-zero property automatic. It also explains why adding a stabilizer changes a representative without changing its logical class. The abstract vector spaces do not specify wire lengths, simultaneous gate conflicts, or the number of extraction ancillas. Those are additional architectural data. A chain complex with short algebraic descriptions can still require physically distant interactions.

For the four-qubit example, ker(H_X) consists of even-weight binary strings and has dimension three. The image of H_Z^T is the one-dimensional space generated by 1111. The quotient has dimension two, matching the two logical qubits. Strings 1100 and 0011 differ by 1111 and therefore represent the same X-type or Z-type class in the appropriate dual interpretation. This provides a concrete quotient-space calculation without treating formal notation as a substitute for a code.

Sources

  • Daniel Gottesman · · Thesis · arXiv · DOI 10.48550/arXiv.quant-ph/9705052
    Verification scope

    Stabilizer Codes and Quantum Error Correction
    Daniel Gottesman · · Thesis · Preprint recorded · arXiv

    Citation identity checked ·

    Stabilizer algebra and fault-tolerance foundations; no current experimental ranking.

  • A. R. Calderbank; Peter W. Shor · · Research paper · Peer-reviewed publication recorded · DOI link
    Verification scope

    Citation identity checked ·

    Existence and CSS foundations; not a practical hardware performance claim.

  • Andrew Steane · · Research paper · Publication status unspecified · arXiv · DOI 10.1098/rspa.1996.0136
    Verification scope

    Selected text checked ·

    Bibliographic/version metadata and primary text connecting classical code structure to quantum correction checked. The exact H-matrix ordering, finite-error enumeration, and q4 correction are original independent calculations.

    Historical primary source; not evidence for present-day implementation quality or a universal modern resource estimate.