Ising Simulation
Note the plots may take 30s to load as the data is unzipped.
The Ising is a tool used in statistical physics to study phase transitions and collective dynamics in systems with many interacting parts. Initially designed to represent ferromagnetism, it models spins on a lattice that can take one of two states, interacting with their neighbors. Its applications extend to areas like neural network activity, protein folding and quantum cluster states. The model's simplicity allows for analytical solutions in certain cases and computational approaches in others, making it broadly applicable for exploring the connection between microscopic interactions and macroscopic phenomena.
Here I'm making a small monte carlo simulation of an Ising Model with Glauber dynamics.
1. Energy of the Ising Model:
The energy of a configuration of spins
Where:
is the interaction strength between neighboring spins (positive for ferromagnetic, negative for antiferromagnetic), denotes summation over nearest neighbors, is an external magnetic field, and is the spin at site .
2. Glauber Dynamics Update Rule:
The Glauber dynamics updates the spin at site
Where:
is the change in energy when the spin flips, is the Boltzmann constant, is the temperature.
For the case of a single spin flip
This means that the probability of flipping a spin depends on the interaction with neighboring spins and the external field. At high temperatures (
Note the critical temperature for an ising model should lie around
in our sim J is always 1.0, so the critical temp is
Lattice state plot
Here we plot the lattice state for various temperatures and time steps, play around with the sliders to view the dynamics behaviour of the lattice.
The simulation calculates the lattice states using Glauber dynamics in the update_step_numba
function. At each step, a random site is picked, and the change in energy (
At low temperatures, we often see large, stable clusters where spins align and rarely flip, indicating an ordered phase. Near critical temperature (
Identifying the critical point
We can plot the following graphs: magnetization, average_energy, susceptibility, and specific_heat.
- For magnetization we should see magnetization drop at the critical point
- For average_energy we should see the center of an
curve at the critical point. - For susceptibility and specific_heat we should see a peak at the critical point.
Correlations
Spatial correlations are calculated by shifting the last step lattice in all possible directions (dx, dy) and measuring how much each site’s spin correlates with its shifted partner. That sum gets binned by the distance
When we plot these spatial correlations, you’ll typically see them decay as distance increases. At high temperature, the correlation should fall off quickly, indicating that spins behave more independently. Near or below the critical temperature, the correlation length grows, and we see a slower or even power-law–like decay, indicating large-scale domains of aligned spins.