Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

TensoredMeasFitter

class TensoredMeasFitter(results, mit_pattern, substate_labels_list=None, circlabel='')

GitHub

Bases: object

Measurement correction fitter for a tensored calibration.

Initialize a measurement calibration matrix from the results of running the circuits returned by measurement_calibration_circuits.

Warning

This class is not a public API. The internals are not stable and will likely change. It is used solely for the measurement_error_mitigation_cls kwarg of the QuantumInstance class’s constructor (as a class not an instance). Anything outside of that usage does not have the normal user-facing API stability.

Parameters

  • results – the results of running the measurement calibration circuits. If this is None, the user will set calibration matrices later.
  • mit_pattern (List[List[int]]) – qubits to perform the measurement correction on, divided to groups according to tensors
  • substate_labels_list (Optional[List[List[str]]]) – for each calibration matrix, the labels of its rows and columns. If None, the labels are ordered lexicographically
  • circlabel (str) – if the qubits were labeled

Raises

ValueError – if the mit_pattern doesn’t match the substate_labels_list


Methods

add_data

TensoredMeasFitter.add_data(new_results, rebuild_cal_matrix=True)

Add measurement calibration data

Parameters

  • new_results (list or qiskit.result.Result) – a single result or list of Result objects.
  • rebuild_cal_matrix (bool) – rebuild the calibration matrix

readout_fidelity

TensoredMeasFitter.readout_fidelity(cal_index=0, label_list=None)

Based on the results, output the readout fidelity, which is the average of the diagonal entries in the calibration matrices.

Parameters

  • cal_index (integer) – readout fidelity for this index in _cal_matrices
  • label_list (list) – Returns the average fidelity over of the groups f states. In the form of a list of lists of states. If None, then each state used in the construction of the calibration matrices forms a group of size 1

Returns

The readout fidelity (assignment fidelity)

Return type

numpy.array

Raises

QiskitError – If the calibration matrix has not been set for the object.

Additional Information:

The on-diagonal elements of the calibration matrices are the probabilities of measuring state ‘x’ given preparation of state ‘x’.


Attributes

cal_matrices

Return cal_matrices.

filter

Return a measurement filter using the cal matrices.

nqubits

Return _qubit_list_sizes.

substate_labels_list

Return _substate_labels_list.

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