pub enum SingleQubitGateOperation {
Show 15 variants
SingleQubitGate(SingleQubitGate),
RotateZ(RotateZ),
RotateX(RotateX),
RotateY(RotateY),
PauliX(PauliX),
PauliY(PauliY),
PauliZ(PauliZ),
SqrtPauliX(SqrtPauliX),
InvSqrtPauliX(InvSqrtPauliX),
Hadamard(Hadamard),
SGate(SGate),
TGate(TGate),
PhaseShiftState1(PhaseShiftState1),
PhaseShiftState0(PhaseShiftState0),
RotateAroundSphericalAxis(RotateAroundSphericalAxis),
}
Expand description
Enum of all Operations implementing OperateSingleQubitGate
Variants
SingleQubitGate(SingleQubitGate)
Variant for SingleQubitGate
RotateZ(RotateZ)
Variant for RotateZ
RotateX(RotateX)
Variant for RotateX
RotateY(RotateY)
Variant for RotateY
PauliX(PauliX)
Variant for PauliX
PauliY(PauliY)
Variant for PauliY
PauliZ(PauliZ)
Variant for PauliZ
SqrtPauliX(SqrtPauliX)
Variant for SqrtPauliX
InvSqrtPauliX(InvSqrtPauliX)
Variant for InvSqrtPauliX
Hadamard(Hadamard)
Variant for Hadamard
SGate(SGate)
Variant for SGate
TGate(TGate)
Variant for TGate
PhaseShiftState1(PhaseShiftState1)
Variant for PhaseShiftState1
PhaseShiftState0(PhaseShiftState0)
Variant for PhaseShiftState0
RotateAroundSphericalAxis(RotateAroundSphericalAxis)
Variant for RotateAroundSphericalAxis
Trait Implementations
sourceimpl Clone for SingleQubitGateOperation
impl Clone for SingleQubitGateOperation
sourcefn clone(&self) -> SingleQubitGateOperation
fn clone(&self) -> SingleQubitGateOperation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for SingleQubitGateOperation
impl Debug for SingleQubitGateOperation
sourceimpl<'de> Deserialize<'de> for SingleQubitGateOperation
impl<'de> Deserialize<'de> for SingleQubitGateOperation
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<Hadamard> for SingleQubitGateOperation
impl From<Hadamard> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<InvSqrtPauliX> for SingleQubitGateOperation
impl From<InvSqrtPauliX> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourcefn from(v: InvSqrtPauliX) -> Self
fn from(v: InvSqrtPauliX) -> Self
Performs the conversion.
sourceimpl From<PauliX> for SingleQubitGateOperation
impl From<PauliX> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<PauliY> for SingleQubitGateOperation
impl From<PauliY> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<PauliZ> for SingleQubitGateOperation
impl From<PauliZ> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<PhaseShiftState0> for SingleQubitGateOperation
impl From<PhaseShiftState0> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourcefn from(v: PhaseShiftState0) -> Self
fn from(v: PhaseShiftState0) -> Self
Performs the conversion.
sourceimpl From<PhaseShiftState1> for SingleQubitGateOperation
impl From<PhaseShiftState1> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourcefn from(v: PhaseShiftState1) -> Self
fn from(v: PhaseShiftState1) -> Self
Performs the conversion.
sourceimpl From<RotateAroundSphericalAxis> for SingleQubitGateOperation
impl From<RotateAroundSphericalAxis> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourcefn from(v: RotateAroundSphericalAxis) -> Self
fn from(v: RotateAroundSphericalAxis) -> Self
Performs the conversion.
sourceimpl From<RotateX> for SingleQubitGateOperation
impl From<RotateX> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<RotateY> for SingleQubitGateOperation
impl From<RotateY> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<RotateZ> for SingleQubitGateOperation
impl From<RotateZ> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<SGate> for SingleQubitGateOperation
impl From<SGate> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl From<SingleQubitGate> for SingleQubitGateOperation
impl From<SingleQubitGate> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourcefn from(v: SingleQubitGate) -> Self
fn from(v: SingleQubitGate) -> Self
Performs the conversion.
sourceimpl From<SingleQubitGateOperation> for Operation
impl From<SingleQubitGateOperation> for Operation
sourcefn from(op: SingleQubitGateOperation) -> Self
fn from(op: SingleQubitGateOperation) -> Self
Performs the conversion.
sourceimpl From<SqrtPauliX> for SingleQubitGateOperation
impl From<SqrtPauliX> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourcefn from(v: SqrtPauliX) -> Self
fn from(v: SqrtPauliX) -> Self
Performs the conversion.
sourceimpl From<TGate> for SingleQubitGateOperation
impl From<TGate> for SingleQubitGateOperation
Implements the From trait $\textit{from}$ this Operation.
sourceimpl InvolveQubits for SingleQubitGateOperation
impl InvolveQubits for SingleQubitGateOperation
Implements InvolveQubits trait for the qubits involved in this Operation.
sourcefn involved_qubits(&self) -> InvolvedQubits
fn involved_qubits(&self) -> InvolvedQubits
Returns a list of all involved qubits.
sourceimpl Operate for SingleQubitGateOperation
impl Operate for SingleQubitGateOperation
Implements the universal basic trait Operate for this Operation.
sourceimpl OperateGate for SingleQubitGateOperation
impl OperateGate for SingleQubitGateOperation
sourcefn unitary_matrix(&self) -> Result<Array2<Complex64>, RoqoqoError>
fn unitary_matrix(&self) -> Result<Array2<Complex64>, RoqoqoError>
Returns unitary matrix of the gate.
sourceimpl OperateSingleQubit for SingleQubitGateOperation
impl OperateSingleQubit for SingleQubitGateOperation
Implements OperateSingleQubit trait for this Operation acting on exactly one qubit.
sourceimpl OperateSingleQubitGate for SingleQubitGateOperation
impl OperateSingleQubitGate for SingleQubitGateOperation
sourcefn alpha_r(&self) -> CalculatorFloat
fn alpha_r(&self) -> CalculatorFloat
Returns alpha_r parameter of operation. Read more
sourcefn alpha_i(&self) -> CalculatorFloat
fn alpha_i(&self) -> CalculatorFloat
Returns alpha_i parameter of operation. Read more
sourcefn beta_r(&self) -> CalculatorFloat
fn beta_r(&self) -> CalculatorFloat
Returns beta_r parameter of operation. Read more
sourcefn beta_i(&self) -> CalculatorFloat
fn beta_i(&self) -> CalculatorFloat
Returns beta_i parameter of operation. Read more
sourcefn global_phase(&self) -> CalculatorFloat
fn global_phase(&self) -> CalculatorFloat
Returns global_phase parameter of operation. Read more
sourcefn mul<T>(&self, other: &T) -> Result<SingleQubitGate, RoqoqoError> where
T: OperateSingleQubitGate,
fn mul<T>(&self, other: &T) -> Result<SingleQubitGate, RoqoqoError> where
T: OperateSingleQubitGate,
Multiplies two compatible operations implementing OperateSingleQubitGate. Read more
sourceimpl PartialEq<SingleQubitGateOperation> for SingleQubitGateOperation
impl PartialEq<SingleQubitGateOperation> for SingleQubitGateOperation
sourcefn eq(&self, other: &SingleQubitGateOperation) -> bool
fn eq(&self, other: &SingleQubitGateOperation) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &SingleQubitGateOperation) -> bool
fn ne(&self, other: &SingleQubitGateOperation) -> bool
This method tests for !=
.
sourceimpl Serialize for SingleQubitGateOperation
impl Serialize for SingleQubitGateOperation
sourceimpl Substitute for SingleQubitGateOperation
impl Substitute for SingleQubitGateOperation
Implements Substitute trait allowing to replace symbolic parameters and to perform qubit mappings.
sourcefn substitute_parameters(
&self,
calculator: &mut Calculator
) -> Result<Self, RoqoqoError>
fn substitute_parameters(
&self,
calculator: &mut Calculator
) -> Result<Self, RoqoqoError>
Substitutes symbolic parameters in clone of the operation.
sourcefn remap_qubits(
&self,
mapping: &HashMap<usize, usize>
) -> Result<Self, RoqoqoError>
fn remap_qubits(
&self,
mapping: &HashMap<usize, usize>
) -> Result<Self, RoqoqoError>
Remaps the qubits in clone of the operation.
sourceimpl TryFrom<&'_ Operation> for SingleQubitGateOperation
impl TryFrom<&'_ Operation> for SingleQubitGateOperation
sourceimpl TryFrom<Operation> for SingleQubitGateOperation
impl TryFrom<Operation> for SingleQubitGateOperation
sourceimpl TryFrom<SingleQubitGateOperation> for SingleQubitGate
impl TryFrom<SingleQubitGateOperation> for SingleQubitGate
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for RotateZ
impl TryFrom<SingleQubitGateOperation> for RotateZ
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for SGate
impl TryFrom<SingleQubitGateOperation> for SGate
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for TGate
impl TryFrom<SingleQubitGateOperation> for TGate
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for PhaseShiftState1
impl TryFrom<SingleQubitGateOperation> for PhaseShiftState1
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for PhaseShiftState0
impl TryFrom<SingleQubitGateOperation> for PhaseShiftState0
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for RotateAroundSphericalAxis
impl TryFrom<SingleQubitGateOperation> for RotateAroundSphericalAxis
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for RotateX
impl TryFrom<SingleQubitGateOperation> for RotateX
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for RotateY
impl TryFrom<SingleQubitGateOperation> for RotateY
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for PauliX
impl TryFrom<SingleQubitGateOperation> for PauliX
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for PauliY
impl TryFrom<SingleQubitGateOperation> for PauliY
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for PauliZ
impl TryFrom<SingleQubitGateOperation> for PauliZ
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for SqrtPauliX
impl TryFrom<SingleQubitGateOperation> for SqrtPauliX
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for InvSqrtPauliX
impl TryFrom<SingleQubitGateOperation> for InvSqrtPauliX
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
sourceimpl TryFrom<SingleQubitGateOperation> for Hadamard
impl TryFrom<SingleQubitGateOperation> for Hadamard
Implements the core::convert::TryFrom trait $\textit{into}$ this Operation.
impl StructuralPartialEq for SingleQubitGateOperation
Auto Trait Implementations
impl RefUnwindSafe for SingleQubitGateOperation
impl Send for SingleQubitGateOperation
impl Sync for SingleQubitGateOperation
impl Unpin for SingleQubitGateOperation
impl UnwindSafe for SingleQubitGateOperation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more