Skip to content

num::markov::metropolis_sweep_prob

Defined in header <stochastic/detail/mcmc_impl.hpp>

template <typename ProbFn, std::invocable<idx> Apply,
          std::uniform_random_bit_generator RNG>
metropolis_stats 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.

Template parameters

  • 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.