Skip to content

Commit a05deb9

Browse files
committed
fix random seed
1 parent 0e7d658 commit a05deb9

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/terra/backends/test_parameterized_qobj.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,9 @@ def test_run_path_with_more_params_than_expressions(self):
213213
circuit.ry(phi, 1)
214214
circuit.measure_all()
215215
parameter_binds = [{theta: [0, pi, 2 * pi], phi: [0, 1, pi]}]
216-
res = backend.run(circuit, shots=shots, parameter_binds=parameter_binds).result()
216+
res = backend.run(
217+
circuit, shots=shots, parameter_binds=parameter_binds, **self.BACKEND_OPTS
218+
).result()
217219
counts = res.get_counts()
218220
for index, expected in enumerate(
219221
[{"00": shots}, {"01": 0.25 * shots, "11": 0.75 * shots}, {"10": shots}]
@@ -317,7 +319,9 @@ def test_run_path_with_more_params_than_expressions_multiple_circuits(self):
317319
circuit.ry(phi, 1)
318320
circuit.measure_all()
319321
parameter_binds = [{theta: [0, pi, 2 * pi], phi: [0, 1, pi]}] * 3
320-
res = backend.run([circuit] * 3, shots=shots, parameter_binds=parameter_binds).result()
322+
res = backend.run(
323+
[circuit] * 3, shots=shots, parameter_binds=parameter_binds, **self.BACKEND_OPTS
324+
).result()
321325
counts = res.get_counts()
322326
for index, expected in enumerate(
323327
[{"00": shots}, {"01": 0.25 * shots, "11": 0.75 * shots}, {"10": shots}] * 3

test/terra/states/test_aer_densitymatrix.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ def test_QFT(self):
147147

148148
def test_two_qubit_QV(self):
149149
"""Test single qubit QuantumVolume"""
150-
state = AerDensityMatrix(QuantumVolume(2))
150+
state = AerDensityMatrix(QuantumVolume(2, seed=1111))
151+
state.seed(1111)
151152
counts = state.sample_counts(shots=1024)
152153
self.assertEqual(4, len(counts))
153154
self.assertTrue("00" in counts)

0 commit comments

Comments
 (0)