Coder Social home page Coder Social logo

big-ising's Introduction

big-ising

Make a huge, really huge, Ising model at Tc

It is mostly a standard Wolff algorithm, but it does two clever things:

  1. Stores spins bit-wise. So 8 spins per byte of memory.
  2. The stack wraps around. So when your cluster gets huge (so long as you're clearing it quick enough) the stack starts overwriting itself. This allows the stack size to scale like $\sqrt{N}$ rather than $N$.

Building

There are no big dependencies for this code. It's been tested on Mac with clang, Linux with gcc and Windows using MingGW-W64. You can get the Windows tool chain from https://mingw-w64.org/. If you have the Rtools tools set then it comes bundled with that. I used rtools34.exe.

I can't get the really really big models to work on Windows, only had success on Linux.

Running

There are no input files. All variables are compiled in as #defines. If the lattice.pos file is present in the working directory then this will be loaded in and the simulation resumed from this point.

Outputs

  • data contains the magnetisation and energy for each MC sweep
  • lattice.pos is a binary dump of the current spin configuration. This can be used for reloading or for making images.
  • swolf*.png these files show the evolution of the configuration.

Making Pngs

A big enough Ising model will be too big to plot. Therefore you need to block spins together to draw pixels. The isingpng programme is designed to help make pngs by choosing location and zoom level. The png library is from Lode Vandevenne, please see its license before distributing.

License

MIT © 2016 Douglas Ashton, 2005-2016 Lode Vandevenne (lodepng)

big-ising's People

Contributors

dougmet avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

big-ising's Issues

Makefile

Please add a make file.

If you really want png and movie versions then either put them in subdirectories or make different targets.

Split out classes

Because you use it in a lot of places. After you've got things working again split out the class and reuse it in the three different binary types (normal, png and movie)

Class structure should be something like:

ising
box
particle

get rid of the _class suffixes.

The three .cpp files that you have currently are three different programmes. So I'd more or less keep them how they are. Rename the files but otherwise just link up to the new classes

Try removing variables as #defines

If it doesn't have a significant impact on speed then it would make the binaries simpler. However, speed is most important so do a proper benchmark.

Make it self contained

  • Copy in MersenneTwister
  • Remove all /home/da246 links. Who's that? ;-)
  • Work out where the pngwriter libraries are

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.