Struct qmc::sse::fast_ops::FastOpsTemplate [−][src]
pub struct FastOpsTemplate<O: Op, ALLOC: FastOpAllocator = DefaultFastOpAllocator> { /* fields omitted */ }
Expand description
A fast op container.
Implementations
pub fn new_from_nvars_and_nbonds_and_alloc(
nvars: usize,
nbonds: Option<usize>,
alloc: ALLOC
) -> Self
pub fn new_from_nvars_and_nbonds_and_alloc(
nvars: usize,
nbonds: Option<usize>,
alloc: ALLOC
) -> Self
A new manager which can handle nvars and is optimized for nbonds, will allocate memory using the given allocator.
A new manager which can handle nvars and is optimized for nbonds.
New manager which can handle nvars
pub fn new_from_ops<I>(nvars: usize, ps_and_ops: I) -> Self where
I: IntoIterator<Item = (usize, O)>,
pub fn new_from_ops<I>(nvars: usize, ps_and_ops: I) -> Self where
I: IntoIterator<Item = (usize, O)>,
Make a new Manager from an interator of ops, and number of variables.
Trait Implementations
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. Returns the number of cluster found. Read more
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. Read more
Find a site with a constant op.
Called after an update.
Count the number of diagonal and offdiagonal ops. Sum is self.get_n()
Count the number of constant ops.
type Args = FastOpMutateArgs
type Args = FastOpMutateArgs
The type required for mutating p values.
Mutate a single p value.
Mutate using a restricted prange and args. Allows for running on smaller subsections of the variables. Read more
Mutate ops using a restricted prange and args. Allows for running on smaller subsections of the variables. Read more
Get empty args for a subsection of variables, or from an existing set of args (does not clear).
Get the args required for mutation.
fn fill_args_at_p_with_hint<It>(
&self,
p: usize,
args: &mut Self::Args,
vars: &[usize],
hint: It
) where
It: IntoIterator<Item = Option<usize>>,
fn fill_args_at_p_with_hint<It>(
&self,
p: usize,
args: &mut Self::Args,
vars: &[usize],
hint: It
) where
It: IntoIterator<Item = Option<usize>>,
Use a list of ps to make args. Hint provides up to one ps per var in order. Read more
Returns arg made for the mutation
Get the substate at p using ps to set values. Hint provides up to one ps per var in order. substate should start in p=0 configuration. Read more
Iterate over ops at indices less than or equal to p. Applies function f_at_p
only to the
op at p. Applies f
to all other ops above p. Read more
Folds across the p values, passing T down. Mutates op if returned values is Some(…)
Mutate only the ops. Override with more efficient solutions if needed.
Iterate through the ops and call f. Exit early with Err(v).
Iterate through ops only. Can override with more efficient implementation.
Iterate through the ops and call f.
Iterate through ops only. Calls try_iterate_ops by default. Read more
fn make_diagonal_update<'b, H: Hamiltonian<'b>>(
&mut self,
cutoff: usize,
beta: f64,
state: &[bool],
hamiltonian: &H
)
fn make_diagonal_update<'b, H: Hamiltonian<'b>>(
&mut self,
cutoff: usize,
beta: f64,
state: &[bool],
hamiltonian: &H
)
Perform a diagonal update step with thread rng.
Perform a diagonal update step.
Perform a diagonal update step using in place edits to state.
Called after an update.
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BinaryHeap<Reverse<usize>>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BinaryHeap<Reverse<usize>>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BondContainer<VarPos>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BondContainer<VarPos>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BondContainer<usize>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<BondContainer<usize>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<OpSide, Global>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<OpSide, Global>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<Option<usize>, Global>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<Option<usize>, Global>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<bool, Global>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<bool, Global>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<f64, Global>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<f64, Global>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<usize, Global>> for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> Factory<Vec<usize, Global>> for FastOpsTemplate<O, ALLOC>
Get an instance of T
Return an instance of T
impl<O: Op + Clone, ALLOC: FastOpAllocator> HeatBathDiagonalUpdater for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> HeatBathDiagonalUpdater for FastOpsTemplate<O, ALLOC>
fn make_heatbath_diagonal_update<'b, H: Hamiltonian<'b>>(
&mut self,
cutoff: usize,
beta: f64,
state: &[bool],
hamiltonian: &H,
bond_weights: &BondWeights
)
fn make_heatbath_diagonal_update<'b, H: Hamiltonian<'b>>(
&mut self,
cutoff: usize,
beta: f64,
state: &[bool],
hamiltonian: &H,
bond_weights: &BondWeights
)
Perform a single heatbath update.
fn make_heatbath_diagonal_update_with_rng<'b, H: Hamiltonian<'b>, R: Rng>(
&mut self,
cutoff: usize,
beta: f64,
state: &[bool],
hamiltonian: &H,
bond_weights: &BondWeights,
rng: &mut R
)
fn make_heatbath_diagonal_update_with_rng<'b, H: Hamiltonian<'b>, R: Rng>(
&mut self,
cutoff: usize,
beta: f64,
state: &[bool],
hamiltonian: &H,
bond_weights: &BondWeights,
rng: &mut R
)
Perform a single heatbath update.
fn make_heatbath_diagonal_update_with_rng_and_state_ref<'b, H: Hamiltonian<'b>, R: Rng>(
&mut self,
cutoff: usize,
beta: f64,
state: &mut [bool],
hamiltonian: &H,
bond_weights: &BondWeights,
rng: &mut R
)
fn make_heatbath_diagonal_update_with_rng_and_state_ref<'b, H: Hamiltonian<'b>, R: Rng>(
&mut self,
cutoff: usize,
beta: f64,
state: &mut [bool],
hamiltonian: &H,
bond_weights: &BondWeights,
rng: &mut R
)
Perform a single heatbath update.
Make the bond weights struct for this container.
type Node = FastOpNodeTemplate<O>
type Node = FastOpNodeTemplate<O>
The type used to contain the Op and handle movement around the worldlines.
Get a ref to a node at position p
Get a mutable ref to the node at position p
Get the first occupied p if it exists.
Get the last occupied p if it exists.
Get the first p occupied which covers variable var
, also returns the relative index.
Get the last p occupied which covers variable var
, also returns the relative index.
Get the previous occupied p compared to node
.
Get the next occupied p compared to node
.
Get the previous p for a given var, takes the relative var index in node. Also returns the new relative var index. Read more
Get the next p for a given var, takes the relative var index in node. Also returns the new relative var index. Read more
Get the previous p for a given var.
Get the next p for a given var.
Returns if a given variable is covered by any ops.
Make a loop update to the graph with thread rng.
Make a loop update to the graph.
Called after an update.
type Op = O
type Op = O
The op object to manage.
Get the cutoff for this container.
Set the cutoff for this container.
Iterate through the imaginary time states of the opcontainer.
impl<O: Op + Clone, ALLOC: FastOpAllocator> OpContainerConstructor for FastOpsTemplate<O, ALLOC>
impl<O: Op + Clone, ALLOC: FastOpAllocator> OpContainerConstructor for FastOpsTemplate<O, ALLOC>
Fill ps
with the p values of constant (Hij=k) ops for a given var.
An implementation by the same name is provided for LoopUpdaters Read more
Fill ps
with the p values of spin flips for a given var.
An implementation by the same name is provided for LoopUpdaters Read more
Perform a resonating bond update.
edges
lists all the 2-site bonds which define the lattice.
state
is the propagated state at time 0.
updates
is the number of updated to perform.
diagonal_edge_hamiltonian
gives the weight of a diagonal edge given a spin state.
rng
prng instance to use. Read more
Perform a resonating bond update.
edges
lists all the 2-site bonds which define the lattice.
state
is the propagated state at time 0.
updates
is the number of updated to perform.
diagonal_edge_hamiltonian
gives the weight of a diagonal edge given a spin state.
ising_ratio
provides the weight ratio of a node after a global ising flip to current.
rng
prng instance to use. Read more
Auto Trait Implementations
impl<O, ALLOC> RefUnwindSafe for FastOpsTemplate<O, ALLOC> where
ALLOC: RefUnwindSafe,
O: RefUnwindSafe,
impl<O, ALLOC> Send for FastOpsTemplate<O, ALLOC> where
ALLOC: Send,
O: Send,
impl<O, ALLOC> Sync for FastOpsTemplate<O, ALLOC> where
ALLOC: Sync,
O: Sync,
impl<O, ALLOC> Unpin for FastOpsTemplate<O, ALLOC> where
ALLOC: Unpin,
O: Unpin,
impl<O, ALLOC> UnwindSafe for FastOpsTemplate<O, ALLOC> where
ALLOC: UnwindSafe,
O: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V