Computing Library › Quantum Error Correction
Quantum Error Correction

The Toric Code and Homology

Kitaev's toric code places qubits on a torus and encodes logical information in topologically nontrivial loops, connecting error correction to homology.

A code on a surface

The toric code is defined by putting one physical qubit on every edge of a square lattice drawn on a torus. Two families of stabilizers are used: a vertex operator A(v), the product of Pauli X on the four edges meeting at a vertex, and a plaquette operator B(p), the product of Pauli Z on the four edges bounding a face. Every A(v) commutes with every B(p) because any vertex and plaquette share either zero or two edges, so the Pauli operators anticommute an even number of times.

The simultaneous +1 eigenspace of all A(v) and B(p) is the code space. On an L-by-L torus there are 2L^2 qubits and 2L^2 stabilizers, but two constraints are redundant (the product of all A equals identity, likewise all B), leaving two logical qubits.

Kronos motion — error correction

Loops and homology

Logical operators are Pauli strings that commute with every stabilizer but are not themselves products of stabilizers. Geometrically these are closed loops of Z along lattice edges, or closed loops of X on the dual lattice, that wind around the torus. A loop that bounds a region is a product of plaquettes and acts trivially; only loops in nontrivial homology classes act as logical X and Z. This is exactly the first homology group of the torus, which has two generators.

The toric code is the archetype of topological quantum error correction. Its planar cousin, the surface code, replaces periodic boundaries with edges so the code can be built on a real chip, at the cost of encoding one logical qubit instead of two.