Skip to content

Commit c2c6097

Browse files
authored
Set noise model basis gates for tomography tests (#1294)
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).
1 parent b1a42e3 commit c2c6097

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

test/library/tomography/tomo_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def readout_noise_model(num_qubits, seed=None):
8787
p1g0s = 0.15 * rng.random(num_qubits)
8888
p0g1s = 0.3 * rng.random(num_qubits)
8989
amats = np.stack([[1 - p1g0s, p1g0s], [p0g1s, 1 - p0g1s]]).T
90-
noise_model = NoiseModel()
90+
# Set `basis_gates` so that reset is included.
91+
# See https://github.com/Qiskit/qiskit-aer/issues/1975
92+
noise_model = NoiseModel(basis_gates=["id", "rz", "sx", "cx", "reset"])
9193
for i, amat in enumerate(amats):
9294
noise_model.add_readout_error(amat.T, [i])
9395
return noise_model

0 commit comments

Comments
 (0)