MeasurementFilter.apply

MeasurementFilter.apply(raw_data, method='least_squares')[source]

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.