qiskit.ignis.mitigation.TensoredFilter
class TensoredFilter(cal_matrices, substate_labels_list)
Tensored measurement error mitigation filter.
Produced from a tensored measurement calibration fitter and can be applied to data.
Initialize a tensored measurement error mitigation filter using the cal_matrices from a tensored measurement calibration fitter.
Parameters
- cal_matrices (
matrix
) – the calibration matrices for applying the correction. - substate_labels_list (
list
) – for each calibration matrix a list of the states (as strings, states in the subspace)
__init__
__init__(cal_matrices, substate_labels_list)
Initialize a tensored measurement error mitigation filter using the cal_matrices from a tensored measurement calibration fitter.
Parameters
- cal_matrices (
matrix
) – the calibration matrices for applying the correction. - substate_labels_list (
list
) – for each calibration matrix a list of the states (as strings, states in the subspace)
Methods
__init__ (cal_matrices, substate_labels_list) | Initialize a tensored measurement error mitigation filter using the cal_matrices from a tensored measurement calibration fitter. |
apply (raw_data[, method]) | Apply the calibration matrices to results. |
Attributes
cal_matrices | Return cal_matrices. |
nqubits | Return the number of qubits. |
qubit_list_sizes | Return _qubit_list_sizes. |
substate_labels_list | Return _substate_labels_list |
apply
apply(raw_data, method='least_squares')
Apply the calibration matrices to results.
Parameters
-
raw_data (dict or Result) –
The data to be corrected. Can be in one of two forms:
- A counts dictionary from results.get_counts
- A Qiskit Result
-
method (str) –
fitting method. The following methods are supported:
- ’pseudo_inverse’: direct inversion of the cal matrices.
- ’least_squares’: constrained to have physical probabilities.
- If None, ‘least_squares’ is used.
Returns
The corrected data in the same form as raw_data
Return type
dict or Result
Raises
QiskitError – if raw_data is not in a one of the defined forms.
cal_matrices
Return cal_matrices.
nqubits
Return the number of qubits. See also MeasurementFilter.apply()
qubit_list_sizes
Return _qubit_list_sizes.
substate_labels_list
Return _substate_labels_list