Giter Site home page Giter Site logo

isingmodel's Introduction

IsPy Package

The Ising Python package (IsPy) provides implementation of four different Monte Carlo algorithms that simulates the Ising model of solids: Metropolis, Glauber, Wolff, and Cluster Heat Bath algorithms. It simulates how solids relax in low temperatures to aligned/anti-aligned spins. This code is flexible enough to be used for square and non-square lattices. This code relies on numpy and SciPy for array generation/random number generation and the Boltzmann constant.

Installation git clone https://github.com/TODO.

Recommendations We highly recommend importing sys to increase the recursion limit of functions in order to utilize the CHB code to its best potential. We also highly recommend using matplotlib.pyplot to visualize these lattices, in particular plt.imshow() to show how these lattices change over time. We’ve also checked and the code plays well with animation in case you want to use matplotlib.animation to animate the relaxation of the system in a cool (and very satisfying) figure.

This code uses lattices of various dimensions. Glauber and Metro run well in one, two, and three dimensions. We even have a function to run Metro in four dimensions, if that’s your thing. CHB runs in two and three dimensions well.

The algorithms can be run in two separate manners: running for N iterations and running until equilibrium. As you can expect the N iterations versions asks you to specify the number of times you’d like the code to be run before returning the altered lattice while the equilibrium functions will run until reaching a certain tolerance where the change of energy between two iterations is so small it’s considered insignificant. Obviously this second version can be very taxing on runtime so make sure to choose lattice size and tolerance wisely. Our best advice is to start small and with a large tolerance and then work your way down.

Notes

Most of this code depends on the use of square matrices to run. This is a limit and an update to include rectangular matrices could be implemented with one day's work. But as of right now this is a limit the user must work within. We have a function that generates 1D, 2D, and 3D lattices in gen1DLat(), gen2DLat(), gen3DLat(), respectively.

Cluster Heat Bath utilizes a recursive function. For larger arrays (particularly in 3D) this means that the recursion limit will be reached very easily. To avoid a recursion error we suggest raising the recursion limit to 100,000 or even 1,000,000, the limit we used in the making of this module.

License This package is released under the MIT License. See the LICENSE file for more information.

Contributing If you find a bug or would like to contribute to the package, please open an issue or pull request on the GitHub repository. We’ll make sure to respond immediately.

isingmodel's People

Contributors

imnotartsy avatar

Watchers

 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.