Skip to main content
KetQat

Appearance

Topic · intermediate

Topological Codes

Stabilizer codes whose checks are local on a lattice drawn on a surface and whose logical operators are strings that wind around it. Covers the homological construction, the toric code, boundaries, anyonic excitations and the statistical-mechanics mapping that fixes the optimal threshold.

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 topological code is a stabilizer code defined on a lattice drawn on a surface, with two properties: every check acts on a few neighbouring qubits, and no operator confined to a small region can read or change the encoded information. The encoded qubits are attached to the global shape of the surface, to its handles and boundaries, and not to any particular qubit.

The first example is the toric code of Kitaev. Its planar versions with boundaries (Bravyi and Kitaev; Freedman and Meyer) are the surface codes used in most current hardware demonstrations. Color codes and Floquet codes are relatives with different checks and the same underlying structure. This page gives the general construction, the toric code as the worked case, and the results that hold for the whole family: the homological formula for the parameters, the mapping of decoding to a disordered spin model, and the limits that locality imposes. Terhal's review covers the same ground at greater length.

Intuition

Draw a square grid on the surface of a doughnut and put a qubit on every edge. Measure two kinds of local parity: around every vertex, the product of XX on the four edges that meet there; around every square, the product of ZZ on its four sides. All of these commute, and the states on which they all equal +1+1 form the code space.

A single ZZ error on an edge flips the two vertex checks at its ends. A chain of ZZ errors flips only the checks at the two ends of the chain: the interior is invisible. So the syndrome shows endpoints, and the decoder must guess how they were joined. If its guess together with the true error forms a closed loop that can be shrunk to a point, the product is a stabilizer and the state is restored. If the loop winds around the doughnut, a logical operator has been applied. A logical error therefore needs a chain of errors about half as long as the shortest winding loop, and the protection grows with the size of the lattice.

Physically, the endpoints behave like particles: they are created in pairs, can be moved by further errors, and annihilate when they meet. They are the anyons of the model, and error correction is the task of pairing them up before they travel around the surface. The lesson The surface code builds this picture with explicit small examples.

Prerequisites

The stabilizer formalism and CSS codes: stabilizer groups, logical operators as elements of the normalizer, and the fact that a CSS code has distance equal to the smaller of its XX and ZZ distances. From topology: chain complexes over F2\F_2, cycles, boundaries and the first homology group of a surface.

Mathematical Definitions

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.

Quantum codeToric codeEstablished definition

Lattice. Fix an integer L≥2L \ge 2. The vertices are the points (i,j)∈ZL×ZL(i, j) \in \Z_L \times \Z_L of a square lattice with periodic boundary conditions. There are two edges per vertex: the horizontal edge hi,jh_{i,j} from (i,j)(i,j) to (i+1,j)(i+1,j) and the vertical edge vi,jv_{i,j} from (i,j)(i,j) to (i,j+1)(i,j+1). One qubit sits on each edge, so n=2L2n = 2L^2.

Checks. For every vertex and every plaquette (unit square)

Ai,j=Xhi,j Xhi−1,j Xvi,j Xvi,j−1,Bi,j=Zhi,j Zhi,j+1 Zvi,j Zvi+1,j.A_{i,j} = X_{h_{i,j}}\, X_{h_{i-1,j}}\, X_{v_{i,j}}\, X_{v_{i,j-1}}, \qquad B_{i,j} = Z_{h_{i,j}}\, Z_{h_{i,j+1}}\, Z_{v_{i,j}}\, Z_{v_{i+1,j}} .

There are L2L^2 operators of each type. A vertex and a plaquette share either no edge or two edges, so all checks commute. They satisfy exactly two relations, ∏i,jAi,j=I\prod_{i,j} A_{i,j} = I and ∏i,jBi,j=I\prod_{i,j} B_{i,j} = I, leaving 2L2−22L^2 - 2 independent generators.

Parameters. [[2L2,2,L]][[2L^2, 2, L]], proved in the parameter theorem.

