Toric code
The toric code is a topological stabilizer model on a periodic two-dimensional lattice whose noncontractible loops encode logical information.
On this page
Explanation and significance
The torus is a mathematical boundary condition, not a demand to fabricate a doughnut-shaped chip. Periodic topology makes the distinction between local checks and global logical loops especially clear. Planar surface codes modify the boundary structure for different physical implementations.
Mechanism and mathematical structure
On an L-by-L square lattice with qubits on edges, there are n=2L² qubits. Vertex X checks and plaquette Z checks commute because their supports overlap in zero or two edges. Products of all vertex checks and of all plaquette checks each equal identity, giving two global dependencies. For the standard connected torus, independent-check count is 2L²-2 and k=2.
Fully worked reference example
For L=3, n=18 and the independent stabilizer rank is 16, leaving k=18-16=2 logical qubits. A Z string wrapping once around one periodic direction has weight three and commutes with every local check but is not a product of local plaquettes. A contractible loop enclosing one plaquette is a stabilizer and acts trivially on the code. A complementary X loop intersects the Z loop once and anticommutes, supplying the logical conjugate.
Limits and misconceptions
Periodic simulations can differ from planar devices through boundaries and logical-path multiplicity. A toric-code memory threshold cannot be transferred unchanged to a planar logical-gate circuit. In two-dimensional thermal environments, topological ground-state structure alone does not automatically provide indefinitely self-correcting storage.
Scientific relationships
Is a topological stabilizer code. Historically informs surface-code constructions. Is distinct from intrinsic anyonic hardware, though the model also has an excitation interpretation.
Boundary operators explain the topology
A binary edge set represents a Z-error string. Its boundary is the set of vertices incident on an odd number of selected edges, which is exactly the violated X-check syndrome. The boundary of a plaquette boundary is empty: each corner meets two selected edges. In chain-complex notation this is ∂1∂2=0. Adding a plaquette boundary to an error therefore changes its physical support without changing its syndrome or logical action.
Closed strings have zero boundary. Some are sums of plaquette boundaries and hence stabilizers; others wind around the torus and represent logical operations. The quotient of closed strings by plaquette boundaries is the first homology group over binary coefficients. For a torus it has two independent generators, corresponding to the two encoded logical Z operators. This mathematical quotient expresses the same physical equivalence used by a decoder when it groups errors into logical classes.
An explicit coordinate convention
For an L-by-L periodic lattice, label horizontal edges h(x,y)=yL+x and vertical edges v(x,y)=L²+yL+x, with x,y in {0,…,L−1}. Coordinates wrap modulo L. An edge h(x,y) joins vertex (x,y) to (x+1,y); v(x,y) joins (x,y) to (x,y+1). A plaquette at (x,y) contains h(x,y), v(x+1,y), h(x,y+1), and v(x,y). These definitions remove ambiguity about wrapped boundaries.
At L=3, a horizontal Z loop along y=0 acts on q0,q1,q2. A conjugate X loop on the dual lattice crosses the horizontal edges q0,q3,q6. Their physical supports overlap only at q0, so the two operators anticommute. Another pair uses a vertical Z loop and a transverse dual X loop. The horizontal and vertical logical pairs can be chosen so that operators belonging to different encoded qubits commute.
Counting with the global dependencies retained
For L=4 there are sixteen vertices, thirty-two edges, and sixteen plaquettes. The product of all vertex checks is identity because each edge appears twice; the same holds for all plaquette checks. Each family therefore has rank fifteen, giving thirty independent stabilizers and k=32−30=2. The Euler characteristic V−E+F=0 is consistent with the torus topology. Treating all thirty-two printed checks as independent would incorrectly predict no logical qubits.
Redundant checks can still be experimentally useful. They constrain syndrome consistency even though they do not remove additional code-space dimensions. With perfect measurements, the number of violated vertices is even. With noisy syndrome readout, an apparent odd number signals that the observed record need not be a valid instantaneous data-error boundary. Repeated measurements supply time information for resolving that inconsistency.
Distance is not an increasing thermal barrier
Consider the commuting Hamiltonian H=−JΣ_v A_v−JΣ_p B_p with J>0. A single Z on an edge flips the eigenvalues of its two adjacent vertex terms. Each flip raises the energy by 2J, giving a pair-creation cost 4J. Extending the string moves an endpoint without increasing the number of violated checks, so the energy remains at that pair cost even when the string becomes long.
A sequence of local errors can therefore grow a noncontractible string through states with an energy cost independent of L. The final closed logical string has no violated checks and returns to the ground-energy sector. Increasing L raises the minimum number of local steps required, but not the maximum energy encountered along this path. This is the key distinction between code distance and the energy barrier relevant to passive thermal protection in this two-dimensional model.
Finite-temperature pair creation, diffusion, and annihilation determine memory behavior together. A high pair-creation barrier can suppress the initial rate without supplying indefinite protection as the system size increases. Active repeated syndrome extraction and classical decoding change the storage protocol and should not be conflated with passive equilibrium stability.
Decoding and physical realization
Two paths joining the same defects can differ by a logical winding. A shortest-path decoder chooses a representative using its assigned edge weights, while maximum-likelihood logical decoding compares the total probability of all paths in each winding class. Multiplicity can matter when many slightly longer paths compete with one shorter path. Measurement faults add a time direction to the decoding problem; a two-dimensional perfect-measurement calculation does not specify the threshold of the resulting circuit.
The L = 3 example identifies opposite lattice edges and supports two conjugate logical loops. Local errors can then move a pair of defects apart at constant excitation energy 4J. Thus larger spatial distance does not automatically raise the thermal barrier. These are features of the toric-code model, independent of whether a particular device realizes protected anyonic hardware.
Why a single endpoint is forbidden on the torus
Summing all vertex syndrome bits modulo two gives zero for every edge-error pattern because each selected edge contributes twice. This is an algebraic conservation law in the closed periodic geometry. A planar code boundary can absorb an endpoint, so a valid planar syndrome may contain a single interior defect connected to a boundary. Using a periodic decoder on that planar problem would impose the wrong parity constraint. Conversely, adding fictitious boundaries to a torus can allow a decoder to terminate strings where no physical termination exists. The boundary model therefore changes the valid recovery classes, not merely the appearance of a lattice drawing.
Sources
Verification scope
Citation identity checked ·
Theoretical anyon framework; no inference of present experimental Majorana certification.
Verification scope
Citation identity checked ·
Architecture and surface-code tutorial; numerical thresholds remain model-specific.