Writing an Ising Model Solver Algorithm in Python for a Square Ferromagnet

Published Date

Publisher

Abstract

This is an example of the Metropolis algorithm used to solve the Ising model, written in Python. The Python program (.py file) simulates a square lattice representing a ferromagnetic material as it reaches equilibrium at different energy levels corresponding to different temperatures in relationship to the magnetic susceptibility of the material. This program outputs a set of numpy matrices as files (.npy, not included in the submitted data) and uses them to create a graph of equilibrium magnetization (sum of spins normalized to the size of the matrix) vs temperature (in units of thermal energy per energy to change spins), which is saved as a .png file. An example image output is also included, as well as the Jupyter notebook used throughout this research project.

Description

A Jupyter notebook file (.ipynb), Python program (.py), and image (.png) depicting one of the outputs of the program. The Jupyter notebook is similar to a lab notebook in terms of chronicling this project, the Python program is the result of the project, and the image is a graph depicting the result of the program.

Related to

item.page.replaces

License

Series/Report Number

Funding Information

This research was supported by the Undergraduate Research Opportunities Program (UROP).

item.page.isbn

DOI identifier

Previously Published Citation

Other identifiers

Suggested Citation

Gunn, Alex. (2025). Writing an Ising Model Solver Algorithm in Python for a Square Ferromagnet. Retrieved from the University Digital Conservancy, https://hdl.handle.net/11299/277701.

Content distributed via the University Digital Conservancy may be subject to additional license and use restrictions applied by the depositor. By using these files, users agree to the Terms of Use. Materials in the UDC may contain content that is disturbing and/or harmful. For more information, please see our statement on harmful content in digital repositories.