Overview
Homology measures the "holes" of a space with linear algebra. One chops the space into cells — vertices, edges, faces — records which cells bound which in matrices , and observes that the boundary of a boundary is empty, . Cycles (chains with no boundary) modulo boundaries form the homology groups; their dimensions, the Betti numbers, count independent holes in each dimension and do not depend on how the space was cut up.
For quantum error correction, the point is that a CSS code is the same thing as a three-term chain complex over . The commutation condition of the and checks is ; logical operators are homology and cohomology classes; the number of logical qubits is a Betti number; and the distance is the weight of the shortest cycle or cocycle that is not a boundary or coboundary. Kitaev's toric code was the first instance, the systematic treatment is in Dennis, Kitaev, Landahl and Preskill, Freedman and Meyer and Bombin and Martin-Delgado, and modern quantum LDPC constructions are products of chain complexes (Breuckmann and Eberhardt). This page gives the mathematics; the codes themselves are on topological codes, CSS codes and quantum LDPC codes.
Intuition
Draw a grid on the surface of a doughnut and put a qubit on every edge. A string of operators along a path of edges is detected only at its two endpoints (the vertex checks there see an odd number of s). A closed loop has no endpoints and is invisible to every check. Two kinds of closed loop exist. A loop that encircles a patch of faces is the product of the face checks inside it, so it acts trivially on the code. A loop that winds around the doughnut encloses nothing: it is not a product of checks, yet commutes with all of them, so it is a logical operator. "Closed but not enclosing anything" is exactly cycle but not boundary, and the number of independent ways to wind around a doughnut, two, is the number of logical qubits.
Errors that would fool the code must wrap all the way around, so the distance grows with the size of the grid. Cohomology is the same story on the dual grid, where strings run between faces: dualising swaps the roles of vertices and faces and of and .
Prerequisites
Linear algebra over a field, in particular rank–nullity and quotient spaces; see linear algebra. Over the arithmetic is that of finite fields. For the coding side, the stabilizer formalism.
Mathematical Definitions
Let be a field. A (bounded, finite-dimensional) chain complex over is a sequence of finite-dimensional -vector spaces and linear maps
Elements of are -chains and is the boundary map. Put and .
- are the -cycles and the -boundaries; says exactly .
- The -th homology is the quotient , and the Betti number is .
Fix a basis of each (the cells), identify and write as a matrix. The cochain complex uses the transposed maps with , which also satisfy . Its cocycles , coboundaries and cohomology are defined in the same way. (Basis-free, is the dual space of and is the dual map of .)
A chain map is a family of linear maps with ; it sends cycles to cycles and boundaries to boundaries and so induces linear maps .
Over a chain is a subset of cells (its support) and its weight is the number of cells in it. The systole of is and the cosystole of is .
For a three-term complex over , with qubits on the cells of , one choice of the two check matrices of a CSS code is and ; the commutation condition is , the number of logical qubits is , and the distance is the smaller of the systole and the cosystole in degree 1 (see the homological code). The other assignment, with and exchanged, is equally common. The general theory is in Munkres; the coding dictionary is surveyed by Breuckmann and Eberhardt.
Let be a compact connected surface without boundary. A cellulation of is a finite graph embedded in such that every connected component of is homeomorphic to an open disc; these components are the faces . Each face is bounded by a closed walk in the graph. Loops and multiple edges are allowed.
The cellulation defines a chain complex over ,
where is the sum of the two endpoints of (zero for a loop) and is the sum, mod 2, of the edges in the boundary walk of (an edge traversed twice contributes zero). Every boundary walk is closed, so . The homology of this complex is the homology of the surface: it does not depend on the cellulation chosen. The Euler characteristic is
also independent of the cellulation. An orientable closed surface of genus (a sphere with handles) has .
Dual cellulation. Place a vertex inside each face ; for each edge draw a dual edge crossing once and joining the dual vertices of the two faces on either side of ; the dual faces are then discs around the original vertices. This is the dual cellulation , with , , . With these identifications the boundary maps of are the transposes of those of :
Hence the cocycles and coboundaries of in degree 1 are the cycles and boundaries of , and of is of (the combinatorial form of Poincaré duality with coefficients).
In the homological code of , -type logical operators are non-trivial cycles of and -type logical operators are non-trivial cycles of : on the square lattice of the toric code these are the loops on the lattice and on the dual lattice that wind around the torus (Kitaev; Bombin and Martin-Delgado). Cellular homology and its invariance are treated in Munkres.
The code obtained from a cellulation is:
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.
Products. Given two complexes and , the tensor product complex has and boundary (no signs are needed over ). Viewing a classical code's parity-check matrix as a two-term complex and taking the product of two such complexes gives a three-term complex, which is the hypergraph product code of Tillich and Zémor.
Theorems
With and Betti numbers ,
For the complex of a cellulated closed surface, . Over , a connected closed surface has (whether or not it is orientable), so
For an orientable surface of genus this is ; for a non-orientable surface with cross-caps () it is . Since the homological code has qubits and , the formula reads : the two "missing" checks are the product of all vertex checks and the product of all face checks, each of which is the identity. The formula and the computation of the homology of surfaces are in Munkres.
- A chain complex of finite-dimensional vector spaces over a field.
Proof · Proof of the Euler–Poincaré formula
General formula. Let , with . Rank–nullity for gives , and . Hence
Reindexing the last sum, (the boundary terms and vanish), so the two rank sums cancel.
Degree 0 and degree 2 for a connected surface. maps an edge to the sum of its endpoints, so lies in the even-weight subspace of , which has dimension ; conversely, because the graph of a cellulation of a connected surface is connected, the sum of any two vertices is the boundary of a path between them, and these sums span the even-weight subspace. So . For : a set of faces has exactly when every edge has both sides in or both outside (an edge with the same face on both sides contributes nothing either way). Two faces adjacent across an edge are therefore both in or both out, and since the faces of a connected surface are linked by such adjacencies, , where the set of all faces is a cycle because each edge borders it twice. So .
Substituting into the general formula with gives . The values and for the standard surfaces with are computed from any one cellulation (for example a -gon or -gon with identified sides, which has one face, or edges and one vertex), and independence of the cellulation is the topological invariance of homology (Munkres).
With cycles , boundaries , cocycles and coboundaries , all subspaces of , the formula
defines a bilinear map that does not depend on the representatives, and it is nondegenerate: if for all then , and if it vanishes for all then . Consequently
and for every basis of there are cocycles with .
In a homological CSS code, and commute exactly when over , so the theorem says that the -type logical operators (non-trivial cycles) and the -type logical operators (non-trivial cocycles) can be chosen in anticommuting pairs, one pair per logical qubit, and that a cycle which commutes with every -type logical operator is a product of stabilizers. Over a field this is the content of the universal coefficient theorem for cohomology (Munkres); the coding interpretation is standard (Breuckmann and Eberhardt).
- is part of a chain complex of finite-dimensional vector spaces over a field , with a fixed basis of and the standard bilinear form .
Proof · Proof of the homology–cohomology pairing over a field
For a subspace write . The standard form is nondegenerate, so and for every subspace, over any field (no positivity is needed; over a nonzero vector can be orthogonal to itself, which does no harm here).
Four complements. For any matrix , , because if and only if for all . Applying this with and with , and taking complements,
Well defined. If and then , so changing by a boundary does not change . Symmetrically, if and then . Bilinearity is inherited from the dot product.
Nondegenerate. Suppose for all . Then , i.e. in . Suppose for all . Then , i.e. in .
Dimensions and dual bases. A nondegenerate bilinear pairing of finite-dimensional spaces gives injective linear maps and , so . Hence , the map is an isomorphism, and the preimage of the dual basis of provides classes with .
This linear-algebra argument is the field case of the universal coefficient theorem treated in Munkres.
For a complex over or with inner products, homology classes have canonical "harmonic" representatives, the kernel of the combinatorial Laplacian; this is the linear algebra used by quantum algorithms that estimate Betti numbers (Lloyd, Garnerone and Zanardi):
Let on . Then is positive semidefinite and
In particular is the multiplicity of the eigenvalue 0 of . This is the linear algebra behind quantum algorithms that estimate Betti numbers by phase estimation on , beginning with Lloyd, Garnerone and Zanardi.
- Finite-dimensional complex inner-product spaces and linear maps with ; adjoints taken with respect to the inner products.
Proof · Proof of the finite-dimensional Hodge theorem
Write , , so on and .
Positivity and harmonic vectors. For , . Hence if and only if and : .
Orthogonality. , since . And is orthogonal to both: if then and .
Spanning. The orthogonal complement of is , using in finite dimension. So .
Cohomology. contains and (because ), and it meets only in 0: if then . Intersecting the decomposition with therefore gives , and the quotient map restricts to an isomorphism on .
The geometry of a surface limits how good its codes can be:
Proved by Delfosse for surface codes and color codes. A family with bounded below therefore has , and hyperbolic surface codes, which have constant rate and logarithmic distance, show that this order is attained. For comparison, the toric code has and . Concrete hyperbolic constructions and their thresholds against independent bit- and phase-flip noise are given by Breuckmann and Terhal. The bound is Theorem 10 of Delfosse's paper, for tilings whose faces have at most edges and whose vertices have degree at most , with depending only on ; it rests on Gromov's systolic inequality for surfaces.
- Homological codes of cellulated closed surfaces (and 2D color codes), with qubits, logical qubits and distance .
- The constant depends only on the maximum weight of a row of the parity-check matrix, so the bound is informative for families with bounded check weight.
Worked Examples
The torus with an square grid
Take the square lattice with periodic boundary conditions in both directions, . Then , (one horizontal and one vertical edge per vertex), , so , the Euler characteristic of the torus, . The Euler–Poincaré formula with gives .
Directly: (connected graph) and (only the sum of all faces has zero boundary). So . The homological code has , , and checks of which are independent.
A horizontal row of 3 edges, , is a cycle: each vertex on it meets two of its edges. The vertical dual loop , consisting of the 3 horizontal edges that one column of dual edges crosses, is a cocycle (each face contains 0 or 2 of its edges) and shares exactly one edge with , so . Boundaries pair to zero with every cocycle (this is the "well defined" step of the pairing theorem), so is not a boundary: is a logical operator, and is a logical operator anticommuting with it. No cycle with fewer than 3 edges winds around, so the code is the toric code, matching from the toric-code parameters.
The sphere has no logical qubits
The cube, viewed as a cellulation of the sphere, has , , , so and : every cycle bounds. The homological code on a cellulated sphere has , however fine the cellulation, which is why planar surface codes need boundaries (relative homology) instead of a closed sphere.
A genus-2 surface
For a closed orientable surface of genus 2, , so any cellulation gives logical qubits. The smallest is the standard octagon with its sides glued in the pattern : one face, four edges and, after gluing, one vertex, so . Every edge is a loop at the single vertex, so , and every edge occurs twice on the boundary of the single face, so . All four edges are non-trivial cycles: the code has and , encoding without protecting. Finer cellulations of the same surface keep and raise the distance.
Applications
- Topological codes. Toric, planar and hyperbolic surface codes and their decoders; see surface codes and topological codes. Matching decoders exploit that a syndrome is the boundary of the error chain.
- Quantum LDPC codes. Hypergraph, lifted and balanced products of complexes, and complexes with good expansion, produce codes with much better rate and distance than surfaces allow (Breuckmann and Eberhardt); see quantum LDPC codes.
- Anyons and topological order. The ground-space degeneracy of the toric-code Hamiltonian on a surface is ; see topological order and anyons.
- Quantum algorithms for topology. Estimating Betti numbers through the Hodge Laplacian (Lloyd, Garnerone and Zanardi).
Limitations and Common Pitfalls
- Coefficients matter. Homology with coefficients ignores orientation: the Klein bottle and the torus both have over , although their integer homology differs. Codes on qudits of dimension use coefficients, where orientations (signs in ) must be tracked.
- Which check is which. Some authors put checks on vertices and checks on faces, others the reverse, and the chain complex may be written in either direction. Before using a formula for "the distance", fix which of , is or .
- Distance is not a homological invariant. Betti numbers do not depend on the cellulation, but the systole does; refining a cellulation increases the distance while stays fixed.
- Counting only. The Euler characteristic gives but nothing about , and the existence of a cellulation with prescribed vertex degrees and face sizes is a separate combinatorial question.
- Boundaries. Surfaces with boundary need relative homology, with "rough" and "smooth" boundaries corresponding to different relative complexes; applying the closed-surface formulas to a planar code gives the wrong .
Related Research
Graph theory supplies the 1-skeleton of a cellulation, Tanner graphs and expanders; group theory supplies the Pauli-group algebra behind the commutation condition; and the higher-dimensional and product constructions are developed under quantum LDPC codes.