[][src]Trait qmc::sse::qmc_traits::op_container::Op

pub trait Op: Clone + Debug {
    type Vars: FromIterator<usize> + AsRef<[usize]> + AsMut<[usize]> + Debug;
    type SubState: FromIterator<bool> + AsRef<[bool]> + AsMut<[bool]> + Debug;
    pub fn diagonal<A, B>(
        vars: A,
        bond: usize,
        state: B,
        constant: bool
    ) -> Self
    where
        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>
;
pub fn index_of_var(&self, var: usize) -> Option<usize>;
pub fn get_vars(&self) -> &[usize];
pub fn get_bond(&self) -> usize;
pub fn get_inputs(&self) -> &[bool];
pub fn get_outputs(&self) -> &[bool];
pub fn clone_and_edit_in_out<F>(&self, f: F) -> Self
    where
        F: Fn(&mut [bool], &mut [bool])
;
pub fn clone_and_edit_in_out_symmetric<F>(&self, f: F) -> Self
    where
        F: Fn(&mut [bool])
;
pub fn edit_in_out<F>(&mut self, f: F)
    where
        F: Fn(&mut [bool], &mut [bool])
;
pub fn edit_in_out_symmetric<F>(&mut self, f: F)
    where
        F: Fn(&mut [bool])
;
pub fn clone_inputs(&self) -> Self::SubState;
pub fn clone_outputs(&self) -> Self::SubState;
pub fn is_constant(&self) -> bool; pub fn make_vars<V>(vars: V) -> Self::Vars
    where
        V: IntoIterator<Item = usize>
, { ... }
pub fn make_substate<S>(state: S) -> Self::SubState
    where
        S: IntoIterator<Item = bool>
, { ... }
pub fn is_diagonal(&self) -> bool { ... } }

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.

Loading content...

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]

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]

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]

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]

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]

Edit inputs and outputs.

pub fn edit_in_out_symmetric<F>(&mut self, f: F) where
    F: Fn(&mut [bool]), 
[src]

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.

Loading content...

Provided methods

pub fn make_vars<V>(vars: V) -> Self::Vars where
    V: IntoIterator<Item = usize>, 
[src]

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]

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).

Loading content...

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]

type Vars = Vars

type SubState = SubState

Loading content...