Papers
Topics
Authors
Recent
Search
2000 character limit reached

Surface Codes Overview

Updated 13 November 2026
  • Surface codes are topological quantum error-correcting codes defined on 2D surfaces using quantum stabilizer formalism.
  • These codes are notable for their simple physical layout consisting of qubits placed on the edges or vertices of a tiling and logical operators represented as cycles with bounded weights.
  • Surface codes excel in noise resilience, with important implementations in schemes like the hexagon surface coding, hypergraph-daul codes and transfitories. They provide a foundation for broader construction geometries, enhancing noise tolerance and scalability.

Surface codes are topological quantum error-correcting codes defined from a cellulation of a two-dimensional surface. In the standard CSS construction, one physical qubit is placed on each edge, vertex-edge incidence operators generate one stabilizer type, and face-edge incidence operators generate the other. For a code associated with a tiling G=(V,E,F)G=(V,E,F), the blocklength is n=∣E∣n=|E|, while the encoded dimension is determined by the topology: k=2−χk=2-\chi, and k=2gk=2g for a closed orientable surface of genus gg. Logical Pauli operators correspond to nontrivial cycles of the primal and dual lattices, whereas contractible error strings are stabilizer-equivalent to trivial errors. Surface codes combine bounded-weight local checks, planar layouts, string-like logical operators, and decoding methods based principally on syndrome-defect matching.

1. Algebraic and topological foundations

A quantum stabilizer code is commonly specified by parameters [[n,k,d]][[n,k,d]], where nn is the number of physical qubits, kk is the number of encoded qubits, and dd is the minimum weight of a nontrivial logical Pauli operator. It can correct up to

⌊d−12⌋\left\lfloor\frac{d-1}{2}\right\rfloor

arbitrary errors. The encoding rate is R=k/nR=k/n. A code family has nonzero asymptotic rate when k/nk/n remains bounded away from zero as n→∞n\to\infty.

Surface codes are CSS codes. Given binary matrices HXH_X and HZH_Z satisfying

HXHZT=0,H_XH_Z^{T}=0,

the encoded dimension is

k=n−rank⁡HX−rank⁡HZ.k=n-\operatorname{rank}H_X-\operatorname{rank}H_Z.

For a tiling G=(V,E,F)G=(V,E,F) of a closed surface, qubits are placed on edges. The vertex-edge incidence matrix and face-edge incidence matrix provide the two parity-check matrices. Over F2\mathbb F_2, the orthogonality condition follows because the boundary of every face is a cycle:

∂1∂2=0.\partial_1\partial_2=0.

Equivalently, the cellular chain complex is

C2(G)→∂2C1(G)→∂1C0(G).C_2(G)\xrightarrow{\partial_2}C_1(G)\xrightarrow{\partial_1}C_0(G).

For an error x∈C1(G)x\in C_1(G), its syndrome is

s=∂1(x),s=\partial_1(x),

the set of vertices incident to an odd number of erroneous edges. Face boundaries form the ZZ-type stabilizer equivalence relation. The XX-error problem is described on the dual cellular complex.

The topological parameters follow from Euler characteristic,

χ=∣V∣−∣E∣+∣F∣.\chi=|V|-|E|+|F|.

The surface code has

k=2−χ.k=2-\chi.

For a closed orientable surface of genus gg, χ=2−2g\chi=2-2g, so

k=2g.k=2g.

The distance is the smaller of the primal and dual combinatorial systoles:

d=min⁡{csyst⁡(G),csyst⁡(G∗)}.d=\min\{\operatorname{csyst}(G),\operatorname{csyst}(G^*)\}.

A logical operator is therefore a cycle that is not a sum of face boundaries, either in the primal tiling or its dual. Local error strings create boundaries and remain stabilizer-equivalent to trivial errors; a sufficiently long noncontractible string implements a logical operation.

The same structure extends to arbitrary qudit dimension D≥2D\geq 2. For generalized Pauli operators,

X=∑j∈ZD∣j+1⟩⟨j∣,Z=∑j∈ZDωj∣j⟩⟨j∣,ω=e2πi/D,X=\sum_{j\in\mathbb Z_D}|j+1\rangle\langle j|, \qquad Z=\sum_{j\in\mathbb Z_D}\omega^j|j\rangle\langle j|, \qquad \omega=e^{2\pi i/D},

