🧲 Ising Model — Phase Transition

A 3D cubic lattice of magnetic spins flips between up and down states under the Metropolis Monte Carlo algorithm. Above the Curie temperature, spins are random (paramagnetic). Below it, they align spontaneously into ferromagnetic domains — a genuine phase transition driven by spontaneous symmetry breaking.

🔬 What It Demonstrates

The Metropolis Monte Carlo algorithm: each spin considers flipping based on its neighbours' alignment and temperature, accepting flips with probability min(1, exp(−ΔE/T)). Ferromagnetism emerges from purely local interactions.

🎮 How to Use

Adjust temperature across the critical point (T_c ≈ 4.51 J/k_B for the 3D cubic lattice). Watch large aligned domains form below T_c and disorder appear above it. Orbit the lattice and read off the live magnetisation and energy.

💡 Did You Know?

Lars Onsager solved the 2D Ising model exactly in 1944 — one of the greatest achievements in statistical mechanics. The 3D Ising model remains unsolved analytically after 100+ years.

About the 3D Ising Model Simulation

This is a real-time, fully three-dimensional Ising model of a ferromagnet, rendered with WebGL via Three.js. A cubic lattice of spins — each pointing up (+1, shown pink) or down (−1, shown blue) — evolves under the Metropolis Monte Carlo algorithm: a random spin is proposed for flipping and accepted with probability min(1, exp(−ΔE/T)), so the lattice relaxes toward thermal equilibrium. You can orbit the cube, adjust temperature and field, and watch ordered magnetic domains grow or dissolve.

The Ising model is the canonical example of a phase transition in statistical mechanics. Below the Curie temperature (T_c ≈ 4.51 J/k_B for the 3D cubic lattice) the spins spontaneously align into a ferromagnet even with no external field — spontaneous symmetry breaking — while above it thermal noise wins and the system becomes a disordered paramagnet. The same ideas describe magnetism, alloy ordering and critical phenomena across physics.

Frequently Asked Questions

What am I looking at in this 3D Ising model?

You are watching a cubic lattice of magnetic spins evolved by the Metropolis Monte Carlo algorithm. Each small cube is a single spin: warm pink cubes point up (+1) and cool blue cubes point down (−1). The lattice relaxes toward thermal equilibrium at the temperature you set, so you can watch ordered ferromagnetic domains grow or dissolve in real time as you cross the Curie temperature.

What is the Curie temperature and why does it matter?

The Curie (critical) temperature T_c marks the phase transition between the ferromagnetic and paramagnetic phases. For the 3D cubic Ising model T_c is approximately 4.51 J/k_B. Below T_c the spins spontaneously align even with no external field — spontaneous symmetry breaking — giving a non-zero magnetisation. Above T_c thermal noise destroys the order and the average magnetisation is zero.

How does the Metropolis Monte Carlo algorithm work?

Each Monte Carlo step picks a random spin and proposes flipping it. It computes the energy change ΔE = 2 s_i (J × the sum of neighbour spins + h). If ΔE is negative the flip is always accepted; if positive it is accepted with probability exp(−ΔE/T). Running many such attempts samples the Boltzmann distribution, so the lattice settles into the correct thermal equilibrium.

What is spontaneous symmetry breaking?

Below the Curie temperature the up and down directions are still equally favoured by the energy, yet the system must collectively choose one of them and form aligned domains. Picking a direction that the underlying rules do not prefer is spontaneous symmetry breaking — a concept central to magnetism, superconductivity and particle physics.

What does the external field h do?

The field h adds a term −h Σ s_i to the energy, biasing spins toward one direction. Even above the Curie temperature a non-zero field produces some net magnetisation, and below it the field can flip the whole magnet from one domain orientation to the other.

What do the render modes do?

Because a solid cube would hide its interior, three modes let you see inside. 'All (fade down)' keeps up-spins opaque and makes down-spins nearly transparent so up-domains stand out. 'Up-spins only' hides all down-spins entirely. 'Slice' shows a single interior cross-section through the middle of the lattice.

How do magnetisation and energy readouts behave at the transition?

The magnetisation m is the average spin; it is near zero in the paramagnet and grows toward ±1 as the lattice orders below T_c. The energy per spin drops as neighbours align. Watching both as you sweep temperature reveals the sharp change that signals the phase transition.

Why does lattice size affect the transition?

Larger lattices (up to 40³ here) suppress finite-size rounding and show a sharper, more abrupt transition closer to the true critical temperature, but they require more spin updates per sweep and therefore run slower. Smaller lattices respond faster but blur the transition.

Does this simulation need WebGL?

Yes. It uses a Three.js WebGL renderer drawing the lattice as a single InstancedMesh of cubes, with OrbitControls for mouse rotation. Any device with WebGL support — virtually all phones and laptops made after 2012 — will run it. The pixel ratio is capped at 1.5x and the lattice size is adjustable so you can trade visual detail for frame rate.

Has the Ising model been solved exactly?

Lars Onsager solved the 2D Ising model exactly in 1944 — a landmark of statistical mechanics. The 3D model you are watching has never been solved analytically; its critical exponents are known only from Monte Carlo and conformal-bootstrap numerics.