From 7ac10c7cab5672332b457fbfd7919d9af85d2bd1 Mon Sep 17 00:00:00 2001 From: Cody Wang Date: Thu, 16 Jan 2025 09:01:28 -0800 Subject: [PATCH] Update test_braket_device.py --- test/unit_tests/test_braket_device.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/test/unit_tests/test_braket_device.py b/test/unit_tests/test_braket_device.py index 2521526d..11c659a8 100644 --- a/test/unit_tests/test_braket_device.py +++ b/test/unit_tests/test_braket_device.py @@ -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] @@ -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