Code Monkey home page Code Monkey logo

ising-model's Introduction

bdhammel

Ising Model

Python code to simulate the Ising model of a Ferromagnet.

For a discussion of the theory, visit my blog post.

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

$ 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:

$ python ising.py --temperature .8 --initial-state r --video

FAQ

If you get the error:

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

$ brew install ffmpeg

ising-model's People

Contributors

bdhammel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.