Skip to content

Commit

Permalink
fix: fixed seed of random_clifford in test_decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Aug 3, 2024
1 parent ef91fc2 commit a610cf4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_models_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ def test_state_layer(backend):
@pytest.mark.parametrize("analytic", [True, False])
def test_expectation_layer(backend, analytic):
backend.set_seed(42)
rng = np.random.default_rng(42)
nqubits = 5
# test observable error
with pytest.raises(RuntimeError):
layer = ed.ExpectationLayer(nqubits, backend=backend)

c = random_clifford(nqubits, backend=backend)
c = random_clifford(nqubits, seed=rng, backend=backend)
observable = hamiltonians.SymbolicHamiltonian(
sum([Z(i) for i in range(nqubits)]),
nqubits=nqubits,
Expand Down

0 comments on commit a610cf4

Please sign in to comment.