GithubHelp home page GithubHelp logo

mcwitt / isg Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 51 KB

Monte Carlo simulation of Ising spin glasses.

Python 9.77% Shell 9.61% C 79.03% Makefile 1.37% Objective-C 0.22%

isg's Introduction

Monte Carlo simulation of one-dimensional Ising spin glasses

isg is an implementation of replica-exchange Monte Carlo for one-dimensional Ising spin glasses with long range interactions. It has a modular measurement system which makes it possible to add new types of measurements without changing the core simulation code.

Basic usage

Simulation parameters are defined as macro constants to allow for effective compiler optimization. Use the script setup.sh to prepare a build for a given set of parameters. Binaries with different sets of parameters should be built in separate directories.

For example, to build a simulation with the following parameters

  • 2^10 spins
  • diluted bonds with average coordination z=6
  • 50 replicas
  • 2^6 warmup sweeps
  • 2^24 measurement sweeps

we use

mkdir -p build/z6-N2p10
cd build/z6-N2p10
export LOG_N=10
export Z=6
export NUM_REPLICAS=50
export LOG_WARMUP_UPDATES=6
export LOG_NUM_UPDATES=24
 ../../setup.sh
make

The ifm binary takes a single argument, which is used to seed the random number generator. Additionally, the following files should exist in the current directory:

  • temps.txt, a list of temperatures. Length must match NUM_REPLICAS.
  • samp_*.txt, bond configuration for each sample. This is only required if GENERATE_SAMPLES=0 (the default value). There must be a sample file corresponding to each seed passed to isg. See "sample generation" below.

Module system

The code to do various measurements on the system is separated from the core simulation code into modules. The header modules.h contains the interface that extension modules should implement. Modules are prefixed with "mod_" and consist of a header file declaring the data structures used by the module and a source file implementing the functions in modules.h. The output from each module should go into a separate file, named according to the type of measurement and the seed of the measured sample.

Some included modules are listed below:

  • meas: basic averages including energy, spin overlap, link overlap
  • hist: distribution of the spin overlap
  • corr (corr_fft): spin correlation function at logarithmically (linearly)-spaced points

Sample generation

There are two methods for sample generation.

  1. Provide a list of bonds in a text file. Each line of the file represents a coupling ("bond") and should be formatted as 3 comma-separated values where the first two are integers representing site indices and the third is the coupling strength. The script bonds.py generates samples in this format.

  2. Set GENERATE_SAMPLES=1. The samples are then generated at run-time in the simulation code. This is useful when studying very large sizes since the bond configurations are not written to disk.

See the help message for bonds.py for more usage information. If using GENERATE_SAMPLES=1, the range parameter is controlled by setting the SIGMA parameter before calling setup.sh.

isg's People

Contributors

mcwitt avatar

Stargazers

 avatar

Watchers

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