Skip to main content

Python bindings for the CUDA Quantum toolkit for heterogeneous quantum-classical workflows.

Project description

Welcome to the CUDA Quantum Python API

CUDA Quantum 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 Quantum Python wheels contain the Python API and core components of CUDA Quantum. 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 requirements and compatibility are listed in the Getting Started section of the linked documentation.

Installing CUDA Quantum

To install the latest stable version of CUDA Quantum, run

python3 -m pip install cuda-quantum

CUDA Quantum can be used to compile and run quantum programs on a CPU-only system, but a GPU is highly recommended and necessary to use the some of the simulators. The GPU-based simulators included in the CUDA Quantum Python wheels require an existing CUDA installation. Additionally, multi-GPU simulators require an existing CUDA-aware MPI installation.

To install the necessary dependencies, we recommend using Conda. If you are not already using Conda, you can install a minimal version following the instructions here. The following commands will create and activate a complete environment for CUDA Quantum with all its dependencies:

    conda create -y -n cuda-quantum python==3.10 pip
    conda install -y -n cuda-quantum -c "nvidia/label/cuda-11.8.0" cuda
    conda install -y -n cuda-quantum -c conda-forge mpi4py openmpi
    conda env config vars set -n cuda-quantum LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CONDA_PREFIX/envs/cuda-quantum/lib"
    conda run -n cuda-quantum pip install cuda-quantum
    conda activate cuda-quantum

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).

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 Quantum

You should now be able to import CUDA Quantum 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 Quantum. If you are interested in developing quantum applications with CUDA Quantum, our GitHub repository is a great place to get started! For more information about contributing to the CUDA Quantum platform, please take a look at Contributing.md.

License

CUDA Quantum is an open source project. The source code is available on GitHub and licensed under Apache License 2.0. CUDA Quantum 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 Quantum 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.

Project details


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-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl (57.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

cuda_quantum-0.5.0-cp311-cp311-manylinux_2_28_aarch64.whl (56.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

cuda_quantum-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl (57.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

cuda_quantum-0.5.0-cp310-cp310-manylinux_2_28_aarch64.whl (56.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

cuda_quantum-0.5.0-cp39-cp39-manylinux_2_28_x86_64.whl (57.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

cuda_quantum-0.5.0-cp39-cp39-manylinux_2_28_aarch64.whl (56.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

cuda_quantum-0.5.0-cp38-cp38-manylinux_2_28_x86_64.whl (57.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

cuda_quantum-0.5.0-cp38-cp38-manylinux_2_28_aarch64.whl (56.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ ARM64

File details

Details for the file cuda_quantum-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7b633007ae5432f8b8a4c088724a24e9c8aa6ff78c4854bf1c56458a2fc16a7a
MD5 4d924e25a4d39a3ac840fb6f9f4142a2
BLAKE2b-256 b339d915bcc9896d8445d538eada441a3d94f5a5fdddd9307215fd575bb602fb

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2455223159d52a8732f7bffc9066b7bde3c4475fb896ae60975ea29fb04fba37
MD5 7b1c34174e56658283b1bd0915dc2b25
BLAKE2b-256 dc8c0440376883b64d265cbf60eb593f240a80e3d7fc5e9f21dc980d115496be

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e715f4d8afbab1b29754dcb6e14749f538d5f4f25289b146fcd8fbf4146d3762
MD5 883f0560c82c96cc52e88941a227e137
BLAKE2b-256 bdfa8399cc1dbfb9096b9146d2eefb7dfae7bcea4fd727d2fb157ecf490ebc40

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 dea1db4f3fc58dd68fb587f92212c241bb2cb42af490e578ac7ceed7dcc08cbb
MD5 1556bf57985bfd7b4c18b57657bafe3d
BLAKE2b-256 dfd6edc2d970ea2cd82ad3718cebeb72d92cc2f0819ce5445584154914a96015

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9f76ea49794b9559ed0dfb12a28953425f30f0f328ee540fcdb59fd2ab614c74
MD5 7add5020182599f00f97aaba330573bf
BLAKE2b-256 fe6360b2e39440cdbd8d4ce7dab08e0918671275ad9aefb06b0d446f0f9c5dcb

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c50931bf1ff0581e0983b2c5a5e1920563c120a7c8c8a57d8c9f5c1ecd5deda4
MD5 c2ba70a9da7606caea5998de19ffdd35
BLAKE2b-256 277966c0fa72477350bf0a7210f50895f8c3c60cadb1c651bdba59964b467d98

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 87eb45445f50eccd3bef074e4d11df0d39536940db633c987164c4aabd1f266f
MD5 a575493001e3f5ef4904d931fa5d05cb
BLAKE2b-256 44def076fcd9baaf6e395cce3814b00b5008b73106de59e9c4aea6334833a4f1

See more details on using hashes here.

File details

Details for the file cuda_quantum-0.5.0-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cuda_quantum-0.5.0-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e98ddf3617e7451e05c92dac7a553b477df0b9034a6fb29cbdcb3ce38f4b024d
MD5 5456679945bddf770a372f29b53e9f98
BLAKE2b-256 8c81a21b3f7dd846c80e84cf4335cd014cdce089a4d8b61a13786a1f7143465e

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 Pingdom Monitoring Sentry Error logging StatusPage Status page