2024 · UNC Chapel Hill

3D Potts Model Simulation

Aug – Dec 2024Computational physics project

A Monte Carlo simulation that calculates the spin state of every site in a 3D lattice and how neighboring spins interact, given the electromagnetic coupling constant and the temperature. It is ferromagnetism and thermodynamics in code: the coupling drives spins to align, thermal energy fights back, and the simulation finds the critical temperature where the material changes phase, the same physics that governs magnetic materials, alloys, and signal noise. The LED cube on the board out front runs a miniature version of it.

The physics

The Potts model generalizes the Ising model to q spin states. Sweep the temperature and the lattice snaps from disorder into ordered domains, a phase transition you can watch happen. I made and coded the 3D simulation myself: it runs the Metropolis-Hastings algorithm on a 3D lattice and renders it as an interactive cube you can rotate, so the domains form and compete right in front of you. The analysis it fed became a group paper with Carter Chapman and Dev Singh.

Why Monte Carlo

A 3D lattice has no analytic solution, but it can be sampled. Monte Carlo methods trade exactness for statistics, and writing one from scratch teaches you exactly where randomness helps and where it hides bugs.

What we found

The final energy of the lattice depends only on the coupling constant and the temperature, never on the starting configuration: random and uniform lattices converge to the same energy every time. Specific heat peaks mark the phase transition, and the critical temperature scales linearly with the coupling constant. The full analysis is in the paper below.

Read the paper full screen (PDF)

Some slides have animations that only play in the live deck. Open it in slideshow mode to see them.

Open the live deck
PythonMonte CarloStatistical mechanicsMetropolis-Hastings