q-Potts Model

template<int Q>
class PottsMagnetization
#include <Potts.h>

Magnetization of the Q-state Potts model.

Template Parameters
  • Q: the number of spin values

Public Functions

template<class StateSpace, class Grid>
double measure(const StateSpace &statespace, const Grid &grid)
PottsMagnetization()

Public Members

std::string name
std::string desc
template<class StateVector>
class PottsInteraction
#include <Potts.h>

The Potts interaction term.

Note

This term does not match the required canonical interaction form and his hence implented as a Flex Term

Template Parameters
  • StateSpace: the type of the state space

  • StateVector: the type of the state vector

Public Functions

PottsInteraction(const double k)
template<class StateSpace>
double diff(const int rsite, const StateVector &svold, const StateVector &svnew, const decltype(std::declval<typename StateSpace::Lattice>().nbrs(0, 0)) &nbrs, StateSpace &s)
template<class StateSpace>
double energy(const StateSpace &s, const typename StateSpace::Lattice &grid, int c)

Public Members

const double k

Scalar prefactor.

template<int Q>
class Potts
#include <Potts.h>

Potts Hamiltonian with Q states.

Template Parameters
  • Q: defines the number of spin values 0,1,…,Q-1

Public Types

typedef std::array<int, SymD> StateVector

Public Functions

Potts(double J)
template<class StateSpace, class Lattice, class RNG>
void initstatespace(StateSpace &statespace, Lattice &grid, RNG &rng) const

Public Members

std::string name = {"Potts"}
PottsInteraction<StateVector> potts_interaction
std::array<decltype(potts_interaction)*, 1> multisite = {&potts_interaction}
PottsMagnetization<Q> obs_m
decltype(std::make_tuple(obs_m)) observables = {std::make_tuple(obs_m)}

Public Static Attributes

constexpr int q = Q
constexpr int SymD = 1
template<int Q>
class Initializer<Potts<Q>>
#include <Potts.h>

Specialization of the Metropolis initialier for the Q-state Potts model.

Template Parameters
  • Q: the number of the spin values

Public Static Functions

template<class RNGCache>
Potts<Q>::StateVector newsv(typename Potts<Q>::StateVector &svold, RNGCache &rng)
namespace MARQOV

The MARQOV namespace.

This namespace collects all things that are related to MARQOV.

template<int Q, class Lattice>
class Embedder<Potts<Q>, Lattice>
#include <Potts.h>

Specialization of the Embedding class for the Potts model.

Template Parameters
  • Q: number of spin values

  • Lattice: the type of the lattice

Public Functions

Embedder(const Hamiltonian &ham, const Lattice &lat, StateSpace &statespace)

Constructs a Potts embedding object.

Parameters
  • ham: The corresponding Hamiltonian

  • lat: The corresponding lattice

  • statespace: The statespace of the simulation

template<class RNG>
void draw(RNG &rng, StateVector &sv)

Set new embedding variable.

Template Parameters
  • RNG: the type of the random number generator

Parameters
  • rng: reference to the random number generator

  • sv: current state of the cluster seed

double coupling(int pos1, int pos2) const

Computes the Wolff coupling when attempting to add a spin to the cluster.

Return

The scalar Wolff coupling (a double)

Parameters
  • pos1: The position (index) of the current state vector

  • pos2: The position (index) of a neighbour being checked whether it will become part of the cluster

void flip(StateVector &sv) const

Specifies how a spin flip in the embedded (reduced) model is performed.

Parameters
  • sv: the spin to flipped

Private Types

typedef Potts<Q> Hamiltonian
typedef Hamiltonian::StateVector StateVector
typedef Space<typename Hamiltonian::StateVector, Lattice> StateSpace

Private Members

const Hamiltonian &ham
const Lattice &lat
const StateSpace &statespace
int newq = -1
int oldq

Private Static Attributes

constexpr int SymD = Hamiltonian::SymD
template<class Lattice, int Q>
struct Wolff<Potts<Q>, Lattice>
#include <Potts.h>

Specialization of the Wolff cluster algorithm for the Q-state Potts model.

Note

this is an example how you can apply a Wolff update to a flex term

Template Parameters
  • Lattice: the type of the lattice

  • Q: number of spin values

Public Functions

template<class RNG, class StateSpace>
int move(const Potts<Q> &ham, const Lattice &grid, StateSpace &statespace, RNG &rng, double beta, int rsite)

Public Members

std::vector<int> cstack = std::vector<int>(4096 / sizeof(int), 0)

the size of the stack is meant to be preserved across different cluster processes.