Skip to main content
KetQat

Appearance

Topic · intermediate

Topology and Homology

Chain complexes, homology and cohomology with binary coefficients, cellulations of surfaces and their duals, and how these turn into CSS codes - qubits on cells, checks from boundary maps, logical qubits from homology and distance from the shortest non-trivial cycle.

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

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 ∂i\partial_i, and observes that the boundary of a boundary is empty, ∂i∂i+1=0\partial_{i}\partial_{i+1} = 0. 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 F2\F_2. The commutation condition of the XX and ZZ checks is ∂1∂2=0\partial_1 \partial_2 = 0; 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 ZZ operators along a path of edges is detected only at its two endpoints (the vertex checks there see an odd number of ZZs). 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 XX strings run between faces: dualising swaps the roles of vertices and faces and of XX and ZZ.

Prerequisites

Linear algebra over a field, in particular rank–nullity and quotient spaces; see linear algebra. Over F2\F_2 the arithmetic is that of finite fields. For the coding side, the stabilizer formalism.

Mathematical Definitions

DefinitionChain complex, homology and cohomology over a fieldEstablished definition

Let F\F be a field. A (bounded, finite-dimensional) chain complex over F\F is a sequence of finite-dimensional F\F-vector spaces and linear maps

0→Cm→  ∂m  Cm−1→  ∂m−1  ⋯→  ∂1  C0→0,∂i ∂i+1=0  for all i.0 \to C_m \xrightarrow{\;\partial_m\;} C_{m-1} \xrightarrow{\;\partial_{m-1}\;} \cdots \xrightarrow{\;\partial_1\;} C_0 \to 0, \qquad \partial_{i}\, \partial_{i+1} = 0 \ \text{ for all } i .

Elements of CiC_i are ii-chains and ∂i\partial_i is the boundary map. Put ∂0=0\partial_0 = 0 and ∂m+1=0\partial_{m+1} = 0.

  • Zi=ker⁡∂iZ_i = \ker \partial_i are the ii-cycles and Bi=im⁡∂i+1B_i = \operatorname{im} \partial_{i+1} the ii-boundaries; ∂i∂i+1=0\partial_i \partial_{i+1} = 0 says exactly Bi⊆ZiB_i \subseteq Z_i.
  • The ii-th homology is the quotient Hi=Zi/BiH_i = Z_i / B_i, and the Betti number is bi=dim⁡Hi=dim⁡ker⁡∂i−rank⁡∂i+1b_i = \dim H_i = \dim \ker \partial_i - \operatorname{rank} \partial_{i+1}.

Fix a basis of each CiC_i (the cells), identify Ci≅FniC_i \cong \F^{n_i} and write ∂i\partial_i as a matrix. The cochain complex uses the transposed maps δi=∂i+1T:Ci→Ci+1\delta^{i} = \partial_{i+1}^{T} : C^{i} \to C^{i+1} with Ci=FniC^{i} = \F^{n_i}, which also satisfy δi+1δi=0\delta^{i+1}\delta^{i} = 0. Its cocycles Zi=ker⁡δiZ^{i} = \ker \delta^{i}, coboundaries Bi=im⁡δi−1B^{i} = \operatorname{im} \delta^{i-1} and cohomology Hi=Zi/BiH^{i} = Z^{i}/B^{i} are defined in the same way. (Basis-free, CiC^{i} is the dual space of CiC_i and δi\delta^{i} is the dual map of ∂i+1\partial_{i+1}.)

A chain map f:C∙→C∙′f : C_\bullet \to C'_\bullet is a family of linear maps fi:Ci→Ci′f_i : C_i \to C'_i with ∂i′fi=fi−1∂i\partial'_i f_i = f_{i-1} \partial_i; it sends cycles to cycles and boundaries to boundaries and so induces linear maps Hi→Hi′H_i \to H'_i.

Over F=F2\F = \F_2 a chain is a subset of cells (its support) and its weight ∣c∣\abs{c} is the number of cells in it. The systole of HiH_i is min⁡{∣c∣:c∈Zi∖Bi}\min\{ \abs{c} : c \in Z_i \setminus B_i \} and the cosystole of HiH^{i} is min⁡{∣c∣:c∈Zi∖Bi}\min\{ \abs{c} : c \in Z^{i} \setminus B^{i} \}.

