Toric Code and Topological Order
The toric code is the model that taught physics what "topological order" means. Alexei Kitaev wrote it down in 1997 as the simplest thing that could work: put one qubit on every edge of a square lattice, wrap the lattice on a doughnut, and add a Hamiltonian built entirely from four-body checks that all commute. Because the terms commute, there is no interacting many-body problem to diagonalize — the ground space and the entire spectrum fall out algebraically. Yet this featureless "loop soup" displays every symptom of a genuinely new phase of matter that the twentieth-century theory of order, built on symmetry breaking and local order parameters, cannot describe. What makes it new is that the ground state is degenerate, and the degeneracy counts the topology of the surface rather than any local pattern. On a torus there are exactly four ground states, indistinguishable by every local measurement, differing only through loop operators that wind the handles. Information written into that space is invisible to local noise: to corrupt it an error must wrap an entire handle, a conspiracy exponentially unlikely in the system size. The excitations above the gap are point-like anyons — charges e, fluxes m, and their fermionic composite ε — and dragging one around another multiplies the state by −1, the unmistakable signature of statistics that live only in two dimensions. The same object wears three faces at once, and they are exact identities rather than analogies: a ℤ₂ lattice gauge theory at its deconfined point, the smallest topological error-correcting code and direct parent of the surface code now running on real hardware, and a microscopic realization of an abelian anyon theory. This article builds all three from the commuting checks, and marks the road on to non-abelian braiding and universal topological quantum computation.
- The toric code is Kitaev's exactly solvable stabilizer model: one qubit per edge of a lattice on a torus, with commuting vertex checks A_v = ∏ X_e and plaquette checks B_p = ∏ Z_e.
- Its ground space on a genus-g surface is 4^g-fold degenerate — a locally indistinguishable code space that stores 2g logical qubits in homological (topological), not local, degrees of freedom.
- Excitations are point-like anyons: charges e on violated vertices and fluxes m on violated plaquettes, with mutual braiding statistics R(e,m) = −1 and a composite fermion ε = e × m.
- Logical operators are noncontractible loops; the code distance equals the lattice size L, so sub-threshold errors are suppressed exponentially in d.
- As a memory it is a weight-4 stabilizer code decodable by minimum-weight perfect matching, and it is the conceptual seed of the surface code and of topological quantum computation.
- Topological order means the degeneracy and anyon content are universal invariants stable to any local perturbation — there is no local order parameter, only long-range entanglement with universal term γ = ln 2.
- Key idea: because every vertex and plaquette check commutes, the ground space is the simultaneous +1 eigenspace of all of them; the leftover degeneracy is fixed not by any local term but by the homology of the surface, and excitations are exactly the localized defects where individual checks read −1.
Because the vertex and plaquette stabilizers all commute, the ground space is the simultaneous +1 eigenspace of every check; the residual degeneracy is fixed not by any local term but by the homology of the surface, and excitations are exactly the localized defects where individual stabilizers are violated.
Where this lives today
The toric code stopped being only a thought experiment around 2021, when Google's superconducting processor prepared a toric-code ground state and braided its anyons to read out the −1 statistics directly, and a Harvard–MIT Rydberg-atom array probed the same ℤ₂ topological order on a programmable simulator. The engineering descendant — the surface code, the toric code cut open onto a plane with boundaries — is the leading candidate for fault-tolerant quantum computing, and in 2023 Google reported that a distance-5 logical qubit outperformed a distance-3 one: the first demonstration that error rates fall, rather than rise, as the code is scaled up. Decoding those weight-4 syndromes in real time, by minimum-weight matching or newer union-find and neural decoders, is now an active systems problem. On the theory side the toric code remains the reference point — the trivial anchor of the anyon-model classification, whose γ = ln 2 has been extracted numerically, and the launch pad for the non-abelian generalizations (Fibonacci, Ising) that would make braiding alone universal.
The physical picture
Picture a square grid drawn on the skin of a doughnut, one qubit on every edge. The vertex check A_v asks, in the X-basis, "is the number of flipped edges meeting at this vertex even?"; the plaquette check B_p asks the dual question, in the Z-basis, around each little square. The ground state satisfies every check at once: in the Z-basis it is the equal superposition of all configurations in which the flipped edges form closed loops — a fluctuating quantum soup of closed strings. Every closed loop is free, every open string costs energy, and so the state has no local pattern at all. It is featureless to any local probe yet globally entangled, and that combination is the whole novelty. The first figure shows why every check commutes, the algebraic fact on which the exact solvability rests. A vertex star and a plaquette that touch it are both four-body operators, but they overlap on exactly two edges; on each shared edge an X meets a Z and they anticommute, contributing −1, and two of them multiply back to +1. Every pair of checks in the whole lattice therefore commutes, so they can be simultaneously diagonalized and the ground state is pinned by setting each to +1.
Break a closed loop and you leave two loose ends: each is a violated vertex — an e-particle — and the pair costs a fixed energy 4J_e no matter how far apart the ends are. The dual construction, an open string on the dual lattice, creates a pair of m-particles on violated plaquettes. An e and an m ignore one another locally, but carry an m on a closed loop that encircles an e and the wavefunction picks up exactly −1. That phase is topological: it depends only on whether the loop links the charge, not on the loop's shape or length. The second figure follows one e-string and one encircling m-loop and reads off the −1.
The core equations
The Hamiltonian is a sum of commuting four-body checks — this is the whole model, and everything else is a consequence of it. Vertex (star) operators are products of Pauli-X, plaquette operators are products of Pauli-Z, and the ground state is the state that reads +1 on every one of them.
where: — vertex/star operator, product of on the four edges meeting at vertex ; — plaquette operator, product of on the four edges bounding plaquette ; — Pauli operators on the qubit at edge ; — coupling constants. Reading: minimize the energy by making every simultaneously — possible only because they commute. Simultaneous diagonalization requires that all checks commute. Same-type checks trivially do; the only nontrivial case is a vertex touching a plaquette, and they share exactly two edges, so the two anticommutations cancel.
where: — any vertices; — any plaquettes; — the set of edges shared by and , with (disjoint) or (adjacent). Reading: two shared edges each give a factor , and , so the checks form a commuting stabilizer group. Two products of checks equal the identity, because every edge is shared by exactly two vertices and bounds exactly two plaquettes. These global relations remove one independent check from each family and are what leaves room for logical qubits.
where: each edge appears in exactly two vertex stars, so every occurs twice and squares to ; likewise each edge bounds two plaquettes. Reading: the vertex checks satisfy one relation and the plaquette checks satisfy one, leaving independent generators. Counting qubits against independent checks fixes the number of encoded logical qubits, and hence the ground-state degeneracy, on the torus.
where: — linear lattice size, giving vertices, plaquettes, edges; from the two global relations; — logical qubits. Reading: independent of , the torus stores exactly two logical qubits in four degenerate ground states. The two logical qubits are addressed not by any local operator but by noncontractible loop operators winding the handles of the torus. A logical runs along a direct-lattice cycle; the partner runs along a dual-lattice cycle crossing it once.
where: — a noncontractible cycle of the direct lattice around handle ; — a noncontractible dual cycle crossing an odd number of times; — code distance, the minimum weight of a logical operator. Reading: commute with every check but anticommute with each other, so they act as genuine logical Paulis; the shortest one has length , so the code distance grows with the system. Excitations are anyons living at the ends of open strings, and their defining feature is mutual statistics: braiding an fully around an multiplies the state by . Their fusion algebra closes on four particle types.
where: — full-braid (monodromy) phase; — electric charge on a violated vertex, born from an open -string; — magnetic flux on a violated plaquette, from an open dual -string; — the composite, a fermion. Reading: all four anyons are their own antiparticle, and the only nontrivial braiding is the – mutual . Finally, the topological order leaves a universal fingerprint in the entanglement of any region: an area law with a constant, shape-independent deficit set by the total quantum dimension.
where: — von Neumann entropy of a disk region ; — boundary length; — nonuniversal area-law coefficient; — universal topological entanglement entropy; — total quantum dimension, with for each of the four abelian anyons. Reading: is a number no short-range-entangled state can produce, and it certifies the topological order.
The goal is to show that the four-fold ground-state degeneracy of the toric code is not a coincidence but a count of the topology of the surface. We do this by comparing the dimension of the full Hilbert space against the number of independent constraints imposed by the stabilizers, then identifying the leftover freedom with the first ℤ₂ homology of the torus. The punchline is that the degeneracy is 4^g, an invariant of the genus g alone, so no local deformation of the lattice or the couplings can lift it — the essence of what "topological" means here.
Step 1. Count the raw Hilbert space: one qubit per edge and 2L² edges on an L×L torus give dim ℋ = 2^(2L²). Why: this is the arena; imposing the checks will carve the ground space out of it.
Step 2. Count independent stabilizers. There are L² vertex checks and L² plaquette checks, but equation (3) says ∏_v A_v = ∏_p B_p = 𝟙, one relation in each family, leaving N_indep = (L²−1) + (L²−1) = 2L²−2. Why: a relation among generators means they are not all independent, so they constrain fewer dimensions than their naive count.
Step 3. Each independent, commuting stabilizer with eigenvalues ±1 that is not a product of the others halves the space when fixed to +1, so dim ℋ_gs = 2^(2L²) / 2^(2L²−2) = 2² = 4. Why: projecting onto the +1 eigenspace of an independent Pauli operator is a rank-halving projector, and independence lets the halvings multiply.
Step 4. Identify the leftover 2² with homology. The operators that commute with every check but are not products of checks are exactly the noncontractible loops winding the two independent cycles of the torus, i.e. the generators of H₁(T², ℤ₂) = ℤ₂ × ℤ₂; on a genus-g surface this gives 4^g. Why: a contractible loop is a product of the enclosed plaquettes (hence a stabilizer and trivial on the ground space), so only winding loops act nontrivially, and their number is a topological invariant. *As a concrete check: for L = 3, dim ℋ = 2^18, N_indep = 16, and dim ℋ_gs = 2² = 4 = 4^1, consistent with k = 2 from equation (4).*
Go deeper · Derivation B · 2 minThe ground state as a fluctuating loop gas
The goal is to write the ground state explicitly and see that it is an equal-weight superposition of all closed-loop configurations of one type — the picture that makes "featureless yet long-range entangled" concrete. We work in the Z-basis, use the plaquette checks to force closed loops, and use the vertex checks to symmetrize over them. The result exhibits the ground state as a projector applied to a reference product state and shows why the four ground states differ only by a global winding parity that no local operator can read.
Step 1. Read B_p in the Z-basis. B_p = +1 demands an even number of flipped edges around every plaquette, which is exactly the statement that the flipped edges form closed loops with no loose ends. Why: an odd plaquette would mean a string terminates inside it — a defect — so the plaquette constraint is the "closed-loop" condition.
Step 2. Build the symmetrizer from the vertex checks. The operator ∏_v (𝟙 + A_v)/2 projects onto the joint +1 eigenspace of all stars; because the A_v commute, the product is an average over the abelian group G they generate. Why: (𝟙 + A_v)/2 is the projector onto A_v = +1, and multiplying commuting projectors averages the state over all products of stars.
Step 3. Apply it to the empty configuration to get |ψ₀⟩ = ∏_v (𝟙 + A_v)/2 |00⋯0⟩ ∝ Σ_{ℓ} |ℓ⟩, the equal superposition over every loop configuration ℓ reachable by adding contractible loops. Why: each A_v flips the four edges of a star, i.e. adds a small contractible loop, so sweeping over G generates all loops in one homology class with equal amplitude.
Step 4. Distinguish the four ground states. They correspond to the four choices of winding parity around the two handles; each is an equal loop gas built on a different homology class, and because a local operator changes only a contractible piece of any loop, none can tell them apart. Why: this local indistinguishability of globally distinct states is precisely topological order, and it is what protects the encoded information.
Go deeper · Derivation C · 1 minThe energy gap and deconfined anyons
The goal is to compute the cost of an excitation and to show that anyons are created in pairs whose energy is independent of their separation — the deconfinement that stabilizes the phase. We flip a single check, read off the cost from the Hamiltonian, then act with an open string operator to see that only the endpoints carry energy. The separation-independence is the physical content: charges are free, the spectrum is gapped, and the gap protects the ground-space degeneracy against weak local perturbations.
Step 1. Cost of one violated check. Flipping a single A_v eigenvalue from +1 to −1 changes its term in H by −J_e(−1) − (−J_e(+1)) = 2J_e. Why: the Hamiltonian rewards +1 and penalizes −1 by ±J_e, so one violation raises the energy by 2J_e.
Step 2. Strings create pairs. An open Z-string W^Z(γ) = ∏_{e∈γ} Z_e anticommutes with A_v exactly at its two endpoints, flipping those two stars to −1 and creating two e-particles, for a total cost ΔE = 2 × 2J_e = 4J_e. Why: Z and X anticommute, and a star sees the string only where it terminates, so only the two endpoints are excited.
Step 3. Energy is independent of separation. Lengthening γ moves the endpoints apart but never changes the number of endpoints, so ΔE = 4J_e regardless of how far the two e's are dragged. Why: no string tension means the charges are deconfined — the defining feature of the topological (rather than confined) phase of the ℤ₂ gauge theory.
Step 4. The gap protects the code. A nonzero gap ∼ min(J_e, J_m) means local perturbations mix the ground space with excited states only at high order, splitting the degeneracy by at most ∼ e^(−L/ξ). Why: a robust gap converts topological degeneracy into an exponentially good quantum memory, the operational payoff of the model.
Limiting cases
The toric code sits at specific corners of several broader classifications, and reading them off is the fastest way to place it in the landscape of topological phases and codes.
| Case | Result | Meaning |
|---|---|---|
| Genus dependence | Sphere (g=0): unique ground state, no logical qubits. Torus (g=1): 4-fold, 2 logical qubits. Genus g stores 2g logical qubits. | |
| Abelian, not universal | braiding ⇒ Clifford only | Anyons are abelian; braiding yields only Clifford gates. Universality needs injected magic states — unlike Fibonacci anyons. |
| Zero-temperature memory | In 2D there is no finite-T topological order: thermal anyons diffuse freely and corrupt the memory, so it is NOT self-correcting. The 4D toric code is. | |
| Continuum / IR limit | The low-energy theory is a ℤ₂ (level-2 BF) topological field theory; its degeneracy and braiding reproduce the lattice exactly. | |
| Planar patch with boundaries | surface code | Cutting the torus open onto a plane with rough/smooth edges gives the surface code — same physics, hardware-friendly geometry. |
Worked examples
1 · The distance-3 toric code, end to end (fully worked)
Take the smallest interesting torus, L = 3. Count its qubits, checks, logical qubits, ground states, code distance, and excitation gap, then estimate how the logical error rate improves as the distance grows.
Step 1. Qubits and checks. A 3×3 torus has L² = 9 vertices, 9 plaquettes, and 2L² = 18 qubits. There are 9 + 9 = 18 checks, but the two global relations of equation (3) make N_indep = 2L²−2 = 16. This is the raw bookkeeping the whole code rests on.
Step 2. Logical qubits and degeneracy. From equation (4), k = 18 − 16 = 2 logical qubits, so dim ℋ_gs = 2² = 4 ground states — independent of L, as promised. The two logical qubits live on the two handles of the torus.
Step 3. Distance and gap. The shortest noncontractible loop wraps three edges, so the code distance is d = L = 3: it can correct any ⌊(d−1)/2⌋ = 1 arbitrary single-qubit error. Creating an e-pair or m-pair costs ΔE = 4J, and the entanglement fingerprint is γ = ln 2 ≈ 0.693. A distance-3 code is the smallest that corrects one error — the workhorse of early hardware demonstrations.
Step 4. Error suppression with distance. Below threshold the logical error scales as p_L ∼ (p/p_th)^⌈d/2⌉. With a physical error rate p = 10⁻³ and threshold p_th ≈ 10⁻² (circuit-level, ∼1%), each step d = 3 → 5 → 7 multiplies p_L by (p/p_th) = 0.1: p_L ≈ 10⁻², then 10⁻³, then 10⁻⁴. Key results: 18 qubits, 16 checks, 4 ground states, d = 3 corrects 1 error, gap 4J, and every +2 in distance divides the logical error by ten.
2 · The braiding phase from a single anticommuting edge
Show explicitly that carrying an m-particle once around an e-particle multiplies the state by −1, and note what changes on a higher-genus surface.
Step 1. Set up the operators. The e sits at the end of an open Z-string W^Z(γ) = ∏_{e∈γ} Z_e. Encircling it with an m means acting with W^X(γ) = ∏_{e∈γ} X_e on a closed dual loop γ that links γ exactly once. A "full braid" is topologically a closed loop of one particle around the other.*
Step 2. Count crossings. A closed dual loop linking the string once shares exactly one edge with γ. On that single shared edge X and Z anticommute; on every other edge the operators are disjoint and commute. The linking number, not the geometry, sets the count.
Step 3. Read off the phase. Therefore W^X(γ) W^Z(γ) = (−1)^(|γ∩γ|) W^Z(γ) W^X(γ) = (−1)^1 W^Z(γ) W^X(γ), so the braided state differs from the original by R(e,m) = −1, independent of the loop's shape or size — the defining anyonic mutual statistics. Contrast: e around e, or m around m, shares an even number of edges and gives +1.
Step 4. Higher genus. On a genus-2 surface the same counting gives dim ℋ_gs = 4² = 16, storing 2g = 4 logical qubits; the braiding rules are unchanged because they are local, but the number of independent noncontractible loops doubles. Key results: one crossing ⇒ R(e,m) = −1 exactly; genus 2 ⇒ 16-fold degeneracy and 4 logical qubits.
Physics of the portrait
The toric code is one person's idea carried almost intact from a 1997 preprint into the error-correcting hardware of the 2020s. It is worth knowing whose idea, and why it reframed a whole field.
Origins · 1 minAlexei Kitaev and how this was discovered
Alexei Kitaev trained in the Soviet physics tradition and made his decisive contribution while at Microsoft Research and later Caltech. In 1997 he circulated "Fault-tolerant quantum computation by anyons," proposing that quantum information could be protected not by actively correcting errors but by storing it in the topology of a many-body ground state where local noise simply cannot reach it. The toric code was his minimal illustration: exactly solvable, built from commuting checks, and displaying anyons, ground-state degeneracy, and long-range entanglement all at once. The same paper sketched the grander program — non-abelian anyons whose braids are quantum gates — later proved universal by Freedman, Larsen, and Wang. Kitaev went on to the 2006 honeycomb spin-liquid model and the Sachdev–Ye–Kitaev model of quantum chaos, and with Preskill defined the topological entanglement entropy γ = ln 𝒟 that turned "topological order" from a slogan into a measurable number. His signature move is the toy model chosen so precisely that an exact solution still contains all the physics — the toric code being the canonical example, now the backbone of the surface codes running on real quantum processors.
Going further
Texts and papers. Kitaev, "Fault-tolerant quantum computation by anyons," Ann. Phys. 303, 2 (2003) · Nielsen & Chuang, Quantum Computation and Quantum Information, §10 (stabilizer codes) · Preskill, Lecture Notes for Physics 219, Ch. 9 (topological quantum computation) · Kitaev, Shen & Vyalyi, Classical and Quantum Computation, Ch. 15 · Watrous, The Theory of Quantum Information (channel and code formalism) · Dennis, Kitaev, Landahl & Preskill, "Topological quantum memory," J. Math. Phys. 43, 4452 (2002) · Kitaev & Preskill, "Topological entanglement entropy," PRL 96, 110404 (2006). The key numbers in this article are: (1) adjacent vertex/plaquette share exactly two edges, giving (−1)² = +1; (2) 2L² edges, 2L²−2 independent checks, dim ℋ_gs = 4 = 4^g for g = 1; (3) braiding phase −1 from a single anticommuting edge; (4) pair gap 4J; (5) total quantum dimension 𝒟 = √(1²+1²+1²+1²) = 2 and γ = ln 2. The distance-3 error-suppression figures use a threshold p_th ≈ 1%; no nonstandard numbers are asserted.
Prerequisites. Stabilizer formalism · Pauli group and Clifford algebra · Homology and the torus · Anyons and fractional statistics. Leads to. Topological quantum computation · Non-abelian braiding and fusion rules · Fibonacci and Ising anyons · Magic-state distillation.
Ask the tutor: ask me to walk you through the star–plaquette commutation edge by edge, count the ground states on a genus-2 surface, or trace how the toric code becomes the surface code on a chip.
Why is the ground state four-fold degenerate on a torus but unique on a sphere?
Because the degeneracy counts noncontractible loops, and a sphere has none. On the sphere every closed loop can be shrunk to a point, so every loop operator is a product of the plaquettes it encloses — a stabilizer, trivial on the ground space — and the state is unique. The torus has two independent cycles that cannot be contracted; the loop operators winding them commute with all checks but are not products of checks, so they act nontrivially and generate a 2² = 4 dimensional ground space. In general the count is 4^g for genus g, which is why the degeneracy is a topological invariant rather than an accident of the Hamiltonian.
What exactly is "topological order," and how is it different from ordinary order?
Ordinary phases are told apart by a local order parameter — magnetization, density, a broken symmetry you can measure in a small region. Topological order has none: the toric-code ground states are identical under every local measurement, with the same correlations everywhere, yet they are globally distinct states that no local operator can connect. What distinguishes them is long-range entanglement, quantified by the universal term γ = ln 2 in the entanglement entropy, and their hallmark is a ground-state degeneracy fixed by the topology of the surface together with anyonic excitations. It is order without a pattern — invisible locally, robust globally.
Is a noncontractible loop operator a symmetry of the toric code?
It commutes with the Hamiltonian, so in that narrow sense yes, but calling it a symmetry misses the point. It is not in the stabilizer group — no product of stars and plaquettes equals a loop that winds the torus — so it does not stabilize the ground states; instead it maps one ground state to another. In coding language it lives in the normalizer of the stabilizer group but outside the group itself, which is the exact definition of a logical operator. That is why it can store information: acting with it changes the encoded logical qubit without leaving the ground space or costing any energy.
Why can't braiding the toric-code anyons give a universal quantum computer?
Because the toric-code anyons are abelian: braiding only ever multiplies the state by a phase, and translated into logical gates this yields at most the Clifford group — CNOT, Hadamard, phase gate — which is efficiently simulable classically and therefore not universal. Universality needs a non-Clifford gate such as the T gate, and in the surface-code setting that gate comes from injecting and distilling "magic states," not from braiding. Non-abelian anyons like Fibonacci change this: their braids are non-commuting unitaries dense in the relevant group, so braiding alone becomes universal — exactly why the toric code "leads to" those richer theories.
Why is the 2D toric code useless as a passive, always-on memory?
Passive storage would need an energy barrier that grows with system size, so every error path is thermodynamically suppressed. The 2D toric code has no such barrier: its excitations are point-like anyons with a fixed creation energy independent of how far they travel, so a thermal e-pair can wander freely around a handle and recombine, causing a logical error at no extra cost. At any T > 0 these anyons appear at finite density and diffuse — there is no finite-temperature topological order in 2D. A growing barrier, hence genuine self-correction, needs confined defects or higher-dimensional membranes, as in the 4D toric code.
How does the abstract toric code relate to the surface codes running on real hardware?
The surface code is the toric code with a boundary. Cut the torus open and lay it flat on a planar patch, terminate the lattice with two "rough" and two "smooth" edges, and you get a code with the same weight-4 stabilizers, the same anyons, and the same distance-L protection — but on a simply connected chip you can actually fabricate, and encoding one logical qubit per patch instead of two per handle. Everything transfers: syndromes are anyon positions, decoding pairs them by minimum-weight matching, and the logical error falls exponentially with distance below threshold. When Google reports a distance-5 logical qubit beating a distance-3 one, that is the toric code's exponential suppression, measured.