From 79b3c6b2875550ae477cc83ed2b929d53d11f224 Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Fri, 27 Oct 2023 15:10:48 -0400 Subject: [PATCH] Set noise model basis gates for tomography tests --- test/library/tomography/tomo_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/library/tomography/tomo_utils.py b/test/library/tomography/tomo_utils.py index 2a1e75b9ec..1304876bb9 100644 --- a/test/library/tomography/tomo_utils.py +++ b/test/library/tomography/tomo_utils.py @@ -87,7 +87,9 @@ def readout_noise_model(num_qubits, seed=None): p1g0s = 0.15 * rng.random(num_qubits) p0g1s = 0.3 * rng.random(num_qubits) amats = np.stack([[1 - p1g0s, p1g0s], [p0g1s, 1 - p0g1s]]).T - noise_model = NoiseModel() + # Set `basis_gates` so that reset is included. + # See https://github.com/Qiskit/qiskit-aer/issues/1975 + noise_model = NoiseModel(basis_gates=["id", "rz", "sx", "cx", "reset"]) for i, amat in enumerate(amats): noise_model.add_readout_error(amat.T, [i]) return noise_model