Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove qml.broadcast template #6527

Merged
merged 7 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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