pub trait Strategy:
Default
+ Clone
+ Copy {
// Required methods
fn capacity(&self, n_qubits: usize) -> usize;
fn truncate<S, V, H, M, W>(&self, map: &mut M)
where S: PauliStorage,
V: Coefficient,
H: BuildHasher + Clone + Default,
W: PauliWordTrait,
M: ACMap<S, V, H, W>;
}Expand description
A truncation policy applied to a PauliSum
during Pauli propagation.
The strategy controls two things: the initial capacity allocated
for the underlying map (estimating how many Pauli paths the
simulation is expected to generate) and the cut applied when
truncate is called explicitly. Implementations
include NoStrategy, the coefficient-magnitude threshold, the
max-Pauli-weight bound, etc.
Required Methods§
Sourcefn capacity(&self, n_qubits: usize) -> usize
fn capacity(&self, n_qubits: usize) -> usize
Given the number of qubits, predict the initial capacity of the map. Ideally this is about guessing the maximum Pauli paths will be generated during the computation, the more precise the better.
Sourcefn truncate<S, V, H, M, W>(&self, map: &mut M)where
S: PauliStorage,
V: Coefficient,
H: BuildHasher + Clone + Default,
W: PauliWordTrait,
M: ACMap<S, V, H, W>,
fn truncate<S, V, H, M, W>(&self, map: &mut M)where
S: PauliStorage,
V: Coefficient,
H: BuildHasher + Clone + Default,
W: PauliWordTrait,
M: ACMap<S, V, H, W>,
Drop entries from map that fall outside this strategy’s policy.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".