ToricCode — Kitaev 2003 Z₂ Surface Code

ToricCode is the canonical topological-order benchmark model: Kitaev's (2003) Z₂ surface code on the square lattice. All physical observables exposed here are closed-form / purely topological — no numerical solver is involved.

Hamiltonian

S = 1/2 on every edge of a square lattice. For each vertex v and each plaquette p define the stabilizer operators

A_v = ∏_{i ∈ star(v)} σˣ_i      (vertex / "electric" stabilizer, 4-body)
B_p = ∏_{i ∈ ∂p}     σᶻ_i      (plaquette / "magnetic" stabilizer, 4-body)
H = − J_e Σ_v A_v − J_m Σ_p B_p,    J_e, J_m ≥ 0.

Each pair of stabilizers shares 0 or 2 edges, hence anti-commutes by an even number of factors and so commutes. The full set {A_v} ∪ {B_p} is mutually commuting, and H is exactly diagonal in their joint eigenbasis. The ground state has every A_v = +1 and every B_p = +1.

Closed-Form Quantities

QuantityValueBoundaryReference
GroundStateEnergyDensity−(J_e + J_m)InfiniteKitaev 2003
MassGap2·min(J_e, J_m)InfiniteKitaev 2003
GroundStateDegeneracy (genus g)4^gPBCKitaev 2003 §5
TopologicalEntanglementEntropylog 2InfiniteKitaev–Preskill 2006 / Levin–Wen 2006
AnyonStatistics(:em) mutual phaseπ(any)Kitaev 2003

Anyon Content

Four Abelian anyons with quantum dimension d_a = 1:

LabelOriginSelf-statisticsNotes
1vacuumboson (0)identity sector
evertex defect A_v = −1boson (0)"electric" charge
mplaquette defect B_p = −1boson (0)"magnetic" flux
εe × mfermion (π)bound state, statistics from mutual braid

Fusion rules: e×e = m×m = ε×ε = 1, e×m = ε. The mutual phase from braiding e once fully around m is π (Z₂ mutual semion); this phase is responsible for the ε self-statistics.

Total quantum dimension 𝒟 = √(Σ_a d_a²) = √4 = 2, matching the Kitaev–Preskill / Levin–Wen extraction γ = log 𝒟 = log 2.

Code Examples

using QAtlas

# Default isotropic point
m = ToricCode()                      # J_e = J_m = 1
QAtlas.fetch(m, GroundStateEnergyDensity(), Infinite())   # -2.0
QAtlas.fetch(m, MassGap(),                  Infinite())   # 2.0
QAtlas.fetch(m, GroundStateDegeneracy(),    PBC(0))       # 4 (torus)
QAtlas.fetch(m, GroundStateDegeneracy(),    PBC(0); genus=2)  # 16
QAtlas.fetch(m, TopologicalEntanglementEntropy(), Infinite()) # log 2

# Anisotropic
m2 = ToricCode(J_e=2.0, J_m=0.5)
QAtlas.fetch(m2, GroundStateEnergyDensity(), Infinite())  # -2.5
QAtlas.fetch(m2, MassGap(),                  Infinite())  # 1.0  (= 2·0.5)

# Anyon table
QAtlas.fetch(m, AnyonStatistics())                     # default :em
QAtlas.fetch(m, AnyonStatistics(); type=:e)            # NamedTuple for e
QAtlas.fetch(m, AnyonStatistics(); type=:ε)            # NamedTuple for ε

Distinction from KitaevHoneycomb

The KitaevHoneycomb model (Kitaev 2006, Annals 321) shares an author and a topological-order theme but is otherwise a different physical system:

ToricCode (this page)KitaevHoneycomb
ReferenceKitaev 2003, Annals 303Kitaev 2006, Annals 321
Latticesquare (qubits on edges)honeycomb (qubits on sites)
Hamiltonian4-body stabilizers (σˣˣˣˣ, σᶻᶻᶻᶻ)bond-anisotropic 2-body (σˣσˣ, σʸσʸ, σᶻσᶻ)
Solutionexact stabilizer codefour-Majorana mapping + Z₂ gauge fields
AnyonsAbelian Z₂ (1, e, m, ε)Abelian (A-phases) / non-Abelian Ising (B + B-field)

References

  1. A. Yu. Kitaev, "Fault-tolerant quantum computation by anyons", Annals Phys. 303, 2 (2003).
  2. A. Kitaev, J. Preskill, "Topological entanglement entropy", Phys. Rev. Lett. 96, 110404 (2006).
  3. M. Levin, X.-G. Wen, "Detecting topological order in a ground state wave function", Phys. Rev. Lett. 96, 110405 (2006).
  4. C. Nayak, S. H. Simon, A. Stern, M. Freedman, S. Das Sarma, "Non-Abelian anyons and topological quantum computation", Rev. Mod. Phys. 80, 1083 (2008).

<!– ATLAS:HUBS:START – auto-generated by docs/atlas/generate.jl. Do not edit by hand; edits between these markers are overwritten on next regen. –>

Verified hubs

In the Verified Atlas, this model registers 5 hubs (quantity / BC pair). The badge column shows the R1 assurance level; click a hub link to see the exact verify(...) calls, references, and corroboration mechanism.

