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§
fn new( creators: impl IntoIterator<Item = usize>, annihilators: impl IntoIterator<Item = usize>, ) -> Result<Self, StruqtureError>
Sourcefn annihilators(&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§
Sourcefn number_creators(&self) -> usize
fn number_creators(&self) -> usize
Sourcefn number_annihilators(&self) -> usize
fn number_annihilators(&self) -> usize
Gets the number of annihilator indices of Self.
§Returns
usize- The number of annihilator indices in Self.
Sourcefn current_number_modes(&self) -> usize
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.
Sourcefn remap_modes(
&self,
reordering_dictionary: &HashMap<usize, usize>,
) -> Result<(Self, CalculatorComplex), StruqtureError>
fn remap_modes( &self, reordering_dictionary: &HashMap<usize, usize>, ) -> Result<(Self, CalculatorComplex), StruqtureError>
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.