For a three-term complex C2→C1→C0C_2 \to C_1 \to C_0 over F2\F_2, with qubits on the cells of C1C_1, one choice of the two check matrices of a CSS code is HX=∂1H_X = \partial_1 and HZ=∂2TH_Z = \partial_2^{T}; the commutation condition HXHZT=0H_X H_Z^{T} = 0 is ∂1∂2=0\partial_1 \partial_2 = 0, the number of logical qubits is b1b_1, and the distance is the smaller of the systole and the cosystole in degree 1 (see the homological code). The other assignment, with XX and ZZ exchanged, is equally common. The general theory is in Munkres; the coding dictionary is surveyed by Breuckmann and Eberhardt.

DefinitionCellulation of a surface, its chain complex and its dualEstablished definition

Let Σ\Sigma be a compact connected surface without boundary. A cellulation of Σ\Sigma is a finite graph (V,E)(V, E) embedded in Σ\Sigma such that every connected component of Σ∖(V∪E)\Sigma \setminus (V \cup E) is homeomorphic to an open disc; these components are the faces FF. Each face is bounded by a closed walk in the graph. Loops and multiple edges are allowed.

The cellulation defines a chain complex over F2\F_2,

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

where ∂1e\partial_1 e is the sum of the two endpoints of ee (zero for a loop) and ∂2f\partial_2 f is the sum, mod 2, of the edges in the boundary walk of ff (an edge traversed twice contributes zero). Every boundary walk is closed, so ∂1∂2=0\partial_1 \partial_2 = 0. The homology of this complex is the homology Hi(Σ;F2)H_i(\Sigma; \F_2) of the surface: it does not depend on the cellulation chosen. The Euler characteristic is

χ(Σ)=∣V∣−∣E∣+∣F∣,\chi(\Sigma) = \abs{V} - \abs{E} + \abs{F},

also independent of the cellulation. An orientable closed surface of genus gg (a sphere with gg handles) has χ=2−2g\chi = 2 - 2g.

Dual cellulation. Place a vertex f∗f^{*} inside each face ff; for each edge ee draw a dual edge e∗e^{*} crossing ee once and joining the dual vertices of the two faces on either side of ee; the dual faces v∗v^{*} are then discs around the original vertices. This is the dual cellulation Σ∗\Sigma^{*}, with V∗↔FV^{*} \leftrightarrow F, E∗↔EE^{*} \leftrightarrow E, F∗↔VF^{*} \leftrightarrow V. With these identifications the boundary maps of Σ∗\Sigma^{*} are the transposes of those of Σ\Sigma:

∂1∗=∂2T,∂2∗=∂1T.\partial_1^{*} = \partial_2^{T}, \qquad \partial_2^{*} = \partial_1^{T} .

Hence the cocycles and coboundaries of Σ\Sigma in degree 1 are the cycles and boundaries of Σ∗\Sigma^{*}, and H1H^{1} of Σ\Sigma is H1H_1 of Σ∗\Sigma^{*} (the combinatorial form of Poincaré duality with F2\F_2 coefficients).

In the homological code of Σ\Sigma, ZZ-type logical operators are non-trivial cycles of Σ\Sigma and XX-type logical operators are non-trivial cycles of Σ∗\Sigma^{*}: 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:

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.

Products. Given two complexes A∙A_\bullet and B∙B_\bullet, the tensor product complex has (A⊗B)k=⨁i+j=kAi⊗Bj(A \otimes B)_k = \bigoplus_{i + j = k} A_i \otimes B_j and boundary ∂(a⊗b)=∂a⊗b+a⊗∂b\partial(a \otimes b) = \partial a \otimes b + a \otimes \partial b (no signs are needed over F2\F_2). Viewing a classical code's parity-check matrix H:F2n→F2mH : \F_2^{n} \to \F_2^{m} 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

TheoremEuler–Poincaré formulaEstablished result

With ni=dim⁡Cin_i = \dim C_i and Betti numbers bi=dim⁡Hib_i = \dim H_i,