Logical operators. One choice of representatives is

Zˉ1=∏iZhi,0,Xˉ1=∏jXh0,j,Zˉ2=∏jZv0,j,Xˉ2=∏iXvi,0.\bar Z_1 = \prod_{i} Z_{h_{i,0}}, \quad \bar X_1 = \prod_{j} X_{h_{0,j}}, \qquad \bar Z_2 = \prod_{j} Z_{v_{0,j}}, \quad \bar X_2 = \prod_{i} X_{v_{i,0}} .

Zˉ1\bar Z_1 and Zˉ2\bar Z_2 are strings of ZZ along the two non-contractible loops of the lattice. Xˉ1\bar X_1 and Xˉ2\bar X_2 are strings of XX on the edges crossed by non-contractible loops of the dual lattice. Each has weight LL; Xˉa\bar X_a anticommutes with Zˉa\bar Z_a and commutes with the other pair. Multiplying a representative by checks deforms the loop without changing its winding.

Properties. The code is a CSS code and the homological code of the square cellulation of the torus. Every check has weight 4 and every qubit is in two checks of each type, so it is a quantum LDPC code with geometrically local checks in two dimensions. Its code space is the ground space of the toric-code Hamiltonian. It was introduced by Kitaev; its use as a memory with repeated syndrome measurement is analysed by Dennis, Kitaev, Landahl and Preskill.

EquationToric-code HamiltonianEstablished definition
H  =  −Je∑vAv  −  Jm∑pBpH \;=\; -J_e \sum_{v} A_v \;-\; J_m \sum_{p} B_p

All terms commute and have eigenvalues ±1\pm 1, so the eigenstates are labelled by the values av,bp∈{+1,−1}a_v, b_p \in \{+1, -1\} of the checks and have energy −Je∑vav−Jm∑pbp-J_e \sum_v a_v - J_m \sum_p b_p. The ground space is the code space of the toric code, where every check equals +1+1; on the L×LL \times L torus it is four-dimensional. A vertex with av=−1a_v = -1 costs energy 2Je2J_e and a plaquette with bp=−1b_p = -1 costs 2Jm2J_m. Because ∏vAv=∏pBp=I\prod_v A_v = \prod_p B_p = I on a closed surface, violated checks of each type come in even numbers, so the gap above the ground space is min⁡(4Je,4Jm)\min(4J_e, 4J_m), independent of LL. Kitaev introduced the model with Je=Jm=1J_e = J_m = 1 and identified its point-like excitations as abelian anyons.

Holds when
  • Couplings Je,Jm>0J_e, J_m > 0; AvA_v and BpB_p are the vertex and plaquette operators of the toric code.

Boundaries

A surface with boundary needs a rule for the checks at its edge. Bravyi and Kitaev introduced two kinds for the square lattice. At a smooth boundary the lattice ends on a line of edges, and the vertex checks on that line have three qubits instead of four. At a rough boundary the lattice ends on edges that stick out with no vertex at their far end, and the plaquette checks there have three qubits. A string of ZZ operators may end on a rough boundary without violating any check, because there is no vertex check at the dangling end; a string of XX operators on the dual lattice may end on a smooth boundary. A rectangle with rough boundaries on two opposite sides and smooth boundaries on the other two encodes one qubit: Zˉ\bar Z is a ZZ string joining the rough sides and Xˉ\bar X is a dual XX string joining the smooth sides. In the anyon language the rough boundary absorbs the vertex excitation and the smooth boundary absorbs the plaquette excitation. The parameters of the resulting codes are given under surface codes.

Noise models used for thresholds

Three idealisations recur, and every threshold must name the one it refers to.

  • Code capacity. Independent Pauli errors on the data qubits; every check is measured once, perfectly.
  • Phenomenological. Data errors as above between rounds, and each measured check outcome is independently wrong with some probability; the syndrome is measured repeatedly.
  • Circuit level. Every gate, preparation, measurement and idle step of the syndrome-extraction circuit can fail. Thresholds of this kind are discussed under surface codes.

