-
Notifications
You must be signed in to change notification settings - Fork 604
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
[BUG] Metric tensor fails under certain combinations of device and differentiation method #5901
Comments
The metric tensor converts to measuring probabilities, and adjoint is only compatible with measuring expectation values. lightning does not support backprop at all, as expected. As for the issue posted above, this is the same issue we encountered last release cycle in #5624. We added a lightning specific patch, but obviously this issue is still an issue and now causing problems with |
@albi3ro does |
So the issue with Potentially @rmoyard might shed some light on why we can't call |
It is a final transform because no other user transform is compatible with it but it might work with the device preprocessing. It is worth giving it a try. |
What would be the difference between a user decomposing to a target gateset and a device decomposing to the target gateset? Or splitting up the measurements? They do the same thing regardless of who is requesting the transform is applied. Though I guess I'm still a little confused about why it isn't compatible with other transforms. Does it have to do with the classical jacobian component? |
Expected behavior
I expect the code below to work with both lightning.qubit and default.qubit for any differentiation method. However qml.metric_tensor is failing for the cases outlined in the table below.
Actual behavior
The table below shows Yes if the combination of diff_method and device works or No if it doesn't.
The exact error that shows up depends on the combination of device and method.
Additional information
This was originally reported as part of this forum post.
This issue might be the cause for QNGO to fail in many of these cases.
Source code
Tracebacks
System information
Name: PennyLane Version: 0.36.0 Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network. Home-page: https://github.com/PennyLaneAI/pennylane Author: Author-email: License: Apache License 2.0 Location: /usr/local/lib/python3.10/dist-packages Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions Required-by: PennyLane_Lightning Platform info: Linux-6.1.85+-x86_64-with-glibc2.35 Python version: 3.10.12 Numpy version: 1.25.2 Scipy version: 1.11.4 Installed devices: - default.clifford (PennyLane-0.36.0) - default.gaussian (PennyLane-0.36.0) - default.mixed (PennyLane-0.36.0) - default.qubit (PennyLane-0.36.0) - default.qubit.autograd (PennyLane-0.36.0) - default.qubit.jax (PennyLane-0.36.0) - default.qubit.legacy (PennyLane-0.36.0) - default.qubit.tf (PennyLane-0.36.0) - default.qubit.torch (PennyLane-0.36.0) - default.qutrit (PennyLane-0.36.0) - default.qutrit.mixed (PennyLane-0.36.0) - null.qubit (PennyLane-0.36.0) - lightning.qubit (PennyLane_Lightning-0.36.0)
Existing GitHub issues
The text was updated successfully, but these errors were encountered: