ModeIndex

Trait ModeIndex 

Source
pub trait ModeIndex:
    SymmetricIndex
    + Hash
    + Eq
    + Sized
    + Clone
    + Debug
    + Display
    + FromStr
    + Default
    + Serialize {
    // Required methods
    fn new(
        creators: impl IntoIterator<Item = usize>,
        annihilators: impl IntoIterator<Item = usize>,
    ) -> Result<Self, StruqtureError>;
    fn creators(&self) -> Iter<'_, usize>;
    fn annihilators(&self) -> Iter<'_, usize>;
    fn create_valid_pair(
        creators: impl IntoIterator<Item = usize>,
        annihilators: impl IntoIterator<Item = usize>,
        value: CalculatorComplex,
    ) -> Result<(Self, CalculatorComplex), StruqtureError>;

    // Provided methods
    fn number_creators(&self) -> usize { ... }
    fn number_annihilators(&self) -> usize { ... }
    fn current_number_modes(&self) -> usize { ... }
    fn remap_modes(
        &self,
        reordering_dictionary: &HashMap<usize, usize>,
    ) -> Result<(Self, CalculatorComplex), StruqtureError> { ... }
}
Expand description

Trait for all index types requires converting between index types

Required Methods§

Source

fn new( creators: impl IntoIterator<Item = usize>, annihilators: impl IntoIterator<Item = usize>, ) -> Result<Self, StruqtureError>

Source

fn creators(&self) -> Iter<'_, usize>

Gets the creator indices of Self.

§Returns
  • Iter<usize> - The creator indices in Self.
Source

fn annihilators(&self) -> Iter<'_, usize>

Gets the annihilator indices of Self.

§Returns
  • Iter<usize> - The annihilator indices in Self.
Source

fn create_valid_pair( creators: impl IntoIterator<Item = usize>, annihilators: impl IntoIterator<Item = usize>, value: CalculatorComplex, ) -> Result<(Self, CalculatorComplex), StruqtureError>

Provided Methods§

Source

fn number_creators(&self) -> usize

Gets the number of creator indices of Self.

§Returns
  • usize - The number of creator indices in Self.
Source

fn number_annihilators(&self) -> usize

Gets the number of annihilator indices of Self.

§Returns
  • usize - The number of annihilator indices in Self.
Source

fn current_number_modes(&self) -> usize

Returns the maximal number of modes the Index (operator product) acts on.

A ModeIndex acts on a state space of unknown dimension. There is only a lower bound of the dimension or number of modes based on the maximal mode the product of operators in the index acts on.

For example an index consisting of one creator acting on mode 0 would have a current_number_modes of one. An index consisting of one annhihilator acting on 3 would have current_number_modes of four.

Source

fn remap_modes( &self, reordering_dictionary: &HashMap<usize, usize>, ) -> Result<(Self, CalculatorComplex), StruqtureError>

Remap modes according to an input dictionary.

§Arguments

reordering_dictionary - The dictionary specifying the remapping. It must represent a permutation.

§Returns

(Self, CalculatorComplex) - The instance of Self with modes remapped, and the sign resulting from symmetry/antisymmetry.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§