pub struct ZeroNoiseExtrapolation { /* private fields */ }Expand description
Zero-Noise Extrapolation for error mitigation.
Runs circuits at multiple noise levels and extrapolates to the zero-noise limit.
§Example
ⓘ
use logosq_error_mitigator::{ZeroNoiseExtrapolation, Extrapolator};
let zne = ZeroNoiseExtrapolation::new()
.with_scale_factors(&[1.0, 2.0, 3.0])
.with_extrapolator(Extrapolator::Polynomial { degree: 2 });
let data = vec![(1.0, -0.85), (2.0, -0.72), (3.0, -0.58)];
let mitigated = zne.extrapolate(&data).unwrap();Implementations§
Source§impl ZeroNoiseExtrapolation
impl ZeroNoiseExtrapolation
Sourcepub fn with_scale_factors(self, factors: &[f64]) -> Self
pub fn with_scale_factors(self, factors: &[f64]) -> Self
Sourcepub fn with_extrapolator(self, extrapolator: Extrapolator) -> Self
pub fn with_extrapolator(self, extrapolator: Extrapolator) -> Self
Set the extrapolation method.
Sourcepub fn with_noise_scaling(self, scaling: NoiseScaling) -> Self
pub fn with_noise_scaling(self, scaling: NoiseScaling) -> Self
Set the noise scaling method.
Sourcepub fn extrapolate(&self, data: &[(f64, f64)]) -> Result<f64, MitigationError>
pub fn extrapolate(&self, data: &[(f64, f64)]) -> Result<f64, MitigationError>
Sourcepub fn scale_factors(&self) -> &[f64]
pub fn scale_factors(&self) -> &[f64]
Get the scale factors.
Trait Implementations§
Source§impl Clone for ZeroNoiseExtrapolation
impl Clone for ZeroNoiseExtrapolation
Source§fn clone(&self) -> ZeroNoiseExtrapolation
fn clone(&self) -> ZeroNoiseExtrapolation
Returns a duplicate 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 Debug for ZeroNoiseExtrapolation
impl Debug for ZeroNoiseExtrapolation
Source§impl Default for ZeroNoiseExtrapolation
impl Default for ZeroNoiseExtrapolation
Source§impl MitigationTechnique for ZeroNoiseExtrapolation
impl MitigationTechnique for ZeroNoiseExtrapolation
Source§fn mitigate_expectation(&self, _value: f64) -> Result<f64, MitigationError>
fn mitigate_expectation(&self, _value: f64) -> Result<f64, MitigationError>
Apply mitigation to an expectation value.
Auto Trait Implementations§
impl Freeze for ZeroNoiseExtrapolation
impl RefUnwindSafe for ZeroNoiseExtrapolation
impl Send for ZeroNoiseExtrapolation
impl Sync for ZeroNoiseExtrapolation
impl Unpin for ZeroNoiseExtrapolation
impl UnwindSafe for ZeroNoiseExtrapolation
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