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.0-cp313-cp313-manylinux_2_28_x86_64.whl (125.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

cuda_quantum_cu13-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl (113.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

cuda_quantum_cu13-0.15.0-cp313-cp313-macosx_13_0_arm64.whl (86.2 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64

cuda_quantum_cu13-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl (125.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

cuda_quantum_cu13-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl (113.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

cuda_quantum_cu13-0.15.0-cp312-cp312-macosx_13_0_arm64.whl (86.2 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

cuda_quantum_cu13-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl (125.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

cuda_quantum_cu13-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl (113.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

cuda_quantum_cu13-0.15.0-cp311-cp311-macosx_13_0_arm64.whl (86.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6cd0411a14979067358683b7793a29eae4c8c02d2799a94e75b51843018a2bf6
MD5 deff03b5e08a63fc1b3611523f368e41
BLAKE2b-256 976f29a11cb037f036caa4c03eb396a4d6fee689bfce74e2977dc89c569c0ebf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 59ae648b0b8a0403f432247ac18f2d6797ac1b00b2b1de93caadd7d3958724b1
MD5 b3eb7d7141d07dbdefb494b3b5acadcc
BLAKE2b-256 1b7035072c3e14b37fdfc991506461ce5bbfc94ad7325756f8e66d5da7458450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp313-cp313-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 37d6c7169c313ece6b1c4d13fd317c5b3841af1a2f2adc3f056cfa522b005018
MD5 f387cf018fea885bfdd2d85ad6c94e13
BLAKE2b-256 b72ad5cb0ac158b5b3c187ec537ad78550e132f84f525c89b3ae2d281573bda4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b6527d127f781e819a86237e670f6bfe2ed63b3d4d0f105b8740f3b210594441
MD5 9e065627d0189ec0b7c4e06c733c6f62
BLAKE2b-256 7a4b251b3fcf73763bf7922b253585e8b93c741c209ca267d5e5bb3963afcd3e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fea287c640e4dfa5e6a6ebe933c18d2770b8b802d70cdf5d716dc9f846be6ca5
MD5 fb751defeec060d4fe36d0721012b075
BLAKE2b-256 992e4e049f918bbd64880c64edb20b6b91e597a0aff5ba780e4850d3d39a44b2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 d2a01548302093f3dd2bfb858959d0207e87353f03874f2823cd540d76832094
MD5 b3bf5871fced09161c320107dc4ee3cb
BLAKE2b-256 185b5793f0ead574d550292257b428073a731b98db758b33fb6699d6cba079b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2832b6493daedca4f9cfe8e2118540d22015188ace5da80c6432d8e9db6125b1
MD5 726ad29de11a4b2cedba10dc4bf39db1
BLAKE2b-256 7217f260c70a0c91f4432087be9c0476dfe3e5be11f751c1a70ce96eb23d66f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ecf851c9f200ed2610f81aeacf8d5d474650c9583ad4d463bec332da1b35e9cb
MD5 53b5f7b0bd2b6cac27b79f4ef285ff5e
BLAKE2b-256 891d1e274915cdda6b71c62f61dd6032d29f3a4a4fc4dae24ba0fd49b292f43c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cuda_quantum_cu13-0.15.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 5676be445a8834a866dac7413380a23843150df44355abfe203a49dc39290587
MD5 d43ef59dbf14ea9e6f0c0e7d40ec3573
BLAKE2b-256 110ed0bde33acdc24e94fe805f9976937df01d18cbc22ea6671ec02d72c419cf

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