Trait qmc::sse::qmc_traits::cluster::ClusterUpdater [−][src]
pub trait ClusterUpdater: LoopUpdater + Factory<Vec<bool>> + Factory<Vec<usize>> + Factory<Vec<Option<usize>>> + Factory<Vec<OpSide>> { fn flip_each_cluster_ising_symmetry_rng<R: Rng>(
&mut self,
prob: f64,
rng: &mut R,
state: &mut [bool]
) { ... } fn flip_each_cluster_rng<R: Rng, F>(
&mut self,
prob: f64,
rng: &mut R,
state: &mut [bool],
weight_change_on_global_flip: Option<F>
)
where
F: Fn(&Self::Node) -> f64, { ... } fn find_constant_op(&self) -> Option<usize> { ... } fn post_cluster_update_hook(&mut self) { ... } }
Expand description
Add cluster updates to LoopUpdater.
Provided methods
fn flip_each_cluster_ising_symmetry_rng<R: Rng>(
&mut self,
prob: f64,
rng: &mut R,
state: &mut [bool]
)
[src]
&mut self,
prob: f64,
rng: &mut R,
state: &mut [bool]
)
Expand description
Flip each cluster in the graph using an rng instance, add to state changes in acc. Use this version if there’s ising symmetry in your graph.
fn flip_each_cluster_rng<R: Rng, F>(
&mut self,
prob: f64,
rng: &mut R,
state: &mut [bool],
weight_change_on_global_flip: Option<F>
) where
F: Fn(&Self::Node) -> f64,
[src]
&mut self,
prob: f64,
rng: &mut R,
state: &mut [bool],
weight_change_on_global_flip: Option<F>
) where
F: Fn(&Self::Node) -> f64,
Expand description
Flip each cluster in the graph using an rng instance, add to state changes in acc. You can
provide a function to adjust the weights for flipping each cluster based off the nodes
within it. Edges of the cluster will always be constant ops but the total weight change
inside the cluster will affect the probability of acceptance (multiplied by a global prob
for each cluster). This function should take a node reference and return the ratio of the
new weight divided by old weight if a global spin flip were to take place.
Rust language note:
To call with none and keep types happy you must use None::<fn(&Self::Node) -> f64>
or
call the helper function flip_each_cluster_ising_symmetry_rng
which does it for you.
fn find_constant_op(&self) -> Option<usize>
[src]
Expand description
Find a site with a constant op.
fn post_cluster_update_hook(&mut self)
[src]
Expand description
Called after an update.