Giter VIP home page Giter VIP logo

ising-model's Introduction

Ising Model Simulation

Two and three dimensional Ising model simulations using Swendsen-Wang algorithm.

Compiling

Open the project's directory in terminal. Type make (or mingw32-make depending on your environment) to compile.

Examples

Two dimensional Ising model simulation

Run main_2 and enter the parameters. You can also write the parameters in a file and use it as the input.

Example command:

For Windows:

main_2 < ./examples/input_2/1.txt

For macOS or a Linux based OS:

./main_2 < ./examples/input_2/1.txt

The results will be written into the files specified in the input.

You can visualize the results using plot.py.

Note

You need to have matplotlib installed for this step.

Example command:

python plot.py -M ./examples/output_2/m1.txt -S ./examples/output_2/s1.txt --save ./examples/output_2/figure1.png

Figure output of the example

  • You may need to type python3 instead of python depending on your environment.
  • --save is optional.
  • If you do not want matplotlib GUI to show up, you can pass the argument --no-gui.
  • If you need help about the usage of plot.py, you can try python plot.py -h.

Three dimensional Ising model simulation

This is similar to the two dimensional case.

Example commands:

For Windows:

main_3 < ./examples/input_3/1.txt
python plot.py -M ./examples/output_3/m1.txt -S ./examples/output_3/s1.txt --save ./examples/output_3/figure1.png

For macOS or a Linux based OS:

./main_3 < ./examples/input_3/1.txt
python plot.py -M ./examples/output_3/m1.txt -S ./examples/output_3/s1.txt --save ./examples/output_3/figure1.png

Figure output of the example

See here for more.

ising-model's People

Contributors

onurscode 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.