Skip to content

Commit

Permalink
Remove hamiltonian_expand and sum_expand (#6204)
Browse files Browse the repository at this point in the history
[sc-72708]

Completes the deprecation cycle for `hamiltonian_expand` and
`sum_expand`. `split_non_commuting` should be used instead for both
cases.
  • Loading branch information
albi3ro authored Sep 4, 2024
1 parent ec0b9f1 commit ae1f40a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1,495 deletions.
12 changes: 6 additions & 6 deletions doc/development/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ Pending deprecations
- Deprecated in v0.38
- Will be removed in v0.39

* The functions ``qml.transforms.sum_expand`` and ``qml.transforms.hamiltonian_expand`` are deprecated.
Instead, ``qml.transforms.split_non_commuting`` can be used for equivalent behaviour.

- Deprecated in v0.38
- Will be removed in v0.39

* The ``expansion_strategy`` attribute of ``qml.QNode`` is deprecated.
Users should make use of ``qml.workflow.construct_batch``, should they require fine control over the output tape(s).

Expand Down Expand Up @@ -129,6 +123,12 @@ Other deprecations
Completed deprecation cycles
----------------------------

* The functions ``qml.transforms.sum_expand`` and ``qml.transforms.hamiltonian_expand`` are deprecated.
Instead, ``qml.transforms.split_non_commuting`` can be used for equivalent behaviour.

- Deprecated in v0.38
- Removed in v0.39

* ``queue_idx`` attribute has been removed from the ``Operator``, ``CompositeOp``, and ``SymboliOp`` classes. Instead, the index is now stored as the label of the ``CircuitGraph.graph`` nodes.

- Deprecated in v0.38
Expand Down
3 changes: 3 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@

<h3>Breaking changes 💔</h3>

* `qml.transforms.hamiltonian_expand` and `qml.transforms.sum_expand` are removed.
Please use `qml.transforms.split_non_commuting` instead.

<h3>Deprecations 👋</h3>

<h3>Documentation 📝</h3>
Expand Down
3 changes: 0 additions & 3 deletions pennylane/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@
defer_measurements
transforms.broadcast_expand
transforms.sum_expand
transforms.split_non_commuting
transforms.hamiltonian_expand
Modifiers
---------
Expand Down
3 changes: 0 additions & 3 deletions pennylane/transforms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@
~transforms.split_non_commuting
~transforms.split_to_single_terms
~transforms.broadcast_expand
~transforms.hamiltonian_expand
~transforms.sign_expand
~transforms.sum_expand
~transforms.convert_to_numpy_parameters
~apply_controlled_Q
~quantum_monte_carlo
Expand Down Expand Up @@ -320,7 +318,6 @@ def circuit(params):
from .diagonalize_measurements import diagonalize_measurements
from .dynamic_one_shot import dynamic_one_shot, is_mcm
from .sign_expand import sign_expand
from .hamiltonian_expand import hamiltonian_expand, sum_expand
from .split_non_commuting import split_non_commuting
from .split_to_single_terms import split_to_single_terms
from .insert_ops import insert
Expand Down
Loading

0 comments on commit ae1f40a

Please sign in to comment.