Skip to main content

qrisp-cudaq

CUDA-Q backend for Eclipse Qrisp. It compiles Qrisp programs to the Quake MLIR dialect of CUDA-Q and runs them as native CUDA-Q kernels.

Installation

pip install qrisp[cudaq]

This installs Qrisp together with qrisp-cudaq. CUDA-Q supports Linux (x86_64 and aarch64) and macOS on Apple silicon (CPU simulation only), with Python 3.11 or later. Windows is not supported.

Simulation targets

CUDA-Q is built for GPU-accelerated simulation and for quantum hardware. On a machine with an NVIDIA GPU, CUDA-Q uses its GPU state-vector simulator by default. The CUDA-Q backends page lists all simulators and hardware backends.

Without an NVIDIA GPU, for example on macOS, CUDA-Q falls back to its CPU simulator qpp-cpu, which the CUDA-Q documentation describes as good "for basic testing and experimentation with just a few qubits". Expect it to become slow from around 20 qubits, in particular with cudaq.run, which simulates the kernel again for every shot.

If a kernel does not use any measurement result inside the kernel, @cudaq_kernel(execution_mode="sample") together with cudaq.sample simulates it once and returns the counts of the measured bitstrings for all shots. Kernels that use measurement results inside the kernel need the default execution_mode="run". This includes much of Qrisp's arithmetic, which uncomputes auxiliary qubits with mid-circuit measurements.

Example

import cudaq
from qrisp import QuantumFloat, h, measure
from qrisp_cudaq import cudaq_kernel


@cudaq_kernel
def main(k: int):
    a = QuantumFloat(3)
    h(a)  # a is in superposition of 0, 1, ..., 7
    b = QuantumFloat(4)
    b[:] = k
    b += a  # adds all eight values of a to k at once
    return measure(a), measure(b)


print(cudaq.run(main, 5, shots_count=5))
# [(1.0, 6.0), (3.0, 8.0), (0.0, 5.0), (4.0, 9.0), (1.0, 6.0)]

Troubleshooting

LLVM ERROR: Option 'default' already exists! on import

On Linux, importing cudaq and Qrisp in the same process can abort with this message. It happens when numba and llvmlite were installed from conda-forge. That build of llvmlite loads LLVM as a shared library, which clashes with the LLVM inside CUDA-Q (NVIDIA/cuda-quantum#2420). Qrisp imports numba, so import cudaq followed by import qrisp is enough to trigger it.

The llvmlite wheels on PyPI link LLVM statically and do not clash. Replace the conda-forge packages with the PyPI wheels of the same versions, so that packages depending on them keep working. With numba 0.60.0 and llvmlite 0.43.0 installed, that is:

conda list | grep -E "numba|llvmlite"  # shows the installed versions
pip install --force-reinstall --no-deps numba==0.60.0 llvmlite==0.43.0
python -c "import cudaq, numba"  # aborts before the fix, succeeds after

Documentation

The CUDA-Q tutorial and API reference are part of the Qrisp documentation at qrisp.eu.

License

EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0

Metadata

Release files for qrisp-cudaq 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qrisp-cudaq 0.2.0
File Size Uploaded Provenance Actions
qrisp_cudaq-0.2.0.tar.gz 87.1 kB With provenance Details for qrisp_cudaq-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qrisp-cudaq 0.2.0
File Interpreter ABI Platform Actions
qrisp_cudaq-0.2.0-py3-none-any.whl Python 3 none any Details for qrisp_cudaq-0.2.0-py3-none-any.whl

Total release size: 170.9 kB

Release files / qrisp_cudaq-0.2.0.tar.gz

Download URL qrisp_cudaq-0.2.0.tar.gz
Size 87.1 kB
Tags Source
SHA-256 checksum
How to use checksums
17146ca5470456c76455cf24f643c2c019ae116eb2f1e42612189fafc2ff66f3
BLAKE2b-256 checksum
How to use checksums
cf39bcda590f953354650408e4c203e07e0745db6c4da50f70d89c1eba44f4dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / qrisp_cudaq-0.2.0-py3-none-any.whl

Download URL qrisp_cudaq-0.2.0-py3-none-any.whl
Size 83.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
75c4495d1ed8eda37143a83a1c9d174faba240fa9d61c2defcebfd8a7a3bce16
BLAKE2b-256 checksum
How to use checksums
8a37c0a5c5d777cb38eada766e9b014ffab3aade1575f80e3726b717ca29292f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for qrisp-cudaq 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for qrisp_cudaq-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page