pub enum GeneratorKind<'a> {
RotX,
RotY,
RotZ,
RotZz,
Phase,
RotPauli(&'a [PauliAxis]),
}Expand description
Analytic differentiation generator for a parametric gate.
Returned by Gate::pauli_generator and consumed by the adjoint gradient
engine. Gate stays 16 bytes: this is produced on demand, never stored in
the enum. Each rotation variant is exp(-i θ/2 G) with the named Pauli
generator G acting on the gate’s targets (in order); Phase is the
non-Pauli phase gate diag(1, e^{iθ}) whose generator is the projector
|1⟩⟨1| on targets[0]. The borrow is of the gate the generator was read
from, so a caller holding one cannot pair it with another gate’s letters.
Variants§
RotX
Rx(θ): generator X on targets[0].
RotY
Ry(θ): generator Y on targets[0].
RotZ
Rz(θ): generator Z on targets[0].
RotZz
Rzz(θ): generator Z⊗Z on targets[0] and targets[1].
Phase
P(θ): generator is the projector |1⟩⟨1| on targets[0].
RotPauli(&'a [PauliAxis])
PauliRot(θ): generator is the Pauli string whose letter at index i
acts on targets[i].
Trait Implementations§
Source§impl<'a> Clone for GeneratorKind<'a>
impl<'a> Clone for GeneratorKind<'a>
Source§fn clone(&self) -> GeneratorKind<'a>
fn clone(&self) -> GeneratorKind<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for GeneratorKind<'a>
Source§impl<'a> Debug for GeneratorKind<'a>
impl<'a> Debug for GeneratorKind<'a>
impl<'a> Eq for GeneratorKind<'a>
Source§impl<'a> PartialEq for GeneratorKind<'a>
impl<'a> PartialEq for GeneratorKind<'a>
impl<'a> StructuralPartialEq for GeneratorKind<'a>
Auto Trait Implementations§
impl<'a> Freeze for GeneratorKind<'a>
impl<'a> RefUnwindSafe for GeneratorKind<'a>
impl<'a> Send for GeneratorKind<'a>
impl<'a> Sync for GeneratorKind<'a>
impl<'a> Unpin for GeneratorKind<'a>
impl<'a> UnsafeUnpin for GeneratorKind<'a>
impl<'a> UnwindSafe for GeneratorKind<'a>
Blanket Implementations§
impl<T> Boilerplate for T
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