Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK. Go to the latest version.

qiskit.ignis.mitigation.MeasurementFilter

class MeasurementFilter(cal_matrix, state_labels)

GitHub

Measurement error mitigation filter.

Produced from a measurement calibration fitter and can be applied to data.

Initialize a measurement error mitigation filter using the cal_matrix from a measurement calibration fitter.

Parameters

  • cal_matrix (matrix) – the calibration matrix for applying the correction
  • state_labels (list) – the states for the ordering of the cal matrix

__init__

__init__(cal_matrix, state_labels)

Initialize a measurement error mitigation filter using the cal_matrix from a measurement calibration fitter.

Parameters

  • cal_matrix (matrix) – the calibration matrix for applying the correction
  • state_labels (list) – the states for the ordering of the cal matrix

Methods

__init__(cal_matrix, state_labels)Initialize a measurement error mitigation filter using the cal_matrix from a measurement calibration fitter.
apply(raw_data[, method])Apply the calibration matrix to results.

Attributes

cal_matrixReturn cal_matrix.
state_labelsreturn the state label ordering of the cal matrix

apply

apply(raw_data, method='least_squares')

Apply the calibration matrix to results.

Parameters

  • raw_data (dict or list) –

    The data to be corrected. Can be in a number of forms:

    Form 1: a counts dictionary from results.get_counts

    Form 2: a list of counts of length==len(state_labels)

    Form 3: a list of counts of length==M*len(state_labels) where M is an integer (e.g. for use with the tomography data)

    Form 4: a qiskit Result

  • method (str) –

    fitting method. If None, then least_squares is used.

    pseudo_inverse: direct inversion of the A matrix

    least_squares: constrained to have physical probabilities

Returns

The corrected data in the same form as raw_data

Return type

dict or list

Raises

QiskitError – if raw_data is not an integer multiple of the number of calibrated states.

cal_matrix

Return cal_matrix.

state_labels

return the state label ordering of the cal matrix

Was this page helpful?
Report a bug or request content on GitHub.