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_cu11-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a936dbc8ec653564bee87746da50f3631aaccc1998a3a43cfa69ea262204afa4
MD5 bd266a694693b5420a382d49cbd4221e
BLAKE2b-256 bf2291e1ebe2cd8cac304ed8beb7073d2f7856aace9c0c33d6a511c05d23f90f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp312-cp312-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 227a8a4fa5049791d143e16a878a9b7d53297b33a5f4b376fc6dd7182a72432e
MD5 556445c89acb5ad3f24a3ff57bb8f1d9
BLAKE2b-256 44afe1ee781cb187bb9c98cce5983083aab17ca36bdfc6abf92b13d089fb44ac

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0274dfac0776ea1cfb65525033bb5670fa7a9ae5d33375cac44ab9a203d634c3
MD5 fd47baca9b328589e4ab1b54cf274e37
BLAKE2b-256 e1fbdb2c0091b52de22e2196a67d51f4fbff7c5f7f40d448ae6ceb67ceae3b6d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 15f431cca78023628e7affbfcb76ad731ff631d7d3dc6206dbaaafd4ffcfdc58
MD5 c34cd229ae72526cf1ecf1331c39a759
BLAKE2b-256 42b1a6134f985c1b4379204bfec6dfd685551d5cb0865fe64bbe49dcdb889c54

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 059ad7b08581c0981685bd8f5972d775f53b926602966f425cff21975923d7ca
MD5 61ff4ca1226713a62a5c03e9d53aff38
BLAKE2b-256 39adc322173c8613e15eb926c1e0482385787fc3b15eff4886ae4e3831bb7c85

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 40e025f9fe7838a36630f26ada55538542512ae99b8e84c3fa2d4806a6286595
MD5 5778826b674395c0658a547679e7bdfd
BLAKE2b-256 7557e5639279195985b7f5b964a4f852c58c655ca3e13df595e60aed354de7f2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 077579506adfda59fddbe6eb4e269817285375fa10c43c533b70828604696f2b
MD5 82b3a16bb595975447bc012805b5e26a
BLAKE2b-256 0b614a61f2b38907f6eb209283fcd68236f9628ef6a2fa7ce95e39d4c230996b

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for cuquantum_python_cu11-24.3.0.post1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 77ef188f76e175fbc5feec8f113bed33347ec3b3a8c61ed3f6ac1f24c1ac994d
MD5 40fc4aa366c08cec0c322c01424d3c0b
BLAKE2b-256 5157b5e53fd280579444eaca37b3e84a43435eaf8e6b23164d9c6aedc79a7656

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