|
numerics
|
Namespaces | |
| namespace | backends |
Classes | |
| struct | MetropolisStats |
| Statistics returned by a single Metropolis sweep. More... | |
| struct | UmbrellaStats |
| Statistics returned by an umbrella sampling sweep. More... | |
| struct | UmbrellaWindow |
| Window constraint for umbrella sampling. More... | |
Metropolis acceptance probability min(1, exp(-β ΔE)).
Definition at line 20 of file boltzmann_table.hpp.
References num::beta(), and num::ipow().
Referenced by make_boltzmann_table(), and IsingLattice::rebuild_boltz().
|
inline |
Precompute a table of acceptance probabilities for a discrete set of dE values.
Definition at line 25 of file boltzmann_table.hpp.
References num::beta(), boltzmann_accept(), and num::ipow().
Construct an RNG from a fixed seed (for reproducible runs).
Definition at line 23 of file rng.hpp.
References num::ipow().
Construct an RNG seeded from hardware entropy.
Equivalent to RNG(std::random_device{}()). Use this at simulation startup for non-deterministic seeds.
| RNG | Any standard-library-compatible random number engine. Defaults to std::mt19937. |
Definition at line 16 of file rng.hpp.
References num::ipow().
| MetropolisStats num::markov::metropolis_sweep | ( | idx | n_sites, |
| DeltaE | delta_energy, | ||
| Apply | apply_flip, | ||
| real | beta, | ||
| RNG & | rng | ||
| ) |
Single Metropolis sweep: n_sites random single-site updates.
The acceptance probability is min(1, exp(-beta * dE)) computed from the value returned by delta_energy(i).
| DeltaE | Callable: idx -> real. Returns dE for proposing a flip at i. |
| Apply | Callable: idx -> void. Applies the flip at site i. |
| RNG | Random number generator (e.g., std::mt19937). |
Definition at line 20 of file mcmc_impl.hpp.
References num::markov::MetropolisStats::accepted, num::beta(), num::ipow(), and num::markov::MetropolisStats::total.
Referenced by umbrella_sweep().
| MetropolisStats num::markov::metropolis_sweep_prob | ( | idx | n_sites, |
| ProbFn | acceptance_prob, | ||
| Apply | apply_flip, | ||
| RNG & | rng | ||
| ) |
Metropolis sweep with caller-supplied acceptance probabilities.
Use this variant when acceptance probabilities are precomputed (e.g. a Boltzmann table for a discrete-dE system like the Ising model), avoiding a runtime exp() call per proposed flip.
| ProbFn | Callable: idx -> real. Returns min(1, exp(-beta*dE)) for site i. |
| Apply | Callable: idx -> void. Applies the flip at site i. |
| RNG | Random number generator. |
Definition at line 55 of file mcmc_impl.hpp.
References num::markov::MetropolisStats::accepted, num::ipow(), and num::markov::MetropolisStats::total.
Referenced by IsingLattice::sweep(), and umbrella_sweep_prob().
| UmbrellaStats num::markov::umbrella_sweep | ( | idx | n_sites, |
| DeltaE | delta_energy, | ||
| Apply | apply_flip, | ||
| Save | save_state, | ||
| Restore | restore_state, | ||
| Measure | measure_order, | ||
| UmbrellaWindow | window, | ||
| real | beta, | ||
| RNG & | rng | ||
| ) |
Umbrella-sampled Metropolis sweep (dE variant).
Performs a sweep, measures the order parameter, then restores the saved state if the order parameter falls outside [window.lo, window.hi].
| DeltaE | Callable: idx -> real |
| Apply | Callable: idx -> void |
| Save | Callable: () -> void. Saves system state before the sweep. |
| Restore | Callable: () -> void. Restores saved state. |
| Measure | Callable: () -> idx. Returns the order parameter. |
| RNG | Random number generator. |
Definition at line 92 of file mcmc_impl.hpp.
References num::beta(), num::ipow(), num::markov::UmbrellaStats::mc, metropolis_sweep(), num::markov::UmbrellaStats::order_param, and num::markov::UmbrellaStats::reverted.
| UmbrellaStats num::markov::umbrella_sweep_prob | ( | idx | n_sites, |
| ProbFn | acceptance_prob, | ||
| Apply | apply_flip, | ||
| Save | save_state, | ||
| Restore | restore_state, | ||
| Measure | measure_order, | ||
| UmbrellaWindow | window, | ||
| RNG & | rng | ||
| ) |
Umbrella-sampled Metropolis sweep (precomputed probability variant).
Same as umbrella_sweep but uses caller-supplied acceptance probabilities.
| ProbFn | Callable: idx -> real |
| Apply | Callable: idx -> void |
| Save | Callable: () -> void |
| Restore | Callable: () -> void |
| Measure | Callable: () -> idx |
| RNG | Random number generator. |
Definition at line 132 of file mcmc_impl.hpp.
References num::ipow(), num::markov::UmbrellaStats::mc, metropolis_sweep_prob(), num::markov::UmbrellaStats::order_param, and num::markov::UmbrellaStats::reverted.
Referenced by IsingLattice::sweep_umbrella().