Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

A Monte Carlo Implementation of the Ising Model in Python

Alexey Khorev

Published Oct 1, 2017• 0 citations
OpenAlex

Abstract

This article explores an implementation of the 2D Ising model using the Metropolis algorithm in the Python programming language. The goal of this work was to explore the scope of behaviours this model can demonstrate through a simplistic implementation on a relatively low-end machine. The Ising model itself is particularly interesting as it demonstrates relatively complex behaviours of ferromagnetics e.g. the second-order phase transition in spite of its simplicity. To study the specifics of this model several parameters were measured (namely the net magnetization and energy, the specific heat and correlation function) and a visualization of the grid was implemented. The simulations demonstrated an easily observable phase transition near critical temperature on a 100 × 100 Ising grid with the measured parameters behaving nearly as predicted by the exact solution developed for this model.

Related papers

Monte Carlo Investigation of Magnetic Phase Transitions in the Two-Dimensional Ising Model

Satyendra Lohar, Neha Srivas, Akhilesh Dwivedi

Many problems in statistical physics resist exact solution once the number of interacting particles becomes large, and the two-dimensional Ising model is a classic case where numerical simulation fills that gap. This paper reports a Monte Carlo study of the two-dimensional Ising model using the Metropolis algorithm, undertaken to examine how magnetization, internal energy, specific heat, and magnetic susceptibility change with temperature. Spin configurations were generated on a square lattice under periodic boundary conditions, with each proposed spin flip accepted or rejected according to the Boltzmann weight of the resulting energy change. The simulation reproduces the expected transition from an ordered ferromagnetic state at low temperature to a disordered paramagnetic state at high temperature, with magnetization falling sharply and both specific heat and susceptibility peaking near a critical temperature of Tc ≈ 2.3–2.4 (in units of J/kB), consistent with the exact value obtained analytically for this system. These results confirm that the Metropolis algorithm, despite its simplicity, remains a dependable tool for locating second-order phase transitions and extracting thermodynamic quantities in lattice spin systems, and the same computational framework can be adapted to more elaborate models used in condensed matter and materials research.

•Aug 14, 2026•0 citations

The hobbyhorse of magnetic systems: the Ising model

Eduardo Ibarra-García-Padilla, Carlos Gerardo Malanche-Flores, Freddy Jackson Poveda-Cuevas

Abstract In undergraduate statistical mechanics courses the Ising model always plays an important role because it is the simplest non-trivial model used to describe magnetic systems. The one-dimensional model is easily solved analytically, while the two-dimensional one can be solved exactly by the Onsager solution. For this reason, numerical simulations are usually used to solve the two-dimensional model. Keeping in mind that the two-dimensional model is the platform for studying phase transitions, it is usually an exercise in computational undergraduate courses because its numerical solution is relatively simple to implement and its critical exponents are perfectly known. The purpose of this article is to present a detailed numerical study of the second-order phase transition in the two-dimensional Ising model at an undergraduate level, allowing readers not only to compare the mean-field solution, the exact solution and the numerical one through a complete study of the order parameter, the correlation function and finite-size scaling, but to present the techniques, along with hints and tips, for solving it themselves. We present the elementary theory of phase transitions and explain how to implement Markov chain Monte Carlo simulations and perform them for different lattice sizes with periodic boundary conditions. Energy, magnetization, specific heat, magnetic susceptibility and the correlation function are calculated and the critical exponents determined by finite-size scaling techniques. The importance of the correlation length as the relevant parameter in phase transitions is emphasized.

arXiv:1606.05800•European Journal of Physics•Sep 26, 2016•23 citations

Monte Carlo-Based Modeling of 2-D Ising Systems Using Metropolis Algorithm, Simulation Techniques, Thermodynamic Behavior and Magnetization Patterns

Adama Gaye, Omolola Dorcas Atanda

This study presents a comprehensive Monte Carlo simulation of the two-dimensional (2-D) Ising model using the Metropolis algorithm to investigate critical phenomena and thermodynamic behavior in spin-lattice systems. The model, implemented in MATLAB with periodic boundary conditions, explores equilibrium properties such as magnetization, internal energy, specific heat, and susceptibility across a range of temperatures. By employing various initial spin configurations—ordered and random—the simulations demonstrate the system's ergodicity and convergence to thermal equilibrium. Key results include a sharp decline in magnetization and a pronounced peak in specific heat near the critical temperature, consistent with second-order phase transition behavior. The simulation captures microscopic domain evolution, highlighting the transition from ferromagnetic to paramagnetic phases as thermal fluctuations increase. The study further evaluates algorithmic efficiency, discusses the impact of lattice size on statistical accuracy, and proposes improvements using advanced cluster algorithms and parallel computing frameworks. The findings validate theoretical predictions from Onsager's solution and underscore the versatility of Monte Carlo techniques in modeling collective behavior in magnetic systems. The simulation framework offers a robust foundation for analyzing critical dynamics and extends its relevance to broader applications in material science, computational physics, and complex systems modeling.

•May 20, 2025•1 citation

Investigation of Phase Transition in 2D Ising Model

