pub struct CoefficientThreshold(pub f64);Expand description
Drop terms whose coefficient magnitude is at most epsilon.
The test is |c|² > ε², so magnitudes below about 1.6e-162 count as zero.
Tuple Fields§
§0: f64Magnitude threshold. Terms with |coeff| <= epsilon are dropped.
Trait Implementations§
Source§impl Clone for CoefficientThreshold
impl Clone for CoefficientThreshold
Source§fn clone(&self) -> CoefficientThreshold
fn clone(&self) -> CoefficientThreshold
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CoefficientThreshold
impl Debug for CoefficientThreshold
Source§impl From<CoefficientThreshold> for BuiltinTruncation
impl From<CoefficientThreshold> for BuiltinTruncation
Source§fn from(p: CoefficientThreshold) -> Self
fn from(p: CoefficientThreshold) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CoefficientThreshold
impl PartialEq for CoefficientThreshold
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
Per-term filter, run inside the merge on every output, so it must be cheap. Read more
Source§fn finalizes_layer(&self) -> bool
fn finalizes_layer(&self) -> bool
Whether
finalize_layer does anything, a hint that lets the engine skip it. Read moreSource§fn finalize_layer(&self, _sum: &mut PauliSum<W>)
fn finalize_layer(&self, _sum: &mut PauliSum<W>)
Pass over the whole sum after each layer;
PauliSum::retain is the easy way to write a filter here.Source§fn finalize_layer_partitioned(
&self,
local: &mut PauliSum<W>,
collectives: &dyn Collectives,
)
fn finalize_layer_partitioned( &self, local: &mut PauliSum<W>, collectives: &dyn Collectives, )
The layer pass over one partition’s slice of the layer, run on every layer on every partition in lock-step. Read more
Source§fn supports_partitioned(&self) -> bool
fn supports_partitioned(&self) -> bool
Whether
finalize_layer_partitioned runs above one partition; every partitioned driver checks it before the first layer. Read moreimpl Copy for CoefficientThreshold
impl StructuralPartialEq for CoefficientThreshold
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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