# The "overlap function" of a $Z_2$ gauge theory

Consider a $$Z_2$$ gauge theory on a square lattice (Ising spins on edges) with classical degrees of freedom, i.e.

$$$$E = -\sum_{\square} \sigma_i\sigma_j\sigma_k\sigma_l$$$$

with $$\sigma_i\in\{-1,+1\}$$ and $$\sum_{\square}$$ denoting summation over all plaquettes.

I guess this is a well-studied model with a continuous phase transition between a low-temperature topological phase and a high-temperature trivial/disordered phase.

My question is: What is the most natural overlap function for the states of this model?

By the overlap function, I mean something that quantifies how "close" two given configurations are. It is very commonly used in e.g. the spin glass community where it is usually defined as the following:

$$$$q({\{\sigma_i\}^{(a)}, \{\sigma_i\}^{(b)}}) = \frac{1}{N}\sum_i \sigma_i^{(a)}\sigma_i^{(a)}$$$$

where $$a$$ and $$b$$ are labels for the two different configuration you want to compare. The overlap $$q$$ becomes $$+1$$ if $$\{\sigma_i\}^{(a)}$$ is exactly the same as $$\{\sigma_i\}^{(b)}$$, becomes $$-1$$ if they are totally the opposite state, and becomes $$0$$ for statistically independently random configurations (as $$N\rightarrow\infty$$). Hopefully this gives you an idea of what role it serves. It is convenient to think about it when you have a Hamiltonian like $$E=\sum_{i,j}J_{ij}\sigma_i\sigma_j$$ with random variables $$J_{ij}$$ and thus the order parameter is hard to define straightforwardly. Note that it is close to distance but not exactly, since it also takes negative values (It's more like an inner product).

The main obstacle for defining an analogous quantity for the $$Z_2$$ gauge theory is that you can always have local gauge transformations so that you kind of want to regard them as actually same states. I searched through literature, but couldn't find any cases where people define such things. Can anyone point me out any literature, or educate me on any related ideas? I'm thinking that it should be a natural thing to consider if people try to define things like "$$Z_2$$ gauge spin glass" with $$E=-\sum_{\square}J_{ijkl}\sigma_i\sigma_j\sigma_k\sigma_l$$ with randomly fixed $$J_{ijkl}$$s.

Thanks!