117 lines
4.3 KiB
Plaintext
117 lines
4.3 KiB
Plaintext
---
|
||
title: CompleteMeasFitter
|
||
description: API reference for qiskit.utils.mitigation.CompleteMeasFitter
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.utils.mitigation.CompleteMeasFitter
|
||
---
|
||
|
||
# CompleteMeasFitter
|
||
|
||
<Class id="qiskit.utils.mitigation.CompleteMeasFitter" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.21/qiskit/utils/mitigation/fitters.py" signature="CompleteMeasFitter(results, state_labels, qubit_list=None, circlabel='')" modifiers="class">
|
||
Bases: `object`
|
||
|
||
Measurement correction fitter for a full calibration
|
||
|
||
Initialize a measurement calibration matrix from the results of running the circuits returned by measurement\_calibration\_circuits
|
||
|
||
A wrapper for the tensored fitter
|
||
|
||
<Admonition title="Warning" type="caution">
|
||
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`](qiskit.utils.QuantumInstance "qiskit.utils.QuantumInstance") class’s constructor (as a class not an instance). Anything outside of that usage does not have the normal user-facing API stability.
|
||
</Admonition>
|
||
|
||
**Parameters**
|
||
|
||
* **results** – the results of running the measurement calibration circuits. If this is None the user will set a calibration matrix later.
|
||
* **state\_labels** (`List`\[`str`]) – list of calibration state labels returned from measurement\_calibration\_circuits. The output matrix will obey this ordering.
|
||
* **qubit\_list** (`Optional`\[`List`\[`int`]]) – List of the qubits (for reference and if the subset is needed). If None, the qubit\_list will be created according to the length of state\_labels\[0].
|
||
* **circlabel** (`str`) – if the qubits were labeled.
|
||
|
||
## Methods
|
||
|
||
### add\_data
|
||
|
||
<Function id="qiskit.utils.mitigation.CompleteMeasFitter.add_data" signature="CompleteMeasFitter.add_data(new_results, rebuild_cal_matrix=True)">
|
||
Add measurement calibration data
|
||
|
||
**Parameters**
|
||
|
||
* **new\_results** (*list or* [*qiskit.result.Result*](qiskit.result.Result "qiskit.result.Result")) – a single result or list of result objects.
|
||
* **rebuild\_cal\_matrix** (*bool*) – rebuild the calibration matrix
|
||
</Function>
|
||
|
||
### readout\_fidelity
|
||
|
||
<Function id="qiskit.utils.mitigation.CompleteMeasFitter.readout_fidelity" signature="CompleteMeasFitter.readout_fidelity(label_list=None)">
|
||
Based on the results, output the readout fidelity which is the normalized trace of the calibration matrix
|
||
|
||
**Parameters**
|
||
|
||
**label\_list** (*bool*) – If None, returns the average assignment fidelity of a single state. Otherwise it returns the assignment fidelity to be in any one of these states averaged over the second index.
|
||
|
||
**Returns**
|
||
|
||
readout fidelity (assignment fidelity)
|
||
|
||
**Return type**
|
||
|
||
numpy.array
|
||
|
||
#### Additional Information:
|
||
|
||
The on-diagonal elements of the calibration matrix are the probabilities of measuring state ‘x’ given preparation of state ‘x’ and so the normalized trace is the average assignment fidelity
|
||
</Function>
|
||
|
||
### subset\_fitter
|
||
|
||
<Function id="qiskit.utils.mitigation.CompleteMeasFitter.subset_fitter" signature="CompleteMeasFitter.subset_fitter(qubit_sublist=None)">
|
||
Return a fitter object that is a subset of the qubits in the original list.
|
||
|
||
**Parameters**
|
||
|
||
**qubit\_sublist** (*list*) – must be a subset of qubit\_list
|
||
|
||
**Returns**
|
||
|
||
**A new fitter that has the calibration for a**
|
||
|
||
subset of qubits
|
||
|
||
**Return type**
|
||
|
||
[CompleteMeasFitter](qiskit.utils.mitigation.CompleteMeasFitter "qiskit.utils.mitigation.CompleteMeasFitter")
|
||
|
||
**Raises**
|
||
|
||
**QiskitError** – If the calibration matrix is not initialized
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### cal\_matrix
|
||
|
||
<Attribute id="qiskit.utils.mitigation.CompleteMeasFitter.cal_matrix">
|
||
Return cal\_matrix.
|
||
</Attribute>
|
||
|
||
### filter
|
||
|
||
<Attribute id="qiskit.utils.mitigation.CompleteMeasFitter.filter">
|
||
Return a measurement filter using the cal matrix.
|
||
</Attribute>
|
||
|
||
### qubit\_list
|
||
|
||
<Attribute id="qiskit.utils.mitigation.CompleteMeasFitter.qubit_list">
|
||
Return list of qubits.
|
||
</Attribute>
|
||
|
||
### state\_labels
|
||
|
||
<Attribute id="qiskit.utils.mitigation.CompleteMeasFitter.state_labels">
|
||
Return state\_labels.
|
||
</Attribute>
|
||
</Class>
|
||
|