Struct qoqo_iqm::devices::DenebDeviceWrapper

source ·
pub struct DenebDeviceWrapper {
    pub internal: DenebDevice,
}
Expand description

IQM Deneb device

A hardware device composed of six qubits each coupled to a central resonator.

Fields§

§internal: DenebDevice

Internal storage of roqoqo_iqm::DenebDevice

Implementations§

source§

impl DenebDeviceWrapper

source

pub fn from_pyany(input: Py<PyAny>) -> PyResult<DenebDevice>

Extracts a DenebDevice from a DenebDeviceWrapper python object.

When working with qoqo and other rust based python packages compiled separately a downcast will not detect that two DenebDeviceWrapper objects are compatible. This function tries to convert a Python object into a DenebDevice instance by first checking if the object is a DenebDeviceWrapper instance and, if not, by invoking the to_bincode method on the object and deserializing the returned binary data.

Args: input (DenebDevice): The Python object that should be cast to a roqoqo_iqm::DenebDevice

Returns: device (DenebDevice): The resulting DenebDevice

Raises: PyTypeError: Something went wrong during the downcasting.

source§

impl DenebDeviceWrapper

source

pub fn new() -> Self

Create new simulator device.

source

pub fn set_endpoint_url(&mut self, new_url: String)

Change API endpoint URL of the device

Args: new_url (str): The new URL to set.

source

pub fn __copy__(&self) -> DenebDeviceWrapper

Return a copy of the DenebDevice (copy here produces a deepcopy).

Returns: DenebDevice: A deep copy of self.

source

pub fn __deepcopy__(&self, _memodict: Py<PyAny>) -> DenebDeviceWrapper

Return a deep copy of the DenebDevice.

Returns: DenebDevice: A deep copy of self.

source

pub fn to_bincode(&self) -> PyResult<Py<PyByteArray>>

Return the bincode representation of the DenebDevice using the bincode crate.

Returns: ByteArray: The serialized DenebDevice (in bincode form).

Raises: ValueError: Cannot serialize DenebDevice to bytes.

source

pub fn from_bincode(input: &PyAny) -> PyResult<DenebDeviceWrapper>

Convert the bincode representation of the DenebDevice to a DenebDevice using the bincode crate.

Args: input (ByteArray): The serialized DenebDevice (in bincode form).

Returns: DenebDevice: The deserialized DenebDevice.

Raises: TypeError: Input cannot be converted to byte array. ValueError: Input cannot be deserialized to DenebDevice.

source

pub fn number_qubits(&self) -> usize

Return number of qubits simulated by DenebDevice.

Returns: int: The number of qubits.

source

pub fn remote_host(&self) -> String

Return the URL of the API endpoint for the device.

Returns: str: The URL of the remote host executing the Circuits.

source

pub fn single_qubit_gate_time( &self, hqslang: &str, qubit: usize, ) -> PyResult<f64>

Return the gate time of a single-qubit operation on this device.

Args: hqslang (str): The name of the operation in hqslang format. qubit (int): The qubit on which the operation is performed.

Returns: f64: The gate time.

Raises: ValueError: The gate is not available in the device.

source

pub fn two_qubit_gate_time( &self, hqslang: &str, control: usize, target: usize, ) -> PyResult<f64>

Return the gate time of a two-qubit operation on this device.

Args: hqslang (str): The name of the operation in hqslang format. control (int): The control qubit on which the operation is performed. target (int): The target qubit on which the operation is performed.

Returns: f64: The gate time.

Raises: ValueError: The gate is not available in the device.

source

pub fn multi_qubit_gate_time( &self, hqslang: &str, qubits: Vec<usize>, ) -> PyResult<f64>

Return the gate time of a multi-qubit operation on this device.

Args: hqslang (str): The name of the operation in hqslang format. qubits (list[int]): The qubits on which the operation is performed.

Returns: f64: The gate time.

Raises: ValueError: The gate is not available in the device.

Trait Implementations§

source§

impl Clone for DenebDeviceWrapper

source§

fn clone(&self) -> DenebDeviceWrapper

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DenebDeviceWrapper

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for DenebDeviceWrapper

source§

fn default() -> DenebDeviceWrapper

Returns the “default value” for a type. Read more
source§

impl IntoPy<Py<PyAny>> for DenebDeviceWrapper

source§

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

Performs the conversion.
source§

impl PartialEq for DenebDeviceWrapper

source§

fn eq(&self, other: &DenebDeviceWrapper) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PyClass for DenebDeviceWrapper

§

type Frozen = False

Whether the pyclass is frozen. Read more
source§

impl PyClassImpl for DenebDeviceWrapper

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<DenebDeviceWrapper>

This handles following two situations: Read more
§

type Inventory = Pyo3MethodsInventoryForDenebDeviceWrapper

§

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>

source§

fn dict_offset() -> Option<isize>

source§

fn weaklist_offset() -> Option<isize>

source§

impl PyClassNewTextSignature<DenebDeviceWrapper> for PyClassImplCollector<DenebDeviceWrapper>

source§

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

source§

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

§

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

source§

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

source§

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

§

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

source§

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

source§

impl PyTypeInfo for DenebDeviceWrapper

§

type AsRefTarget = PyCell<DenebDeviceWrapper>

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

const NAME: &'static str = "DenebDevice"

Class name.
source§

const MODULE: Option<&'static str> = _

Module name, if any.
source§

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

Returns the PyTypeObject instance for this type.
source§

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

Returns the safe abstraction over the type object.
source§

fn is_type_of(object: &PyAny) -> bool

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

fn is_exact_type_of(object: &PyAny) -> bool

Checks if object is an instance of this type.
source§

impl Eq for DenebDeviceWrapper

source§

impl StructuralPartialEq for DenebDeviceWrapper

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> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<'a, T> FromPyObject<'a> for T
where T: PyClass + Clone,

source§

fn extract(obj: &'a PyAny) -> Result<T, PyErr>

Extracts Self from the source PyObject.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

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

source§

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

Arguments for exception
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

source§

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