QuantityBCAssuranceCards
AnyonStatisticsInfinite⚪ cited-only0
GroundStateDegeneracyPBC🟢 corroborated-at-p6
GroundStateEnergyDensityInfinite🟢 corroborated-at-p1
MassGapInfinite🟢 corroborated-at-p1
TopologicalEntanglementEntropyInfinite🟢 corroborated-at-p1

<!– ATLAS:HUBS:END –>


<!– ATLAS:DOCS:START – auto-generated by docs/atlas/generate.jl. Do not edit by hand; edits between these markers are overwritten on next regen. –>

API

Every fetch(::Model, …) method registered for this model — together with the model struct(s) and exported helpers — generated directly from the source (in lock-step with @register):

QAtlas.ToricCodeType
ToricCode(; J_e::Real = 1.0, J_m::Real = 1.0) <: AbstractQAtlasModel

Kitaev (2003) toric code: the square-lattice Z₂ surface code with vertex ("electric") coupling J_e and plaquette ("magnetic") coupling J_m,

H = − J_e Σ_v A_v − J_m Σ_p B_p,

where A_v = ∏_{i ∈ star(v)} σˣ_i and B_p = ∏_{i ∈ ∂p} σᶻ_i. All stabilizers commute, so the model is exactly solvable. See module header for the full closed-form result list and the distinction from KitaevHoneycomb.

source
QAtlas.fetchMethod
fetch(::ToricCode, ::AnyonStatistics; type::Symbol) -> NamedTuple

Topological data of one of the four toric-code anyons or the e/m mutual braiding. The returned NamedTuple shape depends on type:

typeNamedTuple fields
:e(label = :e, statistics = :boson, self_phase = 0.0, quantum_dim = 1.0, fusion = (:e, :e) => :1)
:m(label = :m, statistics = :boson, self_phase = 0.0, quantum_dim = 1.0, fusion = (:m, :m) => :1)
(label = :ε, statistics = :fermion, self_phase = π, quantum_dim = 1.0, fusion = (:ε, :ε) => :1)
:em_braiding(label = :em_braiding, mutual_phase = π, anyons = (:e, :m))

Bosons have self-statistics phase 0; the bound state ε = e × m acquires the relative phase π from the mutual e/m braid, making it a fermion. The e/m mutual phase is π (Z₂ "mutual semion") — a full braid of one around the other multiplies the wave function by exp(iπ) = −1. All quantum dimensions are 1 (Abelian theory).

Aliases: type = :epsilon is accepted as a synonym of .

Throws an ErrorException for any other type.

source
QAtlas.fetchMethod
fetch(::ToricCode, ::GroundStateDegeneracy, ::PBC; genus::Int = 1) -> Int

Ground-state degeneracy on a closed orientable surface of genus g,

GSD(g) = 4^g.

This is the dimension of H¹(Σ_g; Z₂) ⊗ H¹(Σ_g; Z₂) (logical Pauli-X and Pauli-Z operators, one independent pair per non-contractible cycle). The torus (g = 1) gives the canonical 4-fold degeneracy. The result is purely topological — it depends only on genus, not on J_e, J_m or the lattice size.

PBC is the appropriate boundary tag because GSD is meaningful only on a closed surface; on OBC / a disk the model has a unique ground state (no homologically non-trivial loops), so the OBC method is intentionally not registered.

source
QAtlas.fetchMethod
fetch(::ToricCode, ::GroundStateEnergyDensity, ::Infinite) -> Float64

Ground-state energy density ε₀ = −(J_e + J_m).

Closed-form: every stabilizer commutes with every other, so the ground state simultaneously saturates A_v = +1 ∀v and B_p = +1 ∀p. The energy contribution per (vertex + plaquette) unit cell is −J_e − J_m.

source
QAtlas.fetchMethod
fetch(::ToricCode, ::MassGap, ::Infinite) -> Float64

Single-anyon excitation gap Δ = 2·min(J_e, J_m).

Flipping a single vertex stabilizer eigenvalue (creating an e charge) costs 2 J_e; flipping a single plaquette (creating an m flux) costs 2 J_m. The minimum-energy excitation is therefore 2·min(J_e, J_m) — the gap of the cheaper anyon species.

source
QAtlas.fetchMethod
fetch(::ToricCode, ::TopologicalEntanglementEntropy, ::Infinite) -> Float64

Topological entanglement entropy γ = log 2.

For the Z₂ topological order realised by the toric code, the total quantum dimension is 𝒟 = √(Σ_a d_a²) = √(1² + 1² + 1² + 1²) = 2 (four Abelian anyons {1, e, m, ε}, each with d_a = 1). The Kitaev–Preskill (2006) / Levin–Wen (2006) prescription extracts γ = log 𝒟 = log 2 from the constant offset of the bipartite entanglement entropy on a simply-connected region,

S(ρ_A) = α |∂A| − γ + O(|∂A|⁻¹).

Independent of J_e, J_m (purely topological).

Example

julia> QAtlas.fetch(ToricCode(), TopologicalEntanglementEntropy(), Infinite())
0.6931471805599453
source

<!– ATLAS:DOCS:END –>