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.14
  • Cython >=3.0.4,!=3.1.0,!=3.1.1
  • 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.13.1+
  • cuTensorNet 2.12.1+
  • cuDensityMat >=0.5.1, <0.6.0
  • cuPauliProp >=0.3.1, <0.4.0
  • cuStabilizer >=0.3.0, <0.4.0
  • Python >=3.11, <3.14
  • 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)

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_cu13-26.3.1-cp313-cp313-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu13-26.3.1-cp313-cp313-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c58bb0b7cd9d28f25e4987b062c3c31bd270a88de436997ed3c38869c26c78b5
MD5 97c10484c1134f377f848af8cfc1e99f
BLAKE2b-256 530d9af8191ad5ab46e8220ccc3bf617a454eea3bcb58bef24a1399f04e9e7ec

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu13-26.3.1-cp313-cp313-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu13-26.3.1-cp313-cp313-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3657c07291d5904a2afe9e6d41acd5ff10ba66d59ecd64e2bc30d693b6067ea0
MD5 a1f3d38b77fadd86e3c45e10cc70d12f
BLAKE2b-256 83c3b4792973ecd7929eda17d882ae1bb1e1b7e5456e13f4fb9d8af5bf08c976

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu13-26.3.1-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu13-26.3.1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1be2eab8ac9ac66eea07d47308c541fad83f9a3b01f936d99aeae82036556093
MD5 6d9a514e7ed1d70ad4923487458e00bc
BLAKE2b-256 088a1a2a479d9090d76b373d4a02b10a5ebf005c6d4701bfc97bfa0efa7fd449

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu13-26.3.1-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu13-26.3.1-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 7c9668c8edaec6cce8a2dccc035a701a53d5a0394bb22dbc33ee85df01de03e6
MD5 79bfe3a56fb4c940943bf17c9e24749d
BLAKE2b-256 3920f5e9d15c125f2c73d7faab5d052ede6e7adb4cca59f7e74be75e3f52331f

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu13-26.3.1-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu13-26.3.1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc43af3ff93cbc936d211b9e0bfe2627c3005ed02dd0eb016c3b2e6740c36a83
MD5 ebb0b7d848ecb2b3724c94a9b09c3304
BLAKE2b-256 95e820595f9f6ae9a2aece49fd96f30053c6c98c5b9202f15d5f23c1381125b0

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu13-26.3.1-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu13-26.3.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a2374bda57b6f92afd2d7165527e113f58ebbfd92865789e28d4653d7f5bd6b3
MD5 ebc436759e2451742bc0e76958285e28
BLAKE2b-256 b510fd057de76c62c51cc1dd4611bdaffc36bfcd6eb1d1505c95fb7d6172c455

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