|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
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 ¤t, 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_ |
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.
| Engine | RNG engine; defaults to std::mt19937_64. |
Definition at line 489 of file tpl_ca_stochastic_rules.H.
| using Aleph::CA::Ising_Metropolis_Rule< Engine >::engine_type = Engine |
Definition at line 497 of file tpl_ca_stochastic_rules.H.
|
inline |
Build a Metropolis Ising rule.
| [in] | T | temperature; must be strictly positive. |
| [in] | J | coupling constant (default +1). |
| [in] | H | external magnetic field (default 0). |
| [in] | master_seed | master seed forwarded to cell_seed(). |
| std::domain_error | if T <= 0. |
Definition at line 507 of file tpl_ca_stochastic_rules.H.
References ah_domain_error_if.
|
inlinenoexcept |
Definition at line 521 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Metropolis_Rule< Engine >::J_.
|
inlinenoexcept |
Definition at line 526 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Metropolis_Rule< Engine >::H_.
|
inlinenoexcept |
Definition at line 531 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Metropolis_Rule< Engine >::master_seed_.
|
inline |
Compute the next Ising state for cell current (Metropolis dynamics).
| State | integral cell state. |
| Rank | lattice rank. |
| [in] | current | current centre-cell state. |
| [in] | neighbours | read-only neighbour values. |
| [in] | ctx | per-cell context. |
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().
|
inlinenoexcept |
Definition at line 536 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Metropolis_Rule< Engine >::master_seed_.
|
inlinenoexcept |
Definition at line 516 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Metropolis_Rule< Engine >::T_.
|
private |
Definition at line 493 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Metropolis_Rule< Engine >::field(), and Aleph::CA::Ising_Metropolis_Rule< Engine >::operator()().
|
private |
Definition at line 492 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Metropolis_Rule< Engine >::coupling(), and Aleph::CA::Ising_Metropolis_Rule< Engine >::operator()().
|
private |
Definition at line 494 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Metropolis_Rule< Engine >::master_seed(), Aleph::CA::Ising_Metropolis_Rule< Engine >::operator()(), and Aleph::CA::Ising_Metropolis_Rule< Engine >::set_master_seed().
|
private |
Definition at line 491 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Metropolis_Rule< Engine >::operator()(), and Aleph::CA::Ising_Metropolis_Rule< Engine >::temperature().