pub struct MetropolisHastings { /* private fields */ }
Expand description
Metropolis Hastings algorithm. Very slow, use MetropolisHastingsDeltaDiagnostic
instead when applicable.
This a very general method that can manage every LatticeState
but the tread off
is that it is much slower than
a dedicated algorithm knowing the from of the hamiltonian. If you want to use your own
hamiltonian I advice to implement
you own method too.
Note that this method does not do a sweep but change random link matrix,
for a sweep there is super::MetropolisHastingsSweep
.
Example
See the example of super::McWrapper
Implementations§
source§impl MetropolisHastings
impl MetropolisHastings
sourcepub fn new(number_of_update: usize, spread: Real) -> Option<Self>
pub fn new(number_of_update: usize, spread: Real) -> Option<Self>
spread
should be between 0 and 1 both not included and number_of_update should be greater
than 0. 0.1_f64
is a good choice for this parameter.
number_of_update
is the number of times a link matrix is randomly changed.
spread
is the spread factor for the random matrix change
( used in su3::random_su3_close_to_unity
).
sourcepub const fn number_of_update(&self) -> usize
pub const fn number_of_update(&self) -> usize
Get the number of attempted updates per steps.
Trait Implementations§
source§impl Clone for MetropolisHastings
impl Clone for MetropolisHastings
source§fn clone(&self) -> MetropolisHastings
fn clone(&self) -> MetropolisHastings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetropolisHastings
impl Debug for MetropolisHastings
source§impl Default for MetropolisHastings
impl Default for MetropolisHastings
source§impl<'de> Deserialize<'de> for MetropolisHastings
impl<'de> Deserialize<'de> for MetropolisHastings
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>,
source§impl Display for MetropolisHastings
impl Display for MetropolisHastings
source§impl<State, const D: usize> MonteCarloDefault<State, D> for MetropolisHastingswhere
State: LatticeState<D> + LatticeStateNew<D>,
impl<State, const D: usize> MonteCarloDefault<State, D> for MetropolisHastingswhere State: LatticeState<D> + LatticeStateNew<D>,
§type Error = <State as LatticeStateNew<D>>::Error
type Error = <State as LatticeStateNew<D>>::Error
source§fn potential_next_element<Rng>(
&mut self,
state: &State,
rng: &mut Rng
) -> Result<State, Self::Error>where
Rng: Rng + ?Sized,
fn potential_next_element<Rng>( &mut self, state: &State, rng: &mut Rng ) -> Result<State, Self::Error>where Rng: Rng + ?Sized,
source§impl PartialEq<MetropolisHastings> for MetropolisHastings
impl PartialEq<MetropolisHastings> for MetropolisHastings
source§fn eq(&self, other: &MetropolisHastings) -> bool
fn eq(&self, other: &MetropolisHastings) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for MetropolisHastings
impl Serialize for MetropolisHastings
impl Copy for MetropolisHastings
impl StructuralPartialEq for MetropolisHastings
Auto Trait Implementations§
impl RefUnwindSafe for MetropolisHastings
impl Send for MetropolisHastings
impl Sync for MetropolisHastings
impl Unpin for MetropolisHastings
impl UnwindSafe for MetropolisHastings
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>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.