Skip to main content
KetQat

Appearance

Topic · intermediate

CSS Codes

Stabilizer codes whose checks split into X-type and Z-type parts, built from two orthogonal classical codes or, equivalently, from a chain complex. They correct bit flips and phase flips separately and admit a transversal logical CNOT.

ExpositionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

Overview

A CSS code is a stabilizer code in which every stabilizer generator is either a product of XX operators or a product of ZZ operators. The construction, due independently to Calderbank and Shor and to Steane, turns two classical binary codes into a quantum code: one classical code catches bit flips, the other catches phase flips, and the only requirement is that their check matrices be orthogonal, HXHZT=0H_X H_Z^T = 0.

The same condition says that HXH_X and HZTH_Z^T form a chain complex. This makes CSS codes the meeting point of coding theory and topology: the logical qubits are a homology group, the distance is the length of the shortest homologically nontrivial cycle, and cellulated surfaces give the toric and surface codes. Most codes studied for fault tolerance — the Steane code, surface and color codes, and essentially all quantum LDPC codes — are CSS codes.

Intuition

Every Pauli error is, up to phase, X(e1)Z(e2)X(e_1) Z(e_2): a bit-flip pattern e1e_1 followed by a phase-flip pattern e2e_2. A ZZ-type check Z(h)Z(h) ignores phase flips and reports the parity h⋅e1h \cdot e_1 of the bit flips it touches, exactly like a classical parity check. An XX-type check reports h⋅e2h \cdot e_2 in the same way. So a CSS code is two classical codes running side by side on the same qubits, one in the computational basis and one in the Hadamard-rotated basis.

What keeps them from interfering is commutation. An XX-type and a ZZ-type check commute when they overlap on an even number of qubits. Requiring this for all pairs is the orthogonality HXHZT=0H_X H_Z^T = 0. In the nested-code picture C2⊆C1C_2 \subseteq C_1, the code states are uniform superpositions over the cosets of C2C_2 in C1C_1: bit flips move a string out of C1C_1 and are caught by C1C_1's checks, and phase flips change the relative signs inside a coset and are caught after a Hadamard transform, which turns C2C_2 into C2⊥C_2^\perp.

Prerequisites

Stabilizer codes; binary linear codes and dual codes; for the homological view, chains, boundaries and homology over F2\F_2.

Mathematical Definitions

DefinitionCSS codeEstablished definition

For v∈F2nv \in \F_2^n write X(v)=∏j:vj=1XjX(v) = \prod_{j : v_j = 1} X_j and Z(v)=∏j:vj=1ZjZ(v) = \prod_{j : v_j = 1} Z_j. Then X(u)X(u) and Z(v)Z(v) commute if and only if u⋅v=0u \cdot v = 0 over F2\F_2.

Check-matrix form. Let HX∈F2mX×nH_X \in \F_2^{m_X \times n} and HZ∈F2mZ×nH_Z \in \F_2^{m_Z \times n} satisfy

HXHZT=0.H_X H_Z^{T} = 0 .

The CSS code CSS(HX,HZ)\mathrm{CSS}(H_X, H_Z) is the stabilizer code on nn qubits whose stabilizer group is generated by X(h)X(h) for the rows hh of HXH_X and Z(h)Z(h) for the rows hh of HZH_Z. The condition HXHZT=0H_X H_Z^T = 0 says exactly that every XX-type generator commutes with every ZZ-type generator. An XX error X(e)X(e) has syndrome HZeH_Z e and a ZZ error Z(e)Z(e) has syndrome HXeH_X e, so the two kinds of error are detected by separate classical parity checks.

Nested-code form. Equivalently, take binary linear codes C2⊆C1⊆F2nC_2 \subseteq C_1 \subseteq \F_2^n, let HZH_Z be a parity-check matrix of C1C_1 (so C1=ker⁡HZC_1 = \ker H_Z) and HXH_X a generator matrix of C2C_2 (so C2C_2 is the row space of HXH_X). Then HXHZT=0H_X H_Z^T = 0 because C2⊆C1C_2 \subseteq C_1. This is the original formulation of Calderbank and Shor and Steane, usually written CSS(C1,C2)\mathrm{CSS}(C_1, C_2). The case C2=C⊥⊆C=C1C_2 = C^\perp \subseteq C = C_1 uses a single dual-containing code.

Chain-complex form. Matrices with HXHZT=0H_X H_Z^T = 0 are the same thing as a chain complex of F2\F_2-vector spaces of length two,