one has ZX=ωXZZX=\omega XZ. An oriented $2$-complex over ZD\mathbb Z_D yields vertex and face operators with orientation-dependent powers of XX and ZZ. The code-space dimension is exactly the cardinality of first homology,

K=∣H1(Σ)∣.K=|H_1(\Sigma)|.

For a closed orientable genus-gg surface, H1(Σ;ZD)≅ZD2gH_1(\Sigma;\mathbb Z_D)\cong\mathbb Z_D^{2g}, giving K=D2gK=D^{2g}. Composite DD can introduce torsion, so the code dimension need not always be a power of DD (Lei, 2021).

2. Geometries, parameters, and asymptotic tradeoffs

The planar surface code uses rough and smooth boundaries to encode logical qubits. A logical ZZ operator is a string joining appropriate rough boundaries, and a logical XX operator is a dual string joining smooth boundaries. For a square surface-code family of distance DD,

n□=2D2−2D+1n_{\square}=2D^2-2D+1

physical qudits encode one logical qudit. A diamond surface-code family uses

n⋄=D2n_{\diamond}=D^2

physical qudits and also has distance DD.

The asymptotic behavior of ordinary two-dimensional surface codes is

k=O(1),n=Θ(d2),d=Θ(n),k=O(1),\qquad n=\Theta(d^2),\qquad d=\Theta(\sqrt n),

so the rate vanishes. This is a consequence of the two-dimensional topological tradeoff

kd2≲n.kd^2\lesssim n.

For bounded-degree, bounded-face-size surface and color codes, a stronger form is

kd2≤C(log⁡k)2n,kd^2\leq C(\log k)^2n,

where CC depends only on the locality bound. The proof uses a smooth Riemannian realization of the tiling and Gromov’s systolic inequality. The genus is proportional to kk, the area is O(n)O(n), and the distance is bounded by primal and dual systoles. Consequently, any bounded-locality surface or color-code family with nonzero asymptotic rate satisfies

d=O(log⁡n).d=O(\log n).

Hyperbolic surface codes attain nonzero rate with logarithmic distance. Hyperbolic color codes provide an analogous family: finite quotients of regular hyperbolic tilings, followed by a double-cover construction that ensures face 3-colorability, have

d=Ω(log⁡n)d=\Omega(\log n)

and rate converging to

2(12−1ℓ−1m)2\left(\frac12-\frac1\ell-\frac1m\right)

when 1/ℓ+1/m<1/21/\ell+1/m<1/2. Thus logarithmic distance is asymptotically optimal at nonzero rate within these bounded-degree surface and color-code families (Delfosse, 2013).

The tradeoff is not universal for all quantum LDPC codes. Hypergraph-product codes can have constant nonzero rate and

d=Θ(n),d=\Theta(\sqrt n),

while homological constructions encoding one qubit can achieve distance of order

O ⁣(nlog⁡n).O\!\left(\sqrt{n\log n}\right).

The logarithmic restriction is therefore geometric: it applies to these two-dimensional topological code families rather than to quantum LDPC codes in general.

3. Color codes, hypermaps, and local equivalences

Color codes place qubits on vertices rather than edges. Their tilings must be trivalent and face-3-colorable. If HH is the face-vertex incidence matrix, then

HX=HZ=H.H_X=H_Z=H.

For a tiling GG, a color code has

n=∣V∣,k=4−2χ,n=|V|,\qquad k=4-2\chi,

and k=4gk=4g on an orientable genus-gg surface. Logical operators can be described through cycles in shrunk lattices. A local criterion states that if the faces incident to the support of a codeword form a planar subgraph, then the codeword lies in C⊥C^\perp; nontrivial logical operators must therefore detect the global topology.

Color codes can be decoded by projection onto three surface codes. A trivalent, face-3-colorable tiling gives a dual triangulation with three vertex colors. Each color defines a monochromatic surface-code subgraph, and a chain-complex morphism projects the color-code error and syndrome onto that surface code. Every color-code hyperedge projects to one edge in each of the three surface codes. The three surface corrections are combined and then lifted through a polynomial-time compatibility test. If the corrections do not form a liftable boundary, the decoder returns NO LIFTING.

For independent phase errors of probability pp, each projected surface edge has error probability

pproj=2p(1−p).p_{\mathrm{proj}}=2p(1-p).

