From 64991ebe355e3da21675b911c82ae1062e6d56dc Mon Sep 17 00:00:00 2001 From: Renato Mello Date: Tue, 12 Mar 2024 15:22:39 +0400 Subject: [PATCH] fix test seed --- tests/test_backends_clifford.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_backends_clifford.py b/tests/test_backends_clifford.py index 3f3a2d4287..b04fa01d93 100644 --- a/tests/test_backends_clifford.py +++ b/tests/test_backends_clifford.py @@ -128,12 +128,17 @@ def test_random_clifford_circuit(backend, prob_qubits, binary): backend.set_seed(2024) nqubits, nshots = 3, 200 clifford_bkd = construct_clifford_backend(backend) + c = random_clifford(nqubits, seed=1, backend=backend) c.density_matrix = True c_copy = c.copy() c.add(gates.M(*MEASURED_QUBITS)) c_copy.add(gates.M(*MEASURED_QUBITS)) + + numpy_bkd.set_seed(2024) numpy_result = numpy_bkd.execute_circuit(c, nshots=nshots) + + clifford_bkd.set_seed(2024) clifford_result = clifford_bkd.execute_circuit(c_copy, nshots=nshots) backend.assert_allclose(backend.cast(numpy_result.state()), clifford_result.state())