Skip to content

ppvm_traits::config

config

ppvm_traits::config

classConfigsource

ppvm_traits::config::Config

Rust trait. Compile-time configuration bundle for a `PauliSum`.

pub trait Config: Clone

Associated items

NameTypeDescription
Storagetype Storage: PauliStorageassociated type. Backing storage for an individual Pauli word — typically a `[u8; N]` where `N` is the number of bytes packed.
Coefftype Coeff: Coefficientassociated type. Numeric coefficient type (e.g. `f64`, `Complex<f64>`).
Strategytype Strategy: Strategyassociated type. Truncation strategy applied when `PauliSum::truncate` runs.
BuildHashertype BuildHasher: BuildHasher + Clone + Default + HashFinalizeassociated type. Hasher used by the underlying map. It is also the hasher of the [`PauliWordType`](Self::PauliWordType) keys, so it must declare its cached-hash finalization via [`HashFinalize`].
PauliWordTypetype PauliWordType: PauliWordTraitassociated type. Concrete [`PauliWordTrait`] implementation used as map keys.
Maptype Map: ACMap&lt;&lt;Self as &gt;::Storage, &lt;Self as &gt;::Coeff, &lt;Self as &gt;::BuildHasher, &lt;Self as &gt;::PauliWordType&gt;associated type. Concrete map type satisfying [`ACMap`] over the chosen storage / coefficient / hasher / word combination.

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

source