12#ifndef __ISING_MODEL__
13#define __ISING_MODEL__
21#include <unordered_map>
23#define INDEX(I, N) (I + N) % N
Test class for the Ising model.
The Ising model in 2 dimensions.
std::mt19937 engine
The RNG that is used for the Metropolis algorithm.
int64_t E
The current energy state. unit: .
double T
The temperature of the model.
int L
Size of the lattice.
arma::Mat< int > lattice
matrix where element .
void initialize_lattice()
Initialize the lattice with a random distribution of 1s and -1s.
data_t Metropolis()
The Metropolis algorithm.
void initialize_energy()
Initialize the energy of the system.
void initialize_neighbors()
initialize the neighbors matrix.
double energy_diff[17]
An array containing all possible energy differences.
void initialize_magnetization()
Initialize the magnetization of the system.
arma::Mat< int > neighbors
matrix with the neighbors of each element .
void initialize_engine()
Initialize the RNG.
IsingModel()
Constructor used for testing.
int64_t M
The current magnetic strength. unit: Unitless.
void initialize_energy_diff()
Initialize the energy_diff array with the correct values.
Type to use with the IsingModel class and montecarlo module.
Header for the data_t type.
Function prototypes and macros that are useful.