67 # check if cpp library for gradient computation exists
—> 69 from pennylane_lightning.lightning_qubit_ops import (
ImportError: cannot import name ‘adjoint_diff’ from ‘pennylane_lightning.lightning_qubit_ops’ (/usr/local/lib/python3.10/dist-packages/pennylane_lightning/lightning_qubit_ops.cpython-310-x86_64-linux-gnu.so)
Adjoint differentiation is typically applied with qnode decorators such as @qml.qnode(dev, diff_method=“adjoint”). Could you provide more detail of where you would like to apply adjoint in the code?
Can you provide the output of
qml.about()? Also, if you have a minimum working script that reproduces the error this can help us identify the cause of the issue.
I suspect this may be a version mismatch, and if so you can ensure your version of PennyLane and lightning.gpu are at the same version with
python -m pip install pennylane pennylane-lightning-gpu --upgrade.
Thanks. It was a version mismatch between PennyLane and lightning.gpu from a library package.
Problem solved. It was a version mismatch between PennyLane and lightning.gpu from a library package.
Thank you for letting us know that this solved your issue @David_Liu !
We have a new PennyLane survey. We would love to know your thoughts about PennyLane in order to keep bringing you amazing features .