If the three surface-code thresholds are pc(c)p_c(\mathbf c), the induced color-code threshold obeys

pc≥min⁡c∈{R,G,B}{12(1−1−2pc(c))}.p_c\geq \min_{\mathbf c\in\{R,G,B\}} \left\{ \frac12\left(1-\sqrt{1-2p_c(\mathbf c)}\right) \right\}.

For hexagonal color codes decoded by minimum-weight perfect matching on the three projected surface codes, the reported phase-error threshold is approximately

pc≃8.7%,p_c\simeq 8.7\%,

while the associated hexagonal surface-code threshold is approximately 15.9%15.9\% (Delfosse, 2013).

A stronger local equivalence holds for closed two-dimensional color codes. Contracting all faces of one color produces a surface-code lattice τc(Γ)\tau_c(\Gamma), and a color code on Γ\Gamma is locally Clifford equivalent to two copies of the corresponding surface code:

CC(Γ)≃SC(τc(Γ))⊗SC(τc(Γ)).\mathrm{CC}(\Gamma)\simeq \mathrm{SC}(\tau_c(\Gamma))\otimes \mathrm{SC}(\tau_c(\Gamma)).

The equivalence is invertible, locality-preserving, uses CNOT, Hadamard, and SWAP gates, and requires no ancillary qubits. It preserves the number of physical qubits. Independent noise on the color code, however, becomes correlated and nonuniform noise on the two surface-code copies, so an independent MWPM decoder need not be optimal. For the square-octagonal color code, the reported hard-decision MWPM threshold is approximately 5.3%5.3\% for bit-flip noise and 30.8%30.8\% for the improved erasure decoder (Aloshious et al., 2018).

Hypermap-homology codes provide another extension. Canonical hypermap codes are identical to surface codes after an explicit graph construction. Noncanonical hypermap codes are transformable into surface codes using CNOT gates; a basis transformation can be decomposed into at most n2n^2 elementary CNOTs. The transformation preserves encoded dimension but need not preserve distance, stabilizer locality, or stabilizer weight. Thus canonical hypermap codes do not constitute a distinct code family from surface codes, whereas noncanonical choices can alter physical parameters while remaining CNOT-equivalent (Sarvepalli, 2013).

4. Decoding and noise adaptation

For a surface code, decoding means finding an error representative with the measured syndrome, modulo stabilizer boundaries. Minimum-weight perfect matching pairs syndrome defects by minimum-length paths. The union of the paths gives a correction x~\tilde x satisfying

∂1(x~)=s.\partial_1(\tilde x)=s.

For hexagonal toric surface codes, MWPM using Edmonds’ algorithm and Blossom V gives a reported phase-error threshold of approximately

psurf≃15.9%.p_{\mathrm{surf}}\simeq 15.9\%.

Other decoding methods include union-find, belief propagation and ordered-statistics decoding, renormalization-group decoders, cellular automata, tensor-network decoders, neural-network decoders, and MaxSAT formulations. Their essential tradeoff is between likelihood performance, latency, computational complexity, and robustness to correlated or circuit-level noise (iOlius et al., 2023).

With faulty syndrome measurements, decoding becomes a space-time problem. Spatial edges represent data errors, temporal edges represent measurement errors, and detection events are changes between consecutive syndrome rounds. The decoder must distinguish a genuine data-error chain from an isolated measurement fault.

Noise tailoring changes the performance of a fixed surface-code geometry without changing its topological phase. Clifford-deformed surface codes apply independent single-qubit Clifford operators to the physical qubits. The code parameters, locality, and ordinary distance remain unchanged, but the Pauli composition of stabilizers and logical operators changes. Under biased noise, this can substantially alter logical failure rates. Effective distance d′d' measures the probability-weighted cost of the most likely logical operator rather than its ordinary Pauli weight. Random and translation-invariant Clifford-deformed families can outperform established XZZX and XY codes in selected finite-bias regimes, although several phase-diagram claims remain conjectural (Dua et al., 2022).

A related construction exchanges selected ZZ measurements for YY measurements, producing ZZZY surface codes. The resulting [[13,1,3]][[13,1,3]] and [[41,1,5]][[41,1,5]] codes retain the underlying surface-code parameters while adding syndrome information that distinguishes likely ZZ-error patterns. Decoding uses a preprocessing stage followed by MWPM. In the [[13,1,3]][[13,1,3]] code, the fraction of weight-two ZZ-patterns corrected is reported as

