Struct spynoza::QuantumCircuit

source ·
pub struct QuantumCircuit { /* private fields */ }

Implementations§

source§

impl QuantumCircuit

source

pub fn new(registers: &PyTuple) -> Self

source

pub fn register_sizes(&self) -> Vec<usize>

source

pub fn state_vector(&self) -> PyResult<PyState>

source

pub fn transformations(&self) -> Vec<PyQuantumTransformation>

source

pub fn inverse(&mut self)

source

pub fn h(&mut self, target: usize)

source

pub fn x(&mut self, target: usize)

source

pub fn y(&mut self, target: usize)

source

pub fn z(&mut self, target: usize)

source

pub fn p(&mut self, angle: Float, target: usize)

source

pub fn rx(&mut self, angle: Float, target: usize)

source

pub fn ry(&mut self, angle: Float, target: usize)

source

pub fn rz(&mut self, angle: Float, target: usize)

source

pub fn u(&mut self, theta: Float, phi: Float, lambda: Float, target: usize)

source

pub fn ch(&mut self, control: usize, target: usize)

source

pub fn cx(&mut self, control: usize, target: usize)

source

pub fn ccx(&mut self, control0: usize, control1: usize, target: usize)

source

pub fn cy(&mut self, control: usize, target: usize)

source

pub fn cu( &mut self, theta: Float, phi: Float, lambda: Float, control: usize, target: usize )

source

pub fn cp(&mut self, angle: Float, control: usize, target: usize)

source

pub fn crx(&mut self, angle: Float, control: usize, target: usize)

source

pub fn cry(&mut self, angle: Float, control: usize, target: usize)

source

pub fn crz(&mut self, angle: Float, control: usize, target: usize)

source

pub fn measure(&mut self, target: usize)

source

pub fn swap(&mut self, t0: usize, t1: usize)

source

pub fn iqft(&mut self, targets: Vec<usize>)

source

pub fn bit_flip_noise(&mut self, prob: Float, target: usize)

source

pub fn add(&mut self, q_transformation: QuantumTransformation)

source

pub fn append( &mut self, circuit: &QuantumCircuit, quantum_register: &QuantumRegister )

source

pub fn c_append( &mut self, circuit: &QuantumCircuit, c: usize, quantum_register: &QuantumRegister )

source

pub fn mc_append( &mut self, circuit: &QuantumCircuit, cs: Vec<usize>, quantum_register: &QuantumRegister )

source

pub fn execute(&mut self)

Trait Implementations§

source§

impl IntoPy<Py<PyAny>> for QuantumCircuit

source§

fn into_py(self, py: Python<'_>) -> PyObject

Performs the conversion.
source§

impl PyClass for QuantumCircuit

§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for QuantumCircuit

source§

const IS_BASETYPE: bool = false

#[pyclass(subclass)]
source§

const IS_SUBCLASS: bool = false

#[pyclass(extends=…)]
source§

const IS_MAPPING: bool = false

#[pyclass(mapping)]
source§

const IS_SEQUENCE: bool = false

#[pyclass(sequence)]
§

type BaseType = PyAny

Base class
§

type ThreadChecker = SendablePyClass<QuantumCircuit>

This handles following two situations: Read more
§

type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild

Immutable or mutable
§

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.
§

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.
§

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict.
source§

fn items_iter() -> PyClassItemsIter

source§

fn doc(py: Python<'_>) -> PyResult<&'static CStr>

Rendered class doc
source§

fn lazy_type_object() -> &'static LazyTypeObject<Self>

§

fn dict_offset() -> Option<isize>

§

fn weaklist_offset() -> Option<isize>

source§

impl PyClassNewTextSignature<QuantumCircuit> for PyClassImplCollector<QuantumCircuit>

source§

fn new_text_signature(self) -> Option<&'static str>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a QuantumCircuit

§

type Holder = Option<PyRef<'py, QuantumCircuit>>

source§

fn extract(obj: &'py PyAny, holder: &'a mut Self::Holder) -> PyResult<Self>

source§

impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut QuantumCircuit

§

type Holder = Option<PyRefMut<'py, QuantumCircuit>>

source§

fn extract(obj: &'py PyAny, holder: &'a mut Self::Holder) -> PyResult<Self>

source§

impl PyMethods<QuantumCircuit> for PyClassImplCollector<QuantumCircuit>

source§

fn py_methods(self) -> &'static PyClassItems

source§

impl PyTypeInfo for QuantumCircuit

§

type AsRefTarget = PyCell<QuantumCircuit>

Utility type to make Py::as_ref work.
source§

const NAME: &'static str = "QuantumCircuit"

Class name.
source§

const MODULE: Option<&'static str> = ::core::option::Option::None

Module name, if any.
source§

fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject

Returns the PyTypeObject instance for this type.
§

fn type_object(py: Python<'_>) -> &PyType

Returns the safe abstraction over the type object.
§

fn is_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type or a subclass of this type.
§

fn is_exact_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PyErrArguments for T
where T: IntoPy<Py<PyAny>> + Send + Sync,

§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> Ungil for T
where T: Send,