A parallel C++ Library for Simulations in the Heisenberg Model
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HB::MetropolisSimulation Class Reference

#include <simulation.h>

Public Member Functions

 MetropolisSimulation (const Grid< short int > &grid, const float beta, const size_t steps)
 
template<class M >
void operator() (const M &model) const
 

Private Member Functions

template<class M >
void simulate (const M &model)
 performs a production-run.
More...
 
template<class M >
float metropolisSweep (const M &model)
 performs one Monte-Carlo step, updating the entire grid associated with a certain model and calculates the energy difference More...
 

Private Attributes

float mBeta {1.0f}
 
size_t mSteps {1000}
 
std::shared_ptr< Grid< short int > > mGrid {}
 
std::vector< float > mEnergies {}
 
std::vector< float > mMagnetization {}
 

Detailed Description

Definition at line 13 of file simulation.h.

Constructor & Destructor Documentation

◆ MetropolisSimulation()

HB::MetropolisSimulation::MetropolisSimulation ( const Grid< short int > &  grid,
const float  beta,
const size_t  steps 
)
inline

Definition at line 16 of file simulation.h.

Member Function Documentation

◆ metropolisSweep()

template<class M >
float HB::MetropolisSimulation::metropolisSweep ( const M &  model)
private

performs one Monte-Carlo step, updating the entire grid associated with a certain model and calculates the energy difference

Parameters
Referenceto the model
betaInverse Temperature
rngPointer to the state of the GSL RNG
Returns
Energy difference

◆ operator()()

template<class M >
void HB::MetropolisSimulation::operator() ( const M &  model) const
inline

Definition at line 22 of file simulation.h.

Here is the call graph for this function:

◆ simulate()

template<class M >
void HB::MetropolisSimulation::simulate ( const M &  model)
private

performs a production-run.

A production run consists of a number of MC sweeps producing correlated energies

Parameters
Referenceto the model
betaInverse temperature
VVolume
stepsNumber of MC sweeps
energiesGets overridden with a standard vector of correlated energies (initial and one for each step)
Here is the caller graph for this function:

Member Data Documentation

◆ mBeta

float HB::MetropolisSimulation::mBeta {1.0f}
private

Definition at line 27 of file simulation.h.

◆ mEnergies

std::vector<float> HB::MetropolisSimulation::mEnergies {}
private

Definition at line 30 of file simulation.h.

◆ mGrid

std::shared_ptr<Grid<short int> > HB::MetropolisSimulation::mGrid {}
private

Definition at line 29 of file simulation.h.

◆ mMagnetization

std::vector<float> HB::MetropolisSimulation::mMagnetization {}
private

Definition at line 31 of file simulation.h.

◆ mSteps

size_t HB::MetropolisSimulation::mSteps {1000}
private

Definition at line 28 of file simulation.h.


The documentation for this class was generated from the following file: