The toric code places one physical qubit on every edge of a periodic L×L lattice (a torus — no boundary). Two families of stabilizers must all read +1 in the code's ground/logical space:
Vertex op: A_v = ∏_{e∋v} X_e (4 edges touching vertex v)
Plaquette op: B_p = ∏_{e∈∂p} Z_e (4 edges bounding face p)
[A_v, B_p] = 0 for all v, p (always commute)
A physical Pauli-Z error on one edge anticommutes with the two A_v operators at its endpoints, flipping their measured parity — that is an anyon pair (two "e" charges). Extending the error along an adjacent edge moves one anyon by one lattice step without touching any other vertex: the interior of an open error string is invisible, only its two endpoints show up as syndrome defects. This is exactly what this simulator lets you click through.
If the two endpoints of a growing string meet, the anyons annihilate and every A_v is back to +1 — the state looks exactly like vacuum to every local stabilizer measurement, no matter which loop shape you drew. But there are two topologically distinct kinds of closed loop on a torus:
- Contractible loop — can be shrunk to a point without crossing itself. It is literally a product of nearby plaquette-adjacent stabilizers, so it has zero physical effect on the encoded state.
- Non-contractible loop — winds all the way around the torus (θ or φ direction) and cannot be shrunk away. It commutes with every stabilizer too (so it stays invisible to any syndrome measurement) but it is not a product of stabilizers — it implements a real logical Z̄ operator, silently flipping one of the two encoded logical qubits.
The winding readouts count, mod 2, how many error edges cross a fixed reference ring in each direction — a standard Z₂-homology invariant that reveals exactly this "invisible but real" logical flip. The shortest such non-contractible loop has length L, which is why the toric/surface code's protected distance grows with lattice size: an adversarial error needs to corrupt at least L qubits along a straight topological path before it can silently damage the logical information, while any shorter string always leaves a locally-detectable anyon pair behind.
θ-loop / φ-loop buttons toggle a full ring of edges around each non-contractible direction at once — instant, anyon-free logical errors, exactly as the argument above predicts.