Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add warning message to Gradients and training documentation about `Co…
…mplexWarnings` (#6543) **Context:** - This PR addresses a recurring ComplexWarning issue that appears when using differentiable workflows involving both complex and float types, particularly during backpropagation. Users have reported this issue (see an example [here](https://discuss.pennylane.ai/t/casting-of-complex-to-float-when-using-phaseshift-in-circuit-for-qml/7439)), and [internal discussions](https://xanaduhq.slack.com/archives/C0743CNS9E3/p1730329623028289) have concluded that while the warning is generally harmless, it can still be confusing for users. **Description of the Change:** - A warning note has been added to the Gradients and training page in the documentation. The note explains the origin of the ComplexWarning, assures users that it is non-critical in this context, and provides a code snippet to suppress the warning. **Benefits:** - Clarifies to users that the ComplexWarning does not indicate a calculation error, which can help avoid unnecessary troubleshooting. - Offers an easy method to suppress the warning **Possible Drawbacks:** - Suppressing warnings could potentially hide other, less common issues involving complex numbers in more advanced workflows - Users may overlook the warning's informational value if they suppress it without fully understanding the implications **Related GitHub Issues:** --------- Co-authored-by: Mudit Pandey <[email protected]>
- Loading branch information