  We relate a large class of classical spin models, including the inhomogeneous
Ising, Potts, and clock models of q-state spins on arbitrary graphs, to
problems in quantum physics. More precisely, we show how to express partition
functions as inner products between certain quantum stabilizer states and
product states. This connection allows us to use powerful techniques developed
in quantum information theory, such as the stabilizer formalism and classical
simulation techniques, to gain general insights into these models in a unified
way. We recover and generalize several symmetries and high-low temperature
dualities, and we provide an efficient classical evaluation of partition
functions for all interaction graphs with a bounded tree-width.
