Submitted:
20 August 2025
Posted:
21 August 2025
Read the latest preprint version here
Abstract
Keywords:
1. Introduction
1.1. Phase Transition

- First order phase transition: During first order phase transition, the system adsorbs or release latent heat. This heat is required to change the phase only without changing the temperature of system. Melting of ice, boiling of water falls in this category.
- Second Order phase transition: In this transition, no latent heat is involved and there is a continuous change of order parameter and near the transition point, the system exhibit critical behaviour. Ferromagnetic to paramagnetic transition is one of it’s example which we will discuss in this paper.
1.2. Ferromagnetism

1.3. Ising model

1.4. Theory
1.4.1. Lattice and Spin Configuration
1.4.2. Hamiltonian of Ising Model

- is the inverse temperature.
- = Boltzmann constant.
- T = absolute temperature.
- = The partition function which ensures total probability across all configurations sums to one.
1.5. Objectives
1.5.1. General Objectives
1.5.2. Specific Objectives
- To simulate the 2D Ising model and analyze the system’s behaviour at various temperature.
- To plot graph between magnetization and temperature of the magnetic lattice simulated in ising model.
- To determine the critical temperature through the graph plot.
2. Literature Review
2.1. Motivation
3. Methodology
3.1. 2D Ising Model
3.2. Metropolis Algorithm
3.2.1. Steps of Metropolis algorithm
- Initialization: Firstly, we generate a random arbitrary spin configuration with energy .
- Spin Flip Process: We flip the spin of a lattice site selected at random. For instance, if spin was +1, alter it into -1, and vice versa and Calculate the energy using equation
- Change in Energy Calculation: Calculate the difference in energy generated by spin flip, = - and associated transition probability P = .
-
Acceptance Criteria: We then decide whether to accept the new configuration based on energy change.
- If 0 , then we accept the spin flip because it lowers the energy.
- We accept new state with probability P = , If .
- Calculation: Now we update the thermodynamics quantities such as average energy, magnetization, etc.
- Equilibrium Reached: Finally, we repeat the steps 2-6 with chosen spin configuration until thermal equilibrium is reached.

4. Results and Discussion