∑i=0m(−1)i ni  =  ∑i=0m(−1)i bi.\sum_{i=0}^{m} (-1)^{i}\, n_i \;=\; \sum_{i=0}^{m} (-1)^{i}\, b_i .

For the complex of a cellulated closed surface, ∣V∣−∣E∣+∣F∣=b0−b1+b2\abs{V} - \abs{E} + \abs{F} = b_0 - b_1 + b_2. Over F2\F_2, a connected closed surface has b0=b2=1b_0 = b_2 = 1 (whether or not it is orientable), so

b1=2−χ(Σ)=2−∣V∣+∣E∣−∣F∣.b_1 = 2 - \chi(\Sigma) = 2 - \abs{V} + \abs{E} - \abs{F} .

For an orientable surface of genus gg this is b1=2gb_1 = 2g; for a non-orientable surface with hh cross-caps (χ=2−h\chi = 2 - h) it is b1=hb_1 = h. Since the homological code has n=∣E∣n = \abs{E} qubits and k=b1k = b_1, the formula reads k=n−∣V∣−∣F∣+2k = n - \abs{V} - \abs{F} + 2: 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.

Holds when
  • A chain complex 0→Cm→⋯→C0→00 \to C_m \to \cdots \to C_0 \to 0 of finite-dimensional vector spaces over a field.
Proof · Proof of the Euler–Poincaré formula

General formula. Let ri=rank⁡∂ir_i = \operatorname{rank} \partial_i, with r0=rm+1=0r_0 = r_{m+1} = 0. Rank–nullity for ∂i:Ci→Ci−1\partial_i : C_i \to C_{i-1} gives dim⁡ker⁡∂i=ni−ri\dim \ker \partial_i = n_i - r_i, and bi=dim⁡ker⁡∂i−dim⁡im⁡∂i+1=ni−ri−ri+1b_i = \dim\ker\partial_i - \dim \operatorname{im}\partial_{i+1} = n_i - r_i - r_{i+1}. Hence

∑i(−1)ibi=∑i(−1)ini−∑i(−1)iri−∑i(−1)iri+1.\sum_i (-1)^{i} b_i = \sum_i (-1)^{i} n_i - \sum_i (-1)^{i} r_i - \sum_i (-1)^{i} r_{i+1} .

Reindexing the last sum, ∑i(−1)iri+1=−∑j(−1)jrj\sum_i (-1)^{i} r_{i+1} = -\sum_j (-1)^{j} r_j (the boundary terms r0r_0 and rm+1r_{m+1} vanish), so the two rank sums cancel.

Degree 0 and degree 2 for a connected surface. ∂1\partial_1 maps an edge to the sum of its endpoints, so im⁡∂1\operatorname{im} \partial_1 lies in the even-weight subspace of F2V\F_2^{V}, which has dimension ∣V∣−1\abs{V} - 1; 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 b0=∣V∣−(∣V∣−1)=1b_0 = \abs{V} - (\abs{V} - 1) = 1. For b2=dim⁡ker⁡∂2b_2 = \dim \ker \partial_2: a set SS of faces has ∂2S=0\partial_2 S = 0 exactly when every edge has both sides in SS or both outside SS (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, ker⁡∂2={0,F}\ker \partial_2 = \{0, F\}, where the set of all faces FF is a cycle because each edge borders it twice. So b2=1b_2 = 1.

Substituting into the general formula with m=2m = 2 gives ∣V∣−∣E∣+∣F∣=2−b1\abs{V} - \abs{E} + \abs{F} = 2 - b_1. The values χ=2−2g\chi = 2 - 2g and χ=2−h\chi = 2 - h for the standard surfaces with g,h≥1g, h \ge 1 are computed from any one cellulation (for example a 4g4g-gon or 2h2h-gon with identified sides, which has one face, 2g2g or hh edges and one vertex), and independence of the cellulation is the topological invariance of homology (Munkres).

TheoremNondegenerate pairing between homology and cohomology over a fieldEstablished result

With cycles Zi=ker⁡∂iZ_i = \ker \partial_i, boundaries Bi=im⁡∂i+1B_i = \operatorname{im} \partial_{i+1}, cocycles Zi=ker⁡∂i+1TZ^{i} = \ker \partial_{i+1}^{T} and coboundaries Bi=im⁡∂iTB^{i} = \operatorname{im} \partial_i^{T}, all subspaces of Fn\F^{n}, the formula

⟨[z∗],[z]⟩=z∗⋅z(z∗∈Zi, z∈Zi)\big\langle [z^{*}], [z] \big\rangle = z^{*} \cdot z \qquad (z^{*} \in Z^{i},\ z \in Z_i)

defines a bilinear map Hi×Hi→FH^{i} \times H_i \to \F that does not depend on the representatives, and it is nondegenerate: if ⟨[z∗],[z]⟩=0\langle [z^{*}], [z] \rangle = 0 for all [z][z] then [z∗]=0[z^{*}] = 0, and if it vanishes for all [z∗][z^{*}] then [z]=0[z] = 0. Consequently

dim⁡Hi=dim⁡Hi,\dim H^{i} = \dim H_i ,

and for every basis [z1],…,[zk][z_1], \dots, [z_k] of HiH_i there are cocycles z1∗,…,zk∗z_1^{*}, \dots, z_k^{*} with za∗⋅zb=δabz_a^{*} \cdot z_b = \delta_{ab}.

In a homological CSS code, Z(z)Z(z) and X(z∗)X(z^{*}) commute exactly when z∗⋅z=0z^{*} \cdot z = 0 over F2\F_2, so the theorem says that the ZZ-type logical operators (non-trivial cycles) and the XX-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 XX-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).

