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 copy 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§fn sample<R>(&self, rng: &mut R) -> CMatrix2where
R: Rng + ?Sized,
fn sample<R>(&self, rng: &mut R) -> CMatrix2where R: Rng + ?Sized,
Generate a random value of
T
, using rng
as the source of randomness.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<HeatBathDistribution<T>> 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<HeatBathDistribution<T>> 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§fn eq(&self, other: &HeatBathDistribution<T>) -> bool
fn eq(&self, other: &HeatBathDistribution<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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> StructuralEq 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>,
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> 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§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.