5. Conclusions and Future Work
5.1. Conclusions
5.2. Future Work
Appendix A
| Code for simulation of 2D Ising model for different lattice size L. I have taken L = 5, L= 10, L = 15, L=20, L=30 separately. |
| import numpy as np |
| from numpy.random import rand |
| import matplotlib.pyplot as plt |
| from_future_import division |
| def initialstate(L): |
| # random spin configuration generation for initial condition |
| state= 2*np.random.randint(2, size = (L,L)) - 1 |
| return state |
| def mcmove(config, beta): |
| #monte carlo (mc) move using metropolis algorithm |
| for i in range(L): |
| for j in range(L): |
| a = np.random.randint(0,L) |
| b = np.random.randint(0,L) |
| s = config[a,b] |
| nb = config[(a+1)%L,b] + config[a,(b+1)%L] + config[(a-1)%L,b] + config[a,(b-1)%L] |
| cost = 2*s*nb |
| if cost <0: |
| s*=-1 |
| elif rand() < np.exp(-cost*beta): |
| s*=-1 |
| config[a,b] = s |
| return config |
| def calcEnergy(config): |
| # Energy of given configuration |
| energy = 0 |
| for i in range(len(config)): |
| for j in range (len(config)): |
| S = config[i,j] nb = config[(i+1)%L,j]+config[i,(j+1)%L] + config[(i-1]%L,j] + config[i,(j-1)%L] |
| energy += -nb*S |
| return energy/4. |
| def calcMag(config): |
| # Magnetization of given configuration |
| mag = np.sum(config) |
| return mag |
| #parameters |
| nt = 99 # number of temperature points |
| L = 5 # size of the lattice, L x L |
| eqSteps = 1000 # number of MC sweeps for equilibrium |
| mcSteps = 1000 # number of MC sweeps for calculation |
| T = np.linspace(1.3,3.23,nt); |
| E,M = np.zeros(nt),np.zeros(nt) |
| n1,n2 = 1.0/(mcSteps*L*L), 1.0/(mcSteps*mcSteps*L*L) |
| for tt in range(nt): |
| E1 = M1 = E2 = M2 = 0 |
| config =initialstate(L) |
| iT = 1.0/T[tt]; iT2= iT*iT; |
| for i in range (eqSteps): |
| mcmove(config,iT) #montecarlo moves |
| for i in range(mcSteps): |
| mcmove(config,iT) |
| Energy = calcEnergy(config) |
| Mag = calcMag(config) |
| E1 = E1 + Energy |
| M1 = M1 + Mag |
| M2 = M2 + Mag*Mag |
| E2 = E2 + Energy*Energy |
| f = plt.figure(figsize=(18,10)); #plotting the values calculated |
| sp = f.add_subplot(2,2,2): |
| plt.scatter(T, abs(M), s=50,marker= ’o’,color=’RoyalBlue’) |
| plt.xlabel("Temperature(T)", fontsize=20); |
| plt.ylabel("Magnetization",fontsize = 20); plt.axis(’tight’) |
References
- Encyclopædia Britannica. States of Matter.
- Bailey, M. Domestic Applicability of Solid-State Cooling. Emerging Minds Journal for Student Research 2024, pp. 40–46.
- Wikipedia contributors. Ising model — Wikipedia, The Free Encyclopedia, 2024. [Online; accessed 15-August-2024].
- Selinger, J.V.; Selinger, J.V. Ising model for ferromagnetism. Introduction to the Theory of Soft Matter: From Ideal Gases to Liquid Crystals 2016, pp. 7–24.
- Kabelac, A. One-and two-dimensional Ising model, 2021.
- El-Showk, S.; Paulos, M.F.; Poland, D.; Rychkov, S.; Simmons-Duffin, D.; Vichi, A. Solving the 3d ising model with the conformal bootstrap ii. c c-minimization and precise critical exponents. Journal of Statistical Physics 2014, 157, 869–914.
- Bhattacharjee, S.M.; Khare, A. Fifty years of the exact solution of the two-dimensional Ising model by Onsager. Current science 1995, 69, 816–821.
- Landau, R.H.; Páez, M.J.; Bordeianu, C.C. Computational physics: Problem solving with Python; John Wiley & Sons, 2024.
- Knegjens, R. Simulation of the 2D Ising Model, 2008.
- Bennett, D. Numerical Solutions to the Ising Model using the Metropolis Algorithm. JS TP 2016, 13323448.
- Skelton, J. Features of a 2D Ising Model simulated with Markov chain Monte Carlo methods 2021.
- LUZZI, L. Phase transition in the 2D Ising model: the theory behind and simulations via the Metropolis-Hastings algorithm 2022.
- Alexandrou, C.; Athenodorou, A.; Chrysostomou, C.; Paul, S. Unsupervised identification of the phase transition on the 2D-Ising model. arXiv preprint arXiv:1903.03506 2019.
- Neupane, R.; Gauli, H.R.K.; Rai, K.B.; Giri, K. Monte-Carlo simulation of phase transition in 2D and 3D Ising model. Scientific World 2023.
- Onsager, L. Crystal statistics. I. A two-dimensional model with an order-disorder transition. Physical Review 1944, 65, 117.
- Kroese, D.P.; Brereton, T.; Taimre, T.; Botev, Z.I. Why the Monte Carlo method is so important today. Wiley Interdisciplinary Reviews: Computational Statistics 2014, 6, 386–392.
- Wikipedia contributors. Metropolis–Hastings algorithm — Wikipedia, The Free Encyclopedia, 2024. [Online; accessed 16-August-2024].
- Huang, K. Statistical mechanics; John Wiley & Sons, 2008.
- Reible, B.M.; Hille, J.F.; Hartmann, C.; Delle Site, L. Finite-size effects and thermodynamic accuracy in many-particle systems. Physical Review Research 2023, 5, 023156.
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).