Overview
A CSS code is a stabilizer code in which every stabilizer generator is either a product of operators or a product of 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, .
The same condition says that and 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, : a bit-flip pattern followed by a phase-flip pattern . A -type check ignores phase flips and reports the parity of the bit flips it touches, exactly like a classical parity check. An -type check reports 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 -type and a -type check commute when they overlap on an even number of qubits. Requiring this for all pairs is the orthogonality . In the nested-code picture , the code states are uniform superpositions over the cosets of in : bit flips move a string out of and are caught by 's checks, and phase flips change the relative signs inside a coset and are caught after a Hadamard transform, which turns into .
Prerequisites
Stabilizer codes; binary linear codes and dual codes; for the homological view, chains, boundaries and homology over .
Mathematical Definitions
For write and . Then and commute if and only if over .
Check-matrix form. Let and satisfy
The CSS code is the stabilizer code on qubits whose stabilizer group is generated by for the rows of and for the rows of . The condition says exactly that every -type generator commutes with every -type generator. An error has syndrome and a error has syndrome , so the two kinds of error are detected by separate classical parity checks.
Nested-code form. Equivalently, take binary linear codes , let be a parity-check matrix of (so ) and a generator matrix of (so is the row space of ). Then because . This is the original formulation of Calderbank and Shor and Steane, usually written . The case uses a single dual-containing code.
Chain-complex form. Matrices with are the same thing as a chain complex of -vector spaces of length two,
with qubits on the basis of , checks on the basis of and checks on the basis of . The -type logical operators are then the first homology and the -type logical operators the first cohomology . 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 and is called is a convention; the opposite choice exchanges the roles of and .
Logical operators and distance. is a nontrivial logical operator exactly when and is not in the row space of ; is one exactly when and is not in the row space of . The -distance and -distance are
where is the Hamming weight and the row space; the distance of the code is (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 -type or purely -type (up to sign), which fails for the five-qubit code.
Let be a compact connected surface without boundary, divided into vertices , edges and faces (a cellulation). Over the binary field the cellulation defines a chain complex
where sends a face to the sum of the edges around it and sends an edge to the sum of its two endpoints. An element is a set of edges; it is a cycle if and a boundary if for some . A cocycle is a set of edges with (it meets every face in an even number of edges) and a coboundary is a set of the form with .
Put one qubit on every edge and write and . The homological code of the cellulation is the stabilizer code generated by
The generators commute because a vertex and a face share an even number of edges, which is the statement . The code is a CSS code with check matrices and , and its parameters are read from the topology:
- ;
- , which is for an orientable surface of genus ;
- commutes with every check exactly when is a cycle, and it is a product of the exactly when is a boundary; commutes with every check exactly when is a cocycle, and it is a product of the exactly when is a coboundary. The logical operators are therefore the cycles that are not boundaries and the cocycles that are not coboundaries;
- 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.
Let be linear codes of dimensions , and let be the CSS code with stabilizer generated by , , and , .
- Code states. For put
This depends only on the coset , states for distinct cosets are orthogonal, and the coset states form an orthonormal basis of . Hence encodes qubits. 2. Distance. has distance with
so , where is the minimum weight of a nonzero codeword. The bound is strict exactly when every minimum-weight word of lies in , so that it is a stabilizer rather than a logical operator; likewise exactly when every minimum-weight word of lies in . 3. Separate decoding. An error is detected through the two classical syndromes and , so and errors can be corrected independently by decoders for and . In particular corrects any error of weight at most together with any error of weight at most .
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.
- are binary linear codes of dimensions .
- The code is with checks spanning and checks spanning .
Proof · Proof of the CSS code parameters
Write and . Since , every is orthogonal to every , so the two groups commute and is abelian. Its elements are with , , and the only one equal to a multiple of is itself, so .
Item 1. For and , because permutes ; 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 :
- for , , and permutes ;
- for , because .
There are cosets. The stabilizer has independent generators, so by the dimension theorem the code has dimension , and the orthonormal coset states form a basis.
Item 2. A Pauli operator is, up to phase, . It commutes with every , , iff for all such , i.e. ; it commutes with every , , iff . So, up to phase,
An element of is outside iff or . Its weight is the size of , at least . If the weight is at least ; otherwise and the weight is at least . The values are attained by for a minimum-weight and by for a minimum-weight . By the stabilizer distance theorem the distance is . Since consists of nonzero words of , , with equality unless every minimum-weight word of lies in ; likewise for .
Item 3. anticommutes with iff , so the -type checks reveal , a syndrome of the classical code , and they are blind to ; symmetrically the -type checks reveal , a syndrome of . A classical decoder for finds whenever , since two such vectors with the same syndrome differ by a codeword of weight less than , hence are equal; likewise for and . Applying undoes the error.
This follows Calderbank and Shor; compare section 10.4.2 of Nielsen and Chuang.
The stabilizer group has independent generators, because -type and -type operators have binary vectors and in complementary coordinates; the dimension theorem gives the first equality, and rank–nullity, , the second. For the nested codes of dimensions it reads , the count of Calderbank and Shor. Rows of or 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).
- and with ; ranks are over .
- for the complex with and .
The defining structural property of CSS codes for fault tolerance is that a logical CNOT needs no entangling between qubits of the same block.
Let two blocks of qubits each be encoded in the same CSS code , and let apply CNOT from qubit of the first block to qubit of the second. Then for all ,
Fix a linear isomorphism and label the logical basis state when . The identity says that acts on the code space of the two blocks as : a CNOT from logical qubit of the first block to logical qubit of the second, for every simultaneously. is transversal, so a single faulty CNOT damages at most one qubit in each block.
Equivalently, in the Heisenberg picture maps and , 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.
- Both blocks are encoded in the same CSS code on qubits.
- Logical computational-basis states are the coset states, labelled through a fixed linear isomorphism .
Proof · Proof that bitwise CNOT is a logical CNOT on CSS codes
On computational basis states, for . With the coset states of the CSS parameter theorem,
For fixed , the map is a bijection of , so the inner sum equals , independent of . The right-hand side therefore factors as
and because is linear, so the result lies in the code space of the two blocks. Since is linear, , which is the logical CNOT on every pair of corresponding logical qubits. By linearity maps the code space of the two blocks onto itself.
For the Heisenberg-picture form: CNOT maps , , , (the table in the Clifford group record), so the bitwise product maps , , and . 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 and checks coincide (, 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 the Hamming code and , the simplex code. Every simplex codeword has weight 0 or 4, so it is orthogonal to itself and to every other simplex codeword; hence . The theorem gives
A weight-3 Hamming codeword such as is not in the simplex code (whose nonzero words have weight 4), so and the code is , the Steane code. Its six generators are listed on that page.
The Shor code as a CSS code
The Shor code has checks (six weight-2 checks, three repetition codes) and two weight-6 checks. So has rank 6, has rank 2, and . A -type logical operator must lie in and outside the row space of ; qualifies, with weight 3. An -type logical operator must lie in , which contains only unions of whole blocks such as (weight 3), and outside the row space of . So . The weight-2 stabilizers are below the distance: the code is degenerate.
Homology of the torus
For the square cellulation of an torus, edges, vertices and faces. The single relation among the vertex checks (their product is the identity) and the single relation among the face checks give , so
the two independent non-contractible loops. The shortest such loop has edges, so the code is ; see the toric code. The same code is the hypergraph product of two cycle graphs (below).
Applications
- Product constructions. Any two classical codes, with no orthogonality required, give a CSS code through the hypergraph product of Tillich and Zémor; its parameters are in the hypergraph product theorem. Further products of chain complexes (lifted, balanced and fiber-bundle products) lead to the asymptotically good codes described in Quantum LDPC Codes; Kovalev and Pryadko generalise the product with circulant blocks, and Breuckmann and Eberhardt survey the chain-complex view.
- Topological codes. Cellulations of surfaces give the toric code of Kitaev and the planar codes of Freedman and Meyer; the general homological formulation is developed by Bombin and Martin-Delgado.
- Fault-tolerant gadgets. Transversal CNOT underlies Steane-style and Knill-style error extraction and logical Clifford circuits on CSS codes (Shor; Gottesman).
Limitations and Common Pitfalls
- The orthogonality condition is on the check matrices, not on arbitrary pairs of codes. For the nested form one needs ; for a single code one needs (dual-containing). A self-orthogonal code gives the CSS code of the pair , not of .
- -distance and -distance differ in general. Report both; the bound 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, and contain the check rows, so and are at most the check weight. Any useful distance bound must use the full definition , which is how the hypergraph product theorem is proved.
- Independent decoding discards correlations. Decoding and errors separately is optimal for independent bit and phase flips but not for depolarizing noise, where 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 checks on vertices and the checks on faces, or call the boundary map ; this exchanges the roles of and throughout.
Related Research
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.