pub struct MeasurementCorrector { /* private fields */ }Expand description
Corrects readout errors using a full calibration matrix built from per-qubit error probabilities.
Implementations§
Source§impl MeasurementCorrector
impl MeasurementCorrector
Sourcepub fn new(readout_errors: &[(f64, f64)]) -> Self
pub fn new(readout_errors: &[(f64, f64)]) -> Self
Build the calibration matrix from per-qubit readout errors.
readout_errors[q] = (p01, p10) where:
p01= probability of reading 1 when the true state is 0p10= probability of reading 0 when the true state is 1
The full calibration matrix is the tensor product of the individual 2x2 matrices: M_q = [[1 - p01, p10], [p01, 1 - p10]]
Sourcepub fn correct_counts(
&self,
counts: &HashMap<Vec<bool>, usize>,
) -> HashMap<Vec<bool>, f64>
pub fn correct_counts( &self, counts: &HashMap<Vec<bool>, usize>, ) -> HashMap<Vec<bool>, f64>
Correct measurement counts by applying the inverse of the calibration matrix.
For small qubit counts (<= 12), the full matrix is inverted directly. For larger systems, the tensor product structure is exploited for efficient correction.
Returns corrected counts as floating-point values since the inverse may produce non-integer results.
Sourcepub fn calibration_matrix(&self) -> &Vec<Vec<f64>>
pub fn calibration_matrix(&self) -> &Vec<Vec<f64>>
Accessor for the calibration matrix.
Trait Implementations§
Source§impl Clone for MeasurementCorrector
impl Clone for MeasurementCorrector
Source§fn clone(&self) -> MeasurementCorrector
fn clone(&self) -> MeasurementCorrector
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 moreAuto Trait Implementations§
impl Freeze for MeasurementCorrector
impl RefUnwindSafe for MeasurementCorrector
impl Send for MeasurementCorrector
impl Sync for MeasurementCorrector
impl Unpin for MeasurementCorrector
impl UnsafeUnpin for MeasurementCorrector
impl UnwindSafe for MeasurementCorrector
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