# cuda\_quantum compiler not found: 'PackageNotFoundError: No package metadata was found for cuda\_quantum'

**URL:** <https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670>\
**Category:** Catalyst\
**Created:** [June 26, 2025, 2:25pm UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670 "2025-06-26T14:25:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![minn-bj](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@minn-bj](https://discuss.pennylane.ai/u/minn-bj)\
**Post date:** [June 26, 2025, 2:25pm UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670/1 "2025-06-26T14:25:30Z")

</div>

Hello there,

I was trying to use the cuda\_quantum compiler in combination with jax qjit. Unfortunately, pennnylane can’t find the cuda\_quantum package even though it is installed via ‘pip install cudaq’ (cuda\_quantum does not exist anymore as fare as I can say). The issue occures first when while defining a device that supports the cuda\_quantum compiler. A minimal example is shown below.  
Does a workaround exist?

## Example:

import pennylane as qml  
dev = qml.device(“nvidia.custatevec”, wires=2)

## Error msg:

* * *

StopIteration Traceback (most recent call last)  
File /opt/conda/lib/python3.11/importlib/metadata/ **init**.py:563, in Distribution.from\_name(cls, name)  
562 try:  
 → 563 return next(cls.discover(name=name))  
564 except StopIteration:

StopIteration:

During handling of the above exception, another exception occurred:

PackageNotFoundError Traceback (most recent call last)  
Cell In[1], line 2  
1 import pennylane as qml  
----\> 2 dev = qml.device(“nvidia.custatevec”, wires=2)

File /opt/conda/lib/python3.11/site-packages/pennylane/devices/device\_constructor.py:266, in device(name, \*args, \*\*kwargs)  
260 raise qml.DeviceError(  
261 f"The {name} plugin requires PennyLane versions {required\_versions}, "  
262 f"however PennyLane version {qml.version()} is installed."  
263 )  
265 # Construct the device  
 → 266 dev = plugin\_device\_class(\*args, \*\*options)  
268 # Once the device is constructed, we set its custom expansion function if  
269 # any custom decompositions were specified.  
270 if custom\_decomps is not None:

File /opt/conda/lib/python3.11/site-packages/catalyst/third\_party/cuda/ **init**.py:223, in NvidiaCuStateVec. **init** (self, shots, wires, multi\_gpu)  
221 def **init** (self, shots=None, wires=None, multi\_gpu=False): # pragma: no cover  
222 self.multi\_gpu = multi\_gpu  
 → 223 super(). **init** (wires=wires, shots=shots)

File /opt/conda/lib/python3.11/site-packages/catalyst/third\_party/cuda/ **init**.py:137, in BaseCudaInstructionSet. **init** (self, shots, wires)  
136 def **init** (self, shots=None, wires=None):  
 → 137 \_check\_version\_compatibility()  
138 super(). **init** (wires=wires, shots=shots)

File /opt/conda/lib/python3.11/site-packages/catalyst/third\_party/cuda/ **init**.py:26, in \_check\_version\_compatibility()  
25 def \_check\_version\_compatibility():  
—\> 26 installed\_version = version(“cuda\_quantum”)  
27 compatible\_version = “0.6.0”  
28 if installed\_version != compatible\_version:

File /opt/conda/lib/python3.11/importlib/metadata/ **init**.py:1009, in version(distribution\_name)  
1002 def version(distribution\_name):  
1003 “”“Get the version string for the named package.  
1004  
1005 :param distribution\_name: The name of the distribution package to query.  
1006 :return: The version string for the package as defined in the package’s  
1007 “Version” metadata key.  
1008 “””  
 → 1009 return distribution(distribution\_name).version

File /opt/conda/lib/python3.11/importlib/metadata/ **init**.py:982, in distribution(distribution\_name)  
976 def distribution(distribution\_name):  
977 “”“Get the `Distribution` instance for the named package.  
978  
979 :param distribution\_name: The name of the distribution package as a string.  
980 :return: A `Distribution` instance (or subclass thereof).  
981 “””  
 → 982 return Distribution.from\_name(distribution\_name)

File /opt/conda/lib/python3.11/importlib/metadata/ **init**.py:565, in Distribution.from\_name(cls, name)  
563 return next(cls.discover(name=name))  
564 except StopIteration:  
 → 565 raise PackageNotFoundError(name)

PackageNotFoundError: No package metadata was found for cuda\_quantum

## qml.about():

Name: PennyLane  
Version: 0.41.1  
Summary: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.  
Home-page: [GitHub - PennyLaneAI/pennylane: PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Built by researchers, for research.](https://github.com/PennyLaneAI/pennylane)  
Author:  
Author-email:  
License: Apache License 2.0  
Location: /opt/conda/lib/python3.11/site-packages  
Requires: appdirs, autograd, autoray, cachetools, diastatic-malt, networkx, numpy, packaging, pennylane-lightning, requests, rustworkx, scipy, tomlkit, typing-extensions  
Required-by: PennyLane-Catalyst, PennyLane\_Lightning, PennyLane\_Lightning\_GPU, PennyLane\_Lightning\_Kokkos  
Platform info: Linux-5.15.0-134-generic-x86\_64-with-glibc2.35  
Python version: 3.11.10  
Numpy version: 2.2.6  
Scipy version: 1.16.0  
Installed devices:

- lightning.kokkos (PennyLane\_Lightning\_Kokkos-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)
- lightning.qubit (PennyLane\_Lightning-0.41.1)
- nvidia.custatevec (PennyLane-Catalyst-0.11.0)
- nvidia.cutensornet (PennyLane-Catalyst-0.11.0)
- oqc.cloud (PennyLane-Catalyst-0.11.0)
- softwareq.qpp (PennyLane-Catalyst-0.11.0)
- lightning.gpu (PennyLane\_Lightning\_GPU-0.41.1)

---

<div class="post-metadata">

**Author:** ![David\_Ittah](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/david_ittah/32/2395_2.png) [@David\_Ittah](https://discuss.pennylane.ai/u/David_Ittah)\
**Post date:** [June 27, 2025, 3:25pm UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670/2 "2025-06-27T15:25:15Z")

</div>

Hi @minn-bj, thank you for bringing up this issue. The cuda-quantum support in PennyLane is limited to version `0.6.0` of the package, it will not work with `cudaq`. You can download install it from here: [cuda-quantum·PyPI](https://pypi.org/project/cuda-quantum/0.6.0/)

I don’t know of any current plans to update the support to newer versions.

---

<div class="post-metadata">

**Author:** ![minn-bj](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@minn-bj](https://discuss.pennylane.ai/u/minn-bj)\
**Post date:** [July 16, 2025, 2:30pm UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670/3 "2025-07-16T14:30:25Z")

</div>

Hey David\_Ittah, thank you for your quick responds. I just [read](https://docs.pennylane.ai/en/stable/introduction/compiling_workflows.html#cuda-quantum) that cuda\_quantum does potentially not support gradient computations. Is that (still) true?

Is it possible to accelerate a ML training routine by compiling it on a GPU with finite difference diff-method?

Best regards.

---

<div class="post-metadata">

**Author:** ![mlxd](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlxd/32/526_2.png) [@mlxd](https://discuss.pennylane.ai/u/mlxd)\
**Post date:** [July 17, 2025, 9:13pm UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670/4 "2025-07-17T21:13:47Z")

</div>

Hi @minn-bj

If you are looking to execute quantum circuits on GPUs with gradients, the [`lightning.gpu`](https://docs.pennylane.ai/projects/lightning/en/latest/lightning_gpu/device.html) device should be quite efficient — it supports [adjoint differentiation](https://pennylane.ai/qml/demos/tutorial_adjoint_diff) natively and runs on the cuStateVec library, which should be efficient on Nvidia GPUs.

Additionally, you can also use the [`lightning.kokkos`](https://docs.pennylane.ai/projects/lightning/en/latest/lightning_kokkos/device.html) device with the CUDA backend. This requires some manual compilation (see [Lightning-Kokkos installation — Lightning 0.42.0 documentation](https://docs.pennylane.ai/projects/lightning/en/stable/lightning_kokkos/installation.html)), but should also support efficient gradient evaluations, and can run on any GPU device supported by [Kokkos documentation](https://kokkos.org/kokkos-core-wiki/)

If you have trouble using either of these devices, feel free to share a workload and we can take a look.

---

<div class="post-metadata">

**Author:** ![minn-bj](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@minn-bj](https://discuss.pennylane.ai/u/minn-bj)\
**Post date:** [July 18, 2025, 7:18am UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670/5 "2025-07-18T07:18:25Z")

</div>

Hello @mlxd,

thank you for your comment. I already considered this but the lightning.gpu method is for intermediate sized circuits 10-16 qubits much slower than e.g. the GPU usage with the default.qubit in jax or pytorch. My goal is to train a hybrid QML model on a quite large dataset. Each batch optimization (batch\_size ~1000) needs to be faster than ~ 1 sec. In the case of a circuit with 12~16 Qubits, the Lightning GPU device seams to be significantly slower than other simulators. Therefore I thought to try the cuda\_quantum compiler. Is cuda\_quantum the right choice for my goals and do you have any further recommendations to speed up my calculations (CPU and/or GPU)?

Best regards,

minn-bj

---

<div class="post-metadata">

**Author:** ![mlxd](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlxd/32/526_2.png) [@mlxd](https://discuss.pennylane.ai/u/mlxd)\
**Post date:** [July 18, 2025, 6:13pm UTC](https://discuss.pennylane.ai/t/cuda-quantum-compiler-not-found-packagenotfounderror-no-package-metadata-was-found-for-cuda-quantum/8670/6 "2025-07-18T18:13:56Z")

</div>

Hi @minn-bj

Thanks for the context. Yes, as `lightning.gpu` is more suited for larger HPC workloads, we see performance beating other approaches beyond the 18-20 qubits barrier. This was observed to be the case with Nvidia’s custatevec, the CUDA library we use with lightning.gpu, so I’m not sure if using cuda\_quantum will help here, as the limitation may persist.

I’m not sure how your workload is configured, but there may be some gains to be had using [catalyst.accelerate — Catalyst 0.13.0-dev11 documentation](https://docs.pennylane.ai/projects/catalyst/en/latest/code/api/catalyst.accelerate.html)

This allows catalyst to offload computation to the GPU, if supported, for specific function uses.  
While this is no guarantee, it could be possible yield somewhat improved performance using the `lightning.kokkos` CUDA backend, but I suspect this will run into the same issues as custatevec, given the smaller size of the problem.

For CPU scaling, you can try the `lightning.kokkos` backend, which will use OpenMP by default for all gate and measurement processes. If you wish to try `lightning.qubit` with OpenMP, my responses [here](https://discuss.pennylane.ai/t/multi-core-computation-with-lightning-qubit-and-openmp-support/8776) should help.

Feel free to let us know if the above help, or if there’s any minimum example workload we can see to offer more suggestions.
