Models

Ising model

Ising model implemented over a generic graph. For example, for the square lattice

using LatticeModels

IS = Ising(SQLattice_periodic,20,20;T=2.7)
println("Energy $(IS.E), magnetization $(IS.M)")
Energy 8.0, magnetization -16

The single-spin Metropolis and Wolff cluster Monte Carlo algorithms are implemented:

E,M = Metropolis!(IS,steps=100,save_interval=10)
E,M = Wolff!(IS,steps=100,save_interval=10)
([-0.92, -0.94, -0.92, -0.79, -0.85, -0.96, -0.95, -1.06, -0.89, -1.16], [0.25, 0.395, -0.375, -0.095, -0.025, 0.3, 0.335, 0.46, -0.245, -0.595])

API

LatticeModels.IsingType
Ising

Struct to hold an Ising configuration plus parameters.

Alter only through set_... functions to ensure consistency.

source
LatticeModels.Metropolis!Function
Metropolis!(IS::Ising;steps::Int = 1,save_interval::Int=0,conf_save_interval::Int=0)

Do steps steps per spin of single-spin-flip Metropolis Monte Carlo for the Ising model IS. conf_save_interval is not implemented. If save_interval>0 return a tuple (E, M) with energy and magnetization per spin, saved every save_interval steps.

source
LatticeModels.Wolff!Function
Wolff!(IS::Ising;steps::Int = 1,save_interval::Int=0,conf_save_interval::Int=0)

Do steps Monte Carlo steps for the Ising model IS using the Wolff cluster algorithm. conf_save_interval is not implemented. If save_interval>0 return a tuple (E, M) with energy and magnetization per spin, saved every save_interval steps.

source

Analytical results

The following functions return exact values (in the thermodynamic limit), using Onsager's results. These are taken from the IsingModels.jl package by Jorge Fernandez-de-Cossio-Diaz.

Gaussian model