Holds when
  • Ci+1→∂i+1Ci→∂iCi−1C_{i+1} \xrightarrow{\partial_{i+1}} C_i \xrightarrow{\partial_i} C_{i-1} is part of a chain complex of finite-dimensional vector spaces over a field F\F, with a fixed basis of Ci≅FnC_i \cong \F^{n} and the standard bilinear form a⋅b=∑jajbja \cdot b = \sum_j a_j b_j.
Proof · Proof of the homology–cohomology pairing over a field

For a subspace W⊆FnW \subseteq \F^{n} write W⊥={x:x⋅w=0 ∀w∈W}W^{\perp} = \{ x : x \cdot w = 0 \ \forall w \in W \}. The standard form is nondegenerate, so dim⁡W⊥=n−dim⁡W\dim W^{\perp} = n - \dim W and (W⊥)⊥=W(W^{\perp})^{\perp} = W for every subspace, over any field (no positivity is needed; over F2\F_2 a nonzero vector can be orthogonal to itself, which does no harm here).

Four complements. For any matrix AA, ker⁡A=(im⁡AT)⊥\ker A = (\operatorname{im} A^{T})^{\perp}, because Ax=0Ax = 0 if and only if y⋅Ax=(ATy)⋅x=0y \cdot Ax = (A^{T} y) \cdot x = 0 for all yy. Applying this with A=∂iA = \partial_i and with A=∂i+1TA = \partial_{i+1}^{T}, and taking complements,

Zi=(Bi)⊥,Zi=(Bi)⊥,Bi=(Zi)⊥,Bi=(Zi)⊥.Z_i = (B^{i})^{\perp}, \qquad Z^{i} = (B_i)^{\perp}, \qquad B_i = (Z^{i})^{\perp}, \qquad B^{i} = (Z_i)^{\perp} .

Well defined. If z∗∈Zi=Bi⊥z^{*} \in Z^{i} = B_i^{\perp} and b∈Bib \in B_i then z∗⋅b=0z^{*} \cdot b = 0, so changing zz by a boundary does not change z∗⋅zz^{*} \cdot z. Symmetrically, if z∈Ziz \in Z_i and b∗∈Bi=Zi⊥b^{*} \in B^{i} = Z_i^{\perp} then b∗⋅z=0b^{*} \cdot z = 0. Bilinearity is inherited from the dot product.

Nondegenerate. Suppose z∗⋅z=0z^{*} \cdot z = 0 for all z∈Ziz \in Z_i. Then z∗∈Zi⊥=Biz^{*} \in Z_i^{\perp} = B^{i}, i.e. [z∗]=0[z^{*}] = 0 in HiH^{i}. Suppose z∗⋅z=0z^{*} \cdot z = 0 for all z∗∈Ziz^{*} \in Z^{i}. Then z∈(Zi)⊥=Biz \in (Z^{i})^{\perp} = B_i, i.e. [z]=0[z] = 0 in HiH_i.

