From 9ac2504c9a09452c7cf9fee007f425af96ae19f5 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 11 Oct 2024 17:53:25 -0400 Subject: [PATCH] Rename `test_simplify_with_adjoint_not_defined` in `test_pow_ops.py` (#6388) This PR renames `test_simplify_with_adjoint_not_defined` to `test_simplify_with_pow_not_defined` in the `test_pow_ops.py` file. The test is given by the following code. ``` def test_simplify_with_adjoint_not_defined(self): """Test the simplify method with an operator that has not defined the op.pow method.""" op = Pow(qml.U2(1, 1, 0), z=3) simplified_op = op.simplify() assert isinstance(simplified_op, Pow) assert op.data == simplified_op.data assert op.wires == simplified_op.wires assert op.arithmetic_depth == simplified_op.arithmetic_depth ``` Note the function name says `adjoint` is not defined, but the docstring says that `pow` is not defined. The docstring is correct, since `qml.U2` defines the `adjoint` method. --- doc/releases/changelog-dev.md | 5 ++++- tests/ops/op_math/test_pow_op.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index df7004f00f9..8d43c417638 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -269,6 +269,9 @@ * Removed ambiguity in error raised by the `PauliRot` class. [(#6298)](https://github.com/PennyLaneAI/pennylane/pull/6298) +* Renamed an incorrectly named test in `test_pow_ops.py`. + [(#6388)](https://github.com/PennyLaneAI/pennylane/pull/6388) +

Bug fixes 🐛

* `default.qutrit` now returns integer samples. @@ -345,4 +348,4 @@ Erick Ochoa Lopez, Lee J. O'Riordan, Mudit Pandey, Andrija Paurevic, -David Wierichs, \ No newline at end of file +David Wierichs, diff --git a/tests/ops/op_math/test_pow_op.py b/tests/ops/op_math/test_pow_op.py index cf13dddd7f1..b323744c56f 100644 --- a/tests/ops/op_math/test_pow_op.py +++ b/tests/ops/op_math/test_pow_op.py @@ -568,7 +568,7 @@ def test_simplify_method_with_controlled_operation(self): assert final_op.wires == simplified_op.wires assert final_op.arithmetic_depth == simplified_op.arithmetic_depth - def test_simplify_with_adjoint_not_defined(self): + def test_simplify_with_pow_not_defined(self): """Test the simplify method with an operator that has not defined the op.pow method.""" op = Pow(qml.U2(1, 1, 0), z=3) simplified_op = op.simplify()