pub struct HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,{ /* private fields */ }Expand description
Distribution for the Heat Bath methods with the parameter param_exp = beta * sqrt(det(A)).
With distribution dP(X) = 1/(2 \pi^2) d \cos(\theta) d\phi dx_0 \sqrt(1-x_0^2) e^{param_exp x_0}.
§Example
use lattice_qcd_rs::error::ImplementationError;
use lattice_qcd_rs::statistics::HeatBathDistribution;
use nalgebra::{Complex, Matrix2};
use rand::{Rng, SeedableRng};
let mut rng = rand::rngs::StdRng::seed_from_u64(0);
let heat_bath =
HeatBathDistribution::new(0.5_f64).ok_or(ImplementationError::OptionWithUnexpectedNone)?;
let r_matrix: Matrix2<Complex<f64>> = rng.sample(&heat_bath);Implementations§
Source§impl<T> HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Trait Implementations§
Source§impl<T> Clone for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Clone,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Clone for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Clone,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Source§fn clone(&self) -> HeatBathDistribution<T>
fn clone(&self) -> HeatBathDistribution<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T> Debug for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Debug,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Debug for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Debug,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Source§impl<'de, T> Deserialize<'de> for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Deserialize<'de>,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<'de, T> Deserialize<'de> for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Deserialize<'de>,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> Display for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Display,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Display for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Display,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Source§impl Distribution<Matrix<Complex<f64>, Const<2>, Const<2>, ArrayStorage<Complex<f64>, 2, 2>>> for HeatBathDistribution<f64>
impl Distribution<Matrix<Complex<f64>, Const<2>, Const<2>, ArrayStorage<Complex<f64>, 2, 2>>> for HeatBathDistribution<f64>
Source§impl<T> Hash for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Hash,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Hash for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Hash,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Source§impl<T> PartialEq for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + PartialEq,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> PartialEq for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + PartialEq,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Source§impl<T> Serialize for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Serialize,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Serialize for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Serialize,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Copy for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Copy,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> Eq for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd + Eq,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
impl<T> StructuralPartialEq for HeatBathDistribution<T>where
T: One + Div<T, Output = T> + Mul<T, Output = T> + Add<T, Output = T> + Sub<T, Output = T> + Neg<Output = T> + Float + FloatConst + Zero + SampleUniform + PartialOrd,
OpenClosed01: Distribution<T>,
Uniform<T>: Distribution<T>,
Auto Trait Implementations§
impl<T> Freeze for HeatBathDistribution<T>where
T: Freeze,
impl<T> RefUnwindSafe for HeatBathDistribution<T>where
T: RefUnwindSafe,
impl<T> Send for HeatBathDistribution<T>where
T: Send,
impl<T> Sync for HeatBathDistribution<T>where
T: Sync,
impl<T> Unpin for HeatBathDistribution<T>where
T: Unpin,
impl<T> UnwindSafe for HeatBathDistribution<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.