Tune

Trait Tune 

Source
pub trait Tune<P, B, S, X, C, L, H, MA> {
    // Required method
    fn tune(
        &mut self,
        microstate: &Microstate<B, S, X, C>,
        hamiltonian: &H,
        macrostate: &MA,
        target_acceptance: OpenUnitIntervalNumber,
        samples: usize,
        steps: usize,
    );

    // Provided method
    fn tune_default(
        &mut self,
        microstate: &Microstate<B, S, X, C>,
        hamiltonian: &H,
        macrostate: &MA,
    ) { ... }
}
Expand description

Tune trial move maximum sizes toward a target acceptance ratio.

Trial moves that implement Tune can automatically adjust their trial move size to achieve a desired acceptance ratio. The tuning is performed in the context of a given microstate, Hamiltonian, and macrostate but the microstate is not modified.

Required Methods§

Source

fn tune( &mut self, microstate: &Microstate<B, S, X, C>, hamiltonian: &H, macrostate: &MA, target_acceptance: OpenUnitIntervalNumber, samples: usize, steps: usize, )

Tune the trial move maximum size to achieve a given acceptance ratio.

Use tune_default unless you have a specific need to adjust the tuning parameters.

tune performs samples individual trial moves to measure the current acceptance ratio. It then adjusts the trial move size to increase or decrease the acceptance ratio as needed over steps iterations.

Provided Methods§

Source

fn tune_default( &mut self, microstate: &Microstate<B, S, X, C>, hamiltonian: &H, macrostate: &MA, )

Tune the trial move maximum size with default parameters.

The defaults are:

  • target_acceptance: 0.2
  • samples: 8,000
  • steps: 32

Implementors§

Source§

impl<P, B, S, X, C, L, H, MA> Tune<P, B, S, X, C, L, 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> + Adjust + Display, 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> Tune<P, B, S, X, C, L, H, MA> for ParallelSweep<L, K, B, S>
where P: Copy, B: Copy + Default + Transform<S> + Position<Position = P>, S: Copy + Default + Position<Position = P>, X: PointUpdate<P, SiteKey>, L: LocalTrial<B> + Adjust + Display, H: DeltaEnergyOne<B, S, X, C>, C: Wrap<B> + Wrap<S> + GenerateGhosts<S>, MA: Temperature,