[][src]Trait qmc::sse::qmc_traits::cluster::ClusterUpdater

pub trait ClusterUpdater: LoopUpdater + Factory<Vec<bool>> + Factory<Vec<usize>> + Factory<Vec<Option<usize>>> + Factory<Vec<OpSide>> {
    pub fn flip_each_cluster_ising_symmetry_rng<R: Rng>(
        &mut self,
        prob: f64,
        rng: &mut R,
        state: &mut [bool]
    ) { ... }
pub 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
, { ... }
pub fn find_constant_op(&self) -> Option<usize> { ... }
pub fn post_cluster_update_hook(&mut self) { ... } }

Add cluster updates to LoopUpdater.

Provided methods

pub fn flip_each_cluster_ising_symmetry_rng<R: Rng>(
    &mut self,
    prob: f64,
    rng: &mut R,
    state: &mut [bool]
)
[src]

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.

pub 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]

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.

pub fn find_constant_op(&self) -> Option<usize>[src]

Find a site with a constant op.

pub fn post_cluster_update_hook(&mut self)[src]

Called after an update.

Loading content...

Implementors

impl<O: Op + Clone> ClusterUpdater for FastOpsTemplate<O>[src]

Loading content...