Giter VIP home page Giter VIP logo

ising's Introduction

# Ising Lattice Simulation Implementation

The main program here is ising.py which takes a variety of inputs and generates outputs of 
the 2-D Ising model. The Ising lattice simulation is provided by two codes, one in Python
and the other in C++. The C++ code is *much* faster, particularly for larger lattice sizes,
but requires a compiled library to work.

The files present are:

* ising.py:
    You will most likely only need to modify this file.
    This contains the main program. It requires the following:
    1. Python3 (sorry, Python2 will not work)
    2. several modules:
        - logging
        - numpy
        - matplotlib
    It will interface with either the Python or C++ lattice simulations.

    It contains many named inputs from the command line. Each input is
    made with [word]:[value] where value is (case insensitive for boolean values) 
    T/F/True/False/number/string.
    
    Numbers without decimal points are considered integers.

    The inputs options are:
    value           default   use
    t_min           1.6       minimum temperature
    t_max           3.6       maximum temperature (will not be included)
    t_step          0.1       temperatures will be analyzed from t_min to t_max
                              in increments of t_step and exlude t_max 
    t_top           4.0       temperature parameter used by default temperature annealing
    N               10        side of lattice, for a total of N*N sites
    n_steps         10000     number of steps to evolve the ising lattice
    n_burnin        2000      parameter for default annealing process
    n_analyze       5000      number of steps measured for mean and std statistics
    B               0         magnetic field strength
    flip_perc       0.1       ratio of lattice-site that may flip in a step
                              (note: this is exact in the C++ implementation,
                              but only the average in the Python implementation)
    dir_out         data      name of output directory
    plots           False     option to distplay E and M plots after finishign running
                              note: note available for multiprocess
    print_inp       False     echo all of the input options to the command line
    use_cpp         True      use C++ implementation; will switch off if the
                              shared library is not present
    date_output     False     add YYYYMMDD-HHMMSS postfix to output directory name
    file_prefix     ''        string to prefix output files
    multiprocess    False     use multiple processes
    skip_prog_print False     do not provide progress output information
                              note: progress info is not avialable in multiprocess


* IsingLattice_python.py:
    This is the Python implementation of the Ising lattice simulation.

* IsingLattice_cpp.py:
    This is a Python wrapper to talk to the compiled C++ library
    for the IsingLattice

* ising_lattice_lib.cxx:
    This is the C++ library to compile for the ising simulation
    It compiles ot ising_lattice_lib.so ('.so' for 'shared object')

* linux_compile_c_library.sh:
    This is a script to compile ising_lattice_lib.cxx in *NIX systems
    It should work on the cluster and on your PC

* slurm.input:
    This is a sample slurm input script for running concurrent jobs on 
    the grace cluster

* grace_environment.sh
    On the grace gluster, checkout your own node (unless you are just
    submitting jobs to slurm) and then run
    `source grace_environment.sh`

To be done:
    There are at least two major improvements to made in the code.

    1. Add a 'step_SwendsenWang' or a 'step_Wolf' (see lab handout for refernce)
       These algorithms overcome a large degree of the critical slowing that
       occures as the lattice approaches critical temperature, and would 
       allow some much better measurements.

    2. The spin correlations are calculated only for the final step. It
       would likely be *much* better to caclulate the avege and std of
       these values, as is done for the E and M parameter.

ising's People

Contributors

ryan9lim avatar

Stargazers

Qvanta LLC avatar Daniel Camarena avatar K.Liu avatar Natalia Kozinska avatar  avatar Tao Lee avatar

Watchers

James Cloos avatar Surya Dutta avatar  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.