|q⟩ Bad Qubits

advanced · Physics · Surface Codes & Topological Codes

The Toric Code

Kitaev's toric code is the foundational topological code. It lives on a square lattice wrapped onto a torus, with one qubit on every edge. Two families of mutually commuting, geometrically local stabilizers define a code space, and the global topology of the torus endows that space with exactly k=2k=2 protected logical qubits. This lesson sets up the lattice, the operators, and the bookkeeping.

The lattice and where the qubits live

Take an L×LL \times L square lattice with periodic boundary conditions in both directions — a discrete torus. Place one physical qubit on each edge of the lattice. An L×LL \times L torus has L2L^2 vertices, L2L^2 plaquettes (faces), and 2L22L^2 edges, so

n=2L2physical qubits.n = 2L^2 \quad \text{physical qubits}.

(Euler's formula VE+F=0V - E + F = 0 for the torus is satisfied: L22L2+L2=0L^2 - 2L^2 + L^2 = 0.)

Two kinds of stabilizer

For each vertex vv we define a star operator AvA_v, the product of Pauli-XX over the four edges meeting at vv; for each plaquette pp we define a plaquette operator BpB_p, the product of Pauli-ZZ over the four edges bordering pp:

Av=evXe,Bp=epZe.A_v = \prod_{e \,\ni\, v} X_e, \qquad B_p = \prod_{e \,\in\, \partial p} Z_e .

Each acts on exactly four qubits — the checks are local. The next lesson studies these operators in detail; here we just need that they all commute. Two stars or two plaquettes obviously commute (disjoint, or all-XX / all-ZZ). A star AvA_v and a plaquette BpB_p share either 00 or 22 edges; since XX and ZZ anticommute, sharing an even number of qubits makes the operators commute. Hence {Av,Bp}\{A_v, B_p\} generate an abelian stabilizer group.

The toric-code Hamiltonian makes the code space the ground space:

H=vAvpBp.H = -\sum_v A_v - \sum_p B_p .

Every term is ±1\pm 1; the ground states saturate all of them at +1+1, i.e. they are exactly the stabilized states.

The two redundancies

The L2L^2 star operators are not independent: their product over all vertices is the identity, because every edge touches exactly two vertices and so each XeX_e appears twice:

vAv=I.\prod_v A_v = I .

Likewise pBp=I\prod_p B_p = I. Each family therefore contributes only L21L^2 - 1 independent generators, for a total of

nk=2(L21)=2L22independent stabilizers.n - k = 2(L^2 - 1) = 2L^2 - 2 \quad \text{independent stabilizers}.

Counting the logical qubits

The number of encoded qubits follows immediately:

k=n(nk)=2L2(2L22)=2.k = n - (n-k) = 2L^2 - (2L^2 - 2) = 2 .

The toric code encodes two logical qubits, independent of LL. This is no accident of counting: the two logical qubits are tied to the two independent noncontractible cycles of the torus (its first homology H1(T2)=Z2H_1(T^2) = \mathbb{Z}^2), as the lesson on logical operators will make precise.

Summary of parameters

For the L×LL \times L toric code:

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

where the distance d=Ld = L is the length of the shortest noncontractible loop (derived two lessons from now). Growing LL leaves the checks four-local while increasing the protection — the hallmark of a topological code.

Sign in on the full site to ask questions and join the discussion.