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 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_cu13-0.15.1-cp313-cp313-manylinux_2_28_x86_64.whl (126.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

cuda_quantum_cu13-0.15.1-cp313-cp313-manylinux_2_28_aarch64.whl (113.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

cuda_quantum_cu13-0.15.1-cp313-cp313-macosx_13_0_arm64.whl (86.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

cuda_quantum_cu13-0.15.1-cp312-cp312-manylinux_2_28_x86_64.whl (126.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

cuda_quantum_cu13-0.15.1-cp312-cp312-manylinux_2_28_aarch64.whl (113.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

cuda_quantum_cu13-0.15.1-cp312-cp312-macosx_13_0_arm64.whl (86.6 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

cuda_quantum_cu13-0.15.1-cp311-cp311-manylinux_2_28_x86_64.whl (126.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

cuda_quantum_cu13-0.15.1-cp311-cp311-manylinux_2_28_aarch64.whl (113.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

cuda_quantum_cu13-0.15.1-cp311-cp311-macosx_13_0_arm64.whl (86.6 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

Details for the file cuda_quantum_cu13-0.15.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 03413d9869e1f81458564c33d1e81dfb5a3df8b0693528d26e6948bbcf8bfac6
MD5 34db2825f1d677c36810f611b45e814d
BLAKE2b-256 0c58939ff59601181e0f11e107a7fbfe21211123d0a71e91ef55ce172f267351

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7be42f47cc4a80ee927aaa5567eae78f89b4c5520f572ecb2425ef359ec0e05b
MD5 0983adde405e8ca4184bd40a503da518
BLAKE2b-256 c98a261a0a8e6f5089c472b3a98164c9c114f0264dccb3cfbcbb01d3b11081c9

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp313-cp313-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 a7032bfa3f418d19a28b294713960bec962b837cff451c3694153050d8281588
MD5 88684b684ebc611b31f7232956b694c8
BLAKE2b-256 b11c8d7ac84d1aeb71c61ddf64cc67ff1ac4dc86f9968ccacb5dd53eec519853

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5cd9b83d79db7b63488797246880acf6703d4ac5a13ff6dab3b53c74f39fd9b7
MD5 5f387a35d308a0db652da9565989a53c
BLAKE2b-256 51305d6b204d11874a93e6adfcb4e7839fb2a6f90c29dbd8dffcfdd60bd904b3

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d49a2c5135753112fbeaa122e327848d83db6c0228083393fe4db63bcf5b472e
MD5 0b7992e7325b86741d7e2d1210a9b315
BLAKE2b-256 c1d5a96eb262da6a320c0ba78309f71f969291cfed09e7ffdc1b32e6a7b38f05

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 b8cd70b8e0a29f3c0d6eb961264a1081d56acd280baa3f6a4b2de0e822dea63e
MD5 0e0d6478ac91924a70eb8b900dec612e
BLAKE2b-256 b821a4beb33d4216ba983ca4454679ec00bfc52ff4efe5e83696328b2dc7b6dd

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 74ac61012b4ddae110e4adcdb89fc1271c39be5c0ce494e472819007953de30a
MD5 f30115ab54fe81024d6c493d0107f117
BLAKE2b-256 88086e44ea7aafd15bb72cbe67daa6994c62f4046eb04b664100843b9aeb2163

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8c93d5dc697d05f5769a7152a114d7f2595a6e1cf7db11ced4af2f77f3f6dbee
MD5 c8c90f3afdc5536ede947c050a98a580
BLAKE2b-256 f7062b4ab9fc9ffb31f7af548f1189963e0328a1f8bf21d0036dbd6cc63305bb

See more details on using hashes here.

File details

Details for the file cuda_quantum_cu13-0.15.1-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.1-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 74b56e2840817ef6a233a14cd1248682130bfc0ffbed7bdcb1937c0704d2d035
MD5 b26777061d7c8d31e5685a5c5f965cd9
BLAKE2b-256 2c49c89be5aabc14d85225b1213440bd0ad7ef88ddd4577fca87af6bbf216fee

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page