# qiskit.ignis.mitigation.TensoredMeasFitter¶

class TensoredMeasFitter(results, mit_pattern, substate_labels_list=None, circlabel='')[código fonte]

Measurement correction fitter for a tensored calibration.

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

Parâmetros
• results (Union[Result, List[Result]]) – 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

Levanta

ValueError – if the mit_pattern doesn’t match the substate_labels_list

__init__(results, mit_pattern, substate_labels_list=None, circlabel='')[código fonte]

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

Parâmetros
• results (Union[Result, List[Result]]) – 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

Levanta

ValueError – if the mit_pattern doesn’t match the substate_labels_list

Methods

 __init__(results, mit_pattern[, …]) Initialize a measurement calibration matrix from the results of running the circuits returned by measurement_calibration_circuits. add_data(new_results[, rebuild_cal_matrix]) Add measurement calibration data plot_calibration([cal_index, ax, show_plot]) Plot one of the calibration matrices (2D color grid plot). readout_fidelity([cal_index, label_list]) Based on the results, output the readout fidelity, which is the average of the diagonal entries in the calibration matrices.

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.
add_data(new_results, rebuild_cal_matrix=True)[código fonte]

Parâmetros
• new_results (list or qiskit.result.Result) – a single result or list of Result objects.

• rebuild_cal_matrix (bool) – rebuild the calibration matrix

property cal_matrices

Return cal_matrices.

property filter

Return a measurement filter using the cal matrices.

property nqubits

Return _qubit_list_sizes.

plot_calibration(cal_index=0, ax=None, show_plot=True)[código fonte]

Plot one of the calibration matrices (2D color grid plot).

Parâmetros
• cal_index (integer) – calibration matrix to plot

• ax (matplotlib.axes) – settings for the graph

• show_plot (bool) – call plt.show()

Levanta
• QiskitError – if _cal_matrices was not set.

• ImportError – if matplotlib was not installed.

readout_fidelity(cal_index=0, label_list=None)[código fonte]

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

Parâmetros
• 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

Retorna

Tipo de retorno

numpy.array

Levanta

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

property substate_labels_list