Skip to content

Commit

Permalink
Set noise model basis gates for tomography tests (#1294)
Browse files Browse the repository at this point in the history
This sets the basis gates explicitly on the `NoiseModel` used for some
tomography tests. Without this, some of the test circuits fail to
transpile because `reset` is not in the equivalence library when using
qiskit-aer 0.13.0 (see
Qiskit/qiskit-aer#1975).
  • Loading branch information
wshanks authored Oct 31, 2023
1 parent b1a42e3 commit c2c6097
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/library/tomography/tomo_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c2c6097

Please sign in to comment.