Skip to main contentIBM Quantum Documentation

LocalReadoutMitigator

qiskit.result.LocalReadoutMitigator(assignment_matrices=None, qubits=None, backend=None) GitHub(opens in a new tab)

Bases: BaseReadoutMitigator

1-qubit tensor product readout error mitigator.

Mitigates expectation_value() and quasi_probabilities(). The mitigator should either be calibrated using qiskit experiments, or calculated directly from the backend properties. This mitigation method should be used in case the readout errors of the qubits are assumed to be uncorrelated. For N qubits there are N mitigation matrices, each of size 2x22 x 2 and the mitigation complexity is O(2N)O(2^N), so it is more efficient than the CorrelatedReadoutMitigator class.

Initialize a LocalReadoutMitigator

Parameters

Raises

QiskitError – matrices sizes do not agree with number of qubits


Attributes

qubits

The device qubits for this mitigator

settings

Return settings.


Methods

assignment_matrix

assignment_matrix(qubits=None)

Return the measurement assignment matrix for specified qubits.

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

Parameters

qubits (List(opens in a new tab)[int(opens in a new tab)] | None) – Optional, qubits being measured for operator expval.

Returns

the assignment matrix A.

Return type

np.ndarray

expectation_value

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

Compute the mitigated expectation value of a diagonal observable.

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

Parameters

Returns

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

Return type

(float(opens in a new tab), float(opens in a new tab))

Additional Information:

The diagonal observable OO is input using the diagonal kwarg as a list or Numpy array [O(0),...,O(2n1)][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)

Return the measurement mitigation matrix for the specified qubits.

The mitigation matrix A1A^{-1} is defined as the inverse of the assignment_matrix() AA.

Parameters

qubits (List(opens in a new tab)[int(opens in a new tab)] | int(opens in a new tab) | None) – Optional, qubits being measured for operator expval. if a single int is given, it is assumed to be the index of the qubit in self._qubits

Returns

the measurement error mitigation matrix A1A^{-1}.

Return type

np.ndarray

quasi_probabilities

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

Compute mitigated quasi probabilities value.

Parameters

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

Raises

QiskitError – if qubit and clbit kwargs are not valid.

stddev_upper_bound

stddev_upper_bound(shots, qubits=None)

Return an upper bound on standard deviation of expval estimator.

Parameters

Returns

the standard deviation upper bound.

Return type

float(opens in a new tab)

Was this page helpful?