Skip to content
amlawson98Public

About

Monte Carlo Simulator for Magnetism in 2D XY model

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

56 Commits

Folders and files

Repository files navigation

Monte Carlo Simulation of XY Spins

Simulator and GUI for Magnetism with 2D XY model in Python 3

Alex Lawson

In the 2-dimensional XY Model for spins on a lattice, each spin is defined by an angle , and the total energy is given by a dot product with all nearest neighbors term plus a dot product with an external field term.

(Actual energy scales are nonphysical). State of each spin at each iteration chosen from Boltzmann-Gibbs distribution.

VERY QUICK VERSION: DOWNLOAD JUST THE WHOLE FILE AS A ZIP - RUN python3 main.py - Play with controls. (Should work with Anaconda distribution default packages)

dependencies can be downloaded in pip3 install -r requirements.txt

A Quick Explainer for what everything is:

  • General Description and results in Alex_Lawson_Report.pdf

  • XY_MC.py is the main program here. It centers around a function called optimize_and_draw, that runs the simulated annealing algorithm.

  • XY_MC_interact.py pulls up a Tkinter GUI when run, which allows the user to modify lattice type, temperature and Hamiltonian at will.

  • The rest is all different versions/subprojects, function libraries to import, and diagrams/pictures for presentations and reports.

Alt text

Dependencies

  1. Python 3, with packages from default Anaconda Distribution

    • Using packages: tkinter (For GUI), numpy, random, copy, matplotlib, math, time, numba, sklearn, PIL
  2. tdqm - This makes the progress bar. This essential for anything except XY_MC_interact.py, since it tells you the Temperature and Energy as well as the system anneals.

    • Use pip install tqdm. I doubt it'll conflict with any installed packages. Its pretty lightweight.

About

Monte Carlo Simulator for Magnetism in 2D XY model

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages