estimate_confusion_matrix¶
-
forest.benchmarking.readout.
estimate_confusion_matrix
(qc: pyquil.api._quantum_computer.QuantumComputer, qubit: int, num_shots: int = 10000) → numpy.ndarray¶ Estimate the readout confusion matrix for a given qubit.
The confusion matrix will be of the form:
[[ p(0 | 0) p(0 | 1) ] [ p(1 | 0) p(1 | 1) ]]
where each column sums to one. Note that the matrix need not be symmetric.
Parameters: - qc – The quantum computer to estimate the confusion matrix.
- qubit – The actual physical qubit to measure
- num_shots – The number of shots to take. This function runs two programs, so the total number of shots taken will be twice this number.
Returns: a 2x2 confusion matrix for the qubit, where each row sums to one.