This repository contains code for homework 3 of 598APE.
This assignment is relatively simple in comparison to HW1 and HW2 to ensure you have enough time to work on the course project.
In particular, this repository implements a 2D Ising model Monte Carlo simulator (with Metropolis–Hastings algorithm) on an L×L lattice with periodic boundary conditions.
To compile the program run:
make -jTo clean existing build artifacts run:
make cleanThis program assumes the following are installed on your machine:
- A working C compiler (gcc is assumed in the Makefile)
- make
- ImageMagick
convertfor PNG output
Usage (after compiling):
./main.exe <L> <temperature> <steps>In particular, consider speeding up simple run like the following (which runs ~5 seconds on my local laptop under the default setup):
./main.exe 100 2.269 100000Exact bitwise reproducibility is not required; sanity checks on energy/magnetization bounds must pass. In addition, at the critical temperature (T ≈ 2.269) the energy per spin should approach -1.414 in equilibrium.