67 # check if cpp library for gradient computation exists
68 try:
—> 69 from pennylane_lightning.lightning_qubit_ops import (
70 adjoint_diff,
71 StateVectorC64,
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)
Hello @David_Liu,
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.