Skip to content

Commit

Permalink
fix: replacing c() with backend.execute
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoLiegiBastonLiegi committed Aug 28, 2024
1 parent 6820b25 commit c0fd516
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_models_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,17 @@ def test_probabilities_layer(backend):
qubits = np.random.choice(range(nqubits), size=(4,), replace=False)
layer = ed.ProbabilitiesLayer(nqubits, qubits=qubits, backend=backend)
c = random_clifford(nqubits, backend=backend)
backend.assert_allclose(layer(c).ravel(), c().probabilities(qubits))
backend.assert_allclose(
layer(c).ravel(), backend.execute_circuit(c).probabilities(qubits)
)


def test_state_layer(backend):
nqubits = 5
layer = ed.StateLayer(nqubits, backend=backend)
c = random_clifford(nqubits, backend=backend)
real, im = layer(c)
backend.assert_allclose(real + 1j * im, c().state())
backend.assert_allclose(real + 1j * im, backend.execute_circuit(c).state())


@pytest.mark.parametrize("analytic", [True, False])
Expand Down

0 comments on commit c0fd516

Please sign in to comment.