Subeksha Bhattarai

2D Ising model is simple yet powerful model to describe ferromagnetism. In this project, the phase transition and critical behaviour of the 2D Ising model using metropolis algorithm was investigated. The magnetisation vs temperature graph for different lattice size L = 5, L= 10, L = 15, L=20, L=30, was analyzed and compared. The analysis demonstrated a trend where the critical point becomes more sharply defined on increasing lattice size. The obtained value of critical temperature from graph closely approximates to the theoretical value. Hence the simulation successfully demonstrated the phase transition of magnetic material from ordered to disordered state. The significance of Ising model further extends far beyond its application in understanding magnetism. This study though simple but it provides a deeper understanding of phase transition and critical behaviour.

•Aug 21, 2025•0 citations

Critical Behavior Simulation of the Two-Dimensional Ising Model—A Computational Physics Study Based on the Monte Carlo Method

佳钢 李

To demonstrate the application of computational physics in modern statistical physics, this paper investigates the critical behavior of a finite-size ferromagnetic system based on the two-dimensional square-lattice Ising model.A nearest-neighbor Ising Hamiltonian is constructed, and periodic boundary conditions are adopted to reduce finite-boundary effects.The Metropolis Monte Carlo algorithm is used to sample spin configurations at different temperatures, while energy, magnetization, specific heat, magnetic susceptibility and Binder cumulant are calculated to describe the transition from an ordered state to a disordered state.The simulation results show that the system exhibits clear long-range order at low temperatures, where the order parameter remains high.As temperature increases, thermal fluctuations become stronger, magnetization decreases rapidly, and the system gradually evolves into a disordered state.The specific heat curve shows a pronounced peak at approximately (T = 2.269), while the susceptibility peak shifts slightly toward the high-temperature side due to finite-size effects and the discrete temperature grid.Overall, the simulated critical region is consistent with the theoretical critical temperature of the two-dimensional square-lattice Ising model.Spin-configuration analysis further reveals enhanced fluctuations and domain reconstruction near the critical region.In addition, a thermalization criterion and an extended sampling test for L = 48 near the critical region are added to examine the influence of finite sampling and equilibration.These results indicate that Monte Carlo simulation of the two-dimensional Ising model can effectively reproduce continuous phase transition, critical fluctuation and finite-size effects, providing a basic computational case for understanding critical phenomena in complex systems and data-driven physical analysis.

Modern Physics•Jan 1, 2026•0 citations

Investigation of Phase Transition in 2D Ising Model

Subeksha Bhattarai

2D Ising model is simple yet powerful model to describe ferromagnetism. In this project, the phase transition and critical behaviour of the 2D Ising model using metropolis algorithm was investigated. The magnetisation vs temperature graph for different lattice size L = 5, L= 10, L = 15, L=20, L=30, was analyzed and compared. The analysis demonstrated a trend where the critical point becomes more sharply defined on increasing lattice size. The obtained value of critical temperature from graph closely approximates to the theoretical value. Hence the simulation successfully demonstrated the phase transition of magnetic material from ordered to disordered state. The significance of Ising model further extends far beyond its application in understanding magnetism. This study provides a deeper understanding of phase transition and critical behaviour.

