Struct qoqo::operations::ToffoliWrapper
source · pub struct ToffoliWrapper {
pub internal: Toffoli,
}
Expand description
Implements Toffoli gate.
.. math:: U = \begin{pmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \end{pmatrix}
Args: control_0 (int): The index of the most significant qubit in the unitary representation. Here, the first controlling qubit of the operation. control_1 (int): The index of the second most significant qubit in the unitary representation. Here, the second controlling qubit of the operation. target (int): The index of the least significant qubit in the unitary representation. Here, the qubit the PauliX gate is applied to.
Fields§
§internal: Toffoli
Internal storage of Toffoli object
Implementations§
source§impl ToffoliWrapper
impl ToffoliWrapper
sourcepub fn circuit(&self) -> CircuitWrapper
pub fn circuit(&self) -> CircuitWrapper
Returns circuit implementing the ThreeQubitGateOperation
Returns: Circuit
Trait Implementations§
source§impl Clone for ToffoliWrapper
impl Clone for ToffoliWrapper
source§fn clone(&self) -> ToffoliWrapper
fn clone(&self) -> ToffoliWrapper
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ToffoliWrapper
impl Debug for ToffoliWrapper
source§impl HasPyGilRef for ToffoliWrapper
impl HasPyGilRef for ToffoliWrapper
§type AsRefTarget = PyCell<ToffoliWrapper>
type AsRefTarget = PyCell<ToffoliWrapper>
source§impl PartialEq for ToffoliWrapper
impl PartialEq for ToffoliWrapper
source§fn eq(&self, other: &ToffoliWrapper) -> bool
fn eq(&self, other: &ToffoliWrapper) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PyClassImpl for ToffoliWrapper
impl PyClassImpl for ToffoliWrapper
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<ToffoliWrapper>
type ThreadChecker = SendablePyClass<ToffoliWrapper>
type Inventory = Pyo3MethodsInventoryForToffoliWrapper
§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<ToffoliWrapper> for PyClassImplCollector<ToffoliWrapper>
impl PyClassNewTextSignature<ToffoliWrapper> for PyClassImplCollector<ToffoliWrapper>
fn new_text_signature(self) -> Option<&'static str>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ToffoliWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ToffoliWrapper
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut ToffoliWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut ToffoliWrapper
source§impl PyTypeInfo for ToffoliWrapper
impl PyTypeInfo for ToffoliWrapper
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 ToffoliWrapper
impl StructuralPartialEq for ToffoliWrapper
Auto Trait Implementations§
impl Freeze for ToffoliWrapper
impl RefUnwindSafe for ToffoliWrapper
impl Send for ToffoliWrapper
impl Sync for ToffoliWrapper
impl Unpin for ToffoliWrapper
impl UnwindSafe for ToffoliWrapper
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.