Theorems

TheoremParameters of the toric codeEstablished result

For every integer L≥2L \ge 2 the toric code on the L×LL \times L torus is a stabilizer code with parameters

[[ n,k,d ]]=[[ 2L2,  2,  L ]].[[\,n, k, d\,]] = [[\,2L^2,\; 2,\; L\,]] .

More precisely:

  1. the 2L22L^2 vertex and plaquette operators generate a stabilizer group of rank 2L2−22L^2 - 2;
  2. a product of ZZ operators on a set cc of edges commutes with every check exactly when cc meets every vertex in an even number of edges, and it then acts non-trivially on the code space exactly when cc winds an odd number of times around at least one of the two directions of the torus; the same holds for products of XX on the dual lattice;
  3. every Pauli operator that acts non-trivially on the code space has weight at least LL, and the straight loops Zˉ1,Zˉ2,Xˉ1,Xˉ2\bar Z_1, \bar Z_2, \bar X_1, \bar X_2 of weight LL attain the bound.

In homological terms k=dim⁡H1(T2;F2)=2k = \dim H_1(T^2; \F_2) = 2 and dd is the length of the shortest non-contractible loop. The code and these properties are due to Kitaev.

Holds when
  • Square lattice on a torus with L≥2L \ge 2 sites in each direction and one qubit per edge.
  • The distance is the minimum weight of a Pauli operator that commutes with every check and is not, up to a phase, a product of checks.
Proof · Proof of the toric-code parameters by counting and loop intersection

Notation is that of the toric code record: vertices (i,j)∈ZL2(i,j) \in \Z_L^2, edges hi,jh_{i,j} and vi,jv_{i,j}, checks Ai,jA_{i,j} and Bi,jB_{i,j}.

Number of logical qubits. Let SS be a set of vertices. The product ∏v∈SAv\prod_{v \in S} A_v acts on an edge with XX if exactly one endpoint of the edge is in SS and trivially otherwise. It is the identity exactly when every edge has both endpoints in SS or neither, that is, when SS is a union of connected components of the lattice. The lattice is connected, so S=∅S = \emptyset or SS is all of the vertices. Hence the L2L^2 vertex operators satisfy the single relation ∏vAv=I\prod_v A_v = I and generate a group of rank L2−1L^2 - 1. Every edge lies on exactly two plaquettes, so the same argument on the dual lattice shows that the plaquette operators have rank L2−1L^2 - 1. A product of XX-type operators equals a product of ZZ-type operators only if both are the identity, so the stabilizer group has rank 2L2−22L^2 - 2 and

k=n−(2L2−2)=2.k = n - (2L^2 - 2) = 2 .

A symplectic basis of logical operators. For each i∈ZLi \in \Z_L and j∈ZLj \in \Z_L define

Xˉ1(i)=∏j′Xhi,j′,Xˉ2(j)=∏i′Xvi′,j,Zˉ1=∏i′Zhi′,0,Zˉ2=∏j′Zv0,j′.\bar X_1^{(i)} = \prod_{j'} X_{h_{i,j'}}, \qquad \bar X_2^{(j)} = \prod_{i'} X_{v_{i',j}}, \qquad \bar Z_1 = \prod_{i'} Z_{h_{i',0}}, \qquad \bar Z_2 = \prod_{j'} Z_{v_{0,j'}} .

