https://github.com/mariogeiger/ising_triangular
ising in rust-python
https://github.com/mariogeiger/ising_triangular
ising-model
Last synced: 16 days ago
JSON representation
ising in rust-python
- Host: GitHub
- URL: https://github.com/mariogeiger/ising_triangular
- Owner: mariogeiger
- Created: 2017-03-17T08:26:06.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-22T21:58:08.000Z (about 9 years ago)
- Last Synced: 2025-02-23T19:22:56.403Z (over 1 year ago)
- Topics: ising-model
- Language: Jupyter Notebook
- Size: 465 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ising Triangular
- Ising first neighbor on a triangular lattice
- Metropolis algorithm with spin flips and parallel tempering
- Coded in python and rust
## Rust module
sweep(spins, temperature, n_flips=None)
- `spins` numpy 2D matrix of int32, modified by the function
- `temperature` for the flip probabilities
- `n_flips` amount of attempts to flip, by default it is the amount of spins
It returns the difference of energy between the new spin configuration and the original one.
## To run
- Install rust [here](https://www.rust-lang.org/en-US/install.html) or with `sudo apt-get install rustc cargo`
- Install python3 with `sudo apt-get install python3 python3-numpy python3-matplotlib`
- Install jupyther with `sudo apt-get install jupyter-notebook`
- Compile the rust code with the command `cargo build --release`
- Go on jupyter with `jupyter-notebook`