GetValue

Trait GetValue 

Source
pub trait GetValue<T> {
    type ValueIn;
    type ValueOut;

    // Required methods
    fn get_key(index: &T) -> Self;
    fn get_transform(index: &T, value: Self::ValueIn) -> Self::ValueOut;
}
Expand description

Trait for transforming value stored at index I when using index of different type T to read out value e.g. Hermitian Hamiltonian H but we access H[NOIndex(2,1)] -> H[HermitianIndex(1,2)].conj()

Required Associated Types§

Required Methods§

Source

fn get_key(index: &T) -> Self

Source

fn get_transform(index: &T, value: Self::ValueIn) -> Self::ValueOut

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.

Implementations on Foreign Types§

Source§

impl GetValue<(DecoherenceProduct, DecoherenceProduct)> for (DecoherenceProduct, DecoherenceProduct)

Source§

fn get_key(index: &(DecoherenceProduct, DecoherenceProduct)) -> Self

Gets the key corresponding to the input index (here, itself).

§Arguments
  • index - The index for which to get the corresponding (DecoherenceProduct, DecoherenceProduct).
§Returns
  • Self - The corresponding (DecoherenceProduct, DecoherenceProduct).
Source§

fn get_transform( _index: &(DecoherenceProduct, DecoherenceProduct), value: CalculatorComplex, ) -> CalculatorComplex

Gets the transformed value corresponding to the input index and value (here, itself).

§Arguments
  • index - The index to transform the value by.
  • value - The value to be transformed.
§Returns
  • CalculatorComplex - The transformed value.
Source§

type ValueIn = CalculatorComplex

Source§

type ValueOut = CalculatorComplex

Implementors§

Source§

impl GetValue<BosonProduct> for BosonProduct

Trait for transforming value stored at index I when using index of different type T to read out value

Source§

impl GetValue<BosonProduct> for HermitianBosonProduct

Source§

impl GetValue<HermitianBosonProduct> for BosonProduct

Source§

impl GetValue<HermitianBosonProduct> for HermitianBosonProduct

Trait for transforming value stored at index I when using index of different type T to read out value

Source§

impl GetValue<FermionProduct> for FermionProduct

Source§

impl GetValue<FermionProduct> for HermitianFermionProduct

Source§

impl GetValue<HermitianFermionProduct> for FermionProduct

Source§

impl GetValue<HermitianFermionProduct> for HermitianFermionProduct

Trait for transforming value stored at index I when using index of different type T to read out value

Source§

impl GetValue<DecoherenceProduct> for DecoherenceProduct

Source§

impl GetValue<PauliProduct> for PauliProduct