•Aug 22, 2025•0 citations
This article explores an implementation of the 2D Ising model using the Metropolis algorithm in the Python programming language. The goal of this work was to explore the scope of behaviours this model can demonstrate through a simplistic implementation on a relatively low-end machine. The Ising model itself is particularly interesting as it demonstrates relatively complex behaviours of ferromagnetics e.g. the second-order phase transition in spite of its simplicity. To study the specifics of this model several parameters were measured (namely the net magnetization and energy, the specific heat and correlation function) and a visualization of the grid was implemented. The simulations demonstrated an easily observable phase transition near critical temperature on a 100 × 100 Ising grid with the measured parameters behaving nearly as predicted by the exact solution developed for this model.
Many problems in statistical physics resist exact solution once the number of interacting particles becomes large, and the two-dimensional Ising model is a classic case where numerical simulation fills that gap. This paper reports a Monte Carlo study of the two-dimensional Ising model using the Metropolis algorithm, undertaken to examine how magnetization, internal energy, specific heat, and magnetic susceptibility change with temperature. Spin configurations were generated on a square lattice under periodic boundary conditions, with each proposed spin flip accepted or rejected according to the Boltzmann weight of the resulting energy change. The simulation reproduces the expected transition from an ordered ferromagnetic state at low temperature to a disordered paramagnetic state at high temperature, with magnetization falling sharply and both specific heat and susceptibility peaking near a critical temperature of Tc ≈ 2.3–2.4 (in units of J/kB), consistent with the exact value obtained analytically for this system. These results confirm that the Metropolis algorithm, despite its simplicity, remains a dependable tool for locating second-order phase transitions and extracting thermodynamic quantities in lattice spin systems, and the same computational framework can be adapted to more elaborate models used in condensed matter and materials research.
Abstract In undergraduate statistical mechanics courses the Ising model always plays an important role because it is the simplest non-trivial model used to describe magnetic systems. The one-dimensional model is easily solved analytically, while the two-dimensional one can be solved exactly by the Onsager solution. For this reason, numerical simulations are usually used to solve the two-dimensional model. Keeping in mind that the two-dimensional model is the platform for studying phase transitions, it is usually an exercise in computational undergraduate courses because its numerical solution is relatively simple to implement and its critical exponents are perfectly known. The purpose of this article is to present a detailed numerical study of the second-order phase transition in the two-dimensional Ising model at an undergraduate level, allowing readers not only to compare the mean-field solution, the exact solution and the numerical one through a complete study of the order parameter, the correlation function and finite-size scaling, but to present the techniques, along with hints and tips, for solving it themselves. We present the elementary theory of phase transitions and explain how to implement Markov chain Monte Carlo simulations and perform them for different lattice sizes with periodic boundary conditions. Energy, magnetization, specific heat, magnetic susceptibility and the correlation function are calculated and the critical exponents determined by finite-size scaling techniques. The importance of the correlation length as the relevant parameter in phase transitions is emphasized.
This study presents a comprehensive Monte Carlo simulation of the two-dimensional (2-D) Ising model using the Metropolis algorithm to investigate critical phenomena and thermodynamic behavior in spin-lattice systems. The model, implemented in MATLAB with periodic boundary conditions, explores equilibrium properties such as magnetization, internal energy, specific heat, and susceptibility across a range of temperatures. By employing various initial spin configurations—ordered and random—the simulations demonstrate the system's ergodicity and convergence to thermal equilibrium. Key results include a sharp decline in magnetization and a pronounced peak in specific heat near the critical temperature, consistent with second-order phase transition behavior. The simulation captures microscopic domain evolution, highlighting the transition from ferromagnetic to paramagnetic phases as thermal fluctuations increase. The study further evaluates algorithmic efficiency, discusses the impact of lattice size on statistical accuracy, and proposes improvements using advanced cluster algorithms and parallel computing frameworks. The findings validate theoretical predictions from Onsager's solution and underscore the versatility of Monte Carlo techniques in modeling collective behavior in magnetic systems. The simulation framework offers a robust foundation for analyzing critical dynamics and extends its relevance to broader applications in material science, computational physics, and complex systems modeling.
2D Ising model is simple yet powerful model to describe ferromagnetism. In this project, the phase transition and critical behaviour of the 2D Ising model using metropolis algorithm was investigated. The magnetisation vs temperature graph for different lattice size L = 5, L= 10, L = 15, L=20, L=30, was analyzed and compared. The analysis demonstrated a trend where the critical point becomes more sharply defined on increasing lattice size. The obtained value of critical temperature from graph closely approximates to the theoretical value. Hence the simulation successfully demonstrated the phase transition of magnetic material from ordered to disordered state. The significance of Ising model further extends far beyond its application in understanding magnetism. This study though simple but it provides a deeper understanding of phase transition and critical behaviour.
To demonstrate the application of computational physics in modern statistical physics, this paper investigates the critical behavior of a finite-size ferromagnetic system based on the two-dimensional square-lattice Ising model.A nearest-neighbor Ising Hamiltonian is constructed, and periodic boundary conditions are adopted to reduce finite-boundary effects.The Metropolis Monte Carlo algorithm is used to sample spin configurations at different temperatures, while energy, magnetization, specific heat, magnetic susceptibility and Binder cumulant are calculated to describe the transition from an ordered state to a disordered state.The simulation results show that the system exhibits clear long-range order at low temperatures, where the order parameter remains high.As temperature increases, thermal fluctuations become stronger, magnetization decreases rapidly, and the system gradually evolves into a disordered state.The specific heat curve shows a pronounced peak at approximately (T = 2.269), while the susceptibility peak shifts slightly toward the high-temperature side due to finite-size effects and the discrete temperature grid.Overall, the simulated critical region is consistent with the theoretical critical temperature of the two-dimensional square-lattice Ising model.Spin-configuration analysis further reveals enhanced fluctuations and domain reconstruction near the critical region.In addition, a thermalization criterion and an extended sampling test for L = 48 near the critical region are added to examine the influence of finite sampling and equilibration.These results indicate that Monte Carlo simulation of the two-dimensional Ising model can effectively reproduce continuous phase transition, critical fluctuation and finite-size effects, providing a basic computational case for understanding critical phenomena in complex systems and data-driven physical analysis.
2D Ising model is simple yet powerful model to describe ferromagnetism. In this project, the phase transition and critical behaviour of the 2D Ising model using metropolis algorithm was investigated. The magnetisation vs temperature graph for different lattice size L = 5, L= 10, L = 15, L=20, L=30, was analyzed and compared. The analysis demonstrated a trend where the critical point becomes more sharply defined on increasing lattice size. The obtained value of critical temperature from graph closely approximates to the theoretical value. Hence the simulation successfully demonstrated the phase transition of magnetic material from ordered to disordered state. The significance of Ising model further extends far beyond its application in understanding magnetism. This study provides a deeper understanding of phase transition and critical behaviour.