C2→  ∂2=HZT  C1=F2n→  ∂1=HX  C0,∂1∂2=0,C_2 \xrightarrow{\;\partial_2 = H_Z^{T}\;} C_1 = \F_2^{n} \xrightarrow{\;\partial_1 = H_X\;} C_0 , \qquad \partial_1 \partial_2 = 0 ,

with qubits on the basis of C1C_1, ZZ checks on the basis of C2C_2 and XX checks on the basis of C0C_0. The ZZ-type logical operators are then the first homology ker⁡∂1/im⁡∂2\ker \partial_1 / \operatorname{im} \partial_2 and the XX-type logical operators the first cohomology ker⁡∂2T/im⁡∂1T\ker \partial_2^T / \operatorname{im} \partial_1^T. A cellulated surface gives the homological code this way (Bombin and Martin-Delgado), and products of complexes give the hypergraph product and its successors (Breuckmann and Eberhardt). Which of HXH_X and HZH_Z is called ∂1\partial_1 is a convention; the opposite choice exchanges the roles of XX and ZZ.

Logical operators and distance. X(u)X(u) is a nontrivial logical operator exactly when u∈ker⁡HZu \in \ker H_Z and uu is not in the row space of HXH_X; Z(v)Z(v) is one exactly when v∈ker⁡HXv \in \ker H_X and vv is not in the row space of HZH_Z. The XX-distance and ZZ-distance are

dX=min⁡{∣u∣:u∈ker⁡HZ∖rs⁡HX},dZ=min⁡{∣v∣:v∈ker⁡HX∖rs⁡HZ},d_X = \min \bigl\{ \abs{u} : u \in \ker H_Z \setminus \operatorname{rs} H_X \bigr\} , \qquad d_Z = \min \bigl\{ \abs{v} : v \in \ker H_X \setminus \operatorname{rs} H_Z \bigr\} ,

where ∣⋅∣\abs{\cdot} is the Hamming weight and rs⁡\operatorname{rs} the row space; the distance of the code is min⁡(dX,dZ)\min(d_X, d_Z) (see the CSS parameter theorem). Not every stabilizer code is CSS: a stabilizer code is CSS precisely when its stabilizer group is generated by elements that are each purely XX-type or purely ZZ-type (up to sign), which fails for the five-qubit code.

DefinitionHomological code of a cellulated surfaceEstablished definition

Let Σ\Sigma be a compact connected surface without boundary, divided into vertices VV, edges EE and faces FF (a cellulation). Over the binary field the cellulation defines a chain complex

C2=F2F  →  ∂2    C1=F2E  →  ∂1    C0=F2V,∂1∂2=0,C_2 = \F_2^{F} \;\xrightarrow{\;\partial_2\;}\; C_1 = \F_2^{E} \;\xrightarrow{\;\partial_1\;}\; C_0 = \F_2^{V}, \qquad \partial_1 \partial_2 = 0 ,

where ∂2\partial_2 sends a face to the sum of the edges around it and ∂1\partial_1 sends an edge to the sum of its two endpoints. An element c∈C1c \in C_1 is a set of edges; it is a cycle if ∂1c=0\partial_1 c = 0 and a boundary if c=∂2fc = \partial_2 f for some f∈C2f \in C_2. A cocycle is a set of edges c∗c^* with ∂2Tc∗=0\partial_2^{T} c^* = 0 (it meets every face in an even number of edges) and a coboundary is a set of the form ∂1Tu\partial_1^{T} u with u∈C0u \in C_0.

Put one qubit on every edge and write X(c)=∏e∈cXeX(c) = \prod_{e \in c} X_e and Z(c)=∏e∈cZeZ(c) = \prod_{e \in c} Z_e. The homological code of the cellulation is the stabilizer code generated by

Av=X(∂1Tv)=∏e∋vXe(v∈V),Bf=Z(∂2f)=∏e∈∂fZe(f∈F).A_v = X(\partial_1^{T} v) = \prod_{e \ni v} X_e \quad (v \in V), \qquad B_f = Z(\partial_2 f) = \prod_{e \in \partial f} Z_e \quad (f \in F).

