pub struct WeightCutoff(pub u32);Expand description
Drop terms whose Pauli weight (number of non-identity qubits) exceeds k.
§Examples
use paulistrings::truncation::WeightCutoff;
let policy = WeightCutoff(4);Tuple Fields§
§0: u32Maximum allowed Pauli weight. Terms with weight > k are dropped.
Trait Implementations§
Source§impl<const W: usize> TruncationPolicy<W> for WeightCutoff
impl<const W: usize> TruncationPolicy<W> for WeightCutoff
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 WeightCutoff
impl RefUnwindSafe for WeightCutoff
impl Send for WeightCutoff
impl Sync for WeightCutoff
impl Unpin for WeightCutoff
impl UnwindSafe for WeightCutoff
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