Ising Model
Hamiltonian
The famous Hamiltonian of the Ising model is given by
\begin{align} \mathcal{H} = -\sum{\langle i,j \rangle} \sigmai \sigma_j , \end{align}
where $\langle i, j \rangle$ indicates that the sum has to be taken over nearest neighbors.
Creating an Ising model
You can create an Ising model as follows,
model = IsingModel(; dims::Int=2, L::Int=8)
The following parameters can be set via keyword arguments:
dims
: dimensionality of the cubic lattice (i.e. 1 = chain, 2 = square lattice, etc.)L
: linear system size
Supported Monte Carlo flavors
- Monte Carlo (MC) (Have a look at the examples section below)
Examples
You can find example simulations of the 2D Ising model under Getting started and here: 2D Ising model.
Exports
MonteCarlo.IsingModel
— TypeFamous Ising model on a cubic lattice.
IsingModel(; dims, L)
Create Ising model on dims
-dimensional cubic lattice with linear system size L
.
MonteCarlo.IsingModel
— MethodIsingModel(params::Dict)
IsingModel(params::NamedTuple)
Create an Ising model with (keyword) parameters as specified in the dictionary/named tuple params
.
Analytic results
Square lattice (2D)
The model can be solved exactly by transfer matrix method (Onsager solution). This gives the following results.
Critical temperature: $T_c = \frac{2}{\ln{1+\sqrt{2}}}$
Magnetization (per site): $m = \left(1-\left[\sinh 2\beta \right]^{-4}\right)^{\frac {1}{8}}$
Potential extensions
Pull requests are very much welcome!
- Arbitrary dimensions
- Magnetic field
- Maybe explicit $J$ instead of implicit $J=1$
- Non-cubic lattices (just add
lattice::AbstractLattice
keyword)