The generators commute because a vertex and a face share an even number of edges, which is the statement ∂1∂2=0\partial_1 \partial_2 = 0. The code is a CSS code with check matrices HX=∂1H_X = \partial_1 and HZ=∂2TH_Z = \partial_2^{T}, and its parameters are read from the topology:

  • n=∣E∣n = \abs{E};
  • k=dim⁡ker⁡∂1−rank⁡∂2=dim⁡H1(Σ;F2)k = \dim \ker \partial_1 - \operatorname{rank} \partial_2 = \dim H_1(\Sigma; \F_2), which is 2g2g for an orientable surface of genus gg;
  • Z(c)Z(c) commutes with every check exactly when cc is a cycle, and it is a product of the BfB_f exactly when cc is a boundary; X(c∗)X(c^*) commutes with every check exactly when c∗c^* is a cocycle, and it is a product of the AvA_v exactly when c∗c^* is a coboundary. The logical operators are therefore the cycles that are not boundaries and the cocycles that are not coboundaries;
  • dd is the smaller of the minimum number of edges in a cycle that is not a boundary and the minimum number of edges in a cocycle that is not a coboundary.

For a surface with boundary the same construction with relative homology gives the planar codes of Bravyi and Kitaev and Freedman and Meyer. The construction on the torus is the toric code of Kitaev; the general homological formulation is developed by Bombin and Martin-Delgado and in section III of Dennis, Kitaev, Landahl and Preskill.

Theorems

The basic theorem gives the parameters from the classical codes and identifies the code states.

TheoremParameters and code states of CSS codesEstablished result

Let C2⊆C1⊆F2nC_2 \subseteq C_1 \subseteq \F_2^n be linear codes of dimensions k2<k1k_2 < k_1, and let Q=CSS(C1,C2)Q = \mathrm{CSS}(C_1, C_2) be the CSS code with stabilizer generated by X(h)X(h), h∈C2h \in C_2, and Z(h)Z(h), h∈C1⊥h \in C_1^\perp.

  1. Code states. For x∈C1x \in C_1 put
∣x+C2⟩=1∣C2∣∑y∈C2∣x+y⟩.\ket{x + C_2} = \frac{1}{\sqrt{\abs{C_2}}} \sum_{y \in C_2} \ket{x + y} .

This depends only on the coset x+C2x + C_2, states for distinct cosets are orthogonal, and the 2k1−k22^{k_1 - k_2} coset states form an orthonormal basis of QQ. Hence QQ encodes k=k1−k2k = k_1 - k_2 qubits. 2. Distance. QQ has distance d=min⁡(dX,dZ)d = \min(d_X, d_Z) with

dX=min⁡u∈C1∖C2∣u∣  ≥  d(C1),dZ=min⁡v∈C2⊥∖C1⊥∣v∣  ≥  d(C2⊥),d_X = \min_{u \in C_1 \setminus C_2} \abs{u} \;\ge\; d(C_1) , \qquad d_Z = \min_{v \in C_2^\perp \setminus C_1^\perp} \abs{v} \;\ge\; d(C_2^\perp) ,

so d≥min⁡{d(C1),d(C2⊥)}d \ge \min\{ d(C_1), d(C_2^\perp) \}, where d(⋅)d(\cdot) is the minimum weight of a nonzero codeword. The bound dX≥d(C1)d_X \ge d(C_1) is strict exactly when every minimum-weight word of C1C_1 lies in C2C_2, so that it is a stabilizer rather than a logical operator; likewise dZ>d(C2⊥)d_Z > d(C_2^\perp) exactly when every minimum-weight word of C2⊥C_2^\perp lies in C1⊥C_1^\perp. 3. Separate decoding. An error X(e1)Z(e2)X(e_1) Z(e_2) is detected through the two classical syndromes HZe1H_Z e_1 and HXe2H_X e_2, so XX and ZZ errors can be corrected independently by decoders for C1C_1 and C2⊥C_2^\perp. In particular QQ corrects any XX error of weight at most ⌊(d(C1)−1)/2⌋\lfloor (d(C_1) - 1)/2 \rfloor together with any ZZ error of weight at most ⌊(d(C2⊥)−1)/2⌋\lfloor (d(C_2^\perp) - 1)/2 \rfloor.

The construction and the bound are due to Calderbank and Shor and Steane; a textbook account is section 10.4.2 of Nielsen and Chuang. Calderbank and Shor also showed, by choosing the classical codes at random, that CSS codes of positive rate and linear distance exist.

Holds when
  • C2⊆C1⊆F2nC_2 \subseteq C_1 \subseteq \F_2^n are binary linear codes of dimensions k2<k1k_2 < k_1.
  • The code is CSS(C1,C2)\mathrm{CSS}(C_1, C_2) with XX checks spanning C2C_2 and ZZ checks spanning C1⊥C_1^\perp.
