Skip to content

Commit

Permalink
Update test_braket_device.py
Browse files Browse the repository at this point in the history
  • Loading branch information
speller26 committed Jan 16, 2025
1 parent 5c0adb6 commit 7ac10c7
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions test/unit_tests/test_braket_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,10 @@ def test_execute_parametrize_differentiable(mock_run):
qml.RY(0.543, wires=0),
],
measurements=[
qml.expval(2 * qml.PauliX(0) @ qml.PauliY(1) + 0.75 * qml.PauliY(0) @ qml.PauliZ(1)),
qml.expval(
2 * qml.PauliX(0) @ qml.PauliY(1) @ qml.Identity(2)
+ 0.75 * qml.PauliY(0) @ qml.PauliZ(1)
),
],
)
CIRCUIT_3.trainable_params = [0, 1]
Expand Down Expand Up @@ -1627,22 +1630,6 @@ def test_supported_ops_set(monkeypatch):
assert dev.operations == test_ops


def test_simplification():
"""Test that the Projector observable is correctly supported."""
wires = 5
dev = BraketLocalQubitDevice(wires=wires)

obs = qml.ops.LinearCombination([1.0, 2.0], [qml.X(0) @ qml.I(1), qml.Y(0) @ qml.X(1)])

@qml.qnode(dev)
def circuit(x):
qml.RX(x, 0)
return qml.expval(obs)

phi = np.array(1.5, requires_grad=True)
assert np.isclose(circuit(phi), 0)


def test_projection():
"""Test that the Projector observable is correctly supported."""
wires = 2
Expand Down

0 comments on commit 7ac10c7

Please sign in to comment.