Struct qoqo::measurements::ClassicalRegisterWrapper
source · [−]pub struct ClassicalRegisterWrapper {
pub internal: ClassicalRegister,
}
Expand description
Collected information for executing a classical register.
Fields
internal: ClassicalRegister
Internal storage of [roqoqo::ClassicalRegister].
Implementations
sourceimpl ClassicalRegisterWrapper
impl ClassicalRegisterWrapper
sourcepub fn new(
constant_circuit: Option<CircuitWrapper>,
circuits: Vec<CircuitWrapper>
) -> Self
pub fn new(
constant_circuit: Option<CircuitWrapper>,
circuits: Vec<CircuitWrapper>
) -> Self
sourcepub fn circuits(&self) -> Vec<CircuitWrapper>
pub fn circuits(&self) -> Vec<CircuitWrapper>
Return the collection of quantum circuits that make up the total measurement.
Returns: listCircuit: The quantum circuits.
sourcepub fn constant_circuit(&self) -> Option<CircuitWrapper>
pub fn constant_circuit(&self) -> Option<CircuitWrapper>
Returns constant circuit that is executed before any Circuit in circuits.
Returns: OptionalCircuit: The constant Circuit (None if not defined).
sourcepub fn measurement_type(&self) -> &'static str
pub fn measurement_type(&self) -> &'static str
Returns the type of the measurement in string form.
Returns: str: The type of the measurement.
sourcepub fn substitute_parameters(
&self,
substituted_parameters: HashMap<String, f64>
) -> PyResult<Self>
pub fn substitute_parameters(
&self,
substituted_parameters: HashMap<String, f64>
) -> PyResult<Self>
Return copy of Measurement with symbolic parameters replaced.
Args: substituted_parameters (dict[str, float]): The dictionary containing the substitutions to use in the Circuit.
Raises: RuntimeError: Error substituting symbolic parameters.
sourcepub fn _internal_to_bincode(&self) -> PyResult<(&'static str, Py<PyByteArray>)>
pub fn _internal_to_bincode(&self) -> PyResult<(&'static str, Py<PyByteArray>)>
Trait Implementations
sourceimpl Clone for ClassicalRegisterWrapper
impl Clone for ClassicalRegisterWrapper
sourcefn clone(&self) -> ClassicalRegisterWrapper
fn clone(&self) -> ClassicalRegisterWrapper
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ClassicalRegisterWrapper
impl Debug for ClassicalRegisterWrapper
sourceimpl IntoPy<Py<PyAny>> for ClassicalRegisterWrapper
impl IntoPy<Py<PyAny>> for ClassicalRegisterWrapper
sourceimpl PyClass for ClassicalRegisterWrapper
impl PyClass for ClassicalRegisterWrapper
type Dict = PyClassDummySlot
type Dict = PyClassDummySlot
Specify this class has #[pyclass(dict)]
or not.
type WeakRef = PyClassDummySlot
type WeakRef = PyClassDummySlot
Specify this class has #[pyclass(weakref)]
or not.
type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is PyAny
by default, and when you declare
#[pyclass(extends=PyDict)]
, it’s PyDict
. Read more
sourceimpl PyClassDescriptors<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
impl PyClassDescriptors<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
fn py_class_descriptors(self) -> &'static [PyMethodDefType]
sourceimpl PyClassImpl for ClassicalRegisterWrapper
impl PyClassImpl for ClassicalRegisterWrapper
sourceconst IS_BASETYPE: bool
const IS_BASETYPE: bool
#[pyclass(subclass)]
sourceconst IS_SUBCLASS: bool
const IS_SUBCLASS: bool
#[pyclass(extends=…)]
type ThreadChecker = ThreadCheckerStub<ClassicalRegisterWrapper>
type ThreadChecker = ThreadCheckerStub<ClassicalRegisterWrapper>
This handles following two situations: Read more
fn for_each_method_def(visitor: &mut dyn FnMut(&[PyMethodDefType]))
fn get_new() -> Option<newfunc>
fn get_alloc() -> Option<allocfunc>
fn get_free() -> Option<freefunc>
fn for_each_proto_slot(visitor: &mut dyn FnMut(&[PyType_Slot]))
fn get_buffer() -> Option<&'static PyBufferProcs>
sourceimpl PyClassNewImpl<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
impl PyClassNewImpl<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
sourceimpl PyMethods<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
impl PyMethods<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
fn py_methods(self) -> &'static [PyMethodDefType]
sourceimpl PyMethodsProtocolSlots<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
impl PyMethodsProtocolSlots<ClassicalRegisterWrapper> for PyClassImplCollector<ClassicalRegisterWrapper>
fn methods_protocol_slots(self) -> &'static [PyType_Slot]
sourceimpl PyTypeInfo for ClassicalRegisterWrapper
impl PyTypeInfo for ClassicalRegisterWrapper
type AsRefTarget = PyCell<Self>
type AsRefTarget = PyCell<Self>
Utility type to make Py::as_ref work.
sourcefn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
PyTypeObject instance for this type.
sourcefn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if object
is an instance of this type or a subclass of this type.
sourcefn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if object
is an instance of this type.
Auto Trait Implementations
impl RefUnwindSafe for ClassicalRegisterWrapper
impl Send for ClassicalRegisterWrapper
impl Sync for ClassicalRegisterWrapper
impl Unpin for ClassicalRegisterWrapper
impl UnwindSafe for ClassicalRegisterWrapper
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> FromPyObject<'a> for T where
T: PyClass + Clone,
impl<'a, T> FromPyObject<'a> for T where
T: PyClass + Clone,
sourceimpl<T> PyTypeObject for T where
T: PyTypeInfo,
impl<T> PyTypeObject for T where
T: PyTypeInfo,
sourcepub fn type_object(py: Python<'_>) -> &PyType
pub fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more