The current potts_exchange and potts_field functions where $q$ is a parameter is defined in such a way that only $q=3$ is correct.
The Hamiltonian for the Q-state Potts model is
$$H = -\sum{i=1}^L\sum{k=1}^{Q-1} (JZi^\dagger Z{i+1})^k + h X_i^k)$$,
with $Z$ and $X$ already correctly defined in potts_exchange and potts_field.
The current
potts_exchange
andpotts_field
functions where $q$ is a parameter is defined in such a way that only $q=3$ is correct. The Hamiltonian for the Q-state Potts model is $$H = -\sum{i=1}^L\sum{k=1}^{Q-1} (JZi^\dagger Z{i+1})^k + h X_i^k)$$, with $Z$ and $X$ already correctly defined inpotts_exchange
andpotts_field
.