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.Ising
— TypeIsing
Struct to hold an Ising configuration plus parameters.
Alter only through set_...
functions to ensure consistency.
LatticeModels.Metropolis!
— FunctionMetropolis!(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.
LatticeModels.Wolff!
— FunctionWolff!(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.
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.
LatticeModels.Ising_SQ_critical_temperature
— ConstantIsing_SQ_critical_temperature
Critical temperature of the Ising model on the (infinite) square lattice, obtained by Onsager.
LatticeModels.Onsager_magnetization
— FunctionOnsager_magnetization(β)
Analytical magnetization (per spin) of the Ising model on the square lattice, obtained by Onsager in the thermodynamic limit.
LatticeModels.Onsager_internal_energy
— FunctionOnsager_internal_energy(β)
Analytical internal energy (per spin) of the Ising model on the square lattice, obtained by Onsager in the thermodynamic limit.
LatticeModels.Onsager_heat_capacity
— FunctionOnsager_heat_capacity(β)
Specific heat capacity of the Ising model on the square lattice, as obtained by Onsager in the thermodynamic limit.