Trial

Trait Trial 

Source
pub trait Trial<MI, H, MA> {
    type Count;

    // Required method
    fn apply(
        &mut self,
        microstate: &mut MI,
        hamiltonian: &H,
        macrostate: &MA,
    ) -> Self::Count;
}
Expand description

Propose trial moves in the microstate, evaluate the changes in energy and accept or reject accordingly.

Trial describes a type that applies trial moves to microstates. Specifically, the method apply will attempt one or more individual trial moves to the microstate. For each individual move, it evaluates the change in energy with the given hamiltonian, then accepts or rejects the trial based on the state parameters.

Each type of trial move in hoomd-rs implements the Trial trait so that they may be used as generic arguments in higher level functions.

See Sweep or any of the other implementations of Trial for code examples.

The generic type names are:

Required Associated Types§

Source

type Count

Represent the number of accepted and rejected individual trial moves.

Most implementations of Trial will use crate::Count directly. Some may provide more granular detail broken down by move type.

Required Methods§

Source

fn apply( &mut self, microstate: &mut MI, hamiltonian: &H, macrostate: &MA, ) -> Self::Count

Apply the trial move(s).

A given type that implements Trial may perform one or many trial moves in a single call to apply. The returned value informs the caller how many trial moves were accepted and rejected (possibly broken down by type).

Implementors§

Source§

impl<P, B, S, X, C, L, H, MA> Trial<Microstate<B, S, X, C>, H, MA> for Sweep<L>
where P: Copy, B: Copy + Default + Transform<S> + Position<Position = P>, S: Copy + Default + Position<Position = P>, X: PointUpdate<P, SiteKey>, L: LocalTrial<B>, H: DeltaEnergyOne<B, S, X, C>, C: Wrap<B> + Wrap<S> + GenerateGhosts<S>, MA: Temperature,

Source§

impl<P, B, S, X, C, L, H, MA, K> Trial<Microstate<B, S, X, C>, H, MA> for ParallelSweep<L, K, B, S>
where P: Copy, B: Copy + Default + Transform<S> + Position<Position = P> + Send + Sync, S: Copy + Default + Position<Position = P> + Send + Sync, X: PointUpdate<P, SiteKey> + Sync, L: LocalTrial<B> + Sync, H: DeltaEnergyOne<B, S, X, C> + Sync, C: Wrap<B> + Wrap<S> + GenerateGhosts<S> + Cover<P, Checkerboard = K> + Sync, MA: Temperature, K: Checkerboard<P> + Sync,