Skip to main content

Welcome to the CUDA-Q Python API

CUDA-Q is a comprehensive framework for quantum programming. It features:

  • A programming model which extends C++ and Python with quantum kernels, enabling high-level programming in familiar languages
  • A high-performance quantum compiler, nvq++, based on the industry standard LLVM toolchain
  • Interoperability with all of the leading models and tools for accelerated computing, including CUDA, ISO standard parallelism, OpenMP, and OpenACC
  • The ability to utilize and seamlessly switch between different quantum technologies, including state-of-the-art simulator backends with NVIDIA cuQuantum and a number of different physical quantum processors (QPUs)

The CUDA-Q Python wheels contain the Python API and core components of CUDA-Q. This package installs CUDA-Q binaries that are compatible with a CUDA version ${{ cuda_version_requirement }}. More information about available packages as well as a link to the documentation and examples for each version can be found in the release notes. System and compatibility requirements are listed in the Installation Guide of the linked documentation.

Note: CUDA-Q is supported on Linux (x86_64 and aarch64/arm64) and macOS (ARM64/Apple silicon, CPU-only simulation). GPU-accelerated simulation requires Linux with a supported NVIDIA GPU.

Installation Including GPU-Acceleration

CUDA-Q does not require a GPU to use, but some components are GPU-accelerated. Getting started with CUDA-Q requires pip install ${{ package_name }}. Please make sure your pip version is >= 24.0.

${{ deprecation_notice }}

Important: Please check if you have an existing installation of the cuda-quantum, cudaq-quantum-cu11, cuda-quantum-cu12, or cuda-quantum-cu13 package, and uninstall it prior to installation. Different CUDA-Q binary distributions may conflict with each other causing issues.

Platform-specific instructions: Linux | macOS

Linux: GPU-Acceleration and Multi-GPU

If you have an NVIDIA GPU on your host system, you will be able to use it without any further installation steps.

If you want to perform multi-GPU simulations, additional components must be installed. We recommend using Conda to do so. If you are not already using Conda, you can install a minimal version following Miniconda instructions here. The following commands will create and activate a complete environment for CUDA-Q with all its dependencies:

cuda_version=${{ cuda_version_conda }} # set this variable to version ${{ cuda_version_requirement }}
conda create -y -n cudaq-env python=3.11 pip
conda install -y -n cudaq-env -c "nvidia/label/cuda-${cuda_version}" cuda
conda install -y -n cudaq-env -c conda-forge --strict-channel-priority mpi4py openmpi">=5.0.3" cxx-compiler
conda env config vars set -n cudaq-env LD_LIBRARY_PATH="$CONDA_PREFIX/envs/cudaq-env/lib:$LD_LIBRARY_PATH"
conda env config vars set -n cudaq-env MPI_PATH=$CONDA_PREFIX/envs/cudaq-env
conda activate cudaq-env
pip install ${{ package_name }}
source $CONDA_PREFIX/lib/python3.11/site-packages/distributed_interfaces/activate_custom_mpi.sh

Warning (conda-forge): Installing cudaq from the conda-forge channel on recent versions of Python can lead to segmentation faults. If you see such errors, please switch to one of the Python versions 3.11.10 or 3.12.7 as per the issue #2999 or #3104.

You must configure MPI by setting the following environment variables:

export OMPI_MCA_opal_cuda_support=true OMPI_MCA_btl='^openib'

If you do not set these variables you may encounter a segmentation fault.

Important: It is not sufficient to set these variable within the Conda environment, like the commands above do for LD_LIBRARY_PATH. To avoid having to set them every time you launch a new shell, we recommend adding them to ~/.profile (create the file if it does not exist), and to ~/.bash_profile or ~/.bash_login if such a file exists.

macOS

GPU-acceleration is not available on macOS, so a virtual environment is all you need:

python3 -m venv .venv
source .venv/bin/activate
pip install cudaq

MPI uses SSH or RSH to communicate with each node unless another resource manager, such as SLURM, is used. If you are encountering an error "The value of the MCA parameter plm_rsh_agent was set to a path that could not be found", please make sure you have an SSH Client installed.

Running CUDA-Q

You should now be able to import CUDA-Q and start building quantum programs in Python!

import cudaq

kernel = cudaq.make_kernel()
qubit = kernel.qalloc()
kernel.x(qubit)
kernel.mz(qubit)

