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

Update documentation of quantum_fisher #6074

Merged
merged 5 commits into from
Aug 7, 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
4 changes: 4 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@

<h3>Documentation 📝</h3>

* Improves the docstring for `qinfo.quantum_fisher` regarding the internally used functions and
potentially required auxiliary wires.
[(#6074)](https://github.com/PennyLaneAI/pennylane/pull/6074)

* Improves the docstring for `QuantumScript.expand` and `qml.tape.tape.expand_tape`.
[(#5974)](https://github.com/PennyLaneAI/pennylane/pull/5974)

Expand Down
9 changes: 6 additions & 3 deletions pennylane/gradients/fisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,12 @@ def quantum_fisher(

.. note::

``quantum_fisher`` coincides with the ``metric_tensor`` with a prefactor of :math:`4`. Internally, :func:`~.pennylane.adjoint_metric_tensor` is used when executing on a device with
exact expectations (``shots=None``) that inherits from ``"default.qubit"``. In all other cases, i.e. if a device with finite shots is used, the hardware compatible transform :func:`~.pennylane.metric_tensor` is used.
Please refer to their respective documentations for details on the arguments.
``quantum_fisher`` coincides with the ``metric_tensor`` with a prefactor of :math:`4`.
Internally, :func:`~.pennylane.adjoint_metric_tensor` is used when executing on ``"default.qubit"``
with exact expectations (``shots=None``). In all other cases, e.g. if a device with finite shots
is used, the hardware-compatible transform :func:`~.pennylane.metric_tensor` is used, which
may require an additional wire on the device.
Please refer to the respective documentations for details.

**Example**

Expand Down
9 changes: 6 additions & 3 deletions pennylane/qinfo/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,12 @@ def quantum_fisher(

.. note::

``quantum_fisher`` coincides with the ``metric_tensor`` with a prefactor of :math:`4`. Internally, :func:`~.pennylane.adjoint_metric_tensor` is used when executing on a device with
exact expectations (``shots=None``) that inherits from ``"default.qubit"``. In all other cases, i.e. if a device with finite shots is used, the hardware compatible transform :func:`~.pennylane.metric_tensor` is used.
Please refer to their respective documentations for details on the arguments.
``quantum_fisher`` coincides with the ``metric_tensor`` with a prefactor of :math:`4`.
Internally, :func:`~.pennylane.adjoint_metric_tensor` is used when executing on ``"default.qubit"``
with exact expectations (``shots=None``). In all other cases, e.g. if a device with finite shots
is used, the hardware-compatible transform :func:`~.pennylane.metric_tensor` is used, which
may require an additional wire on the device.
Please refer to the respective documentations for details.

**Example**

Expand Down
Loading