Why is Kitaev's toric code a $Z_2$ gauge theory? I am reading Kitaev's 2003 paper. In the literature, it is often said that the model proposed in this paper is a $Z_2$ gauge theory. I don't quite see why it is the case. Where is the $Z_2$ gauge symmetry? (I think, of course, there is a $\mathbb{Z}_2$ global gauge symmetry because we can flip all the spins in the Hamiltonian) I would like to know what is the specific $Z_2$ symmetry that people have in mind when talking about the toric code. Would someone please help? Thanks!

To add some details to Norbert's answer below. The local $Z_2$ gauge symmetry operator is essentially the plaquette term of the toric code. It is called a $Z_2$ operator because it squares to unity. As to how this toric code gauge theory may be coupled to a matter field please see this reference.
 A: If you insist on not breaking one type of terms in the Hamiltonian - say, the plaquette constraints - then the remaining theory is a $Z_2$ gauge theory with the plaquette constraints as the gauge constraints. Thus, within this subspace where the plaquette constraints are not violated, the theory behaves just as a gauge theory.
But this is no longer true when the gauge constraints are broken. However, in that case you can still think of it as a gauge theory, but one where you additionally introduce matter - that is, you imagine having additional matter degrees of freedom sitting on the plaquettes, and there is a joint gauge constraint for matter and gauge fields.  If the Hamiltonian constraint (=gauge constraint of the pure gauge theory) of a plaquette in the toric code is broken, you can then interpret this as having a matter excitation (=charge) sitting on the plaquette (since then the matter + gauge field gauge constraint is still preserved).
Thus, the Toric Code model can be interpreted as a $Z_2$ gauge theory with matter, where the matter amounts to the violation of the plaquette degrees of freedom.
