pub struct Or<A, B>(/* private fields */);Expand description
Either of two per-term filters: a term is kept if either keeps it.
Or combines per-term filters only: an operand with a layer pass (TopN, ApproxTopN, CollapseSample, or an And containing one) is rejected, since “either keeps” has no meaning for a pass over the whole sum.
Use And to add a filter to a layer pass.
Implementations§
Trait Implementations§
Source§impl<A: Into<BuiltinTruncation>, B: Into<BuiltinTruncation>> From<Or<A, B>> for BuiltinTruncation
§Panics
If either operand has a layer pass, as BuiltinTruncation::or.
impl<A: Into<BuiltinTruncation>, B: Into<BuiltinTruncation>> From<Or<A, B>> for BuiltinTruncation
§Panics
If either operand has a layer pass, as BuiltinTruncation::or.
Source§impl<const W: usize, A, B> TruncationPolicy<W> for Or<A, B>where
A: TruncationPolicy<W>,
B: TruncationPolicy<W>,
impl<const W: usize, A, B> TruncationPolicy<W> for Or<A, B>where
A: TruncationPolicy<W>,
B: TruncationPolicy<W>,
Source§fn finalizes_layer(&self) -> bool
fn finalizes_layer(&self) -> bool
false; panics if either operand has a layer pass.
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 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<A: Copy, B: Copy> Copy for Or<A, B>
impl<A, B> StructuralPartialEq for Or<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for Or<A, B>
impl<A, B> RefUnwindSafe for Or<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for Or<A, B>
impl<A, B> Sync for Or<A, B>
impl<A, B> Unpin for Or<A, B>
impl<A, B> UnwindSafe for Or<A, B>where
A: UnwindSafe,
B: UnwindSafe,
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