Instaling default.qubit.torch

Hello, I would like to try default.qubit.torch on a gpu device in my code using

self.dev = qml.device('default.qubit.torch', wires=wires, torch_device=self.device)

I however got the error message

  File "/CT/QDM/work/conda/miniforge3/envs/QDM/lib/python3.13/site-packages/pennylane/devices/device_constructor.py", line 287, in device
    raise qml.DeviceError(
        f"Device {name} does not exist. Make sure the required plugin is installed."
    )

The output of qml.about() indeed shows that such a device is not present

Python version:          3.13.5
Numpy version:           2.2.6
Scipy version:           1.15.3
Installed devices:
- lightning.gpu (PennyLane_Lightning_GPU-0.41.1)
- lightning.qubit (PennyLane_Lightning-0.41.1)
- default.clifford (PennyLane-0.41.1)
- default.gaussian (PennyLane-0.41.1)
- default.mixed (PennyLane-0.41.1)
- default.qubit (PennyLane-0.41.1)
- default.qutrit (PennyLane-0.41.1)
- default.qutrit.mixed (PennyLane-0.41.1)
- default.tensor (PennyLane-0.41.1)
- null.qubit (PennyLane-0.41.1)
- reference.qubit (PennyLane-0.41.1)

Could you help me on how to install that?

Seeing this reply on “Question on data parallelization”, it seems to me that default.qubit.torch is not avilable in the latest versions of pennylane.

Hi @shasa, welcome to the Forum!

I wanted to confirm that Torch is indeed still compatible with PennyLane. The main difference is that you no longer need to specify default.qubit.torch. You can now just use default.qubit and PennyLane will know to use the Torch interface if your input data and parameters are Torch tensors.

Let me know if this is enough to fix the issue. Otherwise, can you please share the Torch version that you’re using?

I hope this helps!

Thanks for confirming that.

1 Like