Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

TensoredMeasFitter

class qiskit.utils.mitigation.TensoredMeasFitter(results, mit_pattern, substate_labels_list=None, circlabel='')

GitHub(opens in a new tab)

Bases: object(opens in a new tab)

Deprecated: 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.

Deprecated since version 0.24.0

The class qiskit.utils.mitigation.fitters.TensoredMeasFitter is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit https://qisk.it/qi_migration(opens in a new tab).

Parameters

Raises

ValueError(opens in a new tab) – if the mit_pattern doesn’t match the substate_labels_list


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.


Methods

add_data

add_data(new_results, rebuild_cal_matrix=True)

Add measurement calibration data

Parameters

readout_fidelity

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(opens in a new tab)) – 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’.

subset_fitter

subset_fitter(qubit_sublist)

Return a fitter object that is a subset of the qubits in the original list.

This is only a partial implementation of the subset_fitter method since only mitigation patterns of length 1 are supported. This corresponds to patterns of the form [[0], [1], [2], ...]. Note however, that such patterns are a good first approximation to mitigate readout errors on large quantum circuits.

Parameters

qubit_sublist (list(opens in a new tab)) – must be a subset of qubit_list

Returns

A new fitter that has the calibration for a

subset of qubits

Return type

TensoredMeasFitter

Raises

  • QiskitError – If the calibration matrix is not initialized
  • QiskitError – If the mit pattern is not a tensor of single-qubit measurement error mitigation.
  • QiskitError – If a qubit in the given qubit_sublist is not in the list of qubits in the mit. pattern.
Was this page helpful?
Report a bug or request content on GitHub.