Hi! Pennylane new release 0.32 doesn’t support GPU? With the last version I have no problems.
dev_train = qml.device("lightning.gpu", wires=WIRES + 1, shots=SHOTS)
If you want help with diagnosing an error, please put the full error message below:
ImportError Traceback (most recent call last)
Cell In[41], line 1
----> 1 dev_train = qml.device("lightning.gpu", wires=WIRES + 1, shots=SHOTS)
File ~/.local/lib/python3.10/site-packages/pennylane/__init__.py:336, in device(name, *args, **kwargs)
333 options.update(kwargs)
335 # loads the device class
--> 336 plugin_device_class = plugin_devices[name].load()
338 if Version(version()) not in SimpleSpec(plugin_device_class.pennylane_requires):
339 raise DeviceError(
340 f"The {name} plugin requires PennyLane versions {plugin_device_class.pennylane_requires}, "
341 f"however PennyLane version {__version__} is installed."
342 )
File /usr/lib/python3/dist-packages/pkg_resources/__init__.py:2465, in EntryPoint.load(self, require, *args, **kwargs)
2463 if require:
2464 self.require(*args, **kwargs)
-> 2465 return self.resolve()
File /usr/lib/python3/dist-packages/pkg_resources/__init__.py:2471, in EntryPoint.resolve(self)
2467 def resolve(self):
2468 """
2469 Resolve the entry point from its module and attrs.
2470 """
-> 2471 module = __import__(self.module_name, fromlist=['__name__'], level=0)
2472 try:
2473 return functools.reduce(getattr, self.attrs, module)
File ~/.local/lib/python3.10/site-packages/pennylane_lightning_gpu/__init__.py:17
14 """Top level PennyLane-Lightning-GPU module."""
16 from ._version import __version__
---> 17 from .lightning_gpu import LightningGPU
File ~/.local/lib/python3.10/site-packages/pennylane_lightning_gpu/lightning_gpu.py:38
24 import concurrent.futures
26 from pennylane import (
27 math,
28 QubitDevice,
(...)
36 QubitStateVector,
37 )
---> 38 from pennylane_lightning import LightningQubit
39 from pennylane.operation import Tensor, Operation
40 from pennylane.ops.op_math import Adjoint
ImportError: cannot import name 'LightningQubit' from 'pennylane_lightning' (unknown location)
And, finally, make sure to include the versions of your packages. Specifically, show us the output of qml.about()
.
Pennylane INFO
Name: PennyLane
Version: 0.32.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: GitHub - PennyLaneAI/pennylane: PennyLane is a cross-platform Python library for differentiable programming of quantum computers. Train a quantum computer the same way as a neural network.
Author:
Author-email:
License: Apache License 2.0
Location: /home/contepablod/.local/lib/python3.10/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml, typing-extensions
Required-by: PennyLane-Lightning, PennyLane-Lightning-GPU, PennyLane-qiskit
Platform info: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python version: 3.10.12
Numpy version: 1.23.5
Scipy version: 1.10.0
Installed devices:
- lightning.qubit (PennyLane-Lightning-0.32.0)
- default.gaussian (PennyLane-0.32.0)
- default.mixed (PennyLane-0.32.0)
- default.qubit (PennyLane-0.32.0)
- default.qubit.autograd (PennyLane-0.32.0)
- default.qubit.jax (PennyLane-0.32.0)
- default.qubit.tf (PennyLane-0.32.0)
- default.qubit.torch (PennyLane-0.32.0)
- default.qutrit (PennyLane-0.32.0)
- null.qubit (PennyLane-0.32.0)
- qiskit.aer (PennyLane-qiskit-0.30.1)
- qiskit.basicaer (PennyLane-qiskit-0.30.1)
- qiskit.ibmq (PennyLane-qiskit-0.30.1)
- qiskit.ibmq.circuit_runner (PennyLane-qiskit-0.30.1)
- qiskit.ibmq.sampler (PennyLane-qiskit-0.30.1)
- lightning.gpu (PennyLane-Lightning-GPU-0.30.0)