Skip to content

malsinac/MoMo-MC

Repository files navigation

Description

This repository contains a 2D Ising simulator employing a Monte Carlo - Hastings simulator for the MoMo subject of the Molecular Modelling master - Barcelona University

How to set up the environment simulation

In order to properly reproduce the results, we recommend the following software:

  • make >= 4.3
  • gfortan >= 11.3.0
  • Python and python packages:
    • python >= 3.10.4
    • numpy >= 1.21.5
    • matplotlib >= 3.5.3
    • scipy >= 1.7.3

Other software versions might arise errors when trying to reproduce the results.

Note as well that only Unix-like OS (GNU/Linux or MacOS) are permitted, since the software has not been designed to run in Windows environvents.

How to reproduce the results

To fully reproduce the results, just bash ./setup.sh. It will compile all fortran programs, run the simulations, and make the analysis and plots. The user has to specify the variable img_dir, which is the path where all the results will be saved. The expected execution time is one hour.

If only specific parts wants to be carried out:

  • To compile the programs:

    make
    make jackknife.x
  • To run a simulation:

    ./main.x parameters.nml

    Where parameters.nml is the namelist containing the parameters for the simulation (an example can be found in this path).

  • To perform the analysis of the simulations:

    python3 analysis/analyzer.py path/of/the/directory/with/simulations /path/where/to/store/the/results

    It will automatically work out the number of simulations that exists, following the name scheme "t_{temperature}_{L}"

About

Monte Carlo simulation of the classical 2D Ising sping model

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published