A plaquette Bi′,j′B_{i',j'} contains the horizontal edges hi′,j′h_{i',j'} and hi′,j′+1h_{i',j'+1}, so it meets the support of Xˉ1(i)\bar X_1^{(i)} in two edges if i′=ii' = i and in none otherwise; likewise for Xˉ2(j)\bar X_2^{(j)} and the vertical edges. So the Xˉ\bar X operators commute with every check. A vertex meets the support of Zˉ1\bar Z_1 (a row of horizontal edges) in two edges or none, and likewise for Zˉ2\bar Z_2, so the Zˉ\bar Z operators commute with every check. The supports of Zˉ1\bar Z_1 and Xˉ1(i)\bar X_1^{(i)} share exactly the edge hi,0h_{i,0}, the supports of Zˉ2\bar Z_2 and Xˉ2(j)\bar X_2^{(j)} share exactly v0,jv_{0,j}, and Zˉ1\bar Z_1, Xˉ2(j)\bar X_2^{(j)} have disjoint supports, as do Zˉ2\bar Z_2, Xˉ1(i)\bar X_1^{(i)}. Therefore

XˉaZˉb=(−1)δab ZˉbXˉa,\bar X_a \bar Z_b = (-1)^{\delta_{ab}}\, \bar Z_b \bar X_a ,

for any choice of the superscripts. No non-trivial product of these four operators commutes with all four, so none is in the stabilizer group, and they represent the 424^2 cosets of logical Pauli operators of a code with k=2k = 2: every Pauli operator commuting with all checks equals, up to a phase, s Xˉ1a1Xˉ2a2Zˉ1b1Zˉ2b2s\, \bar X_1^{a_1} \bar X_2^{a_2} \bar Z_1^{b_1} \bar Z_2^{b_2} with ss a product of checks.

Translated loops are equivalent. Multiply the vertex operators of column i+1i+1:

∏jAi+1,j=∏jXhi+1,jXhi,j⋅∏jXvi+1,jXvi+1,j−1=Xˉ1(i) Xˉ1(i+1),\prod_{j} A_{i+1,j} = \prod_j X_{h_{i+1,j}} X_{h_{i,j}} \cdot \prod_j X_{v_{i+1,j}} X_{v_{i+1,j-1}} = \bar X_1^{(i)}\, \bar X_1^{(i+1)} ,

because each vertical edge of that column appears twice. Hence all Xˉ1(i)\bar X_1^{(i)}, i∈ZLi \in \Z_L, differ by stabilizers, and their supports (the horizontal edges with first coordinate ii) are pairwise disjoint. The same holds for the Xˉ2(j)\bar X_2^{(j)}.

Distance. Let Q=Z(c)Q = Z(c) be a product of ZZ operators that commutes with all checks and is not a product of checks. Write QQ in the form above. Since QQ commutes with Zˉ1\bar Z_1 and Zˉ2\bar Z_2, a1=a2=0a_1 = a_2 = 0; then ss is of ZZ type, and since QQ is not a product of checks, (b1,b2)≠(0,0)(b_1, b_2) \ne (0,0). If b1=1b_1 = 1, QQ anticommutes with Xˉ1(0)\bar X_1^{(0)} and therefore with every Xˉ1(i)\bar X_1^{(i)}, since these differ from it by stabilizers, with which QQ commutes. Anticommuting with Xˉ1(i)\bar X_1^{(i)} requires cc to contain an odd number, so at least one, of the edges hi,jh_{i,j}, j∈ZLj \in \Z_L. These LL sets of edges are disjoint, so ∣c∣≥L\abs{c} \ge L. If b2=1b_2 = 1 the same argument with Xˉ2(j)\bar X_2^{(j)} applies. By the symmetry of the construction under exchanging the lattice with its dual, every non-trivial XX-type logical operator also has weight at least LL.

A general Pauli operator is, up to a phase, X(a)Z(b)X(a) Z(b). It commutes with the ZZ-type checks exactly when X(a)X(a) does and with the XX-type checks exactly when Z(b)Z(b) does. If it is not a product of checks, at least one of X(a)X(a), Z(b)Z(b) is not either, and that factor has weight at least LL, so the whole operator does. The operator Zˉ1\bar Z_1 has weight exactly LL. Hence d=Ld = L.

