Skip to content

Commit 320a5b6

Browse files
justinpickeringCatalinaAlbornozisaacdevlugt
authored
Add warning about precision in interfaces documentation (#8124)
**Context:** A user query on our forum ([Thread #8885](https://discuss.pennylane.ai/t/pytorch-default-data-type/8885)) revealed that PennyLane silently promotes all float32 inputs to float64 during computation. **Description of the Change:** This change adds a warning to the [Interfaces ](https://docs.pennylane.ai/en/stable/introduction/interfaces.html)documentation regarding the behaviour (everything is promoted to 64-bit outputs). **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: Catalina Albornoz <[email protected]> Co-authored-by: Isaac De Vlugt <[email protected]>
1 parent f826d22 commit 320a5b6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

doc/introduction/interfaces.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ PennyLane also provides higher-level classes for converting QNodes into ``torch.
118118

119119
pennylane.qnn.TorchLayer
120120

121+
.. warning::
122+
123+
PennyLane's QNodes currently promote all ``torch.float32`` (single-precision) inputs to ``torch.float64``
124+
(double-precision) during execution. This may result in higher memory usage than expected.
125+
121126

122127
.. note::
123128

doc/releases/changelog-dev.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,6 +1034,10 @@
10341034
Trimmed the outdated part of discussion regarding different choices of `alpha`.
10351035
[(#8100)](https://github.com/PennyLaneAI/pennylane/pull/8100)
10361036

1037+
* A warning was added to the :doc:`interfaces documentation </introduction/interfaces>` under the Pytorch section saying that all Pytorch floating-point inputs are promoted
1038+
to `torch.float64`.
1039+
[(#8124)](https://github.com/PennyLaneAI/pennylane/pull/8124)
1040+
10371041
* The :doc:`Dynamic Quantum Circuits </introduction/dynamic_quantum_circuits>` page has been updated to include the latest device-dependent mid-circuit measurement method defaults.
10381042
[(#8149)](https://github.com/PennyLaneAI/pennylane/pull/8149)
10391043

@@ -1149,6 +1153,7 @@ Pablo Antonio Moreno Casares
11491153
Erick Ochoa,
11501154
Mudit Pandey,
11511155
Andrija Paurevic,
1156+
Justin Pickering,
11521157
Alex Preciado,
11531158
Shuli Shu,
11541159
Jay Soni,

0 commit comments

Comments
 (0)