Initializers

Initializers can be used to specify how the Metropolis Algorithm generates a local update to a State Vector. We do provide default behaviour, but is also possible to specify the behaviour for your Hamiltonian. To that end you should make a declaration in the following form visible before MARQOV::Core gets declared:

Here is the documentation for our default initializers.

template<typename IntType>
class SVInitializer<std::array<IntType, 1>, typename std::enable_if<std::is_integral<IntType>::value && std::is_signed<IntType>::value>::type>
#include <initializers.h>

Initializer for Ising-like models.

draws a random spin site +1/-1.

Template Parameters
  • IntType: the integer type used for storage.

Public Static Functions

template<class RNGCache>
StateVector newsv(const StateVector &svold, RNGCache &rng)

Flip the Ising spin.

Return

the new state vector with flipped spin

Template Parameters
  • RNGCache: the Random Number Generator.

Parameters
  • svold: the old state vector.

  • rng: a reference to the RNG of the Monte Carlo simulation.

Private Types

typedef std::array<IntType, 1> StateVector
template<typename T>
class SVInitializer<T, typename std::enable_if<std::is_floating_point<typename T::value_type>::value>::type>

Public Static Functions

template<class RNGCache>
StateVector newsv(const StateVector &svold, RNGCache &rng)

Flip the Spin.

Return

The new state vector with flipped spin

Template Parameters
  • RNGCache: the Random Number Generator.

Parameters
  • svold: The old state vector.

  • rng: A reference to the RNG of the Monte Carlo simulation.

Private Types

using StateVector = T
template<class StateVector>
class Spin1_Initializer
#include <initializers.h>

Initializer for models with integer spin states -1, 0, 1.

Template Parameters
  • StateVector: the type of the state vector.

Public Static Functions

template<class RNGCache>
StateVector newsv(const StateVector &svold, RNGCache &rng)

Draw a new state vector based on the old one.

Return

The new state vector

Template Parameters
  • RNG: The Random Number Generator.

Parameters
  • svold: The old state vector.

  • rng: A reference to the RNG of the Monte Carlo simulation.

template<class Hamiltonian>
class Initializer : public SVInitializer<Hamiltonian::StateVector>
#include <initializers.h>

The generic case that can be specified by a user for a Hamiltonian.

Template Parameters
  • Hamiltonian: The Hamiltonian that you use.