pub struct ContinuousDecoherenceModelWrapper { /* private fields */ }
Expand description
Noise model representing a continuous decoherence process on qubits.
This noise model assumes that all qubits are constantly experiencing decoherence over time (e.g. due to coupling to the environment). The noise for each qubit can be different but only single qubit noise is included in the model.
Noise is given by the rates of the Lindblad equation. The Lindblad equation is a so-called master equation for the time evolution of a density matrix. For the example of a single qubit the non-coherent part of the Lindblad equation can take the following form:
d/dt * ρ = Σ Mij * Li * ρ * Lj† - 1/2 * ( Lj† * Li * ρ + ρ * Lj† * Li),
where the indices i and j run from 0 to 2
with L0 = σ+, L1 = σ- and L3 = σz.
Here the genreal incoherent part of the Lindblad equation is internally represented by a struqture::spins::PlusMinusLindbladNoiseOperator.
To create a complex decoherence model first create the Lindblad noise and then turn it into a ContinuousDecoherenceModel. For a simple decoherence model, use new to create an empty model and use the add_damping, add_excitation and add_dephasing methods. For more fine control access the internal lindblad_noise directly and modify it.
Args:
noise_operator (struqture_py.spins.PlusMinusLindbladNoiseOperator): Optional initialisation of Noise Model with given Lindblad operator.
Implementations§
source§impl ContinuousDecoherenceModelWrapper
impl ContinuousDecoherenceModelWrapper
sourcepub fn new(noise_operator: Option<&Bound<'_, PyAny>>) -> PyResult<Self>
pub fn new(noise_operator: Option<&Bound<'_, PyAny>>) -> PyResult<Self>
Create a new ContinuousDecoherenceModel
sourcepub fn get_noise_operator(&self) -> PlusMinusLindbladNoiseOperatorWrapper
pub fn get_noise_operator(&self) -> PlusMinusLindbladNoiseOperatorWrapper
Return the internal Lindblad noise operator of the continuous noise model.
Returns: PlusMinusLindbladNoiseOperator: The internal Lindblad noise operator of the continuous noise
sourcepub fn from_bincode(
input: &Bound<'_, PyAny>
) -> PyResult<ContinuousDecoherenceModelWrapper>
pub fn from_bincode( input: &Bound<'_, PyAny> ) -> PyResult<ContinuousDecoherenceModelWrapper>
Convert the bincode representation of the Noise-Model to a device using the bincode crate.
Args: input (ByteArray): The serialized Noise-Model (in bincode form).
Returns: The deserialized Noise-Model.
Raises: TypeError: Input cannot be converted to byte array. ValueError: Input cannot be deserialized to selected Noise-Model.
sourcepub fn from_json(input: &str) -> PyResult<ContinuousDecoherenceModelWrapper>
pub fn from_json(input: &str) -> PyResult<ContinuousDecoherenceModelWrapper>
Convert the json representation of a device to a Noise-Model.
Args: input (str): The serialized device in json form.
Returns: The deserialized device.
Raises: ValueError: Input cannot be deserialized to selected Noise-Model.
sourcepub fn add_damping_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
pub fn add_damping_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
Convenience function to add damping to several qubits
Args: qubits (List[int]): The qubits to add damping to. rate (float): The damping rate.
Returns: ContinuousDecoherenceModel: The model with the damping added.
sourcepub fn add_dephasing_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
pub fn add_dephasing_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
Convenience function to add dephasing to several qubits
Args: qubits (List[int]): The qubits to add dephasing to. rate (float): The dephasing rate.
Returns: ContinuousDecoherenceModel: The model with the dephasing added.
sourcepub fn add_depolarising_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
pub fn add_depolarising_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
Convenience function to add depolarising to several qubits
Args: qubits (List[int]): The qubits to add depolarising to. rate (float): The depolarising rate.
Returns: ContinuousDecoherenceModel: The model with the depolarising added.
sourcepub fn add_excitation_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
pub fn add_excitation_rate(&self, qubits: Vec<usize>, rate: f64) -> Self
Convenience function to add excitation to several qubits
Args: qubits (List[int]): The qubits to add excitation to. rate (float): The excitation rate.
Returns: ContinuousDecoherenceModel: The model with the excitation added.
sourcepub fn __copy__(&self) -> Self
pub fn __copy__(&self) -> Self
Returns a copy of the device (copy here produces a deepcopy).
Returns: A deep copy of self.
sourcepub fn __deepcopy__(&self, _memodict: &Bound<'_, PyAny>) -> Self
pub fn __deepcopy__(&self, _memodict: &Bound<'_, PyAny>) -> Self
Creates deep copy of Noise-Model.
Returns: A deep copy of self.
sourcepub fn to_bincode(&self) -> PyResult<Py<PyByteArray>>
pub fn to_bincode(&self) -> PyResult<Py<PyByteArray>>
Return the bincode representation of the Noise-Model using the bincode crate.
Returns: ByteArray: The serialized Noise-Model (in bincode form).
Raises: ValueError: Cannot serialize Noise-Model to bytes.
source§impl ContinuousDecoherenceModelWrapper
impl ContinuousDecoherenceModelWrapper
sourcepub fn from_pyany(input: &Bound<'_, PyAny>) -> PyResult<NoiseModel>
pub fn from_pyany(input: &Bound<'_, PyAny>) -> PyResult<NoiseModel>
Fallible conversion of generic python object..
Trait Implementations§
source§impl Clone for ContinuousDecoherenceModelWrapper
impl Clone for ContinuousDecoherenceModelWrapper
source§fn clone(&self) -> ContinuousDecoherenceModelWrapper
fn clone(&self) -> ContinuousDecoherenceModelWrapper
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl HasPyGilRef for ContinuousDecoherenceModelWrapper
impl HasPyGilRef for ContinuousDecoherenceModelWrapper
§type AsRefTarget = PyCell<ContinuousDecoherenceModelWrapper>
type AsRefTarget = PyCell<ContinuousDecoherenceModelWrapper>
source§impl PartialEq for ContinuousDecoherenceModelWrapper
impl PartialEq for ContinuousDecoherenceModelWrapper
source§fn eq(&self, other: &ContinuousDecoherenceModelWrapper) -> bool
fn eq(&self, other: &ContinuousDecoherenceModelWrapper) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PyClassImpl for ContinuousDecoherenceModelWrapper
impl PyClassImpl for ContinuousDecoherenceModelWrapper
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<ContinuousDecoherenceModelWrapper>
type ThreadChecker = SendablePyClass<ContinuousDecoherenceModelWrapper>
type Inventory = Pyo3MethodsInventoryForContinuousDecoherenceModelWrapper
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::ImmutableChild
§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<ContinuousDecoherenceModelWrapper> for PyClassImplCollector<ContinuousDecoherenceModelWrapper>
impl PyClassNewTextSignature<ContinuousDecoherenceModelWrapper> for PyClassImplCollector<ContinuousDecoherenceModelWrapper>
fn new_text_signature(self) -> Option<&'static str>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ContinuousDecoherenceModelWrapper
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a ContinuousDecoherenceModelWrapper
source§impl PyTypeInfo for ContinuousDecoherenceModelWrapper
impl PyTypeInfo for ContinuousDecoherenceModelWrapper
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 ContinuousDecoherenceModelWrapper
impl StructuralPartialEq for ContinuousDecoherenceModelWrapper
Auto Trait Implementations§
impl Freeze for ContinuousDecoherenceModelWrapper
impl RefUnwindSafe for ContinuousDecoherenceModelWrapper
impl Send for ContinuousDecoherenceModelWrapper
impl Sync for ContinuousDecoherenceModelWrapper
impl Unpin for ContinuousDecoherenceModelWrapper
impl UnwindSafe for ContinuousDecoherenceModelWrapper
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.