Struct qoqo::operations::ControlledRotateXWrapper
source · pub struct ControlledRotateXWrapper {
pub internal: ControlledRotateX,
}
Expand description
Implements the controlled RotateX operation.
The unitary matrix representation is:
.. math:: U = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & \cos(\frac{\theta}{2}) & -i \sin(\frac{\theta}{2}) \\ 0 & 0 & -i \sin(\frac{\theta}{2}) & \cos(\frac{\theta}{2}) \end{pmatrix}
Args: control (int): The index of the most significant qubit in the unitary representation. Here, the qubit that controls the application of the Rotatex Operation on the target qubit. target (int):: The index of the least significant qubit in the unitary representation. Here, the qubit RotateX Operation is applied to. theta (CalculatorFloat): The angle $\theta$ of the rotation.
Fields§
§internal: ControlledRotateX
Internal storage of ControlledRotateX object
Implementations§
source§impl ControlledRotateXWrapper
impl ControlledRotateXWrapper
sourcepub fn theta(&self) -> CalculatorFloatWrapper
pub fn theta(&self) -> CalculatorFloatWrapper
Returns value of attribute theta
sourcepub fn unitary_matrix(&self) -> PyResult<Py<PyArray2<Complex64>>>
pub fn unitary_matrix(&self) -> PyResult<Py<PyArray2<Complex64>>>
Return unitary matrix of gate.
Returns: np.ndarray
Raises: ValueError: Error symbolic operation cannot return float unitary matrix
sourcepub fn powercf(&self, power: CalculatorFloatWrapper) -> Self
pub fn powercf(&self, power: CalculatorFloatWrapper) -> Self
Returns Rotated gate raised to power
Args:
power
(CalculatorFloat): exponent of the power operation.
Returns:
Self: gate raised to the power of power
Trait Implementations§
source§impl Clone for ControlledRotateXWrapper
impl Clone for ControlledRotateXWrapper
source§fn clone(&self) -> ControlledRotateXWrapper
fn clone(&self) -> ControlledRotateXWrapper
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ControlledRotateXWrapper
impl Debug for ControlledRotateXWrapper
source§impl HasPyGilRef for ControlledRotateXWrapper
impl HasPyGilRef for ControlledRotateXWrapper
§type AsRefTarget = PyCell<ControlledRotateXWrapper>
type AsRefTarget = PyCell<ControlledRotateXWrapper>
source§impl PartialEq for ControlledRotateXWrapper
impl PartialEq for ControlledRotateXWrapper
source§fn eq(&self, other: &ControlledRotateXWrapper) -> bool
fn eq(&self, other: &ControlledRotateXWrapper) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PyClass for ControlledRotateXWrapper
impl PyClass for ControlledRotateXWrapper
source§impl PyClassImpl for ControlledRotateXWrapper
impl PyClassImpl for ControlledRotateXWrapper
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
§type ThreadChecker = SendablePyClass<ControlledRotateXWrapper>
type ThreadChecker = SendablePyClass<ControlledRotateXWrapper>
type Inventory = Pyo3MethodsInventoryForControlledRotateXWrapper
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl PyClassNewTextSignature<ControlledRotateXWrapper> for PyClassImplCollector<ControlledRotateXWrapper>
impl PyClassNewTextSignature<ControlledRotateXWrapper> for PyClassImplCollector<ControlledRotateXWrapper>
fn new_text_signature(self) -> Option<&'static str>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ControlledRotateXWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ControlledRotateXWrapper
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut ControlledRotateXWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut ControlledRotateXWrapper
source§impl PyTypeInfo for ControlledRotateXWrapper
impl PyTypeInfo for ControlledRotateXWrapper
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
PyTypeInfo::type_object
will be replaced by PyTypeInfo::type_object_bound
in a future PyO3 versionsource§fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
fn type_object_bound(py: Python<'_>) -> Bound<'_, PyType>
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
PyTypeInfo::is_type_of
will be replaced by PyTypeInfo::is_type_of_bound
in a future PyO3 versionobject
is an instance of this type or a subclass of this type.source§fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
fn is_type_of_bound(object: &Bound<'_, PyAny>) -> bool
object
is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
PyTypeInfo::is_exact_type_of
will be replaced by PyTypeInfo::is_exact_type_of_bound
in a future PyO3 versionobject
is an instance of this type.impl DerefToPyAny for ControlledRotateXWrapper
impl StructuralPartialEq for ControlledRotateXWrapper
Auto Trait Implementations§
impl Freeze for ControlledRotateXWrapper
impl RefUnwindSafe for ControlledRotateXWrapper
impl Send for ControlledRotateXWrapper
impl Sync for ControlledRotateXWrapper
impl Unpin for ControlledRotateXWrapper
impl UnwindSafe for ControlledRotateXWrapper
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
source§impl<T> FromPyObject<'_> for T
impl<T> FromPyObject<'_> for T
source§impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
impl<'py, T> FromPyObjectBound<'_, 'py> for Twhere
T: FromPyObject<'py>,
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 moresource§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
source§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
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>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.