Skip to main content

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 11.x or 12.x
  • cuStateVec 1.4.0+
  • cuTensorNet 2.4.0+
  • Python 3.9+
  • Cython >=0.29.22,<3
  • pip 21.3.1+
  • packaging
  • setuptools 61.0.0+
  • wheel 0.34.0+

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] Set CUQUANTUM_ROOT to point to your cuQuantum installation
  4. [optional] Set CUTENSOR_ROOT to point to your cuTENSOR installation
  5. [optional] Make sure cuQuantum and cuTENSOR are visible in your LD_LIBRARY_PATH
  6. Switch to the directory containing the Python implementation: cd cuQuantum/python
  7. Build and install:
    • Run pip install . if you skip Step 3-5 above
    • Run pip install -v --no-deps --no-build-isolation . otherwise (advanced)

Notes:

  • For Step 7, 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)
  • As an alternative to setting CUQUANTUM_ROOT, CUSTATEVEC_ROOT and CUTENSORNET_ROOT can be set to point to the cuStateVec and the cuTensorNet libraries, respectively. The latter two environment variables take precedence if defined.
  • Please ensure that you use consistent binaries and packages for either CUDA 11 or 12. Mixing-and-matching will result in undefined behavior.

Running

Requirements

Runtime dependencies of the cuQuantum Python package include:

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!
  • In certain environments, if PyTorch is installed import cuquantum could fail (with a segmentation fault). It is currently under investigation and a temporary workaround is to import torch before importing cuquantum.
  • Please ensure that you use consistent binaries and packages for either CUDA 11 or 12. 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 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.

Release files for cuquantum-python-cu12 24.3.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for cuquantum-python-cu12 24.3.0.post1
File
cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details
cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ ARM64 Details
cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ ARM64 Details
cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_aarch64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ ARM64 Details

Total release size: 30.8 MB

Release files / cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl
Size 3.8 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
59af45a0beb177a88a0cc7527fe27a3b4da99d8eccc7ca1b7a6d039ef8621c99
BLAKE2b-256 checksum
How to use checksums
65aec5bf56d04e13f59a648b66fbb3959804c99ab2d2faafbe228e6b622d781c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_aarch64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
2c2b5a9c08f78926446e90454f8c8485b692ade49e1850fcb3c2c344186f5040
BLAKE2b-256 checksum
How to use checksums
26ef6ac211c4852757b1546bfc760b0bf33a20dc4c8f97ef2ddd4678b8d67e10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_x86_64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_x86_64.whl
Size 4.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
870d766cd3fc5f8c32ef13728ec45740e57f01e0814d9efa80fb904929b8dbbc
BLAKE2b-256 checksum
How to use checksums
0b6194624ce136dd634dede662563e76ff2ca6b226fe6939d5a731e249bce3ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_aarch64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_aarch64.whl
Size 4.0 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
738e01f509b92428e1092424484f91ba66214742e22b3880f271eab5e9db3dbd
BLAKE2b-256 checksum
How to use checksums
ebcd480ba6dde8404856808a01647f4635f7148118d25a1f4080f8185365815f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_x86_64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_x86_64.whl
Size 3.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e72c8815aee8d4aa7cc12d0cc90f04f76c63d164a356c525caf1b393f46f524a
BLAKE2b-256 checksum
How to use checksums
f00b8f479568f31e12234836a4558aa340fb97a64e06016dbdf1eb34831ec3af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_aarch64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
79a15a8fa223340ebd1429280dca607ed776652a3ecc29a81fdf1d7b792ffa94
BLAKE2b-256 checksum
How to use checksums
a7c9e4cd4744348b4092af3456dfed59a4cc69a1da7213a633ce20eb1d6efeee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_x86_64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_x86_64.whl
Size 3.8 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
c52648b11cbb30b026dc44d2de055c62245802de60db347f75e944d4104e7721
BLAKE2b-256 checksum
How to use checksums
775f1223387032763eba736e416d32e3b425f769619d9d6870b74ac1cfe076e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release files / cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_aarch64.whl

Download URL cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_aarch64.whl
Size 3.8 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
2fbf14cca4a357c191b3edf3f858c48203d7ac1d0490686ed5620c9e3bd803c8
BLAKE2b-256 checksum
How to use checksums
cc4f9286c9b17d15140bb5ceb5188a6784808b64ead4292d8a1f797b3ec7b644
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.10.13

Release history Release notifications | RSS feed

26.9.0

8 release files

26.6.0

8 release files

26.3.2

6 release files

26.3.1

6 release files

26.3.0

6 release files

26.1.0

6 release files

25.3.0

6 release files

This release

24.3.0.post1 This release

8 release files

23.6.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page