Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::CA::Ising_Metropolis_Rule< Engine > Class Template Reference

Ising rule with Metropolis–Hastings single-spin-flip dynamics. More...

#include <tpl_ca_stochastic_rules.H>

Public Types

using engine_type = Engine
 

Public Member Functions

 Ising_Metropolis_Rule (const double T, const double J=1.0, const double H=0.0, const std::uint64_t master_seed=0)
 Build a Metropolis Ising rule.
 
double temperature () const noexcept
 
double coupling () const noexcept
 
double field () const noexcept
 
std::uint64_t master_seed () const noexcept
 
void set_master_seed (std::uint64_t s) noexcept
 
template<typename State , std::size_t Rank>
State operator() (const State &current, Neighbor_View< State > neighbours, const Cell_Context< Rank > &ctx) const
 Compute the next Ising state for cell current (Metropolis dynamics).
 

Private Attributes

double T_
 
double J_
 
double H_
 
std::uint64_t master_seed_
 

Detailed Description

template<typename Engine = std::mt19937_64>
class Aleph::CA::Ising_Metropolis_Rule< Engine >

Ising rule with Metropolis–Hastings single-spin-flip dynamics.

Always flip when deltaE <= 0; otherwise flip with probability exp(-deltaE / T). Like Glauber dynamics, Metropolis dynamics satisfy detailed balance and target the Boltzmann distribution of the Ising Hamiltonian.

Template Parameters
EngineRNG engine; defaults to std::mt19937_64.

Definition at line 489 of file tpl_ca_stochastic_rules.H.

Member Typedef Documentation

◆ engine_type

template<typename Engine = std::mt19937_64>
using Aleph::CA::Ising_Metropolis_Rule< Engine >::engine_type = Engine

Definition at line 497 of file tpl_ca_stochastic_rules.H.

Constructor & Destructor Documentation

◆ Ising_Metropolis_Rule()

template<typename Engine = std::mt19937_64>
Aleph::CA::Ising_Metropolis_Rule< Engine >::Ising_Metropolis_Rule ( const double  T,
const double  J = 1.0,
const double  H = 0.0,
const std::uint64_t  master_seed = 0 
)
inline

Build a Metropolis Ising rule.

Parameters
[in]Ttemperature; must be strictly positive.
[in]Jcoupling constant (default +1).
[in]Hexternal magnetic field (default 0).
[in]master_seedmaster seed forwarded to cell_seed().
Exceptions
std::domain_errorif T <= 0.

Definition at line 507 of file tpl_ca_stochastic_rules.H.

References ah_domain_error_if.

Member Function Documentation

◆ coupling()

template<typename Engine = std::mt19937_64>
double Aleph::CA::Ising_Metropolis_Rule< Engine >::coupling ( ) const
inlinenoexcept

◆ field()

template<typename Engine = std::mt19937_64>
double Aleph::CA::Ising_Metropolis_Rule< Engine >::field ( ) const
inlinenoexcept

◆ master_seed()

template<typename Engine = std::mt19937_64>
std::uint64_t Aleph::CA::Ising_Metropolis_Rule< Engine >::master_seed ( ) const
inlinenoexcept

◆ operator()()

template<typename Engine = std::mt19937_64>
template<typename State , std::size_t Rank>
State Aleph::CA::Ising_Metropolis_Rule< Engine >::operator() ( const State &  current,
Neighbor_View< State >  neighbours,
const Cell_Context< Rank > &  ctx 
) const
inline

Compute the next Ising state for cell current (Metropolis dynamics).

Template Parameters
Stateintegral cell state.
Ranklattice rank.
Parameters
[in]currentcurrent centre-cell state.
[in]neighboursread-only neighbour values.
[in]ctxper-cell context.
Returns
next state produced by the rule.

Definition at line 551 of file tpl_ca_stochastic_rules.H.

References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::ca_ising_detail::delta_energy(), Aleph::CA::Ising_Metropolis_Rule< Engine >::H_, Aleph::CA::Ising_Metropolis_Rule< Engine >::J_, Aleph::CA::Ising_Metropolis_Rule< Engine >::master_seed_, Aleph::CA::ca_ising_detail::state_to_spin(), Aleph::CA::Ising_Metropolis_Rule< Engine >::T_, and Aleph::CA::uniform_unit().

◆ set_master_seed()

template<typename Engine = std::mt19937_64>
void Aleph::CA::Ising_Metropolis_Rule< Engine >::set_master_seed ( std::uint64_t  s)
inlinenoexcept

◆ temperature()

template<typename Engine = std::mt19937_64>
double Aleph::CA::Ising_Metropolis_Rule< Engine >::temperature ( ) const
inlinenoexcept

Member Data Documentation

◆ H_

◆ J_

◆ master_seed_

◆ T_


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