result = cudaq.sample(kernel)

Additional examples and documentation are linked in the release notes.

Contributing

There are many ways in which you can get involved with CUDA-Q. If you are interested in developing quantum applications with CUDA-Q, our GitHub repository is a great place to get started! For more information about contributing to the CUDA-Q platform, please take a look at Contributing.md.

License

CUDA-Q is an open source project. The source code is available on GitHub and licensed under Apache License 2.0. CUDA-Q makes use of the NVIDIA cuQuantum SDK to enable high-performance simulation, which is held to its own respective license.

Feedback

Please let us know your feedback and ideas for the CUDA-Q platform in the Discussions tab of our GitHub repository, or file an issue. To report security concerns please reach out to cuda-quantum@nvidia.com.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cuda_quantum_cu12-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl (92.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

cuda_quantum_cu12-0.16.0-cp314-cp314-manylinux_2_28_aarch64.whl (80.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ ARM64

cuda_quantum_cu12-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl (92.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

cuda_quantum_cu12-0.16.0-cp313-cp313-manylinux_2_28_aarch64.whl (80.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

cuda_quantum_cu12-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl (92.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

cuda_quantum_cu12-0.16.0-cp312-cp312-manylinux_2_28_aarch64.whl (80.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

cuda_quantum_cu12-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl (92.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

cuda_quantum_cu12-0.16.0-cp311-cp311-manylinux_2_28_aarch64.whl (80.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

File details

Details for the file cuda_quantum_cu12-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad12e23b84ef8864105a43e20b6da79a1e1cad9fc3b6e8dd627346bb31ad8f38
MD5 60b57e2d261e567de109e34b5a39e8b3
BLAKE2b-256 f3eb6f4aa8e12ff3a61704827e48ea7c24b9c625a5bb113d8cf91727b83d7937

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9afa93b6d0635847c5bb76b7c6dc5a18246034a7a14652e5e1c5688be496796e
MD5 cce7ff3de4682f73156d2b8135840d9d
BLAKE2b-256 93e90ffea8bb447f22351fa95ab6754af668ee7bbebd2e315ddd4bb10889ac12

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fc6449f7f434affcb6033f4ac1c1f23035095db9df36701112df8926eb87e62d
MD5 34bcf7f8db3dfebb2515e6506ee5180f
BLAKE2b-256 22629a4b7614c447339e826759a3fb4385d537a25517a048c8586492aec564de

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bea77a48d6b4e4b7e14e16f7f04081e5c8cf77d58a12017a01818a122757aae5
MD5 421449d7873b73da177dbc45d141e8c7
BLAKE2b-256 ce49a6e3602bd2b064bff7689ee62ce416c71c8457bac7a4a67af48a558342af

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 069240a693c1da8d47ba2d75b926ed78dd01cba726056687d9f8cde880b14046
MD5 2e52556e4cb0b9aeea996d02a586456c
BLAKE2b-256 638c2e5a14556d9e031e089e1fb2c8629271918d7ac52d6f05f69b8acdd30aac

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6a8a4365c552ae3df55c181262ce67d3fc1aca65f7cf0126f0300c8115f0a256
MD5 a4f7ba3d38f9fdf73a43aa2b96bd54e0
BLAKE2b-256 0a9c04e47dfadd26196a27e212ce9e260983fc328790de8e3491dfabb238155f

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a9182a36c66ad888e72205db8253fd007e3d5260183231406a905ea82d4e443
MD5 4c3a126322575a1883bf6322b5db9a2b
BLAKE2b-256 3844a471f921bd7fd852fe65e8fd3f4b1bb42aba769250c84293347a7cafb1cf

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu12-0.16.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu12-0.16.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1edba416b41e41507fb4b8bf3467d390e3209794cbd907e5db0c54c44dbaf684
MD5 d757f350cc804a6817cf836f3ea0b2d8
BLAKE2b-256 3e25a7e48aa7ab19190c781b9e0f2570ffbc64c2d8b608555f60f56346f66576

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.16.0 This release

8 files

0.15.1

6 files

0.15.0

6 files

0.14.2

6 files

0.14.0

7 files

0.13.0

6 files

0.12.0.post1

8 files

0.12.0

8 files

0.11.0

6 files

0.10.0

6 files

0.9.1

6 files

0.9.0

1 file

0.0.0a0

1 file

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