Metropolis

This is the basic single spin flip Metropolis rule.

template<class Hamiltonian, class Lattice>
struct MARQOV::Metropolis

A class to encapsulate the Metropolis update.

Using the power of partial template class specializations it is possible to define moves peculiar to your model.

Template Parameters
  • Hamiltonian: The Hamiltonian used to generate a Metropolis move

  • Lattice: The lattice used for the neighbourhood relations.

Public Static Functions

template<class StateSpace, class RNGType>
int move(const Hamiltonian &ham, const Lattice &grid, StateSpace &statespace, RNGCache<RNGType> &rng, double beta, int rsite)

The actual Metropolis move attempt.

The behaviour of the basic local MARQOV step, how to generate a new state vector from an old one, can be set by the initializers,

See

initializers.h

Return

integer, encoding whether the update was accepted or rejected

Template Parameters
  • Hamiltonian: the type of the Hamiltonian

  • Lattice: the type of the lattice

  • StateSpace: the type of the state space

  • M: the type of the initializer

  • RNG: the type of the random number generator

Parameters
  • ham: the Hamiltonian

  • grid: the lattice

  • statespace: the statespace

  • rng: the random number generator

  • beta: inverse temperature

  • rsite: site to be considered for an update