Ising Model Simulator
Ising Model Simulator simulates a 2D Ising model using the Metropolis algorithm, computing magnetization and energy for a given lattice size, temperature, magnetic field, and interaction strength.
Formulas Used in Ising Model Simulator
The simulator uses the 2D Ising model Hamiltonian and the Metropolis algorithm:
Hamiltonian:
\\[ H(\sigma) = -J \sum_{\langle i,j \rangle} \sigma_i \sigma_j – \mu B \sum_i \sigma_i \\]Magnetization:
\\[ m = \frac{1}{N} \sum_i \sigma_i \\]Energy per site:
\\[ E = \frac{H(\sigma)}{N} \\]Metropolis Acceptance Probability:
\\[ P(\text{accept}) = \min\left(1, e^{-\Delta E / (k_B T)}\right) \\]Where:
- \\(J\\): Interaction strength (J)
- \\(\sigma_i\\): Spin at site \\(i\\) (\\(+1\\) or \\(-1\\))
- \\(\sum_{\langle i,j \rangle}\\): Sum over nearest neighbors
- \\(\mu\\): Magnetic moment (set to 1)
- \\(B\\): External magnetic field (T)
- \\(N = L \times L\\): Total number of spins
- \\(k_B\\): Boltzmann constant (set to 1 for \\(T\\) in units of \\(J/k_B\\))
- \\(\Delta E\\): Energy change from flipping a spin
- \\(T\\): Temperature (\\(J/k_B\\))
Example Calculation
Example: \\(L = 20\\), \\(T = 2.5\\), \\(B = 0.0\\), \\(J = 1.0 \times 10^{-20}\\), Steps = 10000
Runs the Metropolis algorithm, flipping spins based on \\(\Delta E\\), and computes final magnetization and energy.