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
Built Distributions
File details
Details for the file cuda_quantum-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 73.5 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f32d1e782f8e034942f70ec847633f304c0b22d20d242a153306042f0e9e0ca |
|
MD5 | ed69cf7c926164b9eb98601375df6032 |
|
BLAKE2b-256 | c3f9237ba4c1121b3210f93437982fb73ae68969288e4f61a62d633252d8825c |
File details
Details for the file cuda_quantum-0.4.1-cp311-cp311-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp311-cp311-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.2 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4dff2a0d14a5ee45ce625e3620baeb1efc15768ca5c07ed5457a8fb305bb3951 |
|
MD5 | b2688605e904eec5297d467af26484d1 |
|
BLAKE2b-256 | 77f7380a792e4bc3829cdd5e01fad0491e9aa4d946d94b5990773b3b5b000e95 |
File details
Details for the file cuda_quantum-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 73.5 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89b2eaa63a9d2542b9863a374b3c28994668af847e3193cd8ef5f1c5e7ade827 |
|
MD5 | 9c1db65192cbdd57beeb3fc4e5189149 |
|
BLAKE2b-256 | 2e7f0330d237120ab215d07a057f3834ba0a1088077bf5771d6270419c929968 |
File details
Details for the file cuda_quantum-0.4.1-cp310-cp310-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp310-cp310-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.2 MB
- Tags: CPython 3.10, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e9bdec900ac93d1b883e27246c2d0ee646f10afe69b5ff1f08ac03ce22de08d |
|
MD5 | 98177e19d8f84566953ce3cdeecb5e1e |
|
BLAKE2b-256 | c7cc8d74b67d16cdbff83cc4f6f427c51ff5c1c0496aebb0b924801ef84a9cfc |
File details
Details for the file cuda_quantum-0.4.1-cp39-cp39-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp39-cp39-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 73.5 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4344ab0d2f9b165e339e2300615bead768b55db14733ce9fe62f464b46ae338 |
|
MD5 | 18e153dfc1afbc961899175a2c14062d |
|
BLAKE2b-256 | df485e555c477a2a11d3b9ac0517cfa1f3a28d1ad7dcc640a9995581b3e52e8f |
File details
Details for the file cuda_quantum-0.4.1-cp39-cp39-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp39-cp39-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.2 MB
- Tags: CPython 3.9, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05c12fdd6f92656565b2304cd459dd7b38e81369856779b19822aef0d5e11400 |
|
MD5 | 804328ac17f8ac23f55f11486c571b3a |
|
BLAKE2b-256 | 26bf0e0dfb932b2679f8b8a58953d03c767d5158a2d2a0c62c4c4aa72ce4ca22 |
File details
Details for the file cuda_quantum-0.4.1-cp38-cp38-manylinux_2_28_x86_64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp38-cp38-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 73.5 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d1bcd11f7cad24bc6f4c0e1b60224b32b748ff532f567d058c3e37897a2f49d |
|
MD5 | 85bfad2dd5310084fccc2a7dfc7dbed2 |
|
BLAKE2b-256 | 42c0513f4ec936eefa068a06593dd67a58bb3ab7054286567de0c17b06d92417 |
File details
Details for the file cuda_quantum-0.4.1-cp38-cp38-manylinux_2_28_aarch64.whl
.
File metadata
- Download URL: cuda_quantum-0.4.1-cp38-cp38-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 65.2 MB
- Tags: CPython 3.8, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3593d6f72f3413acc95642ad2fa035505c04e23b99fe0c4f9e15d9fe807eb5b |
|
MD5 | edd111691437d9d998af3ccab0a2a0ff |
|
BLAKE2b-256 | fec9f6d9fb22368d81efad7971a8da5ff55be9aa98e989344ee50a3cea8c62b6 |