Proof · Proof of the CSS code parameters

Write SX={X(h):h∈C2}S_X = \{ X(h) : h \in C_2 \} and SZ={Z(h):h∈C1⊥}S_Z = \{ Z(h) : h \in C_1^\perp \}. Since C2⊆C1=(C1⊥)⊥C_2 \subseteq C_1 = (C_1^\perp)^\perp, every h∈C2h \in C_2 is orthogonal to every h′∈C1⊥h' \in C_1^\perp, so the two groups commute and S=SXSZS = S_X S_Z is abelian. Its elements are X(a)Z(b)X(a) Z(b) with a∈C2a \in C_2, b∈C1⊥b \in C_1^\perp, and the only one equal to a multiple of II is II itself, so −I∉S-I \notin S.

Item 1. For x∈C1x \in C_1 and y′∈C2y' \in C_2, ∣x+y′+C2⟩=∣x+C2⟩\ket{x + y' + C_2} = \ket{x + C_2} because y↦y+y′y \mapsto y + y' permutes C2C_2; so the state depends only on the coset. Two distinct cosets are disjoint sets of strings, so their states have disjoint supports in the computational basis and are orthogonal. Each state is fixed by SS:

  • for h∈C2h \in C_2, X(h)∣x+y⟩=∣x+y+h⟩X(h) \ket{x + y} = \ket{x + y + h}, and y↦y+hy \mapsto y + h permutes C2C_2;
  • for h∈C1⊥h \in C_1^\perp, Z(h)∣x+y⟩=(−1)h⋅(x+y)∣x+y⟩=∣x+y⟩Z(h) \ket{x + y} = (-1)^{h \cdot (x + y)} \ket{x + y} = \ket{x + y} because x+y∈C1x + y \in C_1.

There are ∣C1∣/∣C2∣=2k1−k2\abs{C_1} / \abs{C_2} = 2^{k_1 - k_2} cosets. The stabilizer has dim⁡C2+dim⁡C1⊥=k2+(n−k1)\dim C_2 + \dim C_1^\perp = k_2 + (n - k_1) independent generators, so by the dimension theorem the code has dimension 2 n−k2−(n−k1)=2k1−k22^{\,n - k_2 - (n - k_1)} = 2^{k_1 - k_2}, and the orthonormal coset states form a basis.

Item 2. A Pauli operator is, up to phase, X(a)Z(b)X(a) Z(b). It commutes with every Z(h)Z(h), h∈C1⊥h \in C_1^\perp, iff a⋅h=0a \cdot h = 0 for all such hh, i.e. a∈C1a \in C_1; it commutes with every X(h)X(h), h∈C2h \in C_2, iff b∈C2⊥b \in C_2^\perp. So, up to phase,

N(S)={X(a)Z(b):a∈C1, b∈C2⊥},S={X(a)Z(b):a∈C2, b∈C1⊥}.N(S) = \{ X(a) Z(b) : a \in C_1,\ b \in C_2^\perp \} , \qquad S = \{ X(a) Z(b) : a \in C_2,\ b \in C_1^\perp \} .

An element X(a)Z(b)X(a) Z(b) of N(S)N(S) is outside ⟨iI⟩S\langle iI \rangle S iff a∉C2a \notin C_2 or b∉C1⊥b \notin C_1^\perp. Its weight is the size of supp⁡a∪supp⁡b\operatorname{supp} a \cup \operatorname{supp} b, at least max⁡(∣a∣,∣b∣)\max(\abs{a}, \abs{b}). If a∉C2a \notin C_2 the weight is at least ∣a∣≥dX\abs{a} \ge d_X; otherwise b∉C1⊥b \notin C_1^\perp and the weight is at least ∣b∣≥dZ\abs{b} \ge d_Z. The values are attained by X(u)X(u) for a minimum-weight u∈C1∖C2u \in C_1 \setminus C_2 and by Z(v)Z(v) for a minimum-weight v∈C2⊥∖C1⊥v \in C_2^\perp \setminus C_1^\perp. By the stabilizer distance theorem the distance is min⁡(dX,dZ)\min(d_X, d_Z). Since C1∖C2C_1 \setminus C_2 consists of nonzero words of C1C_1, dX≥d(C1)d_X \ge d(C_1), with equality unless every minimum-weight word of C1C_1 lies in C2C_2; likewise for dZd_Z.