Dimensions and dual bases. A nondegenerate bilinear pairing of finite-dimensional spaces U×W→FU \times W \to \F gives injective linear maps U→W∗U \to W^{*} and W→U∗W \to U^{*}, so dim⁡U≤dim⁡W≤dim⁡U\dim U \le \dim W \le \dim U. Hence dim⁡Hi=dim⁡Hi\dim H^{i} = \dim H_i, the map Hi→(Hi)∗H^{i} \to (H_i)^{*} is an isomorphism, and the preimage of the dual basis of [z1],…,[zk][z_1], \dots, [z_k] provides classes [za∗][z_a^{*}] with za∗⋅zb=δabz_a^{*} \cdot z_b = \delta_{ab}.

This linear-algebra argument is the field case of the universal coefficient theorem treated in Munkres.

For a complex over R\R or C\C 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):

TheoremHodge theorem for finite-dimensional chain complexesEstablished result

Let Δi=di−1di−1†+di†di\Delta_i = d_{i-1} d_{i-1}\dagg + d_i\dagg d_i on CiC^{i}. Then Δi\Delta_i is positive semidefinite and

Ci=ker⁡Δi  ⊕  im⁡di−1  ⊕  im⁡di†(orthogonal sum),Hi=ker⁡di/im⁡di−1  ≅  ker⁡Δi.C^{i} = \ker \Delta_i \;\oplus\; \operatorname{im} d_{i-1} \;\oplus\; \operatorname{im} d_i\dagg \quad \text{(orthogonal sum)}, \qquad H^{i} = \ker d_i / \operatorname{im} d_{i-1} \;\cong\; \ker \Delta_i .

In particular dim⁡Hi\dim H^{i} is the multiplicity of the eigenvalue 0 of Δi\Delta_i. This is the linear algebra behind quantum algorithms that estimate Betti numbers by phase estimation on e−iΔte^{-i\Delta t}, beginning with Lloyd, Garnerone and Zanardi.

Holds when
  • Finite-dimensional complex inner-product spaces CiC^{i} and linear maps di:Ci→Ci+1d_i : C^{i} \to C^{i+1} with di+1di=0d_{i+1} d_i = 0; adjoints taken with respect to the inner products.
Proof · Proof of the finite-dimensional Hodge theorem

Write d=did = d_i, e=di−1e = d_{i-1}, so Δ=ee†+d†d\Delta = e e\dagg + d\dagg d on CiC^{i} and de=0d e = 0.

Positivity and harmonic vectors. For x∈Cix \in C^{i}, ⟨x,Δx⟩=∥e†x∥2+∥dx∥2≥0\langle x, \Delta x\rangle = \norm{e\dagg x}^2 + \norm{d x}^2 \ge 0. Hence Δx=0\Delta x = 0 if and only if dx=0d x = 0 and e†x=0e\dagg x = 0: ker⁡Δ=ker⁡d∩ker⁡e†\ker\Delta = \ker d \cap \ker e\dagg.

Orthogonality. im⁡e⊥im⁡d†\operatorname{im} e \perp \operatorname{im} d\dagg, since ⟨ey,d†z⟩=⟨dey,z⟩=0\langle e y, d\dagg z\rangle = \langle d e y, z\rangle = 0. And ker⁡Δ\ker \Delta is orthogonal to both: if Δx=0\Delta x = 0 then ⟨x,ey⟩=⟨e†x,y⟩=0\langle x, e y\rangle = \langle e\dagg x, y\rangle = 0 and ⟨x,d†z⟩=⟨dx,z⟩=0\langle x, d\dagg z\rangle = \langle d x, z\rangle = 0.

