diff --git a/test/unit_tests/test_ahs_device.py b/test/unit_tests/test_ahs_device.py index 67fda630..47840f01 100644 --- a/test/unit_tests/test_ahs_device.py +++ b/test/unit_tests/test_ahs_device.py @@ -467,25 +467,6 @@ def test_check_validity_valid_circuit(self, H, params): dev.check_validity(ops, obs) - @pytest.mark.parametrize("H, params", HAMILTONIANS_AND_PARAMS) - def test_check_validity_valid_circuit_no_op_math(self, H, params): - """Tests that check_validity() doesn't raise any errors when the operations and - observables are valid.""" - qml.operation.disable_new_opmath() - ops = [ParametrizedEvolution(H, params, [0, 1.5])] - obs = [ - qml.PauliZ(0), - qml.expval(qml.PauliZ(0)), - qml.var(qml.Identity(0)), - qml.sample(qml.PauliZ(0)), - qml.prod(qml.PauliZ(0), qml.Identity(1)), - qml.Hamiltonian([2, 3], [qml.PauliZ(0), qml.PauliZ(1)]), - qml.counts(), - ] - dev = qml.device("braket.local.ahs", wires=3) - - dev.check_validity(ops, obs) - @pytest.mark.parametrize("H, params", HAMILTONIANS_AND_PARAMS) def test_check_validity_raises_error_for_state_based_measurement(self, H, params): """Tests that requesting a measurement other than a sample-based diff --git a/test/unit_tests/test_braket_device.py b/test/unit_tests/test_braket_device.py index 94062dab..533e1626 100644 --- a/test/unit_tests/test_braket_device.py +++ b/test/unit_tests/test_braket_device.py @@ -569,7 +569,6 @@ def test_execute_with_gradient_no_op_math( result_types, expected_pl_result, ): - qml.operation.disable_new_opmath() task = Mock() type(task).id = PropertyMock(return_value="task_arn") @@ -830,8 +829,8 @@ def test_pl_to_braket_circuit_hamiltonian(): def test_pl_to_braket_circuit_hamiltonian_tensor_product_terms(): - """Tests that a PennyLane circuit is correctly converted into a Braket circuit""" - """when the Hamiltonian has multiple tensor product ops""" + """Tests that a PennyLane circuit is correctly converted into a Braket circuit + when the Hamiltonian has multiple tensor product ops""" dev = _aws_device(wires=2, foo="bar") with QuantumTape() as tape: @@ -1314,6 +1313,8 @@ def test_execute_some_samples(mock_run): mock_run.return_value = task dev = _aws_device(wires=3) + print(type(qml.Hadamard(0) @ qml.Identity(1))) + with QuantumTape() as circuit: qml.Hadamard(wires=0) qml.CNOT(wires=[0, 1]) diff --git a/test/unit_tests/test_translation.py b/test/unit_tests/test_translation.py index 5c719e68..b28470f8 100644 --- a/test/unit_tests/test_translation.py +++ b/test/unit_tests/test_translation.py @@ -749,7 +749,7 @@ def test_translate_result_type_hamiltonian_unsupported_return(return_type): with Hamiltonian observable and non-Expectation return type""" obs = qml.Hamiltonian((2, 3), (qml.PauliX(wires=0), qml.PauliY(wires=1))) tape = qml.tape.QuantumTape(measurements=[_braket_to_pl_result_types[return_type](obs)]) - with pytest.raises(NotImplementedError, match="unsupported for Hamiltonian"): + with pytest.raises(NotImplementedError, match="unsupported for LinearCombination"): translate_result_type(tape.measurements[0], [0], frozenset())