|q⟩ Bad Qubits

advanced · Physics · Surface Codes & Topological Codes

Logical Operators as Loops

The toric code encodes k=2k=2 logical qubits. This lesson identifies the operators that act on them: the logical Pauli operators are string operators wrapped around the noncontractible loops of the torus. A contractible loop is a product of stabilizers and acts trivially; only loops that wind the torus give genuine logical action. The algebra of these logical operators is fixed entirely by how the loops intersect.

Contractible loops are stabilizers

Consider a closed ZZ-string WCZ=eCZeW^Z_C = \prod_{e \in C} Z_e around a loop CC. If CC is contractible — the boundary of some region RR of faces — then it is exactly the product of the plaquette operators inside RR:

WRZ=pRBp    S.W^Z_{\partial R} = \prod_{p \in R} B_p \;\in\; \mathcal{S}.

So a contractible ZZ-loop is a stabilizer: it acts as +1+1 on the code space and changes nothing. The same holds for contractible XX-loops on the dual lattice, which are products of star operators. Only loops that cannot be filled in can act nontrivially.

Noncontractible loops and homology

On a torus there are two independent noncontractible cycles — one winding the "horizontal" direction, one the "vertical". Two loops that differ by a contractible deformation belong to the same homology class; the classes form the first homology group

H1(T2;Z2)=Z2×Z2.H_1(T^2;\mathbb{Z}_2) = \mathbb{Z}_2 \times \mathbb{Z}_2 .

Define logical ZZ operators Zˉ1,Zˉ2\bar Z_1, \bar Z_2 as ZZ-strings running along the two noncontractible cycles of the lattice, and logical XX operators Xˉ1,Xˉ2\bar X_1, \bar X_2 as XX-strings running along the two noncontractible cycles of the dual lattice. Each:

which is exactly the definition of a logical operator. Deforming a logical string by multiplying with stabilizers keeps it in the same homology class — its class, not its shape, is what matters.

The logical algebra from intersections

The commutation of two string operators is governed (as always) by the parity of their crossings. A logical Xˉi\bar X_i string on the dual lattice and a logical Zˉj\bar Z_j string on the direct lattice cross on shared edges where XX and ZZ anticommute:

XˉiZˉj=(1)I(i,j)ZˉjXˉi,\bar X_i \bar Z_j = (-1)^{\,I(i,j)}\, \bar Z_j \bar X_i ,

where I(i,j)I(i,j) is the number of intersections mod 2. Choosing the cycles so that Xˉi\bar X_i and Zˉj\bar Z_j cross exactly once when i=ji=j and not at all when iji \ne j gives

{Xˉi,Zˉi}=0,[Xˉi,Zˉj]=0 (ij),\{\bar X_i, \bar Z_i\} = 0, \qquad [\bar X_i, \bar Z_j] = 0 \ (i \ne j),

the canonical Pauli algebra of two qubits. The two independent winding directions \Rightarrow two anticommuting (Xˉ,Zˉ)(\bar X, \bar Z) pairs \Rightarrow exactly k=2k=2 logical qubits, confirming the count from the stabilizer bookkeeping.

Why this is fault-tolerant

A logical operator is supported on a loop that wraps the entire torus, so its weight is at least LL (one edge per lattice row it crosses). Any local error is a short, contractible string — detectable and correctable. To enact an unintended logical operation, noise must build an undetected string spanning a noncontractible cycle, requiring at least LL coordinated single-qubit errors. That minimum weight is the code distance, the subject of the next lessons.

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