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 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.

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

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 59af45a0beb177a88a0cc7527fe27a3b4da99d8eccc7ca1b7a6d039ef8621c99
MD5 eb615285fb9cba3b62a0d7b4ad8c4c89
BLAKE2b-256 65aec5bf56d04e13f59a648b66fbb3959804c99ab2d2faafbe228e6b622d781c

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2c2b5a9c08f78926446e90454f8c8485b692ade49e1850fcb3c2c344186f5040
MD5 98ef1eb5793d50431766ddffc54f97f5
BLAKE2b-256 26ef6ac211c4852757b1546bfc760b0bf33a20dc4c8f97ef2ddd4678b8d67e10

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 870d766cd3fc5f8c32ef13728ec45740e57f01e0814d9efa80fb904929b8dbbc
MD5 056235fb8807570545b55845acfe2360
BLAKE2b-256 0b6194624ce136dd634dede662563e76ff2ca6b226fe6939d5a731e249bce3ee

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 738e01f509b92428e1092424484f91ba66214742e22b3880f271eab5e9db3dbd
MD5 e2513509f1f4fbc6592d854ca4b18f34
BLAKE2b-256 ebcd480ba6dde8404856808a01647f4635f7148118d25a1f4080f8185365815f

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e72c8815aee8d4aa7cc12d0cc90f04f76c63d164a356c525caf1b393f46f524a
MD5 3871a59ffc72c52aeb58995afb268199
BLAKE2b-256 f00b8f479568f31e12234836a4558aa340fb97a64e06016dbdf1eb34831ec3af

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79a15a8fa223340ebd1429280dca607ed776652a3ecc29a81fdf1d7b792ffa94
MD5 54ecf795fe8f7cfb68c279617ee8bf72
BLAKE2b-256 a7c9e4cd4744348b4092af3456dfed59a4cc69a1da7213a633ce20eb1d6efeee

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c52648b11cbb30b026dc44d2de055c62245802de60db347f75e944d4104e7721
MD5 6d34492f12159d257e1691e869e535ce
BLAKE2b-256 775f1223387032763eba736e416d32e3b425f769619d9d6870b74ac1cfe076e7

See more details on using hashes here.

File details

Details for the file cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu12-24.3.0.post1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2fbf14cca4a357c191b3edf3f858c48203d7ac1d0490686ed5620c9e3bd803c8
MD5 8f6b59496334eb7a0941f12db9dd0984
BLAKE2b-256 cc4f9286c9b17d15140bb5ceb5188a6784808b64ead4292d8a1f797b3ec7b644

See more details on using hashes here.

Supported by

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