Skip to content

Commit

Permalink
Remove qml.broadcast template (#6527)
Browse files Browse the repository at this point in the history
Context:

Completing the deprecation cycle of `qml.broadcast`.

Description of the Change:

1. Update deprecations.rst
2. Update changelog-dev.md
3. Remove all deprecated source code

Found references in Catalyst:
PennyLaneAI/catalyst#1290
No references found in Lightning and QML.

[sc-77484]

---------

Co-authored-by: Mudit Pandey <[email protected]>
  • Loading branch information
andrijapau and mudit2812 authored Nov 12, 2024
1 parent 297e573 commit e27f881
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 1,013 deletions.
10 changes: 5 additions & 5 deletions doc/development/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ Pending deprecations
- Deprecated in v0.39
- Will be removed in v0.40

* ``qml.broadcast`` has been deprecated. Users should use ``for`` loops instead.

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

* The ``qml.qinfo`` module has been deprecated. Please see the respective functions in the ``qml.math`` and ``qml.measurements``
modules instead.

Expand Down Expand Up @@ -111,6 +106,11 @@ Other deprecations
Completed deprecation cycles
----------------------------

* ``qml.broadcast`` has been removed. Users should use ``for`` loops instead.

- Deprecated in v0.39
- Removed in v0.40

* The ``max_expansion`` argument for :func:`~pennylane.transforms.decompositions.clifford_t_decomposition`
has been removed.

Expand Down
48 changes: 0 additions & 48 deletions doc/introduction/templates.rst
Original file line number Diff line number Diff line change
Expand Up @@ -360,54 +360,6 @@ Other useful templates which do not belong to the previous categories can be fou

.. _intro_ref_temp_constr:

Broadcasting function
---------------------

PennyLane offers a broadcasting function to easily construct templates: :func:`~.broadcast`
takes either quantum gates or templates and applies them to wires in a specific pattern.

.. warning::

While the broadcasting function can make template construction very convenient, it
adds an overhead and is therefore not recommended when speed is a major concern.

.. gallery-item::
:description: :doc:`Broadcast (Single) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_single.png

.. gallery-item::
:description: :doc:`Broadcast (Double) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_double.png

.. gallery-item::
:description: :doc:`Broadcast (Double Odd) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_double_odd.png

.. gallery-item::
:description: :doc:`Broadcast (Chain) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_chain.png

.. gallery-item::
:description: :doc:`Broadcast (Ring) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_ring.png

.. gallery-item::
:description: :doc:`Broadcast (Pyramid) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_pyramid.png

.. gallery-item::
:description: :doc:`Broadcast (All-to-All) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_alltoall.png

.. gallery-item::
:description: :doc:`Broadcast (Custom) <../code/api/pennylane.broadcast>`
:figure: _static/templates/broadcast_custom.png

.. raw:: html

<div style='clear:both'></div>

.. _intro_ref_temp_init:

Parameter initializations
-------------------------
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 @@ -71,6 +71,9 @@

<h3>Breaking changes 💔</h3>

* `qml.broadcast` has been removed. Users should use `for` loops instead.
[(#6527)](https://github.com/PennyLaneAI/pennylane/pull/6527)

* The `max_expansion` argument for `qml.transforms.clifford_t_decomposition` has been removed.
[(#6531)](https://github.com/PennyLaneAI/pennylane/pull/6531)

Expand Down
2 changes: 1 addition & 1 deletion pennylane/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
)
from pennylane.ops import *
from pennylane.ops import adjoint, ctrl, cond, exp, sum, pow, prod, s_prod
from pennylane.templates import broadcast, layer
from pennylane.templates import layer
from pennylane.templates.embeddings import *
from pennylane.templates.layers import *
from pennylane.templates.tensornetworks import *
Expand Down
1 change: 0 additions & 1 deletion pennylane/templates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
This module contains templates, which are pre-coded routines that can be used in a quantum node.
"""

from .broadcast import *
from .embeddings import *
from .layer import *
from .layers import *
Expand Down
Loading

0 comments on commit e27f881

Please sign in to comment.