pub struct CoefficientThreshold(pub f64);Expand description
Drop terms whose coefficient magnitude is at most epsilon.
§Examples
use paulistrings::truncation::CoefficientThreshold;
let policy = CoefficientThreshold(1e-9);Tuple Fields§
§0: f64Magnitude threshold. Terms with |coeff| <= epsilon are dropped.
Trait Implementations§
Source§impl<const W: usize> TruncationPolicy<W> for CoefficientThreshold
impl<const W: usize> TruncationPolicy<W> for CoefficientThreshold
Source§fn keep_term(&self, _x: &[u64; W], _z: &[u64; W], c: Complex64) -> bool
fn keep_term(&self, _x: &[u64; W], _z: &[u64; W], c: Complex64) -> bool
Cheap per-term filter applied during the merge phase. Must inline. Read more
Source§fn finalize_layer(&self, _sum: &mut PauliSum<W>)
fn finalize_layer(&self, _sum: &mut PauliSum<W>)
Optional global pass after each circuit layer. May be non-local
(e.g. partial sort for
TopN).Auto Trait Implementations§
impl Freeze for CoefficientThreshold
impl RefUnwindSafe for CoefficientThreshold
impl Send for CoefficientThreshold
impl Sync for CoefficientThreshold
impl Unpin for CoefficientThreshold
impl UnwindSafe for CoefficientThreshold
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more