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
impl DenebDeviceWrapper
sourcepub fn from_pyany(input: Py<PyAny>) -> PyResult<DenebDevice>
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
impl DenebDeviceWrapper
sourcepub fn set_endpoint_url(&mut self, new_url: String)
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.
sourcepub fn __copy__(&self) -> DenebDeviceWrapper
pub fn __copy__(&self) -> DenebDeviceWrapper
Return a copy of the DenebDevice (copy here produces a deepcopy).
Returns: DenebDevice: A deep copy of self.
sourcepub fn __deepcopy__(&self, _memodict: Py<PyAny>) -> DenebDeviceWrapper
pub fn __deepcopy__(&self, _memodict: Py<PyAny>) -> DenebDeviceWrapper
Return a deep copy of the DenebDevice.
Returns: DenebDevice: A deep copy of self.
sourcepub fn to_bincode(&self) -> PyResult<Py<PyByteArray>>
pub fn to_bincode(&self) -> PyResult<Py<PyByteArray>>
sourcepub fn from_bincode(input: &PyAny) -> PyResult<DenebDeviceWrapper>
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.
sourcepub fn number_qubits(&self) -> usize
pub fn number_qubits(&self) -> usize
Return number of qubits simulated by DenebDevice.
Returns: int: The number of qubits.
sourcepub fn remote_host(&self) -> String
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.
sourcepub fn single_qubit_gate_time(
&self,
hqslang: &str,
qubit: usize,
) -> PyResult<f64>
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.
sourcepub fn two_qubit_gate_time(
&self,
hqslang: &str,
control: usize,
target: usize,
) -> PyResult<f64>
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.
sourcepub fn multi_qubit_gate_time(
&self,
hqslang: &str,
qubits: Vec<usize>,
) -> PyResult<f64>
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
impl Clone for DenebDeviceWrapper
source§fn clone(&self) -> DenebDeviceWrapper
fn clone(&self) -> DenebDeviceWrapper
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for DenebDeviceWrapper
impl Debug for DenebDeviceWrapper
source§impl Default for DenebDeviceWrapper
impl Default for DenebDeviceWrapper
source§fn default() -> DenebDeviceWrapper
fn default() -> DenebDeviceWrapper
source§impl PartialEq for DenebDeviceWrapper
impl PartialEq for DenebDeviceWrapper
source§fn eq(&self, other: &DenebDeviceWrapper) -> bool
fn eq(&self, other: &DenebDeviceWrapper) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PyClass for DenebDeviceWrapper
impl PyClass for DenebDeviceWrapper
source§impl PyClassImpl for DenebDeviceWrapper
impl PyClassImpl for DenebDeviceWrapper
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<DenebDeviceWrapper>
type ThreadChecker = SendablePyClass<DenebDeviceWrapper>
type Inventory = Pyo3MethodsInventoryForDenebDeviceWrapper
§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<DenebDeviceWrapper> for PyClassImplCollector<DenebDeviceWrapper>
impl PyClassNewTextSignature<DenebDeviceWrapper> for PyClassImplCollector<DenebDeviceWrapper>
fn new_text_signature(self) -> Option<&'static str>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a DenebDeviceWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a DenebDeviceWrapper
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut DenebDeviceWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut DenebDeviceWrapper
source§impl PyTypeInfo for DenebDeviceWrapper
impl PyTypeInfo for DenebDeviceWrapper
§type AsRefTarget = PyCell<DenebDeviceWrapper>
type AsRefTarget = PyCell<DenebDeviceWrapper>
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
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &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
object
is an instance of this type.impl Eq for DenebDeviceWrapper
impl StructuralPartialEq for DenebDeviceWrapper
Auto Trait Implementations§
impl Freeze for DenebDeviceWrapper
impl RefUnwindSafe for DenebDeviceWrapper
impl Send for DenebDeviceWrapper
impl Sync for DenebDeviceWrapper
impl Unpin for DenebDeviceWrapper
impl UnwindSafe for DenebDeviceWrapper
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<'a, T> FromPyObject<'a> for T
impl<'a, T> FromPyObject<'a> for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<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.