diff --git a/doc/introduction/interfaces.rst b/doc/introduction/interfaces.rst index 7eb3d391600..61ff7aeb61f 100644 --- a/doc/introduction/interfaces.rst +++ b/doc/introduction/interfaces.rst @@ -34,6 +34,17 @@ a :class:`QNode `, e.g., If no interface is specified, PennyLane will automatically determine the interface based on provided arguments and keyword arguments. See ``qml.workflow.SUPPORTED_INTERFACES`` for a list of all accepted interface strings. +.. warning:: + + ``ComplexWarning`` messages may appear when running differentiable workflows involving both complex and float types, particularly + with certain interfaces. These warnings are common in backpropagation due to the nature of complex casting and do not + indicate an error in computation. If desired, you can suppress these warnings by adding the following code: + + .. code-block:: python + + import warnings + warnings.filterwarnings("ignore", category=np.ComplexWarning) + This will allow native numerical objects of the specified library (NumPy arrays, JAX arrays, Torch Tensors, or TensorFlow Tensors) to be passed as parameters to the quantum circuit. It also makes the gradients of the quantum circuit accessible to the classical library, enabling the diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index 50f62fd7899..d95737af09d 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -52,6 +52,9 @@

Documentation 📝

+* Add a warning message to Gradients and training documentation about ComplexWarnings + [(#6543)](https://github.com/PennyLaneAI/pennylane/pull/6543) +

Bug fixes 🐛

Contributors ✍️

@@ -60,5 +63,7 @@ This release contains contributions from (in alphabetical order): Shiwen An Astral Cai, -Pietropaolo Frisoni, -Andrija Paurevic +Andrija Paurevic, +Justin Pickering +Pietropaolo Frisoni +