Here’s an example of a Phase Transition in physics, demonstrated using the Ising Model in $Python$.
The Ising Model is a mathematical model used to describe ferromagnetism in statistical mechanics.
Problem
We want to simulate the 2D Ising Model to understand phase transitions.
Specifically, we will:
- Simulate a 2D lattice of spins that can either be $+1$ or $-1$.
- Study how the magnetization of the system changes with temperature.
- Observe the critical temperature at which a phase transition occurs.
Python Code Implementation
1 | import numpy as np |
Explanation
- Initialization:
The lattice is a grid of spins, initialized randomly. - Metropolis Algorithm:
For each spin, we calculate the energy change (ΔE) if the spin is flipped.
The flip is accepted based on the Metropolis criterion, which ensures proper statistical weighting. - Magnetization:
The total magnetization of the system is recorded as the absolute sum of spins normalized by the number of spins. - Temperature Sweep:
By sweeping through a range of temperatures, we observe how the magnetization changes, showing a sharp drop near the critical temperature $(( T_c \approx 2.27 )$ for the 2D Ising Model).
Result

The graph shows magnetization as a function of temperature.
Below the critical temperature $(T_c)$, the system exhibits spontaneous magnetization, indicating a ferromagnetic phase.
Above $(T_c)$, the magnetization drops to zero, showing a transition to the paramagnetic phase.
The red vertical line indicates $(T_c)$.









