Trait qmc::sse::qmc_traits::op_container::Op [−][src]
pub trait Op: Clone + Debug { type Vars: FromIterator<usize> + AsRef<[usize]> + AsMut<[usize]> + Debug; type SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Debug;}Show methods
fn diagonal<A, B>(vars: A, bond: usize, state: B, constant: bool) -> Self
where
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>; fn index_of_var(&self, var: usize) -> Option<usize>; fn get_vars(&self) -> &[usize]; fn get_bond(&self) -> usize; fn get_inputs(&self) -> &[bool]; fn get_outputs(&self) -> &[bool]; fn clone_and_edit_in_out<F>(&self, f: F) -> Self
where
F: Fn(&mut [bool], &mut [bool]); fn clone_and_edit_in_out_symmetric<F>(&self, f: F) -> Self
where
F: Fn(&mut [bool]); fn edit_in_out<F>(&mut self, f: F)
where
F: Fn(&mut [bool], &mut [bool]); fn edit_in_out_symmetric<F>(&mut self, f: F)
where
F: Fn(&mut [bool]); fn clone_inputs(&self) -> Self::SubState; fn clone_outputs(&self) -> Self::SubState; fn is_constant(&self) -> bool; fn make_vars<V>(vars: V) -> Self::Vars
where
V: IntoIterator<Item = usize>, { ... } fn make_substate<S>(state: S) -> Self::SubState
where
S: IntoIterator<Item = bool>, { ... } fn is_diagonal(&self) -> bool { ... }
Expand description
Ops for holding SSE graph state.
Associated Types
The list of op variables.
Required methods
Make a diagonal op.
Make an offdiagonal op.
fn index_of_var(&self, var: usize) -> Option<usize>
fn index_of_var(&self, var: usize) -> Option<usize>
Get the relative index of a variable.
fn get_inputs(&self) -> &[bool]
fn get_inputs(&self) -> &[bool]
Get the input state for the op.
fn get_outputs(&self) -> &[bool]
fn get_outputs(&self) -> &[bool]
Get the output state for the op.
Clone the op and edit inputs and outputs.
Clone the op and edit inputs and outputs. Must edit states symmetrically (diagonal stays diagonal, offdiagonal stays offdiagonal).
Edit inputs and outputs.
Edit inputs and outputs. Must edit states symmetrically (diagonal stays diagonal, offdiagonal stays offdiagonal).
fn clone_inputs(&self) -> Self::SubState
fn clone_inputs(&self) -> Self::SubState
Get the input state for the op.
fn clone_outputs(&self) -> Self::SubState
fn clone_outputs(&self) -> Self::SubState
Get the output state for the op.
fn is_constant(&self) -> bool
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>(vars: V) -> Self::Vars where
V: IntoIterator<Item = usize>,
fn make_vars<V>(vars: V) -> Self::Vars where
V: IntoIterator<Item = usize>,
Make vars (this is here mostly due to rust bug 38078)
fn make_substate<S>(state: S) -> Self::SubState where
S: IntoIterator<Item = bool>,
fn make_substate<S>(state: S) -> Self::SubState where
S: IntoIterator<Item = bool>,
Make substate (this is here mostly due to rust bug 38078)
fn is_diagonal(&self) -> bool
fn is_diagonal(&self) -> bool
Check if the op is diagonal (makes no state changes).