# Pennylane Lightning.gpu simulator

**URL:** https://discuss.pennylane.ai/t/pennylane-lightning-gpu-simulator/2306
**Category:** PennyLane Help
**Created:** [November 22, 2022, 2:41pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-simulator/2306 "2022-11-22T14:41:19Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![aouie](https://avatars.discourse-cdn.com/v4/letter/a/a9a28c/32.png) [@aouie](https://discuss.pennylane.ai/u/aouie)
#### Post date: [November 22, 2022, 2:41pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-simulator/2306/1 "2022-11-22T14:41:19Z")

</div>

Hello! I am encountering an error whenever I try to use lightning.gpu simulator instead of lightning.qubit simulator.  
This is the version information:  
Name: PennyLane  
Version: 0.23.1  
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.](https://github.com/XanaduAI/pennylane)  
Author: None  
Author-email: None  
License: Apache License 2.0  
Location: /home/jay/.local/lib/python3.8/site-packages  
Requires: semantic-version, networkx, pennylane-lightning, appdirs, scipy, numpy, toml, autoray, retworkx, autograd, cachetools  
Required-by: PennyLane-Lightning, PennyLane-Lightning-GPU

Platform info: Linux-5.15.0-50-generic-x86\_64-with-glibc2.29  
Python version: 3.8.10  
Numpy version: 1.22.3  
Scipy version: 1.8.0  
Installed devices:

- default.gaussian (PennyLane-0.23.1)
- default.mixed (PennyLane-0.23.1)
- default.qubit (PennyLane-0.23.1)
- default.qubit.autograd (PennyLane-0.23.1)
- default.qubit.jax (PennyLane-0.23.1)
- default.qubit.tf (PennyLane-0.23.1)
- default.qubit.torch (PennyLane-0.23.1)
- lightning.qubit (PennyLane-Lightning-0.23.0)
- lightning.gpu (PennyLane-Lightning-GPU-0.26.0)  
[PhysicalDevice(name=‘/physical\_device:GPU:0’, device\_type=‘GPU’),  
PhysicalDevice(name=‘/physical\_device:GPU:1’, device\_type=‘GPU’)]

This is the code:

```auto
n_qubits =10
dev = qml.device("lightning.gpu", wires=n_qubits)
tf.keras.backend.set_floatx('float64')
@qml.qnode(dev, diff_method="adjoint")
def qnode(inputs, weights):
    QAOAEmbedding(features=inputs, weights=weights, local_field='Z', wires=range(n_qubits))
    return [qml.expval(qml.PauliZ(wires=i)) for i in range(n_qubits)]

```

And this is the error:

> TypeError Traceback (most recent call last)  
> Input In [12], in \<cell line: 2\>()  
> 1 n\_qubits =10  
> ----\> 2 dev = qml.device(“lightning.gpu”, wires=n\_qubits)  
> 3 tf.keras.backend.set\_floatx(‘float64’)  
> 4 @qml.qnode(dev, diff\_method=“adjoint”)  
> 5 def qnode(inputs, weights):

File ~/.local/lib/python3.8/site-packages/pennylane/ **init**.py:306, in device(name, \*args, \*\*kwargs)  
300 raise DeviceError(  
301 f"The {name} plugin requires PennyLane versions {plugin\_device\_class.pennylane\_requires}, "  
302 f"however PennyLane version { **version** } is installed."  
303 )  
305 # Construct the device  
 → 306 dev = plugin\_device\_class(\*args, \*\*options)  
308 # Once the device is constructed, we set its custom expansion function if  
309 # any custom decompositions were specified.  
310 if custom\_decomps is not None:

File ~/.local/lib/python3.8/site-packages/pennylane\_lightning\_gpu/lightning\_gpu.py:128, in LightningGPU. **init** (self, wires, sync, c\_dtype, shots, batch\_obs)  
127 def **init** (self, wires, \*, sync=True, c\_dtype=np.complex128, shots=None, batch\_obs=False):  
 → 128 super(). **init** (wires, c\_dtype=c\_dtype, shots=shots)  
129 self.\_gpu\_state = \_gpu\_dtype(self.\_state.dtype)(self.\_state)  
130 self.\_sync = sync

TypeError: **init** () got an unexpected keyword argument ‘c\_dtype’

How can I fix this? Thank you

---

<div class="post-metadata">

### Author: ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)
#### Post date: [November 23, 2022, 3:53pm UTC](https://discuss.pennylane.ai/t/pennylane-lightning-gpu-simulator/2306/2 "2022-11-23T15:53:57Z")

</div>

Hi @aouie, I see that you’re using a very old version of PennyLane. The current version is 0.27. Do you get the same error if you update the version?
