$ show NVIDIA/cuQuantum
This repository is the NVIDIA cuQuantum SDK, a comprehensive suite of GPU-accelerated libraries for quantum computing simulation. It provides high-performance implementations for state-vector simulation (cuStateVec), tensor network contraction and decomposition (cuTensorNet), density matrix evolution (cuDensityMat), Pauli propagation (cuPauliProp), and stabilizer simulation (cuStabilizer). The codebase includes Python bindings with both high-level APIs (e.g., NetworkState, DenseMixedState, Operator) and low-level Cython bindings, as well as C++ sample codes, a benchmark suite, and JAX extensions for differentiable quantum operations. The architecture is modular, with each quantum simulation method organized into its own subpackage under `cuquantum/`. The Python package exposes a consistent interface for circuit simulation, operator construction, and distributed execution via MPI/NCCL. Key entry points include the `cuquantum.tensornet`, `cuquantum.densitymat`, `cuquantum.stabilizer`, and `cuquantum.pauliprop` modules, along with the `cuquantum.bindings` for direct C API access. The repository also contains extensive tests and samples that validate correctness against analytical results and reference implementations. The codebase is actively maintained with recent commits and issue triage. It demonstrates strong engineering practices with reusable patterns for memory management, callback-based operator coefficients, distributed tensor layouts, and custom JAX differentiation. However, some experimental APIs and version inconsistencies (e.g., CITATION.cff vs pyproject.toml) indicate areas of potential drift. Overall, it is a high-quality, production-ready SDK for quantum computing research and development.
The LLM identified 4 files worth highlighting for reuse:
Provides a reusable abstraction for time-dependent operator coefficients via `CallbackCoefficient` and its subclasses (`ScalarCallbackCoefficient`, `BatchedCallbackCoefficient`). Supports composition (multiplication, conjugation) and gradient propagation, enabling differentiable quantum dynamics. The pattern is self-contained and can be extracted for any time-dependent operator evaluation in quantum simulation.
Core parser for einsum expressions supporting both string and interleaved formats, ellipsis expansion, and operand validation. Used internally by cuTensorNet for contraction path optimization. The parsing logic is isolated and could be reused in any tensor network library or numerical computing project that requires flexible einsum notation.
Defines a `BaseCUDAMemoryManager` protocol and `MemoryPointer` RAII wrapper for GPU memory allocation. Includes implementations for raw CUDA, CuPy, and PyTorch allocators, with support for stream-ordered allocation and deallocation. This pattern is reusable across any CUDA-based Python project requiring flexible memory management.
Implements block-cyclic distribution classes (`BlockCyclic`, `ProcessGrid`) for N-dimensional tensor layouts across MPI ranks. Provides coordinate mapping, local segment ownership, and replica layer support. This is a self-contained, reusable pattern for distributed tensor operations in HPC environments, applicable beyond quantum computing.