What this shows
Each square is a site that holds one of states, drawn as colors. Neighboring sites lower their energy by matching, while temperature changes them at random. The temperature is shown as a multiple of the critical temperature , so the phase transition is always at 1:
- Below , matching wins. Regions of one color grow, and given enough time one color covers most of the grid.
- Above , the random changes win, and every color covers about of the grid.
- At , what happens depends on . Up to 4 states the transition is continuous: regions of every size appear at once, as in the Ising model. With 5 or more it is discontinuous: ordered and disordered regions can sit side by side, and the order disappears abruptly.
The corner shows the temperature, and the share of sites in the most common state.
Things to try: at the default 3 states, drag the temperature from 1.2 down to 0.8 and back. Then set 10 states and do the same, and compare how sharply the order appears and disappears.
How the visualization works
- Sites are updated with the Metropolis algorithm. Each attempt picks a site at random and proposes one of the other states. If the energy would not go up, the change is made. Otherwise it is made with probability .
- One sweep is as many attempts as there are sites.
- The grid wraps around at the edges, so no site sits on a boundary.
- All randomness comes from a seeded pseudo-random generator, and the acceptance probabilities use only addition, subtraction, multiplication and division, so a shared link replays exactly in every browser.
- The simulation runs in a Web Worker so the page stays responsive.
Parameters
- Grid size: sites along each side. Restarts the run.
- States: , from 2 to 10. Restarts the run.
- Temperature: as a multiple of . Applies from the next sweep.
- Starting state: random (as if infinitely hot) or all the same (as if at absolute zero). Restarts the run.
- Speed: sweeps per second. Never changes the results.
Mathematical background
A configuration assigns a state to every site . Its energy is
summed over neighboring pairs, where is 1 when and 0 otherwise. At temperature a configuration occurs with probability proportional to . With this is the Ising model with every temperature halved: is about 1.135 here and 2.269 there.
Renfrey Potts introduced the model in 1952 and located its critical point on the square lattice by a duality argument. Beffara and Duminil-Copin proved in 2012 that the transition is at
about 0.995 for . Whether the transition is continuous was settled by Duminil-Copin, Sidoravicius and Tassion for and by Duminil-Copin, Gagnebin, Harel, Manolescu and Tassion for .
Each configuration also has a random-cluster (Fortuin–Kasteleyn) picture, in which bonds between equal neighbors are kept at random and the spins are read off the clusters. At with the boundaries of those clusters are expected to look like Schramm–Loewner evolution (SLE) curves. A 2026 manuscript from OpenAI's openai/math collection proves this for . It has not been refereed, and its main result is not formalized in Lean. This page shows the spins, not those cluster boundaries.
References
Full citations are listed below.
- R. B. Potts. Some generalized order-disorder transformations (1952). Mathematical Proceedings of the Cambridge Philosophical Society 48, 106–109. Introduces the model.
- F. Y. Wu. The Potts model (1982). Reviews of Modern Physics 54, 235–268. A survey of the model and its exact results.
- V. Beffara and H. Duminil-Copin. The self-dual point of the two-dimensional random-cluster model is critical for q ≥ 1 (2012). Probability Theory and Related Fields 153, 511–542. Proves the critical temperature T_c = 1/ln(1 + √q).
- H. Duminil-Copin, V. Sidoravicius and V. Tassion. Continuity of the phase transition for planar random-cluster and Potts models with 1 ≤ q ≤ 4 (2017). Communications in Mathematical Physics 349, 47–107.
- H. Duminil-Copin, M. Gagnebin, M. Harel, I. Manolescu and V. Tassion. Discontinuity of the phase transition for the planar random-cluster and Potts models with q > 4 (2016). arXiv preprint.
- OpenAI. Square-lattice FK interfaces and nested loops for 1 ≤ q < 4 (2026). Unrefereed manuscript in the openai/math collection (family 223); its main result is not Lean-formalized. It proves that cluster boundaries in this model's random-cluster picture converge to SLE curves at T_c. This page shows the spins, not those boundaries.
- N. Metropolis, A. W. Rosenbluth, M. N. Rosenbluth, A. H. Teller and E. Teller. Equation of State Calculations by Fast Computing Machines (1953). The Journal of Chemical Physics 21, 1087–1092. The sampling algorithm used here.