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 low-level virtual machine (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 MPI installation.

In most cases, the CUDA and MPI dependencies can be installed via package manager. On Ubuntu 22.04, for example, the following commands install all optional CUDA dependencies:

arch=x86_64 # set this to sbsa for ARM processors
sudo apt-get update && sudo apt-get install -y wget
wget -q https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/$arch/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb && rm cuda-keyring_1.0-1_all.deb
sudo apt-get update && sudo apt-get install -y cuda-toolkit-11.8

Detailed instructions for how to install the complete CUDA toolkit on different operating systems can be found in the CUDA documentation.

If you have several GPUs available but no MPI installation yet, we recommend taking a look at the OpenMPI documentation and installing mpi4py. On Ubuntu 22.04, for example, the following commands install the necessary MPI libraries:

sudo apt-get update && sudo apt-get install -y libopenmpi-dev libpython3-dev gcc
python3 -m pip install mpi4py

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

cuda_quantum-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl (73.5 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

cuda_quantum-0.4.1-cp311-cp311-manylinux_2_28_aarch64.whl (65.2 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARM64

cuda_quantum-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl (73.5 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

cuda_quantum-0.4.1-cp310-cp310-manylinux_2_28_aarch64.whl (65.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

cuda_quantum-0.4.1-cp39-cp39-manylinux_2_28_x86_64.whl (73.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

cuda_quantum-0.4.1-cp39-cp39-manylinux_2_28_aarch64.whl (65.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

cuda_quantum-0.4.1-cp38-cp38-manylinux_2_28_x86_64.whl (73.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

cuda_quantum-0.4.1-cp38-cp38-manylinux_2_28_aarch64.whl (65.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.28+ ARM64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page