Spanning. The orthogonal complement of im⁡e⊕im⁡d†\operatorname{im} e \oplus \operatorname{im} d\dagg is (im⁡e)⊥∩(im⁡d†)⊥=ker⁡e†∩ker⁡d=ker⁡Δ(\operatorname{im} e)^{\perp} \cap (\operatorname{im} d\dagg)^{\perp} = \ker e\dagg \cap \ker d = \ker \Delta, using (im⁡A)⊥=ker⁡A†(\operatorname{im} A)^{\perp} = \ker A\dagg in finite dimension. So Ci=ker⁡Δ⊕im⁡e⊕im⁡d†C^{i} = \ker\Delta \oplus \operatorname{im} e \oplus \operatorname{im} d\dagg.

Cohomology. ker⁡d\ker d contains ker⁡Δ\ker\Delta and im⁡e\operatorname{im} e (because de=0de = 0), and it meets im⁡d†\operatorname{im} d\dagg only in 0: if d d†z=0d\, d\dagg z = 0 then ∥d†z∥2=⟨z,dd†z⟩=0\norm{d\dagg z}^2 = \langle z, d d\dagg z\rangle = 0. Intersecting the decomposition with ker⁡d\ker d therefore gives ker⁡d=ker⁡Δ⊕im⁡e\ker d = \ker \Delta \oplus \operatorname{im} e, and the quotient map ker⁡d→ker⁡d/im⁡e=Hi\ker d \to \ker d/\operatorname{im} e = H^{i} restricts to an isomorphism on ker⁡Δ\ker \Delta.

The geometry of a surface limits how good its codes can be:

EquationRate–distance tradeoff for homological codes of surfacesPeer-reviewed result
k d2  ≤  C (log⁡k)2 nk\, d^{2} \;\le\; C\, (\log k)^{2}\, n

Proved by Delfosse for surface codes and color codes. A family with k/nk / n bounded below therefore has d=O(log⁡n)d = O(\log n), and hyperbolic surface codes, which have constant rate and logarithmic distance, show that this order is attained. For comparison, the toric code has k=2k = 2 and d2=n/2d^2 = n/2. 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 mm edges and whose vertices have degree at most mm, with CC depending only on mm; it rests on Gromov's systolic inequality for surfaces.

Holds when
  • Homological codes of cellulated closed surfaces (and 2D color codes), with nn qubits, kk logical qubits and distance dd.
  • The constant CC 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 L×LL \times L square grid

Take the square lattice with periodic boundary conditions in both directions, L=3L = 3. Then ∣V∣=9\abs{V} = 9, ∣E∣=2⋅9=18\abs{E} = 2 \cdot 9 = 18 (one horizontal and one vertical edge per vertex), ∣F∣=9\abs{F} = 9, so χ=9−18+9=0\chi = 9 - 18 + 9 = 0, the Euler characteristic of the torus, g=1g = 1. The Euler–Poincaré formula with b0=b2=1b_0 = b_2 = 1 gives b1=2−χ=2b_1 = 2 - \chi = 2.

Directly: rank⁡∂1=∣V∣−1=8\operatorname{rank} \partial_1 = \abs{V} - 1 = 8 (connected graph) and rank⁡∂2=∣F∣−1=8\operatorname{rank} \partial_2 = \abs{F} - 1 = 8 (only the sum of all faces has zero boundary). So b1=dim⁡ker⁡∂1−rank⁡∂2=(18−8)−8=2b_1 = \dim\ker\partial_1 - \operatorname{rank}\partial_2 = (18 - 8) - 8 = 2. The homological code has n=18n = 18, k=2k = 2, and 9+99 + 9 checks of which 8+88 + 8 are independent.

A horizontal row of 3 edges, cc, is a cycle: each vertex on it meets two of its edges. The vertical dual loop c∗c^{*}, 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 cc, so c∗⋅c=1c^{*} \cdot c = 1. Boundaries pair to zero with every cocycle (this is the "well defined" step of the pairing theorem), so cc is not a boundary: Z(c)Z(c) is a logical operator, and X(c∗)X(c^{*}) is a logical operator anticommuting with it. No cycle with fewer than 3 edges winds around, so the code is the [[18,2,3]][[18, 2, 3]] toric code, matching [[2L2,2,L]][[2L^2, 2, L]] from the toric-code parameters.

The sphere has no logical qubits

