pub struct CalibrationMatrix { /* private fields */ }Expand description
Calibration matrix for measurement error mitigation.
Implementations§
Source§impl CalibrationMatrix
impl CalibrationMatrix
Sourcepub fn from_confusion_matrix(matrix: &[&[f64]]) -> Result<Self, MitigationError>
pub fn from_confusion_matrix(matrix: &[&[f64]]) -> Result<Self, MitigationError>
Create from a confusion matrix.
§Arguments
matrix- 2D array where M[i][j] = P(measure i | prepared j)
Sourcepub fn apply_inverse(&self, probs: &[f64]) -> Result<Vec<f64>, MitigationError>
pub fn apply_inverse(&self, probs: &[f64]) -> Result<Vec<f64>, MitigationError>
Apply the inverse calibration matrix to a probability vector.
Sourcepub fn num_states(&self) -> usize
pub fn num_states(&self) -> usize
Get the number of states (2^n).
Sourcepub fn num_qubits(&self) -> usize
pub fn num_qubits(&self) -> usize
Get the number of qubits.
Trait Implementations§
Source§impl Clone for CalibrationMatrix
impl Clone for CalibrationMatrix
Source§fn clone(&self) -> CalibrationMatrix
fn clone(&self) -> CalibrationMatrix
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 CalibrationMatrix
impl RefUnwindSafe for CalibrationMatrix
impl Send for CalibrationMatrix
impl Sync for CalibrationMatrix
impl Unpin for CalibrationMatrix
impl UnwindSafe for CalibrationMatrix
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