PennyLaneAI / pennylane-lightning

The PennyLane-Lightning plugin provides a fast state-vector simulator written in C++ for use with PennyLane
https://docs.pennylane.ai/projects/lightning
Apache License 2.0
95 stars 40 forks source link

Cannot Import Name 'adjoint_ops' from 'pennylane.devices.default_qubit' When Using lightning.qubit Device #860

Open AIdjis opened 3 months ago

AIdjis commented 3 months ago

Issue description

when i use the lightning.qubit device i got the error below i already install pennylane-lightning latest version.

Source code and tracebacks

import pennylane as qml
dev = qml.device("lightning.qubit", wires=2,)
File c:\Users\pc1\anaconda3\envs\quantum\lib\site-packages\pennylane_lightning\lightning_qubit\__init__.py:18
     [14](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/__init__.py:14) """PennyLane lightning_qubit package."""
     [16](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/__init__.py:16) from pennylane_lightning.core import __version__
---> [18](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/__init__.py:18) from .lightning_qubit import LightningQubit

File c:\Users\pc1\anaconda3\envs\quantum\lib\site-packages\pennylane_lightning\lightning_qubit\lightning_qubit.py:25
     [23](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:23) import pennylane as qml
     [24](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:24) from pennylane.devices import DefaultExecutionConfig, Device, ExecutionConfig
---> [25](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:25) from pennylane.devices.default_qubit import adjoint_ops
     [26](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:26) from pennylane.devices.modifiers import simulator_tracking, single_tape_support
...
   (...)
     [34](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:34)     validate_observables,
     [35](file:///C:/Users/pc1/anaconda3/envs/quantum/lib/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:35) )

ImportError: cannot import name 'adjoint_ops' from 'pennylane.devices.default_qubit'

Platform info: Windows-10-10.0.22621-SP0 Python version: 3.10.13 Numpy version: 1.26.4 Scipy version: 1.14.0 Installed devices:

mlxd commented 3 months ago

Hi @AIdjis thanks for reporting this. Can you include the output from the issue template's System Information section?

#### Before posting an issue
...
* *System information:* (post the output of `import pennylane as qml; qml.about()`)