$F$ of the lattice there is a constraint between edge spins in the form of $\prod_{e\in \partial F} S_e =1$ where $e\in \partial F$ refers to an edge around the face $F$. We apply such constraints by delta functions in Eq.(\[ranz\]) and rewrite the partition function in the following form: $$\label{cons0}
\mathcal{Z}[\mathbf{J}]=\sum_{\mathbf{S}}e^{\beta \sum_{e} J_{e}S_e }\prod_{F} \delta(\prod_{e \in \partial F} S_e ,1).$$ Here $\prod_F$ refers to all independent constraints corresponding to faces of the lattice and $J_e=J_{ij}$ where $i, j$ are the two endpoints of $e$. Furthermore, using the following form of the delta function $\delta(\prod_{e \in \partial F} S_e ,1)=\frac{1+\prod_{e \in \partial F} S_e}{2}$, we obtain: $$\label{cons}
\mathcal{Z}[\mathbf{J}]=\sum_{\mathbf{S}}e^{\beta \sum_{e} J_{e}S_e }\prod_{F} \frac{1+\prod_{e \in \partial F} S_e}{2}.$$

Now, we are ready to introduce the quantum formalism of the partition function by replacing edge spins $S_e$ in Eq.(\[cons\]) with Pauli operators $Z_e$. To this end, note that each edge spin $S_e$ takes two values $\pm1$ which can be considered as eigenvalues of a Pauli operator $Z_e$. Let $|0\ra$ and $|1\ra$ refer to eigenstates of the $Z$ operator with eigenvalues $+1$ and $-1$, respectively. It is simple to check that $\sum_{S_e} g(S_e) =2 \la +| g(Z_e)|+\ra$ where $g$ is an arbitrary function and 