Trait ergothic::Sample [−][src]
pub trait Sample { fn prepare() -> Self; fn mutate(&mut self); fn thermalize(&mut self) { ... } }
A configuration sample from the ergodic distribution must implement this trait in order to be used in the ergothic simulation.
Required Methods
fn prepare() -> Self
Creates a new configuration sample with randomized degrees of freedom.
fn mutate(&mut self)
Make a randomized step in the configuration step. This function drives
statistical simulations in ergothic. When implementing it, make sure
that your implementation is not biased.
The most common implementation of mutate
uses the Metropolis algorithm.
You may want to check out the metropolis
module for useful helpers.
Provided Methods
fn thermalize(&mut self)
Generally, randomized samples are highly atypical. In order to improve the quality of simulation results, a configuration sample has to be thermalized before measuring physical observables. This generally means running the simulation without recording observables for a couple dozens of iterations. Simulation engines allowed free to call this function from time to time to get rid of possible biases and improve ergodicity, as long as it is not on the critical path.