@@ -165,7 +165,8 @@ def test_random_clifford_circuit(backend, prob_qubits, binary):
165
165
backend .assert_allclose (np_count / nshots , clif_count / nshots , atol = 1e-1 )
166
166
167
167
168
- def test_collapsing_measurements (backend ):
168
+ @pytest .mark .parametrize ("seed" , [2024 ])
169
+ def test_collapsing_measurements (backend , seed ):
169
170
clifford_bkd = construct_clifford_backend (backend )
170
171
gate_queue = random_clifford (3 , density_matrix = True , backend = backend ).queue
171
172
measured_qubits = np .random .choice (range (3 ), size = 2 , replace = False )
@@ -180,8 +181,13 @@ def test_collapsing_measurements(backend):
180
181
c2 .add (g )
181
182
c1 .add (gates .M (* range (3 )))
182
183
c2 .add (gates .M (* range (3 )))
183
- clifford_res = clifford_bkd .execute_circuit (c1 , nshots = 1000 )
184
- numpy_res = numpy_bkd .execute_circuit (c2 , nshots = 1000 )
184
+
185
+ clifford_bkd .set_seed (seed )
186
+ clifford_res = clifford_bkd .execute_circuit (c1 , nshots = 100 )
187
+
188
+ numpy_bkd .set_seed (seed )
189
+ numpy_res = numpy_bkd .execute_circuit (c2 , nshots = 100 )
190
+
185
191
backend .assert_allclose (
186
192
clifford_res .probabilities (), backend .cast (numpy_res .probabilities ()), atol = 1e-1
187
193
)
0 commit comments