Item 3. X(e1)X(e_1) anticommutes with Z(h)Z(h) iff h⋅e1=1h \cdot e_1 = 1, so the ZZ-type checks reveal HZe1H_Z e_1, a syndrome of the classical code C1C_1, and they are blind to e2e_2; symmetrically the XX-type checks reveal HXe2H_X e_2, a syndrome of C2⊥C_2^\perp. A classical decoder for C1C_1 finds e1e_1 whenever ∣e1∣≤⌊(d(C1)−1)/2⌋\abs{e_1} \le \lfloor (d(C_1)-1)/2 \rfloor, since two such vectors with the same syndrome differ by a codeword of weight less than d(C1)d(C_1), hence are equal; likewise for e2e_2 and C2⊥C_2^\perp. Applying X(e1)Z(e2)X(e_1) Z(e_2) undoes the error.

This follows Calderbank and Shor; compare section 10.4.2 of Nielsen and Chuang.

EquationNumber of logical qubits of a CSS codeEstablished result
k  =  n−rank⁡HX−rank⁡HZ  =  dim⁡ker⁡HX−rank⁡HZ  =  dim⁡H1k \;=\; n - \operatorname{rank} H_X - \operatorname{rank} H_Z \;=\; \dim \ker H_X - \operatorname{rank} H_Z \;=\; \dim H_1

The stabilizer group has rank⁡HX+rank⁡HZ\operatorname{rank} H_X + \operatorname{rank} H_Z independent generators, because XX-type and ZZ-type operators have binary vectors (u∣0)(u \mid 0) and (0∣v)(0 \mid v) in complementary coordinates; the dimension theorem gives the first equality, and rank–nullity, dim⁡ker⁡HX=n−rank⁡HX\dim \ker H_X = n - \operatorname{rank} H_X, the second. For the nested codes C2⊆C1C_2 \subseteq C_1 of dimensions k1,k2k_1, k_2 it reads k=(n−(n−k1))−k2=k1−k2k = (n - (n - k_1)) - k_2 = k_1 - k_2, the count of Calderbank and Shor. Rows of HXH_X or HZH_Z that are linearly dependent are harmless: they add redundant checks, not constraints. The formula is the usual starting point for counting logical qubits of product constructions (Breuckmann and Eberhardt).

Holds when
  • HX∈F2mX×nH_X \in \F_2^{m_X \times n} and HZ∈F2mZ×nH_Z \in \F_2^{m_Z \times n} with HXHZT=0H_X H_Z^T = 0; ranks are over F2\F_2.
  • H1=ker⁡∂1/im⁡∂2H_1 = \ker \partial_1 / \operatorname{im} \partial_2 for the complex with ∂1=HX\partial_1 = H_X and ∂2=HZT\partial_2 = H_Z^T.

The defining structural property of CSS codes for fault tolerance is that a logical CNOT needs no entangling between qubits of the same block.

TheoremTransversal CNOT on CSS codesEstablished result

Let two blocks of nn qubits each be encoded in the same CSS code CSS(C1,C2)\mathrm{CSS}(C_1, C_2), and let U=∏j=1nCNOTj→n+jU = \prod_{j=1}^{n} \mathrm{CNOT}_{j \to n + j} apply CNOT from qubit jj of the first block to qubit jj of the second. Then for all x,x′∈C1x, x' \in C_1,

U ∣x+C2⟩∣x′+C2⟩=∣x+C2⟩∣x+x′+C2⟩.U \, \ket{x + C_2} \ket{x' + C_2} = \ket{x + C_2} \ket{x + x' + C_2} .

Fix a linear isomorphism λ:C1/C2→F2k\lambda : C_1 / C_2 \to \F_2^{k} and label the logical basis state ∣zˉ⟩=∣x+C2⟩\ket{\bar z} = \ket{x + C_2} when λ(x+C2)=z\lambda(x + C_2) = z. The identity says that UU acts on the code space of the two blocks as ∣zˉ⟩∣zˉ′⟩↦∣zˉ⟩∣z+z′‾⟩\ket{\bar z} \ket{\bar z'} \mapsto \ket{\bar z} \ket{\overline{z + z'}}: a CNOT from logical qubit ii of the first block to logical qubit ii of the second, for every ii simultaneously. UU is transversal, so a single faulty CNOT damages at most one qubit in each block.

