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 reproduces the same sequence of configurations at the same sweep count.
- 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 .
The critical temperature describes the infinite square lattice. This finite simulation shows fluctuations and finite-size effects, rather than a sharp thermodynamic singularity.