Skip to main content

Config

Trait Config 

Source
pub trait Config: Clone {
    type Storage: PauliStorage;
    type Coeff: Coefficient;
    type Strategy: Strategy;
    type BuildHasher: BuildHasher + Clone + Default + HashFinalize;
    type PauliWordType: PauliWordTrait;
    type Map: ACMap<Self::Storage, Self::Coeff, Self::BuildHasher, Self::PauliWordType>;
}
Expand description

Compile-time configuration bundle for a PauliSum.

Config is a zero-cost generic dispatch mechanism: it pins down the storage backing (Storage), coefficient type (Coeff), truncation strategy (Strategy), hasher (BuildHasher), Pauli-word representation (PauliWordType), and concrete map (Map) used by a single PauliSum instantiation. Pre-built bundles live in the submodules (fxhash, indexmap, …); user code may define its own.

Required Associated Types§

Source

type Storage: PauliStorage

Backing storage for an individual Pauli word — typically a [u8; N] where N is the number of bytes packed.

Source

type Coeff: Coefficient

Numeric coefficient type (e.g. f64, Complex<f64>).

Source

type Strategy: Strategy

Truncation strategy applied when PauliSum::truncate runs.

Source

type BuildHasher: BuildHasher + Clone + Default + HashFinalize

Hasher used by the underlying map. It is also the hasher of the PauliWordType keys, so it must declare its cached-hash finalization via HashFinalize.

Source

type PauliWordType: PauliWordTrait

Concrete PauliWordTrait implementation used as map keys.

Source

type Map: ACMap<Self::Storage, Self::Coeff, Self::BuildHasher, Self::PauliWordType>

Concrete map type satisfying ACMap over the chosen storage / coefficient / hasher / word combination.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§