Skip to content

Commit

Permalink
Merge branch 'master' into fermi-commute
Browse files Browse the repository at this point in the history
  • Loading branch information
willjmax committed Sep 17, 2024
2 parents 118dffb + 2c0fdf0 commit 1e1557d
Show file tree
Hide file tree
Showing 19 changed files with 367 additions and 396 deletions.
11 changes: 7 additions & 4 deletions doc/code/qml_qinfo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ qml.qinfo
Overview
--------

.. warning::

The ``qinfo`` module is deprecated and scheduled to be removed in v0.40. Most quantum information transforms
are available as measurement processes (see the :mod:`~pennylane.measurements` module for more details).
Additionally, the transforms are also available as standalone functions in the :mod:`~pennylane.math` and
:mod:`~pennylane.gradients` modules.

This module provides a collection of methods to return quantum information quantities from :class:`~.QNode`
returning :func:`~pennylane.state`.

Expand All @@ -15,8 +22,4 @@ Transforms
.. automodapi:: pennylane.qinfo.transforms
:no-heading:
:no-inherited-members:
:skip: metric_tensor
:skip: adjoint_metric_tensor
:skip: transform
:skip: classical_fisher
:skip: quantum_fisher
20 changes: 13 additions & 7 deletions doc/development/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ deprecations are listed below.
Pending deprecations
--------------------

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

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

* ``Device``, ``QubitDevice``, and ``QutritDevice`` will no longer be imported top level in v0.40. They instead
we be available as ``qml.devices.LegacyDevice``, ``qml.devices.QubitDevice``, and ``qml.devices.QutritDevice``
respectively.

- Deprecated top level access in v0.39
- Top level access removed in v0.40
- Top level access will be removed in v0.40

* `QNode.gradient_fn` is deprecated. Please use `QNode.diff_method` instead. `QNode.get_gradient_fn` can also be used to
process the diff method.
Expand All @@ -27,12 +33,6 @@ Pending deprecations
- Deprecated in v0.38
- Will be removed in v0.39

* The functions ``qml.qinfo.classical_fisher`` and ``qml.qinfo.quantum_fisher`` are deprecated since they are being migrated
to the ``qml.gradients`` module. Therefore, ``qml.gradients.classical_fisher`` and ``qml.gradients.quantum_fisher`` should be used instead.

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

* The ``simplify`` argument in ``qml.Hamiltonian`` and ``qml.ops.LinearCombination`` is deprecated.
Instead, ``qml.simplify()`` can be called on the constructed operator.

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

* The functions ``qml.qinfo.classical_fisher`` and ``qml.qinfo.quantum_fisher`` have been removed and migrated to the ``qml.gradients``
module. Therefore, ``qml.gradients.classical_fisher`` and ``qml.gradients.quantum_fisher`` should be used instead.

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

* All of the legacy devices (any with the name ``default.qubit.{autograd,torch,tf,jax,legacy}``) are removed. Use ``default.qubit`` instead,
as it supports backpropagation for the many backends the legacy devices support.

Expand Down
10 changes: 10 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@

<h3>Breaking changes 💔</h3>

* The functions `qml.qinfo.classical_fisher` and `qml.qinfo.quantum_fisher` have been removed and migrated to the `qml.gradients`
module. Therefore, `qml.gradients.classical_fisher` and `qml.gradients.quantum_fisher` should be used instead.
[(#5911)](https://github.com/PennyLaneAI/pennylane/pull/5911)

* Remove support for Python 3.9.
[(#6223)](https://github.com/PennyLaneAI/pennylane/pull/6223)

Expand Down Expand Up @@ -96,6 +100,10 @@

<h3>Deprecations 👋</h3>

* The `qml.qinfo` module has been deprecated. Please see the respective functions in the `qml.math` and
`qml.measurements` modules instead.
[(#5911)](https://github.com/PennyLaneAI/pennylane/pull/5911)

* The ``QubitStateVector`` template is deprecated.
Instead, use ``StatePrep``.
[(#6172)](https://github.com/PennyLaneAI/pennylane/pull/6172)
Expand Down Expand Up @@ -143,10 +151,12 @@ This release contains contributions from (in alphabetical order):
Guillermo Alonso,
Utkarsh Azad,
Astral Cai,
Isaac De Vlugt,
Lillian M. A. Frederiksen,
Pietropaolo Frisoni,
Emiliano Godinez,
Christina Lee,
William Maxwell,
Lee J. O'Riordan,
Mudit Pandey,
David Wierichs,
5 changes: 3 additions & 2 deletions pennylane/devices/default_mixed.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,9 @@ def execute(self, circuit, **kwargs):
self.measured_wires = self.wires
return super().execute(circuit, **kwargs)
if isinstance(m, (VnEntropyMP, MutualInfoMP)):
# VnEntropy, MutualInfo: Computed for the state prior to measurement. So, readout
# error need not be applied on the corresponding device wires.
# VnEntropy, MutualInfo: Computed for the state
# prior to measurement. So, readout error need not be applied to the
# corresponding device wires.
continue
wires_list.append(m.wires)
self.measured_wires = qml.wires.Wires.all_wires(wires_list)
Expand Down
2 changes: 1 addition & 1 deletion pennylane/measurements/mutual_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def circuit_mutual(x):
using the classical backpropagation differentiation method (``diff_method="backprop"``)
with a compatible device and finite differences (``diff_method="finite-diff"``).
.. seealso:: :func:`~.vn_entropy`, :func:`pennylane.qinfo.transforms.mutual_info` and :func:`pennylane.math.mutual_info`
.. seealso:: :func:`~pennylane.vn_entropy`, :func:`pennylane.math.mutual_info`
"""
wires0 = qml.wires.Wires(wires0)
wires1 = qml.wires.Wires(wires1)
Expand Down
2 changes: 1 addition & 1 deletion pennylane/measurements/purity.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def circuit_purity(p):
>>> circuit_purity(0.1)
array(0.7048)
.. seealso:: :func:`pennylane.qinfo.transforms.purity` and :func:`pennylane.math.purity`
.. seealso:: :func:`pennylane.math.purity`
"""
wires = Wires(wires)
return PurityMP(wires=wires)
Expand Down
6 changes: 3 additions & 3 deletions pennylane/measurements/vn_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ def circuit_entropy(x):
.. note::
Calculating the derivative of :func:`~.vn_entropy` is currently supported when
Calculating the derivative of :func:`~pennylane.vn_entropy` is currently supported when
using the classical backpropagation differentiation method (``diff_method="backprop"``)
with a compatible device and finite differences (``diff_method="finite-diff"``).
.. seealso:: :func:`pennylane.qinfo.transforms.vn_entropy` and :func:`pennylane.math.vn_entropy`
.. seealso:: :func:`pennylane.math.vn_entropy`
"""
wires = Wires(wires)
return VnEntropyMP(wires=wires, log_base=log_base)
Expand All @@ -74,7 +74,7 @@ def circuit_entropy(x):
class VnEntropyMP(StateMeasurement):
"""Measurement process that computes the Von Neumann entropy of the system prior to measurement.
Please refer to :func:`vn_entropy` for detailed documentation.
Please refer to :func:`~pennylane.vn_entropy` for detailed documentation.
Args:
wires (.Wires): The wires the measurement process applies to.
Expand Down
2 changes: 0 additions & 2 deletions pennylane/qinfo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
vn_entropy,
purity,
mutual_info,
classical_fisher,
quantum_fisher,
fidelity,
relative_entropy,
trace_distance,
Expand Down
Loading

0 comments on commit 1e1557d

Please sign in to comment.