Skip to content

Models ferromagnetic phase transitions using Metropolis-Hastings Monte Carlo algorithm.

Notifications You must be signed in to change notification settings

KianSc/Ising-Simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

2D Ising Model Simulation

Real-time visualization of ferromagnetic domain formation near the critical temperature.

Overview

This project is a Python-based Monte Carlo simulation of the 2D Ising Model, a mathematical model of ferromagnetism in statistical mechanics. It uses the Metropolis-Hastings algorithm to simulate magnetic spin dynamics on a lattice.

I built this to explore phase transitions, specifically how macroscopic order (magnetism) emerges from microscopic interactions and how systems behave near the critical point.

Features

  • Metropolis Dynamics: Implements the Metropolis-Hastings acceptance criterion for spin flips.
  • Real-time Visualization: Uses matplotlib.animation to visualize spin evolution and domain growth.
  • Periodic Boundary Conditions: Simulates an infinite lattice by wrapping grid edges.
  • Customizable Parameters: Easy adjustment of Grid Size ($N$), Temperature ($T$), and Interaction Strength ($J$).

Usage

1. Prerequisites

You will need Python installed along with the following libraries:

pip install numpy matplotlib

About

Models ferromagnetic phase transitions using Metropolis-Hastings Monte Carlo algorithm.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages