---
title: CorrelatedReadoutMitigator (v1.4)
description: API reference for qiskit.result.CorrelatedReadoutMitigator in qiskit v1.4
source: https://eu-de.quantum.cloud.ibm.com/docs/en/api/qiskit/1.4/qiskit.result.CorrelatedReadoutMitigator
---

# CorrelatedReadoutMitigator

*class* `qiskit.result.CorrelatedReadoutMitigator(assignment_matrix, qubits=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.4/qiskit/result/mitigation/correlated_readout_mitigator.py#L28-L277)

Bases: [`BaseReadoutMitigator`](/docs/api/qiskit/1.4/qiskit.result.BaseReadoutMitigator "qiskit.result.mitigation.base_readout_mitigator.BaseReadoutMitigator")

This class is DEPRECATED. N-qubit readout error mitigator.

Mitigates [`expectation_value()`](#qiskit.result.CorrelatedReadoutMitigator.expectation_value "qiskit.result.CorrelatedReadoutMitigator.expectation_value") and [`quasi_probabilities()`](#qiskit.result.CorrelatedReadoutMitigator.quasi_probabilities "qiskit.result.CorrelatedReadoutMitigator.quasi_probabilities"). The mitigation\_matrix should be calibrated using qiskit experiments. This mitigation method should be used in case the readout errors of the qubits are assumed to be correlated. The mitigation\_matrix of *N* qubits is of size $2^N x 2^N$ so the mitigation complexity is $O(4^N)$.

Initialize a CorrelatedReadoutMitigator

> **Deprecated since version 1.3**
>
> The class `qiskit.result.mitigation.correlated_readout_mitigator.CorrelatedReadoutMitigator` is deprecated as of Qiskit 1.3. It will be removed in Qiskit 2.0. The qiskit.result.mitigation module is deprecated in favor of the [https://github.com/Qiskit/qiskit-addon-mthree](https://github.com/Qiskit/qiskit-addon-mthree) package.

**Parameters**

- **assignment\_matrix** ([*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray)) – readout error assignment matrix.
- **qubits** ([*Iterable*](https://docs.python.org/3/library/typing.html#typing.Iterable)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – Optional, the measured physical qubits for mitigation.

**Raises**

[**QiskitError**](/docs/api/qiskit/1.4/exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – matrix size does not agree with number of qubits

## Attributes

### qubits

The device qubits for this mitigator

### settings

Return settings.

## Methods

### assignment\_matrix

`assignment_matrix(qubits=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.4/qiskit/result/mitigation/correlated_readout_mitigator.py#L214-L248)

Return the readout assignment matrix for specified qubits.

The assignment matrix is the stochastic matrix $A$ which assigns a noisy readout probability distribution to an ideal input readout distribution: $P(i|j) = \langle i | A | j \rangle$.

**Parameters**

**qubits** ([*List*](https://docs.python.org/3/library/typing.html#typing.List)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – Optional, qubits being measured.

**Returns**

the assignment matrix A.

**Return type**

np.ndarray

### expectation\_value

`expectation_value(data, diagonal=None, qubits=None, clbits=None, shots=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.4/qiskit/result/mitigation/correlated_readout_mitigator.py#L79-L138)

Compute the mitigated expectation value of a diagonal observable.

This computes the mitigated estimator of $\langle O \rangle = \mbox{Tr}[\rho. O]$ of a diagonal observable $O = \sum_{x\in\{0, 1\}^n} O(x)|x\rangle\!\langle x|$.

**Parameters**

- **data** ([*Counts*](/docs/api/qiskit/1.4/qiskit.result.Counts "qiskit.result.counts.Counts")) – Counts object
- **diagonal** ([*Callable*](https://docs.python.org/3/library/typing.html#typing.Callable)  *|*[*dict*](https://docs.python.org/3/library/stdtypes.html#dict)  *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str)  *|*[*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray) *| None*) – Optional, the vector of diagonal values for summing the expectation value. If `None` the default value is $[1, -1]^\otimes n$.
- **qubits** ([*Iterable*](https://docs.python.org/3/library/typing.html#typing.Iterable)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – Optional, the measured physical qubits the count bitstrings correspond to. If None qubits are assumed to be $[0, ..., n-1]$.
- **clbits** ([*List*](https://docs.python.org/3/library/typing.html#typing.List)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – Optional, if not None marginalize counts to the specified bits.
- **shots** ([*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – the number of shots.

**Returns**

the expectation value and an upper bound of the standard deviation.

**Return type**

([float](https://docs.python.org/3/library/functions.html#float), [float](https://docs.python.org/3/library/functions.html#float))

**Additional Information:**

The diagonal observable $O$ is input using the `diagonal` kwarg as a list or Numpy array $[O(0), ..., O(2^n -1)]$. If no diagonal is specified the diagonal of the Pauli operator :math\`O = mbox\{diag}(Z^\{otimes n}) = \[1, -1]^\{otimes n}\` is used. The `clbits` kwarg is used to marginalize the input counts dictionary over the specified bit-values, and the `qubits` kwarg is used to specify which physical qubits these bit-values correspond to as `circuit.measure(qubits, clbits)`.

### mitigation\_matrix

`mitigation_matrix(qubits=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.4/qiskit/result/mitigation/correlated_readout_mitigator.py#L185-L212)

Return the readout mitigation matrix for the specified qubits.

The mitigation matrix $A^{-1}$ is defined as the inverse of the [`assignment_matrix()`](#qiskit.result.CorrelatedReadoutMitigator.assignment_matrix "qiskit.result.CorrelatedReadoutMitigator.assignment_matrix") $A$.

**Parameters**

**qubits** ([*List*](https://docs.python.org/3/library/typing.html#typing.List)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – Optional, qubits being measured.

**Returns**

the measurement error mitigation matrix $A^{-1}$.

**Return type**

np.ndarray

### quasi\_probabilities

`quasi_probabilities(data, qubits=None, clbits=None, shots=None)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.4/qiskit/result/mitigation/correlated_readout_mitigator.py#L140-L183)

Compute mitigated quasi probabilities value.

**Parameters**

- **data** ([*Counts*](/docs/api/qiskit/1.4/qiskit.result.Counts "qiskit.result.counts.Counts")) – counts object
- **qubits** ([*List*](https://docs.python.org/3/library/typing.html#typing.List)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – qubits the count bitstrings correspond to.
- **clbits** ([*List*](https://docs.python.org/3/library/typing.html#typing.List)*\[*[*int*](https://docs.python.org/3/library/functions.html#int)*] | None*) – Optional, marginalize counts to just these bits.
- **shots** ([*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – Optional, the total number of shots, if None shots will be calculated as the sum of all counts.

**Returns**

**A dictionary containing pairs of \[output, mean] where “output”**

is the key in the dictionaries, which is the length-N bitstring of a measured standard basis state, and “mean” is the mean of non-zero quasi-probability estimates.

**Return type**

[QuasiDistribution](/docs/api/qiskit/1.4/qiskit.result.QuasiDistribution "qiskit.result.QuasiDistribution")

### stddev\_upper\_bound

`stddev_upper_bound(shots)`

[GitHub](https://github.com/Qiskit/qiskit/tree/stable/1.4/qiskit/result/mitigation/correlated_readout_mitigator.py#L262-L272)

Return an upper bound on standard deviation of expval estimator.

**Parameters**

**shots** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of shots used for expectation value measurement.

**Returns**

the standard deviation upper bound.

**Return type**

[float](https://docs.python.org/3/library/functions.html#float)