β2=0.987.\beta_2=0.987.

The method is designed for ZZ-dominated channels and maintains comparable behavior to ordinary surface codes under depolarizing noise (Forlivesi et al., 2024).

For highly biased noise, rectangular surface codes with gcd⁡(j,k)=1\gcd(j,k)=1, and odd-dimensional rotated codes, have especially favorable dominant-error properties. In the pure-YY representation, a standard j×kj\times k code has

dY=(2g−1)jkg2,g=gcd⁡(j,k),d_Y=\frac{(2g-1)jk}{g^2}, \qquad g=\gcd(j,k),

and 2g−12^{g-1} nontrivial YY-type logical operators. Coprime codes have dY=jkd_Y=jk and one such logical operator. Odd rotated codes have

dY=n,d_Y=n,

with the only nontrivial YY-type logical operator equal to Y⊗nY^{\otimes n}. The pure-dephasing threshold reaches

pc=12p_c=\frac12

with a polynomial-time decoder, and the subthreshold logical failure rate can scale as exp⁡[−αO(n)]\exp[-\alpha O(n)] rather than exp⁡[−αO(n)]\exp[-\alpha O(\sqrt n)] for square codes (Tuckett et al., 2018).

5. Variants beyond static two-dimensional codes

Folded surface codes introduce a mirror-dual two-layer geometry so that surface-code stabilizers retain their topological structure while supporting transversal or constant-depth logical Clifford gates. The construction applies to qudits of arbitrary dimension. Logical Hadamard and phase gates are implemented through paired operations on the two virtual layers, with stabilizer exchange between the mirror-dual XX- and ZZ-type structures. Folding itself has depth $6D-5$ for the square family, although the logical gates are constant depth after folding. The principal costs are deeper syndrome extraction, additional swaps, correlated errors, and the absence of a complete circuit-level threshold analysis (Moussa, 2016).

Three-dimensional surface codes retain qubits on edges, vertex XX-stabilizers, and face ZZ-stabilizers, but their excitations and logical operators change dimension. Magnetic excitations become flux strings, and one logical operator becomes membrane-like. A distance-dd three-dimensional patch uses O(d3)O(d^3) qubits; its logical ZZ is string-like while its logical XX has weight O(d2)O(d^2). A stack of three three-dimensional surface codes supports transversal CCZCCZ and CZCZ gates. The reported perfect-measurement threshold is approximately 3.3%3.3\%, with an asymmetric ZZ-error threshold of approximately 3.3%3.3\% and XX-error threshold of approximately 23.5%23.5\%. The architecture avoids magic-state distillation in the proposed three-dimensional settings, but requires three-dimensional connectivity and more complex syndrome extraction (Vasmer et al., 2018).

Dynamic surface codes modify the space-time pattern of syndrome extraction rather than fixing a static stabilizer layout. Experiments have demonstrated three variants: a hexagonal-lattice implementation, a walking surface code in which data and measurement roles alternate, and an iSWAP-based implementation. The distance-3-to-distance-5 error-suppression factors are

Λ35,hex=2.15(2),\Lambda_{35,\mathrm{hex}}=2.15(2),

Λ35,walk=1.69(6),\Lambda_{35,\mathrm{walk}}=1.69(6),

Λ35,iSWAP=1.56(2).\Lambda_{35,\mathrm{iSWAP}}=1.56(2).

The hexagonal implementation reduces the required local connectivity from four to three couplings per qubit; the walking implementation periodically measures and resets every qubit; and the iSWAP implementation replaces the conventional CNOT/CZ interaction family while using time-reversed schedules to compensate for dynamically distorted stabilizers (Eickbusch et al., 2024).

Subsystem surface codes replace directly measured high-weight stabilizers with lower-weight gauge operators. Generalized subsystem surface codes based on four-valent cellulations use weight-three XXXXXX and ZZZZZZ gauge checks, encode $2g$ logical qubits into $3v$ physical qubits, and decode by mapping the XX- and ZZ-error problems to two ordinary surface-code decoding graphs. A square-octagon subsystem code simulation reports a depolarizing-noise threshold of approximately

