[−][src]Trait qmc::sse::qmc_traits::op_container::Op
Ops for holding SSE graph state.
Associated Types
type Vars: FromIterator<usize> + AsRef<[usize]> + AsMut<[usize]>
The list of op variables.
type SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]>
The list of op input and output states.
Required methods
fn diagonal<A, B>(vars: A, bond: usize, state: B, constant: bool) -> Self where
A: Into<Self::Vars>,
B: Into<Self::SubState>,
A: Into<Self::Vars>,
B: Into<Self::SubState>,
Make a diagonal op.
fn offdiagonal<A, B, C>(
vars: A,
bond: usize,
inputs: B,
outputs: C,
constant: bool
) -> Self where
A: Into<Self::Vars>,
B: Into<Self::SubState>,
C: Into<Self::SubState>,
vars: A,
bond: usize,
inputs: B,
outputs: C,
constant: bool
) -> Self where
A: Into<Self::Vars>,
B: Into<Self::SubState>,
C: Into<Self::SubState>,
Make an offdiagonal op.
fn index_of_var(&self, var: usize) -> Option<usize>
Get the relative index of a variable.
fn get_vars(&self) -> &[usize]
Get the set of variables used for this op.
fn get_bond(&self) -> usize
Get the associated bond number for the op.
fn get_inputs(&self) -> &[bool]
Get the input state for the op.
fn get_outputs(&self) -> &[bool]
Get the output state for the op.
fn get_inputs_mut(&mut self) -> &mut [bool]
Get the input state for the op.
fn get_outputs_mut(&mut self) -> &mut [bool]
Get the output state for the op.
fn get_mut_inputs_and_outputs(&mut self) -> (&mut [bool], &mut [bool])
Get both the inputs and outputs for op.
fn clone_inputs(&self) -> Self::SubState
Get the input state for the op.
fn clone_outputs(&self) -> Self::SubState
Get the output state for the op.
fn is_constant(&self) -> bool
If the op is always a constant under any bit flip in input or output, then it can be used to mark the edges of clusters.
Provided methods
fn make_vars<V: Iterator<Item = usize>>(vars: V) -> Self::Vars
Make vars (this is here mostly due to rust bug 38078)
fn make_substate<S: Iterator<Item = bool>>(state: S) -> Self::SubState
Make substate (this is here mostly due to rust bug 38078)
fn is_diagonal(&self) -> bool
Check if the op is diagonal (makes no state changes).
Implementors
impl<Vars, SubState> Op for BasicOp<Vars, SubState> where
Vars: FromIterator<usize> + AsRef<[usize]> + AsMut<[usize]> + Clone,
SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Clone,
[src]
Vars: FromIterator<usize> + AsRef<[usize]> + AsMut<[usize]> + Clone,
SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Clone,
type Vars = Vars
type SubState = SubState
fn diagonal<A, B>(vars: A, bond: usize, state: B, constant: bool) -> Self where
A: Into<Self::Vars>,
B: Into<Self::SubState>,
[src]
A: Into<Self::Vars>,
B: Into<Self::SubState>,
fn offdiagonal<A, B, C>(
vars: A,
bond: usize,
inputs: B,
outputs: C,
constant: bool
) -> Self where
A: Into<Self::Vars>,
B: Into<Self::SubState>,
C: Into<Self::SubState>,
[src]
vars: A,
bond: usize,
inputs: B,
outputs: C,
constant: bool
) -> Self where
A: Into<Self::Vars>,
B: Into<Self::SubState>,
C: Into<Self::SubState>,