Homological reading. The first step computes dim⁡ker⁡∂1−rank⁡∂2=dim⁡H1(T2;F2)=2\dim \ker \partial_1 - \operatorname{rank} \partial_2 = \dim H_1(T^2; \F_2) = 2 for the chain complex of the homological code. The exponents (b1,b2)(b_1, b_2) are the homology class of the cycle cc, detected by its intersection numbers with the two dual loops. This is the argument indicated by Kitaev, written out with explicit coordinates.

Decoding as a disordered spin model

EquationOptimal toric-code threshold as the Nishimori point of the random-bond Ising modelPeer-reviewed result
pthML  =  pN,e−2βpJ  =  p1−pp_{\mathrm{th}}^{\mathrm{ML}} \;=\; p_{\mathrm{N}}, \qquad e^{-2\beta_p J} \;=\; \frac{p}{1-p}

Consider ZZ errors on a set EE of edges of the toric code with nn qubits; XX errors are treated identically on the dual lattice. Two error sets have the same syndrome and the same effect on the code space exactly when they differ by a sum of plaquette boundaries. Write E‾\overline{E} for this class. Put an Ising spin σf=±1\sigma_f = \pm 1 on every plaquette and a coupling ηe=−1\eta_e = -1 on the edges of EE, ηe=+1\eta_e = +1 elsewhere. The spin configuration with σf=−1\sigma_f = -1 on a set SS of plaquettes corresponds to the error E+∂SE + \partial S, whose edges are those with ηeσfσf′=−1\eta_e \sigma_f \sigma_{f'} = -1, where f,f′f, f' are the two plaquettes sharing ee. Summing the probabilities p∣E′∣(1−p)n−∣E′∣p^{\abs{E'}} (1-p)^{n - \abs{E'}} over the class gives

Pr⁡[ E‾ ]  =  12 (p(1−p))n/2  Z[η;βp],Z[η;β]=∑σexp⁡(βJ∑eηe σf(e)σf′(e)),\Pr\big[\,\overline{E}\,\big] \;=\; \tfrac{1}{2}\, \big(p(1-p)\big)^{n/2}\; Z[\eta;\beta_p], \qquad Z[\eta;\beta] = \sum_{\sigma} \exp\Big(\beta J \sum_{e} \eta_e\, \sigma_{f(e)} \sigma_{f'(e)}\Big),

provided the inverse temperature is tied to the error rate by the second relation in the displayed equation. The factor 12\tfrac12 appears because a spin configuration and its global flip give the same error set. The couplings η\eta are themselves drawn with a fraction pp of antiferromagnetic bonds, so the disorder strength and the temperature are locked together: this is the line in the phase diagram of the ±J\pm J random-bond Ising model studied by Nishimori.

The other classes with the same syndrome are obtained by adding a non-contractible loop to EE, which inserts a domain wall around the torus. Maximum-likelihood decoding succeeds with probability tending to 1 exactly when, for typical η\eta, the free-energy cost of that domain wall diverges with LL, which is the definition of the ferromagnetically ordered phase. Hence the threshold pthMLp_{\mathrm{th}}^{\mathrm{ML}} is the disorder strength pNp_{\mathrm{N}} at which the Nishimori line leaves the ordered phase. The mapping is due to Dennis, Kitaev, Landahl and Preskill; the numerical value of pNp_{\mathrm{N}} is recorded in a separate result.

A decoder that returns the single most probable error, such as minimum-weight matching, corresponds to the zero-temperature axis of the same model and has a lower threshold (Wang, Harrington and Preskill).

Holds when
  • Toric code on the square lattice in the limit L→∞L \to \infty; one type of error (XX or ZZ) considered at a time.
  • Each qubit suffers the error independently with probability pp; all checks are measured once, without error (code-capacity noise).
  • Maximum-likelihood decoding, which returns a member of the most probable equivalence class of errors given the syndrome.
  • The class-probability identity is exact. Identifying the threshold with the phase boundary uses the characterisation of the ordered phase by a domain-wall free energy that diverges with LL.
Research resultOptimal code-capacity threshold of the toric code under independent bit-flip and phase-flip noiseIndependently reproduced result

By the statistical-mechanics mapping the threshold is the critical concentration pNp_{\mathrm{N}} of antiferromagnetic bonds at the multicritical (Nishimori) point of the two-dimensional ±J\pm J random-bond Ising model on the square lattice. Two independent numerical determinations agree:

Source Method pNp_{\mathrm{N}}
Honecker, Picco and Pujol transfer matrix, domain-wall free energy 0.1094±0.00020.1094 \pm 0.0002
Hasenbusch, Parisen Toldin, Pelissetto and Vicari Monte Carlo with finite-size scaling along the Nishimori line 0.10919±0.000070.10919 \pm 0.00007

The second paper reports the concentration of ferromagnetic bonds, 0.89081(7)0.89081(7); the table gives its complement. The commonly quoted "10.9%" is this number.

For comparison, the same model on the zero-temperature axis, which describes minimum-weight decoding, has critical concentration 0.1031±0.00010.1031 \pm 0.0001 (Wang, Harrington and Preskill). The rate 1−2H2(p)1 - 2H_2(p) of random CSS codes on this channel vanishes at p≈0.1100p \approx 0.1100, the root of H2(p)=12H_2(p) = \tfrac12 with H2H_2 the binary entropy; the numerical value of pNp_{\mathrm{N}} lies slightly below that point.

Holds when
  • Square-lattice toric code, L→∞L \to \infty, independent XX and ZZ errors each with probability pp per qubit, decoded separately.
  • Perfect syndrome measurement and maximum-likelihood decoding.
  • The value is a numerical estimate for the ±J\pm J random-bond Ising model; the quoted uncertainties are those of the cited simulations.

The same construction applies to the other noise models, with other spin models.

  • Phenomenological noise. With data and measurement errors both at rate pp, the relevant model is a three-dimensional random-plaquette Z2\Z_2 gauge theory, the third dimension being time. Minimum-weight decoding corresponds to its zero-temperature transition, located numerically at p=0.0293±0.0002p = 0.0293 \pm 0.0002 by Wang, Harrington and Preskill. The optimal threshold is the transition on the Nishimori line of that model, estimated by Monte Carlo simulation at p≃0.033p \simeq 0.033 by Ohno, Arakawa, Ichinose and Matsui.
  • Depolarizing noise, perfect measurement. If each qubit suffers XX, YY or ZZ with probability p/3p/3 each and the decoder uses the correlation between XX and ZZ errors, the model is a disordered eight-vertex model and the threshold rises to p=0.189±0.003p = 0.189 \pm 0.003 (Bombin, Andrist, Ohzeki, Katzgraber and Martin-Delgado).

What locality forbids

Three results bound what any code with local checks in two dimensions can do.

  • Parameters. For commuting local checks on a two-dimensional lattice of nn qubits, k d2=O(n)k\, d^{2} = O(n) (Bravyi, Poulin and Terhal). The toric code, with kd2=nk d^2 = n, saturates the scaling. For local stabilizer codes on a DD-dimensional lattice of linear size LL the distance satisfies d=O(LD−1)d = O(L^{D-1}) (Bravyi and Terhal). Codes that escape these bounds give up geometric locality; see quantum LDPC codes.
  • Gates. A logical gate implemented by a constant-depth circuit on a two-dimensional local stabilizer code with large distance is a Clifford gate (Bravyi and König). A non-Clifford gate needs an extra ingredient such as magic states.
  • Classification. Translation-invariant two-dimensional topological stabilizer codes are equivalent, under local unitary circuits and the addition of ancilla qubits, to a finite number of copies of the toric code (Bombin, Duclos-Cianci and Poulin).

Worked Examples

The smallest toric code

Take L=2L = 2: four vertices, eight edges, four plaquettes, so n=8n = 8. The Euler characteristic is 4−8+4=04 - 8 + 4 = 0, as it must be for a torus. There are four vertex operators with one relation and four plaquette operators with one relation, so six independent checks and k=8−6=2k = 8 - 6 = 2. A row contains two horizontal edges, so Zˉ1=Zh0,0Zh1,0\bar Z_1 = Z_{h_{0,0}} Z_{h_{1,0}} has weight 2 and the code is [[8,2,2]][[8, 2, 2]]: it detects any single-qubit error and corrects none.

Why distance 3 corrects one error and not two

Take L=3L = 3: n=18n = 18, with 9+99 + 9 checks of which 16 are independent, giving [[18,2,3]][[18, 2, 3]]. A single error Zh0,0Z_{h_{0,0}} flips A0,0A_{0,0} and A1,0A_{1,0}. The lowest-weight operator with that syndrome is Zh0,0Z_{h_{0,0}} itself, so minimum-weight decoding removes it.

Now suppose two errors occur on the same row, Zh0,0Zh1,0Z_{h_{0,0}} Z_{h_{1,0}}. The checks A0,0A_{0,0} and A2,0A_{2,0} are flipped; A1,0A_{1,0} is flipped twice and reads +1+1. The two flipped vertices are also joined by the single edge h2,0h_{2,0}, which runs the other way around the row. A minimum-weight decoder applies Zh2,0Z_{h_{2,0}}. The total operator is

Zh0,0Zh1,0Zh2,0=Zˉ1,Z_{h_{0,0}} Z_{h_{1,0}} Z_{h_{2,0}} = \bar Z_1 ,

a logical error. Two errors out of three on a winding loop are enough, in agreement with ⌊(d−1)/2⌋=1\lfloor (d-1)/2 \rfloor = 1 correctable error.

Reading the threshold numbers

Suppose bit-flip errors occur independently with p=0.105p = 0.105 and measurements are perfect. This is below the optimal threshold 0.10920.1092 and above the minimum-weight value 0.10310.1031. For this noise a maximum-likelihood decoder makes the logical error probability go to zero as LL grows, while a minimum-weight matching decoder does not. At p=0.09p = 0.09 both succeed; at p=0.12p = 0.12 neither does. The same error rate under the phenomenological model, where the relevant thresholds are near 0.030.03, is far above threshold.

Limitations and Common Pitfalls

  • A threshold is a property of a code family, a noise model and a decoder together. The value 10.9%10.9\% is a code-capacity number for independent XX and ZZ noise with optimal decoding. It says nothing directly about hardware, where the circuit-level threshold is roughly an order of magnitude lower.
  • Optimal and minimum-weight decoding differ. Minimum-weight matching finds the most likely single error; the optimal decoder finds the most likely class of equivalent errors. The gap between 0.10310.1031 and 0.10920.1092 is the cost of ignoring the number of equivalent errors.
  • The distance is topological, the constant is not. The number of logical qubits depends only on the surface, and the distance is the length of the shortest non-trivial loop, which depends on the lattice. Different cellulations of the same surface give different ratios n/d2n / d^2.
  • Locality costs rate. With kd2=O(n)k d^2 = O(n), a two-dimensional local code with growing distance has vanishing rate. This is a theorem about local checks, not a weakness of a particular construction.
  • A gapped Hamiltonian does not make a self-correcting memory. The toric-code Hamiltonian has a gap, but at any non-zero temperature its excitations diffuse at no energy cost and cause logical errors; see passive protection.

Decoding algorithms for these codes (matching, union-find, tensor-network and neural decoders) are treated under quantum decoders. Logical operations by deforming boundaries and merging patches are treated under lattice surgery. The phases of matter behind the codes are the subject of topological order and anyons.

Generalizes

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. 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
  2. S. B. Bravyi, A. Yu. Kitaev (1998). Quantum codes on a lattice with boundary. arXiv:quant-ph/9811052
  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. Chenyang Wang, Jim Harrington, John Preskill (2003). Confinement-Higgs transition in a disordered gauge theory and the accuracy threshold for quantum memory. Annals of Physics 303, 31-58. doi:10.1016/S0003-4916(02)00019-2arXiv:quant-ph/0207088
  7. Takuya Ohno, Gaku Arakawa, Ikuo Ichinose, Tetsuo Matsui (2004). Phase structure of the random-plaquette Z2 gauge model: accuracy threshold for a toric quantum memory. Nuclear Physics B 697, 462-480. doi:10.1016/j.nuclphysb.2004.07.003arXiv:quant-ph/0401101
  8. H. Bombin, Ruben S. Andrist, Masayuki Ohzeki, … M. A. Martin-Delgado (2012). Strong Resilience of Topological Codes to Depolarization. Physical Review X 2, 021004. doi:10.1103/PhysRevX.2.021004arXiv:1202.1852
  9. Sergey Bravyi, David Poulin, Barbara Terhal (2010). Tradeoffs for reliable quantum information storage in 2D systems. Physical Review Letters 104, 050503. doi:10.1103/PhysRevLett.104.050503arXiv:0909.5200
  10. Sergey Bravyi, Barbara Terhal (2009). A no-go theorem for a two-dimensional self-correcting quantum memory based on stabilizer codes. New Journal of Physics 11, 043029. doi:10.1088/1367-2630/11/4/043029arXiv:0810.1983
  11. Sergey Bravyi, Robert König (2013). Classification of topologically protected gates for local stabilizer codes. Physical Review Letters 110, 170503. doi:10.1103/PhysRevLett.110.170503arXiv:1206.1609
  12. H. Bombin, Guillaume Duclos-Cianci, David Poulin (2012). Universal topological phase of two-dimensional stabilizer codes. New Journal of Physics 14, 073048. doi:10.1088/1367-2630/14/7/073048arXiv:1103.4606
  13. Barbara M. Terhal (2015). Quantum error correction for quantum memories. Reviews of Modern Physics 87, 307-346. doi:10.1103/RevModPhys.87.307arXiv:1302.3428
  14. Hidetoshi Nishimori (1981). Internal Energy, Specific Heat and Correlation Function of the Bond-Random Ising Model. Progress of Theoretical Physics 66, 1169-1181. doi:10.1143/PTP.66.1169
  15. Martin Hasenbusch, Francesco Parisen Toldin, Andrea Pelissetto, Ettore Vicari (2008). Multicritical Nishimori point in the phase diagram of the ±J Ising model on a square lattice. Physical Review E 77, 051115. doi:10.1103/PhysRevE.77.051115arXiv:0803.0444
  16. A. Honecker, M. Picco, P. Pujol (2001). Universality class of the Nishimori point in the 2D ±J random-bond Ising model. Physical Review Letters 87, 047201. doi:10.1103/PhysRevLett.87.047201arXiv:cond-mat/0010143

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. Worked examples recomputed with own GF(2) computations: L = 2 toric code [[8,2,2]], L = 3 [[18,2,3]] and the two-error logical failure Z h00 Z h10 Z h20 = Zbar_1. Numbers compared with sources: Wang-Harrington-Preskill quant-ph/0207088 (phenomenological T = 0 point .0293 +- .0002; 2D .1031), Ohno et al. quant-ph/0401101 (Nishimori-line p_c ~ 0.033), Bombin et al. 1202.1852 (depolarizing 18.9(3)% via eight-vertex model), Bravyi-Poulin-Terhal 0909.5200, Bravyi-Terhal 0810.1983, Bravyi-Koenig 1206.1609 (2D constant-depth gates are Clifford), Bombin-Duclos-Cianci-Poulin 1103.4606 (copies of the toric code), Bravyi-Kitaev quant-ph/9811052 (smooth/rough boundaries), Terhal review 1302.3428. Reference metadata matched Crossref. Embedded records carry their own review states and were checked separately.

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 31d96b42cf437229. Source file knowledge/records/topic/topological-codes.md in the content repository (readable there once it is public).