pub struct DeviceNoiseSimulator { /* private fields */ }Expand description
Comprehensive device noise simulator
Implementations§
Source§impl DeviceNoiseSimulator
impl DeviceNoiseSimulator
Sourcepub fn new(noise_model: Box<dyn DeviceNoiseModel>) -> Result<Self>
pub fn new(noise_model: Box<dyn DeviceNoiseModel>) -> Result<Self>
Create new device noise simulator
Sourcepub fn with_backend(self) -> Result<Self>
pub fn with_backend(self) -> Result<Self>
Initialize with SciRS2 backend
Sourcepub fn apply_gate_noise(
&mut self,
gate_type: &str,
qubits: &[usize],
gate_time: f64,
state: &mut Array1<Complex64>,
) -> Result<()>
pub fn apply_gate_noise( &mut self, gate_type: &str, qubits: &[usize], gate_time: f64, state: &mut Array1<Complex64>, ) -> Result<()>
Apply gate noise
Sourcepub fn apply_measurement_noise(
&mut self,
qubits: &[usize],
results: &mut [bool],
) -> Result<()>
pub fn apply_measurement_noise( &mut self, qubits: &[usize], results: &mut [bool], ) -> Result<()>
Apply measurement noise
Sourcepub fn apply_idle_noise(
&mut self,
idle_time: f64,
state: &mut Array1<Complex64>,
num_qubits: usize,
) -> Result<()>
pub fn apply_idle_noise( &mut self, idle_time: f64, state: &mut Array1<Complex64>, num_qubits: usize, ) -> Result<()>
Apply idle noise to all qubits
Sourcepub const fn get_stats(&self) -> &NoiseSimulationStats
pub const fn get_stats(&self) -> &NoiseSimulationStats
Get simulation statistics
Sourcepub fn reset_stats(&mut self)
pub fn reset_stats(&mut self)
Reset simulation statistics
Auto Trait Implementations§
impl Freeze for DeviceNoiseSimulator
impl !RefUnwindSafe for DeviceNoiseSimulator
impl Send for DeviceNoiseSimulator
impl Sync for DeviceNoiseSimulator
impl Unpin for DeviceNoiseSimulator
impl !UnwindSafe for DeviceNoiseSimulator
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<T> Pointable for T
impl<T> Pointable 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>
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.