Skip to content

Commit

Permalink
Deprecate classical_fisher and quantum_fisher (#5985)
Browse files Browse the repository at this point in the history
- Duplicated functions in new module `qml.gradients.fisher`. Moved tests
to `test.gradient.core.test_fisher`.
- Added new test file `test.qinfo.test_fisher_deprecation` with
deprecation tests.
- Added entry for functions in `qml.gradients` doc page.
- Removed entries of functions in `qml.qinfo`.

[[sc-67213](https://app.shortcut.com/xanaduai/story/67213)]
[[sc-67214](https://app.shortcut.com/xanaduai/story/67214)]

---------

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
  • Loading branch information
Shiro-Raven and mudit2812 authored Jul 12, 2024
1 parent bca15cc commit 48eef6c
Show file tree
Hide file tree
Showing 9 changed files with 498 additions and 129 deletions.
2 changes: 2 additions & 0 deletions doc/code/qml_qinfo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ Transforms
:skip: metric_tensor
:skip: adjoint_metric_tensor
:skip: transform
:skip: classical_fisher
:skip: quantum_fisher
6 changes: 6 additions & 0 deletions doc/development/deprecations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ deprecations are listed below.
Pending deprecations
--------------------

* 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
4 changes: 4 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@

<h3>Deprecations 👋</h3>

* `pennylane.qinfo.classical_fisher` and `pennylane.qinfo.quantum_fisher` have been deprecated.
Instead, use `pennylane.gradients.classical_fisher` and `pennylane.gradients.quantum_fisher`.
[(#5985)](https://github.com/PennyLaneAI/pennylane/pull/5985)

<h3>Documentation 📝</h3>

* Improves the docstring for `QuantumScript.expand` and `qml.tape.tape.expand_tape`.
Expand Down
3 changes: 3 additions & 0 deletions pennylane/gradients/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
batch_jvp
jvp
classical_jacobian
classical_fisher
quantum_fisher
Registering autodifferentiation gradients
Expand Down Expand Up @@ -341,6 +343,7 @@ def my_custom_gradient(tape: qml.tape.QuantumTape, **kwargs) -> (Sequence[qml.ta
from .adjoint_metric_tensor import adjoint_metric_tensor
from .classical_jacobian import classical_jacobian
from .finite_difference import finite_diff, finite_diff_coeffs
from .fisher import classical_fisher, quantum_fisher
from .general_shift_rules import (
eigvals_to_frequencies,
generate_multi_shift_rule,
Expand Down
Loading

0 comments on commit 48eef6c

Please sign in to comment.