pub struct SingleQubitOverrotationOnGate {
single_qubit_overrotation: HashMap<(String, usize), SingleQubitOverrotationDescription>,
two_qubit_overrotation: HashMap<(String, (usize, usize)), (SingleQubitOverrotationDescription, SingleQubitOverrotationDescription)>,
}
Expand description
Single qubit overrotation noise model on gate.
Adds a rotatation gate with a randomly distributed rotation angle after specified gates in a quantum circuit. Example:
use roqoqo::noise_models::SingleQubitOverrotationDescription;
use roqoqo::noise_models::SingleQubitOverrotationOnGate;
use roqoqo::noise_models::NoiseModel;
let gate = "RotateX";
let theta_mean = 0.0;
let theta_std = 1.0;
let mut noise_desc = SingleQubitOverrotationDescription::new(gate, theta_mean, theta_std);
let mut noise = SingleQubitOverrotationOnGate::new();
let circuit_gate_with_noise = "RotateZ";
let qubit = 0;
noise = noise.set_single_qubit_overrotation(circuit_gate_with_noise, qubit, noise_desc);
let noise_model = NoiseModel::SingleQubitOverrotationOnGate(noise);
Fields§
§single_qubit_overrotation: HashMap<(String, usize), SingleQubitOverrotationDescription>
Overrotation noise information for single qubit gates in a quantum circuit.
two_qubit_overrotation: HashMap<(String, (usize, usize)), (SingleQubitOverrotationDescription, SingleQubitOverrotationDescription)>
Overrotation noise information for two qubit gates in a quantum circuit.
Implementations§
source§impl SingleQubitOverrotationOnGate
impl SingleQubitOverrotationOnGate
sourcepub fn set_single_qubit_overrotation(
self,
gate: &str,
qubit: usize,
noise_description: SingleQubitOverrotationDescription,
) -> Self
pub fn set_single_qubit_overrotation( self, gate: &str, qubit: usize, noise_description: SingleQubitOverrotationDescription, ) -> Self
sourcepub fn get_single_qubit_overrotation(
&self,
gate: &str,
qubit: usize,
) -> Option<&SingleQubitOverrotationDescription>
pub fn get_single_qubit_overrotation( &self, gate: &str, qubit: usize, ) -> Option<&SingleQubitOverrotationDescription>
sourcepub fn set_two_qubit_overrotation(
self,
gate: &str,
control: usize,
target: usize,
noise_description: (SingleQubitOverrotationDescription, SingleQubitOverrotationDescription),
) -> Self
pub fn set_two_qubit_overrotation( self, gate: &str, control: usize, target: usize, noise_description: (SingleQubitOverrotationDescription, SingleQubitOverrotationDescription), ) -> Self
sourcepub fn get_two_qubit_overrotation(
&self,
gate: &str,
control: usize,
target: usize,
) -> Option<&(SingleQubitOverrotationDescription, SingleQubitOverrotationDescription)>
pub fn get_two_qubit_overrotation( &self, gate: &str, control: usize, target: usize, ) -> Option<&(SingleQubitOverrotationDescription, SingleQubitOverrotationDescription)>
Trait Implementations§
source§impl Clone for SingleQubitOverrotationOnGate
impl Clone for SingleQubitOverrotationOnGate
source§fn clone(&self) -> SingleQubitOverrotationOnGate
fn clone(&self) -> SingleQubitOverrotationOnGate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for SingleQubitOverrotationOnGate
impl Default for SingleQubitOverrotationOnGate
source§fn default() -> SingleQubitOverrotationOnGate
fn default() -> SingleQubitOverrotationOnGate
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for SingleQubitOverrotationOnGate
impl<'de> Deserialize<'de> for SingleQubitOverrotationOnGate
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<SingleQubitOverrotationOnGate> for NoiseModel
impl From<SingleQubitOverrotationOnGate> for NoiseModel
source§fn from(value: SingleQubitOverrotationOnGate) -> Self
fn from(value: SingleQubitOverrotationOnGate) -> Self
Converts to this type from the input type.
source§impl From<SingleQubitOverrotationOnGate> for SingleQubitOverrotationOnGateSerialize
impl From<SingleQubitOverrotationOnGate> for SingleQubitOverrotationOnGateSerialize
source§fn from(value: SingleQubitOverrotationOnGate) -> Self
fn from(value: SingleQubitOverrotationOnGate) -> Self
Converts to this type from the input type.
source§impl From<SingleQubitOverrotationOnGateSerialize> for SingleQubitOverrotationOnGate
impl From<SingleQubitOverrotationOnGateSerialize> for SingleQubitOverrotationOnGate
source§fn from(value: SingleQubitOverrotationOnGateSerialize) -> Self
fn from(value: SingleQubitOverrotationOnGateSerialize) -> Self
Converts to this type from the input type.
source§impl PartialEq for SingleQubitOverrotationOnGate
impl PartialEq for SingleQubitOverrotationOnGate
source§fn eq(&self, other: &SingleQubitOverrotationOnGate) -> bool
fn eq(&self, other: &SingleQubitOverrotationOnGate) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for SingleQubitOverrotationOnGate
Auto Trait Implementations§
impl Freeze for SingleQubitOverrotationOnGate
impl RefUnwindSafe for SingleQubitOverrotationOnGate
impl Send for SingleQubitOverrotationOnGate
impl Sync for SingleQubitOverrotationOnGate
impl Unpin for SingleQubitOverrotationOnGate
impl UnwindSafe for SingleQubitOverrotationOnGate
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
Mutably borrows from an owned value. Read more
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>
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 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>
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 moresource§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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.