https://github.com/bdhammel/ising-model
Python implementation of the Ising model
https://github.com/bdhammel/ising-model
ising-model monte-carlo python simulation
Last synced: about 1 month ago
JSON representation
Python implementation of the Ising model
- Host: GitHub
- URL: https://github.com/bdhammel/ising-model
- Owner: bdhammel
- License: unlicense
- Created: 2017-05-15T02:55:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-11T19:12:44.000Z (over 5 years ago)
- Last Synced: 2024-04-21T11:20:25.528Z (over 1 year ago)
- Topics: ising-model, monte-carlo, python, simulation
- Language: Python
- Homepage: http://www.bdhammel.com/ising-model/
- Size: 843 KB
- Stars: 53
- Watchers: 3
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://app.circleci.com/pipelines/github/bdhammel/ising-model)
# Ising Model
Python code to simulate the Ising model of a Ferromagnet.
For a discussion of the theory, visit [my blog post](http://www.bdhammel.com/ising-model/).

The initial conditions of the ising lattice can be specified by the `tempature`, `initial state`, and `size parameters` of the model.
Running the simulation will output a video of system as it changes through out the run steps.
## Example
The `--help` command can show to possible parameters for modifying the simulation
~~~bash
$ python ising.py --help
Usage: ising.py [OPTIONS]Options:
-t, --temperature FLOAT temperature of the system [default: 0.5]
-i, --initial-state [r|u] (R)andom or (U)niform initial state of the system [default: r]
-s, --size INTEGER Number of sites, M, in the MxM lattice [default: 100]
-e, --epochs INTEGER Number of iterations to run the simulation for [default: 1000000]
--video Record a video of the simulation progression
--help Show this message and exit.
~~~For example:
~~~bash
$ python ising.py --temperature .8 --initial-state r --video
~~~## FAQ
If you get the error:
~~~bash
MovieWriter stderr:
dyld: Library not loaded: /usr/local/opt/x264/lib/libx264.152.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: image not found
~~~Then you need to install ffmpeg
~~~bash
$ brew install ffmpeg
~~~