Skip to content

Simple 2D and 1D Ising model simulations using the Metropolis algorithm.

Notifications You must be signed in to change notification settings

epa058/Ising-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ising-Model

This Python code simulates the two-dimensional Ising model using the Metropolis algorithm on a square lattice at a given temperature.

It begins by initializing the spin grid, in which each magnetic spin is assigned a random initial state of -1 or +1. The Metropolis algorithm then evolves the spin system by randomly flipping spins based on changes in the system's energy, parametrized by $\verb|kBT|$, the Boltzmann constant $k_B$ multiplied by the temperature $T$. The energy calculations take into account the nearest neighbours' spins, which may include diagonal interactions, under periodic boundary conditions. After a set number of iterations, the resulting spin configuration is visualized using a colour map. The script also includes a section for a one-dimensional model, which is currently commented out.

The results are displayed in the folders "2D noDiag," "2D withDiag," and "1D."

About

Simple 2D and 1D Ising model simulations using the Metropolis algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages