Module lattice_qcd_rs::simulation::monte_carlo::hybrid
source · Expand description
Combine multiple Monte Carlo methods.
this module present different ways to combine multiple method
Example
use lattice_qcd_rs::simulation::{HeatBathSweep, LatticeState, LatticeStateDefault, OverrelaxationSweepReverse, HybridMethodVec};
use rand::SeedableRng;
let rng = rand::rngs::StdRng::seed_from_u64(0); // change with your seed
let mut heat_bath = HeatBathSweep::new(rng);
let mut overrelax = OverrelaxationSweepReverse::default();
let mut hybrid = HybridMethodVec::with_capacity(2);
hybrid.push_method(&mut heat_bath);
hybrid.push_method(&mut overrelax);
let mut state = LatticeStateDefault::<3>::new_cold(1_f64, 8_f64, 4)?; // 1_f64 : size, 8_f64: beta, 4 number of points.
for _ in 0..2 {
state = state.monte_carlo_step(&mut hybrid)?;
// operation to track the progress or the evolution
}
// operation at the end of the simulation
Structs
- Adaptor used to convert the error to another type. It is intended to use with
HybridMethodVec
. - This method can combine any two methods. The down side is that it can be very verbose to write Couples for a large number of methods.
- hybrid method that combine multiple methods. It requires that all methods return the same error. You can use
AdaptorMethodError
to convert the error. If you want type with different error you can useHybridMethodCouple
.
Enums
- Error given by
HybridMethodCouple
- Error given by
HybridMethodVec
Type Definitions
- Combine four methods.
- Error returned by
HybridMethodQuadruple
. - Combine four methods.
- Error returned by
HybridMethodQuintuple
. - Combine three methods.
- Error returned by
HybridMethodTriple
.