ising-model | Python implementation of the Ising model

 by   bdhammel Python Version: Current License: Unlicense

kandi X-RAY | ising-model Summary

kandi X-RAY | ising-model Summary

ising-model is a Python library typically used in Simulation applications. ising-model has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Python code to simulate the Ising model of a Ferromagnet. For a discussion of the theory, visit my blog post. The initial conditions of the ising lattice can be specified by the tempature, initial state, and size parameters of the model. Running the simulation will output a video of system as it changes through out the run steps.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ising-model has a low active ecosystem.
              It has 29 star(s) with 11 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              ising-model has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of ising-model is current.

            kandi-Quality Quality

              ising-model has no bugs reported.

            kandi-Security Security

              ising-model has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              ising-model is licensed under the Unlicense License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              ising-model releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed ising-model and discovered the below as its top functions. This is intended to give you an instant insight into ising-model implemented functionality, and help decide if they suit your requirements.
            • Runs the fitting algorithm
            • Return the index of the index i
            • Calculate the energy of a system
            • Compute the internal energy
            Get all kandi verified functions for this library.

            ising-model Key Features

            No Key Features are available at this moment for ising-model.

            ising-model Examples and Code Snippets

            No Code Snippets are available at this moment for ising-model.

            Community Discussions

            QUESTION

            How to use prange in cython?
            Asked 2020-Nov-08 at 18:14

            I'm trying to solve a 2D-Ising model with Monte Carlo approach.

            As it is slow I used Cython to accelerate the code execution. I would like to push it even further and parallelize the Cython code. My idea is to split the 2D-lattice in two, so for any point on a lattice has it's nearest neigbours on the other lattice. This way I can randomly choose one lattice and I can flip all the spins and this could be done in parallel since all those spins are independent.

            So far this is my code :
            ( inspired from http://jakevdp.github.io/blog/2017/12/11/live-coding-cython-ising-model/ )

            ...

            ANSWER

            Answered 2020-Jun-07 at 18:39

            From a Cython point-of-view the main problem is that cy_spin_flip requires the GIL. You need to add nogil to the end of its signature, and set the return type to void (since by default it returns a Python object, which requires the GIL).

            However, np.exp and np.random.rand also require the GIL, because they're Python function calls. np.exp is probably easily replaced with libc.math.exp. np.random is a bit harder, but there's plenty of suggestions for C- and C++-based approaches: 1 2 3 4 (+ others).

            A more fundamental problem is the line:

            Source https://stackoverflow.com/questions/62249186

            QUESTION

            Ising model simulation offset critical temperature
            Asked 2018-Apr-05 at 11:27

            I'm writing a simulation of the Ising model in 2D. The model behaves as predicted except for one thing: the critical temperature is roughly 3.5 while it should be near 2/ln(2 + sqrt (2)).

            The project is a C++ program that generates the data, and a shell script that exercises the program. The full code can be found here. Also here's lattice.cpp

            ...

            ANSWER

            Answered 2018-Apr-05 at 11:27

            I have found a few issues in your code:

            • The compute_dE method returns the wrong energy, as the factor of 2 shouldn't be there. The Hamiltonian of the Ising system is

              While you are effectively using

            • The compute_energy method returns the wrong energy. The method should iterate over each spin pair only once. Something like this should do the trick:

              for (unsigned int i = 0; i < max; i++) { for (unsigned int j = i + 1; j < max; j++) { energy_sum += other.compute_point_energy(i, j); } }

            • You use a temperature that is updated on the fly instead of using the target temperature. I do not really understand the purpose of that.

            Source https://stackoverflow.com/questions/49661195

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ising-model

            You can download it from GitHub.
            You can use ising-model like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bdhammel/ising-model.git

          • CLI

            gh repo clone bdhammel/ising-model

          • sshUrl

            git@github.com:bdhammel/ising-model.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link