Equivalently, in the Heisenberg picture UU maps X(a)⊗I↦X(a)⊗X(a)X(a) \otimes I \mapsto X(a) \otimes X(a) and I⊗Z(b)↦Z(b)⊗Z(b)I \otimes Z(b) \mapsto Z(b) \otimes Z(b), which sends the stabilizer of the two blocks to itself. Transversal CNOT on CSS codes is used in the fault-tolerance constructions of Shor and Gottesman; see also section 10.6 of Nielsen and Chuang.

Holds when
  • Both blocks are encoded in the same CSS code CSS(C1,C2)\mathrm{CSS}(C_1, C_2) on nn qubits.
  • Logical computational-basis states are the coset states, labelled through a fixed linear isomorphism C1/C2≅F2kC_1 / C_2 \cong \F_2^{k}.
Proof · Proof that bitwise CNOT is a logical CNOT on CSS codes

On computational basis states, U∣u⟩∣v⟩=∣u⟩∣u+v⟩U \ket{u} \ket{v} = \ket{u} \ket{u + v} for u,v∈F2nu, v \in \F_2^n. With the coset states of the CSS parameter theorem,

U∣x+C2⟩∣x′+C2⟩=1∣C2∣∑y∈C2∑y′∈C2∣x+y⟩∣x+x′+y+y′⟩.U \ket{x + C_2} \ket{x' + C_2} = \frac{1}{\abs{C_2}} \sum_{y \in C_2} \sum_{y' \in C_2} \ket{x + y} \ket{x + x' + y + y'} .

