cuQUANTUM¶
Description¶
NVIDIA cuQuantum is an SDK of optimized libraries and tools that accelerate quantum computing emulations at both the circuit and device level by orders of magnitude. It consists of three major components:
- cuDensityMat: a high-performance library for quantum dynamics equation solvers
- cuStateVec: a high-performance library for state vector quantum simulators
- cuTensorNet: a high-performance library for tensor network computations
In addition to C APIs, cuQuantum also provides Python APIs via cuQuantum Python.
Versions¶
Following versions of cuQuantum are currently available:
- Runtime dependencies:
- cuQuantum/25.09.0.7-CUDA-12.9.0
- CUDA/12.9.0
- Optional dependiencies:
- cuTENSOR/2.3.1.0-CUDA-12.9.0
- OpenMPI/4.1.6-GCC-13.2.0
- Python/3.11.5-GCCcore-13.2.0
You can load selected version (also with runtime dependencies) as a one module by following command:
module load cuQuantum/25.09.0.7-CUDA-12.9.0
You can load optional dependencies in similar fashion.
Best practice for using cuQuantum¶
We recommend running cuQuantum applications on GPUs. CuQuantum algorithm simulations can achieve a great speedup on GPU over CPU.
Examples¶
Examples can be found on github repository. Clone the repository using:
git clone https://github.com/NVIDIA/cuQuantum
To use python bindings load the required modules and your preffered python version. In this example we use python 3.11.5 and work in $HOME directory.
module load cuQuantum/25.09.0.7-CUDA-12.9.0
module load cuTENSOR/2.3.1.0-CUDA-12.9.0
module load OpenMPI/4.1.6-GCC-13.2.0
module load Python/3.11.5-GCCcore-13.2.0
python3 -m venv cuQuantum-env
source cuQuantum-env/bin/activate
python3 -m pip install -U pip setuptools wheel
cd cuQuantum/python
pip install .
- 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)
Change directory to one of the samples directory:
cd samples/densitymat/
#!/bin/bash
#SBATCH --partition=gpu
#SBATCH --job-name=test
#SBATCH --nodes=1
#SBATCH --output=out.txt
#SBATCH --error=err.txt
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --time=0:01:00
#SBATCH --gres=gpu:1
module load cuQuantum/25.09.0.7-CUDA-12.9.0
module load cuTENSOR/2.3.1.0-CUDA-12.9.0
module load OpenMPI/4.1.6-GCC-13.2.0
module load Python/3.11.5-GCCcore-13.2.0
source $HOME/cuQuantum-env/bin/activate
python3 operator_advanced_example.py
sbatch submit.sh
Examples in c++ language are in the samples folder. To build the examples set the following environment:
module load cuQuantum/25.09.0.7-CUDA-12.9.0
module load cuTENSOR/2.3.1.0-CUDA-12.9.0
module load OpenMPI/4.1.6-GCC-13.2.0
export CUQUANTUM_ROOT=/storage-apps/easybuild-soft/software/cuQuantum/25.09.0.7-CUDA-12.9.0/
export CUTENSOR_ROOT=/storage-apps/easybuild-soft/software/cuTENSOR/2.3.1.0-CUDA-12.9.0/
export MPI_ROOT=/storage-apps/easybuild-soft/software/OpenMPI/4.1.6-GCC-13.2.0/
cd cuQuantum/samples/cudensitymat
make
#!/bin/bash
#SBATCH --partition=gpu
#SBATCH --job-name=test
#SBATCH --nodes=1
#SBATCH --output=out.txt
#SBATCH --error=err.txt
#SBATCH --ntasks=2
#SBATCH --cpus-per-task=16
#SBATCH --time=0:01:00
#SBATCH --gres=gpu:2
module load cuQuantum/25.09.0.7-CUDA-12.9.0
module load cuTENSOR/2.3.1.0-CUDA-12.9.0
module load OpenMPI/4.1.6-GCC-13.2.0
mpiexec ./operator_action_mpi_example
sbatch submit.sh
User guide¶
More information and user documentation on cuQuantum can be found here.