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