Skip to main content

NVIDIA cuQuantum Python

Project description

cuQuantum Python

Documentation

Please visit the NVIDIA cuQuantum Python documentation.

Building

Requirements

Build-time dependencies of the cuQuantum Python package and some versions that are known to work are as follows:

  • CUDA Toolkit 11.x
  • cuQuantum 22.07+
  • cuTENSOR 1.5.0+
  • Python 3.8+
  • Cython - e.g. 0.29.21
  • packaging

Install cuQuantum Python from conda-forge

If you already have a Conda environment set up, it is the easiest to install cuQuantum Python from the conda-forge channel:

conda install -c conda-forge cuquantum-python

The Conda solver will install all required dependencies for you.

Install cuQuantum Python from PyPI

Alternatively, assuming you already have a Python environment set up (it doesn't matter if it's a Conda env or not), you can also install cuQuantum Python this way:

pip install cuquantum-python

The pip solver will also install both cuTENSOR and cuQuantum for you.

Note: To properly install the wheels the environment variable CUQUANTUM_ROOT must not be set.

Install cuQuantum Python from source

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

  1. Set CUDA_PATH to point to your CUDA installation
  2. Set CUQUANTUM_ROOT to point to your cuQuantum installation
  3. Set CUTENSOR_ROOT to point to your cuTENSOR installation
  4. Make sure CUDA, cuQuantum and cuTENSOR are visible in your LD_LIBRARY_PATH
  5. Run pip install -v .

Notes:

  • For the pip install step, adding the -e flag after -v would allow installing the package in-place (i.e., in "editable mode" for testing/developing).
  • If CUSTATEVEC_ROOT and CUTENSORNET_ROOT are set (for the cuStateVec and the cuTensorNet libraries, respectively), they overwrite CUQUANTUM_ROOT.
  • For local development, set CUQUANTUM_IGNORE_SOLVER=1 to ignore the dependency on the cuquantum wheel.

Running

Requirements

Runtime dependencies of the cuQuantum Python package include:

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

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

If you build cuQuantum Python from source, please make sure the paths to the cuQuantum and cuTENSOR libraries are added to your LD_LIBRARY_PATH environment variable.

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.

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.

Citing cuQuantum

Pleae click this Zenodo badge to see the citation format: DOI

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-22.7.0-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cuquantum_python-22.7.0-cp310-cp310-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for cuquantum_python-22.7.0-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 79eeaacc22c5b7fc7523f0a8cb1de9869011fc3d3ef360cfbbbd50deb0bfa66b
MD5 dd3b1f512a49170025acc6c5323f8afd
BLAKE2b-256 6d549721c2bda347e43a813cd5ed82d40cb6f05d3c9b447a1f3bded7425d6443

See more details on using hashes here.

Provenance

File details

Details for the file cuquantum_python-22.7.0-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

  • Download URL: cuquantum_python-22.7.0-cp310-cp310-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: CPython 3.10
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for cuquantum_python-22.7.0-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b2a4c0f597d8f649dbad9c9ac98b34e7faad7418920f5f99292f86e4618e8364
MD5 4aba7fe797ecb10834e5ffd635937c9f
BLAKE2b-256 5b1ef3b69ee2e975aadedd11147bfd1b70e87f9d861a8f928902f57a10cdc2a8

See more details on using hashes here.

Provenance

File details

Details for the file cuquantum_python-22.7.0-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cuquantum_python-22.7.0-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for cuquantum_python-22.7.0-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 51c0718a4984988ddc2d1f12f2181795f5ae9e24f687c408f4a2145e6c825718
MD5 d681b3c553be17bbd63f9b3ee7f018ac
BLAKE2b-256 21afcb946f6e1d80f1ee2b46b5e04438fbb71c643df5cfb13a561aeea88b3005

See more details on using hashes here.

Provenance

File details

Details for the file cuquantum_python-22.7.0-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

  • Download URL: cuquantum_python-22.7.0-cp39-cp39-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for cuquantum_python-22.7.0-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3c4fe7f73ed44fe9b83710fb22bdefadc63fffe0f4ac8c6ed5770bd3e3622210
MD5 aedbcd10a42b10dda7bf4deac8d4b439
BLAKE2b-256 370ac0e3442a71800db506beb940a18c7c731ac73840241d736d3f4f327cb096

See more details on using hashes here.

Provenance

File details

Details for the file cuquantum_python-22.7.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: cuquantum_python-22.7.0-cp38-cp38-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for cuquantum_python-22.7.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 30e5059907082c82a29342c83150233cf9d4e8fb692940aca37f10ce5a4871ed
MD5 657f73d2527eec5a003427c1071542f1
BLAKE2b-256 3ed78ab2c04f9a8e1b1b9419238abaa87db54c0b56ccb440699f5040de168825

See more details on using hashes here.

Provenance

File details

Details for the file cuquantum_python-22.7.0-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

  • Download URL: cuquantum_python-22.7.0-cp38-cp38-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.10 tqdm/4.64.0 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for cuquantum_python-22.7.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ca9a3290af9fff83431ebbcec56d505a177156d2716d12e3b2bea94f9ef8457d
MD5 8f9f5b4f831b5d26aa4f307314999464
BLAKE2b-256 500d0aa99908441cba14402756695cf847846dbf8e9aff6c05b540736d5272a8

See more details on using hashes here.

Provenance

Supported by

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