|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Ising rule with Glauber single-spin-flip dynamics. More...
#include <tpl_ca_stochastic_rules.H>
Public Types | |
| using | engine_type = Engine |
Public Member Functions | |
| Ising_Glauber_Rule (const double T, const double J=1.0, const double H=0.0, const std::uint64_t master_seed=0) | |
| Build a Glauber 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. | |
Private Attributes | |
| double | T_ |
| double | J_ |
| double | H_ |
| std::uint64_t | master_seed_ |
Ising rule with Glauber single-spin-flip dynamics.
At each cell the flip probability is
p_flip = 1 / (1 + exp(deltaE / T))
where deltaE = 2 * s * (J * sum_neighbours + H). Glauber dynamics satisfy detailed balance and converge to the canonical Boltzmann distribution for the Ising Hamiltonian
H = -J * sum_<i,j> s_i s_j - H * sum_i s_i.
Cell states must be integral. Signed types are treated as ±1; unsigned types as {0, 1} (with 0 representing spin -1).
| Engine | RNG engine; defaults to std::mt19937_64. |
Definition at line 399 of file tpl_ca_stochastic_rules.H.
| using Aleph::CA::Ising_Glauber_Rule< Engine >::engine_type = Engine |
Definition at line 407 of file tpl_ca_stochastic_rules.H.
|
inline |
Build a Glauber Ising rule.
| [in] | T | temperature; must be strictly positive. |
| [in] | J | coupling constant (default +1, ferromagnetic). |
| [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 417 of file tpl_ca_stochastic_rules.H.
References ah_domain_error_if.
|
inlinenoexcept |
Definition at line 431 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Glauber_Rule< Engine >::J_.
|
inlinenoexcept |
Definition at line 436 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Glauber_Rule< Engine >::H_.
|
inlinenoexcept |
Definition at line 441 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Glauber_Rule< Engine >::master_seed_.
|
inline |
Compute the next Ising state for cell current.
| 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 461 of file tpl_ca_stochastic_rules.H.
References Aleph::blossom_maximum_cardinality_matching(), Aleph::CA::ca_ising_detail::delta_energy(), Aleph::CA::Ising_Glauber_Rule< Engine >::H_, Aleph::CA::Ising_Glauber_Rule< Engine >::J_, Aleph::CA::Ising_Glauber_Rule< Engine >::master_seed_, Aleph::CA::ca_ising_detail::state_to_spin(), Aleph::CA::Ising_Glauber_Rule< Engine >::T_, and Aleph::CA::uniform_unit().
|
inlinenoexcept |
Definition at line 446 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Glauber_Rule< Engine >::master_seed_.
|
inlinenoexcept |
Definition at line 426 of file tpl_ca_stochastic_rules.H.
References Aleph::CA::Ising_Glauber_Rule< Engine >::T_.
|
private |
Definition at line 403 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Glauber_Rule< Engine >::field(), and Aleph::CA::Ising_Glauber_Rule< Engine >::operator()().
|
private |
Definition at line 402 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Glauber_Rule< Engine >::coupling(), and Aleph::CA::Ising_Glauber_Rule< Engine >::operator()().
|
private |
Definition at line 404 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Glauber_Rule< Engine >::master_seed(), Aleph::CA::Ising_Glauber_Rule< Engine >::operator()(), and Aleph::CA::Ising_Glauber_Rule< Engine >::set_master_seed().
|
private |
Definition at line 401 of file tpl_ca_stochastic_rules.H.
Referenced by Aleph::CA::Ising_Glauber_Rule< Engine >::operator()(), and Aleph::CA::Ising_Glauber_Rule< Engine >::temperature().