Coder Social home page Coder Social logo

partitioned-ising-model's Introduction

Fortran Implementation of Ising model in 2D

A Fortran implementation of Markov Chain Monte Carlo for 2D square-lattice Ising model.

It is possible to calculate mean energy, magnetization, specific heat, and susceptibility at various temperatures and save it to a csv file.

  • OpenMP supported. This repository is useful for simulations on a large square-lattice at few temperature points.

Warning

For precise results, experiments on a large scale lattice Ising model need a lot of energy and time. We strongly recommend you to use a server with decent multi-core CPUs.

How to run Monte Carlo simulation

Clone the git repository

First, clone the git repository on your own computer directory (e.g. home directory).

After cloning the repository, enter the source directory.

git clone https://github.com/ising-model/ising-model.git
cd ising-model

Compile the code

In order to run the simulation, you have to compile the code first.

To compile the code, simply run the command below:

bash compile.sh

Run the simulation

To run experiments, run the command below:

./main --size 30 --init_temp 1.5 --final_temp 3.5 --temp_step 0.02 --eqstep 1000 --mcstep 1000

Options

To run simulation with your own custom options, run the program with the options below:

  • -s, --block_size : size of the partitioned block of a lattice (default: 30)
  • -i, --init_temp : initial temperature of the output (default: 1.5)
  • -f, --final_temp : final temperature of the output (default: 6.5)
  • -t, --temp_step : step size of the temperature (default: 0.04)
  • -m, --mcstep : number of Monte Carlo steps (default: 1000)
  • -e, --eqstep : number of steps for equilibration (default: 1000)
  • -r, --dir : directory to save the results (default: ./results/)
  • -p, --thread_per_row : number of threads per row of a lattice (default: 6)
  • -h, --help : print usage information and exit

Future works to be done

We want to parallelize the sampling procedure using GPU.

We also want to speed up the process using various techniques (e.g. importance sampling).

If you have abundant knowledge of those techniques, please contact us!

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.