Skip to content

Commit

Permalink
Rename test_simplify_with_adjoint_not_defined in test_pow_ops.py (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
willjmax authored Oct 11, 2024
1 parent 0848a36 commit 9ac2504
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

<h3>Bug fixes 🐛</h3>

* `default.qutrit` now returns integer samples.
Expand Down Expand Up @@ -345,4 +348,4 @@ Erick Ochoa Lopez,
Lee J. O'Riordan,
Mudit Pandey,
Andrija Paurevic,
David Wierichs,
David Wierichs,
2 changes: 1 addition & 1 deletion tests/ops/op_math/test_pow_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 9ac2504

Please sign in to comment.