[−][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]> + Debug
[src]
The list of op variables.
type SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Debug
[src]
The list of op input and output states.
Required methods
pub 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>,
Make a diagonal op.
pub 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>,
Make an offdiagonal op.
pub fn index_of_var(&self, var: usize) -> Option<usize>
[src]
Get the relative index of a variable.
pub fn get_vars(&self) -> &[usize]
[src]
Get the set of variables used for this op.
pub fn get_bond(&self) -> usize
[src]
Get the associated bond number for the op.
pub fn get_inputs(&self) -> &[bool]
[src]
Get the input state for the op.
pub fn get_outputs(&self) -> &[bool]
[src]
Get the output state for the op.
pub fn clone_and_edit_in_out<F>(&self, f: F) -> Self where
F: Fn(&mut [bool], &mut [bool]),
[src]
F: Fn(&mut [bool], &mut [bool]),
Clone the op and edit inputs and outputs.
pub fn clone_and_edit_in_out_symmetric<F>(&self, f: F) -> Self where
F: Fn(&mut [bool]),
[src]
F: Fn(&mut [bool]),
Clone the op and edit inputs and outputs. Must edit states symmetrically (diagonal stays diagonal, offdiagonal stays offdiagonal).
pub fn edit_in_out<F>(&mut self, f: F) where
F: Fn(&mut [bool], &mut [bool]),
[src]
F: Fn(&mut [bool], &mut [bool]),
Edit inputs and outputs.
pub fn edit_in_out_symmetric<F>(&mut self, f: F) where
F: Fn(&mut [bool]),
[src]
F: Fn(&mut [bool]),
Edit inputs and outputs. Must edit states symmetrically (diagonal stays diagonal, offdiagonal stays offdiagonal).
pub fn clone_inputs(&self) -> Self::SubState
[src]
Get the input state for the op.
pub fn clone_outputs(&self) -> Self::SubState
[src]
Get the output state for the op.
pub fn is_constant(&self) -> bool
[src]
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
pub fn make_vars<V>(vars: V) -> Self::Vars where
V: IntoIterator<Item = usize>,
[src]
V: IntoIterator<Item = usize>,
Make vars (this is here mostly due to rust bug 38078)
pub fn make_substate<S>(state: S) -> Self::SubState where
S: IntoIterator<Item = bool>,
[src]
S: IntoIterator<Item = bool>,
Make substate (this is here mostly due to rust bug 38078)
pub fn is_diagonal(&self) -> bool
[src]
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 + Debug,
SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Clone + Debug,
[src]
Vars: FromIterator<usize> + AsRef<[usize]> + AsMut<[usize]> + Clone + Debug,
SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Clone + Debug,
type Vars = Vars
type SubState = SubState
pub 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>,
pub 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>,
pub fn is_diagonal(&self) -> bool
[src]
pub fn index_of_var(&self, var: usize) -> Option<usize>
[src]
pub fn get_vars(&self) -> &[usize]
[src]
pub fn get_bond(&self) -> usize
[src]
pub fn get_inputs(&self) -> &[bool]
[src]
pub fn get_outputs(&self) -> &[bool]
[src]
pub fn clone_and_edit_in_out<F>(&self, f: F) -> Self where
F: Fn(&mut [bool], &mut [bool]),
[src]
F: Fn(&mut [bool], &mut [bool]),
pub fn clone_and_edit_in_out_symmetric<F>(&self, f: F) -> Self where
F: Fn(&mut [bool]),
[src]
F: Fn(&mut [bool]),
pub fn clone_inputs(&self) -> Self::SubState
[src]
pub fn clone_outputs(&self) -> Self::SubState
[src]
pub fn is_constant(&self) -> bool
[src]
pub fn edit_in_out<F>(&mut self, f: F) where
F: Fn(&mut [bool], &mut [bool]),
[src]
F: Fn(&mut [bool], &mut [bool]),
pub fn edit_in_out_symmetric<F>(&mut self, f: F) where
F: Fn(&mut [bool]),
[src]
F: Fn(&mut [bool]),