This is the identical toric code as the 3D version — same L×L periodic lattice, same qubit-per-edge layout, same stabilizers — but instead of embedding it on a 3D donut it is drawn the way it is actually defined in the literature: a flat fundamental domain with its opposite edges identified. Every row wraps top-to-bottom and every column wraps left-to-right; those seams are drawn as short dashed stub pairs at the chart's border rather than as a curved 3D surface, because the identification — not the embedding shape — is the physically meaningful part of "torus".
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 — an anyon pair. Extending the error string one edge at a time hops one anyon per click; the string's interior stays invisible to every stabilizer, only its two endpoints show up as red defects. Grow a string across a dashed seam and the anyon reappears on the opposite border, exactly as periodic boundary conditions require — this is the one place a flat chart must do real extra bookkeeping a 3D embedding gets "for free" visually, and it is handled here by explicit wrap-aware edge lookups (`(i mod L, j mod L)`), not by any drawing trick.
If a string's two endpoints meet, the anyons annihilate and every A_v reads +1 again — indistinguishable from vacuum to any local check. But two closed loops that look equally "closed" on this flat chart are topologically different once the periodic identification is accounted for:
- Contractible loop — shrinks to a point without crossing a seam. It is a product of nearby plaquette stabilizers and has zero physical effect.
- Non-contractible loop — crosses a seam an odd number of times, i.e. it winds around the identification at least once and cannot be shrunk away. It still commutes with every stabilizer (invisible to syndrome measurement) but is not a product of stabilizers — it implements a real logical Z̄, silently flipping one of the two encoded logical qubits.
The winding readouts count, mod 2, how many placed error edges cross a fixed reference ring in each direction — a Z₂-homology invariant computed from the same two arrays of booleans the 3D version uses, exactly reproducing its silent-logical-error demonstration. The shortest non-contractible loop has length L, so the protected code distance grows with lattice size: a shorter error string always leaves a locally-detectable anyon pair behind.
θ-loop / φ-loop buttons toggle a full ring of edges around each periodic direction at once — instant, anyon-free logical errors, exactly as the argument above predicts.