Skip to content

split_non_commuting's expected PyTreeDef does not match observed PyTreeDef #1099

Open
@erick-xanadu

Description

@erick-xanadu
  • Expected behavior:

In pytest/test_transform.py, when changing @sum_expand in TestSumExpand to @qml.transforms.split_non_commuting as suggested by the warning, I expect the tree def to remain the same.

  • Actual behavior: A tuple is returned instead of a list.
diff --git a/frontend/test/pytest/test_transform.py b/frontend/test/pytest/test_transform.py
index 9fcb8457..a616bdb6 100644
--- a/frontend/test/pytest/test_transform.py
+++ b/frontend/test/pytest/test_transform.py
@@ -41,7 +41,7 @@ try:
 except:  # pylint: disable=bare-except
     from pennylane.transforms import qcut
 
-from pennylane.transforms import merge_rotations, sum_expand
+from pennylane.transforms import merge_rotations
 
 from catalyst import measure, qjit
 from catalyst.utils.exceptions import CompileError
@@ -375,7 +375,7 @@ class TestSumExpand:
         def qnode_builder(device_name):
             """Builder"""
 
-            @sum_expand
+            @qml.transforms.split_non_commuting
             @qml.qnode(qml.device(device_name, wires=2, shots=None))
             def qfunc():
                 """Example taken from PL tests"""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions