pub struct GateFilter { /* private fields */ }Expand description
Which gates a rule fires after.
An unset field imposes no restriction, so GateFilter::all matches every
gate on every qubit.
Implementations§
Source§impl GateFilter
impl GateFilter
pub fn all() -> Self
Sourcepub fn named(self, name: impl Into<String>) -> Self
pub fn named(self, name: impl Into<String>) -> Self
Restrict to gates whose Gate::name equals name, such as "cx".
A name no gate in the circuit carries is not an error: the rule emits
nothing. Fusion renames gates ("fused", "fused_2q", "multi_fused"),
so build the model against the circuit the caller holds rather than a
fused stream.
Sourcepub fn on_qubits(self, qubits: impl IntoIterator<Item = usize>) -> Self
pub fn on_qubits(self, qubits: impl IntoIterator<Item = usize>) -> Self
Restrict to the listed qubits, as an unordered set. Every rule kind honours it: one acting per target emits events only on the targets in the set, and one acting on a gate’s whole target list, or on the spectators of a target, fires only for targets the set admits.
Sourcepub fn on_targets(self, targets: impl IntoIterator<Item = usize>) -> Self
pub fn on_targets(self, targets: impl IntoIterator<Item = usize>) -> Self
Restrict to gates whose target list equals targets in order.
Directed, unlike GateFilter::on_qubits: on_targets([0, 1]) matches
cx(0, 1) and not cx(1, 0), which is what a calibration table keyed by
coupling-map edge needs.
Trait Implementations§
Source§impl Clone for GateFilter
impl Clone for GateFilter
Source§fn clone(&self) -> GateFilter
fn clone(&self) -> GateFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GateFilter
impl Debug for GateFilter
Source§impl Default for GateFilter
impl Default for GateFilter
Source§fn default() -> GateFilter
fn default() -> GateFilter
Auto Trait Implementations§
impl Freeze for GateFilter
impl RefUnwindSafe for GateFilter
impl Send for GateFilter
impl Sync for GateFilter
impl Unpin for GateFilter
impl UnsafeUnpin for GateFilter
impl UnwindSafe for GateFilter
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T, U> Imply<T> for U
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> ⓘ
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> ⓘ
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