pth≃1.75%.p_{\mathrm{th}}\simeq1.75\%.

The principal tradeoff is reduced measurement weight at the cost of gauge freedom and more elaborate decoding (Gayatri et al., 2018).

6. Rate enhancement, higher-dimensional constructions, and practical realization

Several recent constructions augment surface-code patches with structured connectivity while retaining bounded-weight checks.

Long-range-enhanced surface codes concatenate classical LDPC codes with repetition codes and then apply a hypergraph product. They encode

⟦Θ(L2),K,Θ(L)⟧\llbracket \Theta(L^2),K,\Theta(L)\rrbracket

with

Θ(LK)\Theta(L\sqrt K)

long-range stabilizers. A lower-bound argument shows that adding logical qubits while preserving surface-code distance d∼nd\sim\sqrt n requires Ω(d)\Omega(d) nonlocal checks. The construction is intended for trapped ions and reconfigurable neutral-atom arrays. Simulations indicate that such codes can outperform conventional surface-code copies under noisy syndrome measurements, with a representative rate k/n=4/244k/n=4/244 and break-even behavior around operation fidelities of approximately 99.5%99.5\% (Hong et al., 2023).

Lift-connected surface codes apply the lifted-product construction to repetition-code parity checks. The resulting codes are stacks of surface-code patches interconnected by neighboring-layer links. Their parameters are

[[n,k,d]]=[[((ℓ+1)2+ℓ2)L, L, min⁡(L,2ℓ+1)]].[[n,k,d]] = \left[ \left[ \big((\ell+1)^2+\ell^2\big)L,\, L,\, \min(L,2\ell+1) \right] \right].

They are (6,6)(6,6)-QLDPC codes: stabilizer weight and qubit degree are bounded by six. For selected finite-size comparisons, LCS codes have lower logical error rates than disconnected surface-code copies with the same [[n,k,d]][[n,k,d]] parameters. Reported code-capacity pseudo-thresholds include approximately 8.7%8.7\% for a [[39,3,3]][[39,3,3]] LCS code compared with approximately 6.4%6.4\% for three [[13,1,3]][[13,1,3]] surface codes. Phenomenological-noise thresholds are approximately 4.6%4.6\% and 3.0%3.0\%, respectively, in that comparison (Old et al., 2024).

Layer codes geometrize arbitrary CSS codes in three spatial dimensions. Each input qubit becomes an xzxz-oriented surface-code layer, each XX-check becomes an xyxy-oriented layer, and each ZZ-check becomes a yzyz-oriented layer. Local defect junctions implement the input-code relations. The output has maximum stabilizer weight six and parameters

[[n,k,d]]⟼[[Θ(nnXnZ), k, Ω ⁣(dwmin⁡(nX,nZ))]].[[n,k,d]] \longmapsto \left[ \left[ \Theta(nn_Xn_Z),\, k,\, \Omega\!\left(\frac{d}{w}\min(n_X,n_Z)\right) \right] \right].

For good CSS LDPC inputs, this gives

[[Θ(L3),Θ(L),Θ(L2)]],[[\Theta(L^3),\Theta(L),\Theta(L^2)]],

which achieves the optimal three-dimensional topological scaling. The construction also yields a polynomial energy barrier for suitable input families, but it does not establish a finite-temperature self-correcting quantum memory or provide a complete decoder (Williamson et al., 2023).

Measurement-based quantum computation provides another implementation route. A two-dimensional cluster state is prepared using symmetric controlled-ZZ gates, selected qubits are measured in the XX- and ZZ-bases, and the remaining qubits form a surface-code block. The reported constructions include a [[5,1,2]][[5,1,2]] code from a 3×33\times3 cluster and a [[13,1,3]][[13,1,3]] code from a 5×55\times5 cluster. Measurement outcomes produce known Pauli byproducts that can be tracked in a Pauli frame (Srivastava et al., 2023).

At the architecture level, surface codes therefore form a platform rather than a single fixed code. Their common invariant is the relation between local stabilizer checks, chain complexes, topological excitations, and nontrivial cycles. Geometry, boundary conditions, local Clifford dressing, gauge structure, dynamic schedules, higher-dimensional defect networks, and structured interconnections can alter rate, distance, gate transversality, noise tolerance, decoding complexity, and hardware requirements without abandoning the surface-code framework.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Surface Codes.