Skip to main content

NVIDIA cuQuantum Python

Project description

cuQuantum Python

Documentation

Please visit the NVIDIA cuQuantum Python documentation.

For instructions on installing cuQuantum Python, refer to our getting started section

Building and installing cuQuantum Python from source

Requirements

The build-time dependencies of the cuQuantum Python package include:

  • CUDA Toolkit 12.x or 13.x
  • Python >=3.11, <3.15
  • Cython >=3.0.4,!=3.1.0,!=3.1.1 (>=3.1.3 for Python 3.14)
  • pip 21.3.1+
  • packaging
  • setuptools 77.0.3+
  • wheel 0.34.0+

Note: Starting with cuQuantum Python v25.06, cuQuantum C libraries including cuDensityMat, cuStateVec and cuTensorNet are no longer build-time dependencies. However, they are still required at runtime.

Except for CUDA and Python, the rest of the build-time dependencies are handled by the new PEP-517-based build system (see Step 7 below).

To compile and install cuQuantum Python from source, please follow the steps below:

  1. Clone the NVIDIA/cuQuantum repository: git clone https://github.com/NVIDIA/cuQuantum
  2. Set CUDA_PATH to point to your CUDA installation
  3. [optional] Make sure cuQuantum and cuTENSOR are visible in your LD_LIBRARY_PATH
  4. Switch to the directory containing the Python implementation: cd cuQuantum/python
  5. Build and install:
    • Run pip install . if you skip Step 3 above
    • Run pip install -v --no-deps --no-build-isolation . otherwise (advanced)

Notes:

  • For Step 5, if you are building from source for testing/developing purposes you'd likely want to insert a -e flag before the last period (so pip ... . becomes pip ... -e .):
    • -e: use the "editable" (in-place) mode
    • -v: enable more verbose output
    • --no-deps: avoid installing the run-time dependencies
    • --no-build-isolation: reuse the current Python environment instead of creating a new one for building the package (this avoids installing any build-time dependencies)
  • Please ensure that you use consistent binaries and packages for either CUDA 12 or 13. Mixing-and-matching will result in undefined behavior.

Running

Requirements

Runtime dependencies of the cuQuantum Python package include:

  • An NVIDIA GPU with compute capability 7.5+
  • Driver: Linux (525.60.13+ for CUDA 12, 580.65.06+ for CUDA 13)
  • CUDA Toolkit 12.x or 13.x
  • cuStateVec 1.14.0+
  • cuTensorNet 2.13.0+
  • cuDensityMat >=0.6.0, <0.7.0
  • cuPauliProp >=0.4.0, <0.5.0
  • cuStabilizer >=0.4.0, <0.5.0
  • Python >=3.11, <3.15
  • NumPy v1.21+
  • nvmath-python >=0.7.0, <1.0.0
  • cuda-bindings >=12.9.4, <13.0.0 for CUDA 12 or cuda-bindings >=13.0.3, <14.0.0
  • CuPy v13.0.0+ (see installation guide)
  • PyTorch v1.10+ (optional, see installation guide)
  • Qiskit v1.4.2+ (optional, see installation guide)
  • Cirq v0.6.0+ (optional, see installation guide)
  • mpi4py v3.1.0+ (optional, see installation guide)
  • nccl4py (optional)

If you install everything from conda-forge, all the required dependencies are taken care for you (except for the driver).

If you install the pip wheels, CuPy, cuTENSOR and cuQuantum (but not CUDA Toolkit or the driver, please make sure the CUDA libraries are visible through your LD_LIBRARY_PATH) are installed for you.

If you build cuQuantum Python from source, please make sure that the paths to the CUDA, cuQuantum, and cuTENSOR libraries are added to your LD_LIBRARY_PATH environment variable, and that a compatible CuPy is installed.

Known issues:

  • If a system has multiple copies of cuTENSOR, one of which is installed in a default system path, the Python runtime could pick it up despite cuQuantum Python is linked to another copy installed elsewhere, potentially causing a version-mismatch error. The proper fix is to remove cuTENSOR from the system paths to ensure the visibility of the proper copy. DO NOT ATTEMPT to use LD_PRELOAD to overwrite it --- it could cause hard to debug behaviors!
  • Please ensure that you use consistent binaries and packages for either CUDA 12 or 13. Mixing-and-matching will result in undefined behavior.

Samples

Samples for demonstrating the usage of both low-level and high-level Python APIs are available in the samples directory. The low-level API samples are 1:1 translations of the corresponding samples written in C. The high-level API samples demonstrate pythonic usages of the cuTensorNet and cuDensityMat library in Python.

Testing

If pytest is installed, typing pytest tests at the command prompt in the Python source root directory will run all tests. Some tests would be skipped if cffi is not installed or if the environment variable CUDA_PATH is not set.

Citing cuQuantum

H. Bayraktar et al., "cuQuantum SDK: A High-Performance Library for Accelerating Quantum Science", 2023 IEEE International Conference on Quantum Computing and Engineering (QCE), Bellevue, WA, USA, 2023, pp. 1050-1061, doi: 10.1109/QCE57702.2023.00119

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.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp314-cp314-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp314-cp314-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 848da68ea88b95398dcf19ea60ba5a144c13065bba94d00954d59482e843985a
MD5 156c3062e13474b978e81763b27a0202
BLAKE2b-256 e23a2089c5c7a587535658656fc061e2abc2c1f13806ae52a95ffa8c5910d2b6

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp314-cp314-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp314-cp314-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 960a0c133e7aad43e488d678dcedf90255db3de9dbf480705fd5e1351fc56330
MD5 6a9a67b5b15a8933044046c0437337ae
BLAKE2b-256 754502cffb667d770f16372c91a42b1fb3a396d36169a15d9be5bda4073b6edb

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cfd0816593ab426880608528c559f0032f9b48b18b41cd6df741ff11cbe52bca
MD5 b3ae574adbeedbc506feeddf28956759
BLAKE2b-256 6eda7254dab6e66ac7ff834fc9994ad0b4350ae3cae81a94ea2dd6eb6c43eaf5

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2567ced759ecc7b35f1beb136c0baf8eef94de78ddfe220b7aabb68a269732cc
MD5 405f94b47b7c03a1dcf3525d931e0701
BLAKE2b-256 f07de91998989bf77f420bde450cabaf0f66b091c1478ec812a3f89443b7ef61

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7d933d0be6b5c0efdadf3f6f1e6b315422e02fd2736b91ae35f3df14dd42c1c1
MD5 11470ae57f86c4bf62eeea1a191f458f
BLAKE2b-256 b09fd0d42e32150e8414b81c95c1a76a062712fb48b9ade3ae8c8f3d05802b4d

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0419509cfaa2d06c7e7d1fac29ec6dae87479e4e4d0dd367491ebd3a3ec9cf75
MD5 1df1c84096a2ea4bf2e619d60b29fbb8
BLAKE2b-256 f478be6a5d5b4e96683088d265db09d3d0f4c4191419a61cc71aa7b1826ae04c

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 41561f67239eaa7ffc19ec8a97a0cf41fa23a007362ae6a5df0dd9bd4db5d813
MD5 a1e95764769e73d488d94f74317e6e79
BLAKE2b-256 7ca8210fd5022ae31eb64adc3dba138ba19bd118c4be18c719a5b1c1b877e703

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-26.6.0-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-26.6.0-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1684c14466e730357090f7b6ddceaa490b3140c00bb969551970233d00045b78
MD5 35806e28afaf2916c6c1c13eff87a894
BLAKE2b-256 3db8db9f27a1126de571b5a5d8d8cca8b99130486b8aec99bb0c898c6c1f2193

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