For fixed yy, the map y′↦y+y′y' \mapsto y + y' is a bijection of C2C_2, so the inner sum equals ∑y′′∈C2∣x+x′+y′′⟩\sum_{y'' \in C_2} \ket{x + x' + y''}, independent of yy. The right-hand side therefore factors as

(1∣C2∣∑y∈C2∣x+y⟩)(1∣C2∣∑y′′∈C2∣x+x′+y′′⟩)=∣x+C2⟩∣x+x′+C2⟩,\Big( \frac{1}{\sqrt{\abs{C_2}}} \sum_{y \in C_2} \ket{x + y} \Big) \Big( \frac{1}{\sqrt{\abs{C_2}}} \sum_{y'' \in C_2} \ket{x + x' + y''} \Big) = \ket{x + C_2} \ket{x + x' + C_2} ,

and x+x′∈C1x + x' \in C_1 because C1C_1 is linear, so the result lies in the code space of the two blocks. Since λ\lambda is linear, λ(x+x′+C2)=z+z′\lambda(x + x' + C_2) = z + z', which is the logical CNOT on every pair of corresponding logical qubits. By linearity UU maps the code space of the two blocks onto itself.

For the Heisenberg-picture form: CNOT maps Xc↦XcXtX_c \mapsto X_c X_t, Xt↦XtX_t \mapsto X_t, Zc↦ZcZ_c \mapsto Z_c, Zt↦ZcZtZ_t \mapsto Z_c Z_t (the table in the Clifford group record), so the bitwise product maps X(a)⊗I↦X(a)⊗X(a)X(a) \otimes I \mapsto X(a) \otimes X(a), I⊗X(a)↦I⊗X(a)I \otimes X(a) \mapsto I \otimes X(a), Z(b)⊗I↦Z(b)⊗IZ(b) \otimes I \mapsto Z(b) \otimes I and I⊗Z(b)↦Z(b)⊗Z(b)I \otimes Z(b) \mapsto Z(b) \otimes Z(b). Each image of a stabilizer generator of the two blocks is a product of stabilizer generators, which gives a second proof that the code space is preserved. The argument is the standard one, as in section 10.6 of Nielsen and Chuang.

When the XX and ZZ checks coincide (C1=C2⊥C_1 = C_2^\perp, a single dual-containing code), bitwise Hadamard exchanges the two kinds of checks and is a logical Hadamard; the Steane code adds a transversal phase gate as well. No code has a transversal universal gate set, by the Eastin–Knill theorem (Eastin and Knill).

Worked Examples

The Steane code from the Hamming code

Take C1=CC_1 = C the [7,4,3][7, 4, 3] Hamming code and C2=C⊥C_2 = C^\perp, the [7,3,4][7, 3, 4] simplex code. Every simplex codeword has weight 0 or 4, so it is orthogonal to itself and to every other simplex codeword; hence C⊥⊆(C⊥)⊥=CC^\perp \subseteq (C^\perp)^\perp = C. The theorem gives

k=k1−k2=4−3=1,d≥min⁡{d(C),d((C⊥)⊥)}=min⁡{3,3}=3.k = k_1 - k_2 = 4 - 3 = 1, \qquad d \ge \min\{ d(C), d((C^\perp)^\perp) \} = \min\{3, 3\} = 3 .

A weight-3 Hamming codeword such as 11100001110000 is not in the simplex code (whose nonzero words have weight 4), so dX=dZ=3d_X = d_Z = 3 and the code is [[7,1,3]][[7, 1, 3]], the Steane code. Its six generators are listed on that page.

The Shor code as a CSS code

The Shor code has ZZ checks Z1Z2,Z2Z3,…Z_1 Z_2, Z_2 Z_3, \dots (six weight-2 checks, three repetition codes) and two weight-6 XX checks. So HZ∈F26×9H_Z \in \F_2^{6 \times 9} has rank 6, HX∈F22×9H_X \in \F_2^{2 \times 9} has rank 2, and k=9−6−2=1k = 9 - 6 - 2 = 1. A ZZ-type logical operator must lie in ker⁡HX\ker H_X and outside the row space of HZH_Z; Z1Z4Z7Z_1 Z_4 Z_7 qualifies, with weight 3. An XX-type logical operator must lie in ker⁡HZ\ker H_Z, which contains only unions of whole blocks such as X1X2X3X_1 X_2 X_3 (weight 3), and outside the row space of HXH_X. So dX=dZ=3d_X = d_Z = 3. The weight-2 ZZ stabilizers are below the distance: the code is degenerate.

Homology of the torus

For the square cellulation of an L×LL \times L torus, n=2L2n = 2L^2 edges, L2L^2 vertices and L2L^2 faces. The single relation among the vertex checks (their product is the identity) and the single relation among the face checks give rank⁡HX=rank⁡HZ=L2−1\operatorname{rank} H_X = \operatorname{rank} H_Z = L^2 - 1, so

k=2L2−2(L2−1)=2=dim⁡H1(T2;F2),k = 2L^2 - 2(L^2 - 1) = 2 = \dim H_1(T^2; \F_2) ,

the two independent non-contractible loops. The shortest such loop has LL edges, so the code is [[2L2,2,L]][[2L^2, 2, L]]; see the toric code. The same code is the hypergraph product of two cycle graphs (below).

Applications

Limitations and Common Pitfalls

  • The orthogonality condition is on the check matrices, not on arbitrary pairs of codes. For the nested form one needs C2⊆C1C_2 \subseteq C_1; for a single code CC one needs C⊥⊆CC^\perp \subseteq C (dual-containing). A self-orthogonal code C⊆C⊥C \subseteq C^\perp gives the CSS code of the pair (C⊥,C)(C^\perp, C), not of (C,C⊥)(C, C^\perp).
  • XX-distance and ZZ-distance differ in general. Report both; the bound min⁡(d(C1),d(C2⊥))\min(d(C_1), d(C_2^\perp)) can be far from tight in either direction for a specific choice of checks. Asymmetric codes deliberately trade one for the other against biased noise.
  • Low-weight checks cap classical bounds. For an LDPC CSS code, C2⊆C1C_2 \subseteq C_1 and C1⊥⊆C2⊥C_1^\perp \subseteq C_2^\perp contain the check rows, so d(C1)d(C_1) and d(C2⊥)d(C_2^\perp) are at most the check weight. Any useful distance bound must use the full definition min⁡∣C1∖C2∣\min \abs{C_1 \setminus C_2}, which is how the hypergraph product theorem is proved.
  • Independent decoding discards correlations. Decoding XX and ZZ errors separately is optimal for independent bit and phase flips but not for depolarizing noise, where YY errors correlate the two syndromes (Delfosse and Tillich exploit these correlations).
  • Not all good codes are CSS. The five-qubit code is not, and the smallest CSS code correcting one arbitrary error, the Steane code, uses seven qubits.
  • Sign and index conventions vary. Some sources put the ZZ checks on vertices and the XX checks on faces, or call HZH_Z the boundary map ∂1\partial_1; this exchanges the roles of XX and ZZ throughout.

Calderbank and Shor also proved, by a random-coding argument, that CSS codes with positive rate and linear distance exist. Chapter 10 of Nielsen and Chuang is a standard introduction; Breuckmann and Eberhardt review the homological constructions that lead to quantum LDPC codes.

Mentioned in

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. A. R. Calderbank, Peter W. Shor (1996). Good quantum error-correcting codes exist. Physical Review A 54, 1098-1105. doi:10.1103/PhysRevA.54.1098
  2. Andrew Steane (1996). Multiple Particle Interference and Quantum Error Correction. Proceedings of the Royal Society A 452, 2551. doi:10.1098/rspa.1996.0136arXiv:quant-ph/9601029
  3. Peter W. Shor (1995). Scheme for reducing decoherence in quantum computer memory. Physical Review A 52, R2493-R2496. doi:10.1103/PhysRevA.52.R2493
  4. A. Yu. Kitaev (2003). Fault-tolerant quantum computation by anyons. Annals of Physics 303, 2-30. doi:10.1016/S0003-4916(02)00018-0arXiv:quant-ph/9707021
  5. H. Bombin, M. A. Martin-Delgado (2007). Homological error correction: Classical and quantum codes. Journal of Mathematical Physics 48, 052105. doi:10.1063/1.2731356arXiv:quant-ph/0605094
  6. Michael H. Freedman, David A. Meyer (2001). Projective Plane and Planar Quantum Codes. Foundations of Computational Mathematics 1, 325-332. doi:10.1007/s102080010013arXiv:quant-ph/9810055
  7. Jean-Pierre Tillich, Gilles Zémor (2014). Quantum LDPC Codes With Positive Rate and Minimum Distance Proportional to the Square Root of the Blocklength. IEEE Transactions on Information Theory 60 (2), 1193-1202. doi:10.1109/TIT.2013.2292061arXiv:0903.0566
  8. Alexey A. Kovalev, Leonid P. Pryadko (2013). Quantum Kronecker sum-product low-density parity-check codes with finite rate. Physical Review A 88, 012311. doi:10.1103/PhysRevA.88.012311arXiv:1212.6703
  9. Nikolas P. Breuckmann, Jens Niklas Eberhardt (2021). Quantum Low-Density Parity-Check Codes. PRX Quantum 2, 040101. doi:10.1103/PRXQuantum.2.040101arXiv:2103.06309
  10. Peter W. Shor (1996). Fault-tolerant quantum computation. Proceedings of the 37th Conference on Foundations of Computer Science (FOCS), 56-65. doi:10.1109/SFCS.1996.548464arXiv:quant-ph/9605011
  11. Daniel Gottesman (1998). Theory of fault-tolerant quantum computation. Physical Review A 57, 127-137. doi:10.1103/PhysRevA.57.127arXiv:quant-ph/9702029
  12. Bryan Eastin, Emanuel Knill (2009). Restrictions on Transversal Encoded Quantum Gate Sets. Physical Review Letters 102, 110502. doi:10.1103/PhysRevLett.102.110502arXiv:0811.4262
  13. Nicolas Delfosse, Jean-Pierre Tillich (2014). A decoding algorithm for CSS codes using the X/Z correlations. 2014 IEEE International Symposium on Information Theory (ISIT), 1071-1075. doi:10.1109/ISIT.2014.6874997arXiv:1401.6975
  14. Michael A. Nielsen, Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press. doi:10.1017/CBO9780511976667
  15. Daniel Gottesman (1997). Stabilizer Codes and Quantum Error Correction. PhD thesis, California Institute of Technology. arXiv:quant-ph/9705052
  16. Eric Dennis, Alexei Kitaev, Andrew Landahl, John Preskill (2002). Topological quantum memory. Journal of Mathematical Physics 43, 4452-4505. doi:10.1063/1.1499754arXiv:quant-ph/0110143

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Topic's own text checked (embedded records carry their own review states): intuition and nested-code picture re-derived; Steane worked example (k = 1, d >= 3, weight-3 Hamming word outside the simplex code), Shor code as CSS (ranks 6 and 2, k = 1, d_X = d_Z = 3, degenerate) and toric code (rank L^2 - 1 each, k = 2, [[2L^2, 2, L]]) recomputed, the latter two numerically (numpy scripts for L = 2, 3); the LDPC cap on d(C1), d(C2^perp) re-derived; the claim that seven qubits is the smallest CSS code correcting one error confirmed by exhaustive search over all nested pairs with n <= 7 (none for n = 4, 5, 6); attributions compared with Calderbank-Shor arXiv quant-ph/9512032 and Crossref metadata of Tillich-Zemor, Kovalev-Pryadko, Delfosse-Tillich, Eastin-Knill and the other cited works (titles match the attributed content).

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 8780bf424941caf7. Source file knowledge/records/topic/css-codes.md in the content repository (readable there once it is public).