pub struct ParametricCNOT {
pub control: usize,
pub target: usize,
}Expand description
Non-parametric CNOT gate, used for the entangling layers of ansätze such
as ansatze::hardware_efficient. It has no free parameters (an empty
ParametricGate::parameter_indices), so parameter-shift/finite-
difference/SPSA gradient computation simply never varies it, and its own
gradient with respect to any parameter is the zero matrix.
Fields§
§control: usize§target: usizeTrait Implementations§
Source§impl ParametricGate for ParametricCNOT
impl ParametricGate for ParametricCNOT
Source§fn parameter_indices(&self) -> Vec<usize>
fn parameter_indices(&self) -> Vec<usize>
Get parameter indices this gate depends on
Source§fn matrix(&self, _params: &[f64]) -> Result<Array2<Complex64>>
fn matrix(&self, _params: &[f64]) -> Result<Array2<Complex64>>
Evaluate gate matrix given parameter values
Auto Trait Implementations§
impl Freeze for ParametricCNOT
impl RefUnwindSafe for ParametricCNOT
impl Send for ParametricCNOT
impl Sync for ParametricCNOT
impl Unpin for ParametricCNOT
impl UnsafeUnpin for ParametricCNOT
impl UnwindSafe for ParametricCNOT
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.