The cube, viewed as a cellulation of the sphere, has ∣V∣=8\abs{V} = 8, ∣E∣=12\abs{E} = 12, ∣F∣=6\abs{F} = 6, so χ=2\chi = 2 and b1=0b_1 = 0: every cycle bounds. The homological code on a cellulated sphere has k=0k = 0, 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, χ=−2\chi = -2, so any cellulation gives b1=4b_1 = 4 logical qubits. The smallest is the standard octagon with its sides glued in the pattern a1b1a1−1b1−1a2b2a2−1b2−1a_1 b_1 a_1^{-1} b_1^{-1} a_2 b_2 a_2^{-1} b_2^{-1}: one face, four edges and, after gluing, one vertex, so 1−4+1=−21 - 4 + 1 = -2. Every edge is a loop at the single vertex, so ∂1=0\partial_1 = 0, and every edge occurs twice on the boundary of the single face, so ∂2=0\partial_2 = 0. All four edges are non-trivial cycles: the code has n=k=4n = k = 4 and d=1d = 1, encoding without protecting. Finer cellulations of the same surface keep k=4k = 4 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 2b12^{b_1}; 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 F2\F_2 coefficients ignores orientation: the Klein bottle and the torus both have b1=2b_1 = 2 over F2\F_2, although their integer homology differs. Codes on qudits of dimension pp use Fp\F_p coefficients, where orientations (signs in ∂\partial) must be tracked.
  • Which check is which. Some authors put XX checks on vertices and ZZ checks on faces, others the reverse, and the chain complex may be written in either direction. Before using a formula for "the XX distance", fix which of HXH_X, HZH_Z is ∂1\partial_1 or ∂2T\partial_2^{T}.
  • 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 kk stays fixed.
  • Counting only. The Euler characteristic gives kk but nothing about dd, 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 kk.

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.

Builds on
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. James R. Munkres (2018). Elements of Algebraic Topology. CRC Press (reissue of the 1984 Addison-Wesley edition). doi:10.1201/9780429493911
  2. 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
  3. 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
  4. 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
  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. 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
  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. Nicolas Delfosse (2013). Tradeoffs for reliable quantum information storage in surface codes and color codes. 2013 IEEE International Symposium on Information Theory, 917-921. doi:10.1109/ISIT.2013.6620360arXiv:1301.6588
  9. Nikolas P. Breuckmann, Barbara M. Terhal (2016). Constructions and Noise Threshold of Hyperbolic Surface Codes. IEEE Transactions on Information Theory 62 (6), 3731-3744. doi:10.1109/TIT.2016.2555700arXiv:1506.04029
  10. Seth Lloyd, Silvano Garnerone, Paolo Zanardi (2016). Quantum algorithms for topological and geometric analysis of data. Nature Communications 7, 10138. doi:10.1038/ncomms10138arXiv:1408.3106

Contributors

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

Review history

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

    Topic body only (embedded records carry their own review states). Re-derived the worked examples: 3x3 torus (|V| = 9, |E| = 18, |F| = 9, chi = 0, rank d1 = rank d2 = 8, b_1 = 2, cycle c and cocycle c* with c*.c = 1, [[18,2,3]]); cube as a sphere (chi = 2, b_1 = 0); genus-2 octagon (one vertex, four loop edges, one face, d1 = d2 = 0, n = k = 4, d = 1); tensor-product complex and hypergraph product; Klein bottle b_1 = 2 over F_2; toric-code ground-space degeneracy 2^{b_1}. Product-code and LDPC statements compared with Breuckmann-Eberhardt, arXiv:2103.06309; attributions checked by Crossref metadata (Kitaev 2003, Dennis et al. 2002, Freedman-Meyer 2001, Bombin-Martin-Delgado 2007, Tillich-Zemor 2014, Lloyd-Garnerone-Zanardi 2016).

    The overview said the distance is the length of the shortest cycle that is not a boundary; for a CSS code it is the minimum over both cycles (Z-type) and cocycles (X-type), as definition/chain-complex states. Changed to 'the shortest cycle or cocycle that is not a boundary or coboundary'.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e

Current revision 83811dc689509dc6. Source file knowledge/records/topic/topology-and-homology.md in the content repository (readable there once it is public).