Skip to content

num::energy_difference

Defined in header <stochastic/concepts.hpp>

template <class F, class T = real>
concept energy_difference = field<T> && requires(F &&delta_e, idx site) {
  { delta_e(site) } -> std::convertible_to<T>;
};

Energy difference for a proposed move, \(\Delta E\).

Metropolis accepts with probability \(\min(1, e^{-\beta \Delta E})\), so the callable reports the change rather than the total, which is what makes a sweep cost \(O(1)\) per site instead of \(O(N)\).