unit cell), whereas $s$ and $s'$ run over all ‘stars’ (involving the four spins around a corner of a unit cell), see Fig.  \[fig:toric code\]. The operator $n_p$ ($n_s$) has eigenvalues $0, 1$ and counts the number of plaquette- (star-) anyons at site $p$ ($s$). The fourfold degenerate energy levels encode two qubits with logical operators given by $Z_i = \prod_{k\in \ell_i} \sigma_{z,k}$ and $X_i = \prod_{k\in \ell'_i} \sigma_{x,k}$, $i = 1, 2$, where $\ell_i$ and $\ell'_i$ are strings of spins topologically equivalent to single loops around the torus (see Fig. \[fig:toric code\] for an example). These operators commute with all $n_p$ and $n_s$ and obey themselves the usual spin commutation relations.

Note that by specializing to $U_{p p'} = 2J\delta_{p p'}$ and $V_{s s'} = 2J\delta_{s s'}$, where $J > 0$ is the single-anyon excitation energy, the Kitaev original toric code model is recovered. Except for the boundary conditions, the structure of the toric code is very similar to an earlier model by Wegner [@Wegner1971; @Kogut1979]. Wegner’s Ising lattice gauge theory involves only plaquette operators in the Hamiltonian ($U_{p p'} = 2J\delta_{p p'}$ and $V_{s s'} = 0$), while the stars play the role of a gauge symmetry group. 