cuQuantum¶
Description¶
NVIDIA cuQuantum is an SDK of optimized libraries and tools that accelerate quantum computing emulation 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.
Available Versions¶
The following versions of cuQuantum are currently available:
- Runtime dependencies:
- CUDA/12.9.0
- Optional dependencies:
- 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 the selected version (also with its runtime dependencies) as one module with the following command:
module load cuQuantum/25.09.0.7-CUDA-12.9.0
You can load the optional dependencies in a similar fashion.
Best practice for using cuQuantum¶
We recommend running cuQuantum applications on GPUs. cuQuantum algorithm simulations can achieve a significant speedup on the GPU over the CPU.
Examples¶
Examples can be found in the GitHub repository. Clone the repository using:
git clone https://github.com/NVIDIA/cuQuantum
To use the Python bindings, load the required modules and your preferred Python version. In this example we use Python 3.11.5 and work in the $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 /storage-apps/easybuild-soft/software/cuQuantum/25.09.0.7-CUDA-12.9.0/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 sample directories:
cd cuQuantum/samples/cudensitymat
#!/bin/bash
#SBATCH --account=<project> # project number
#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 the 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 --account=<project> # project number
#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 -np 2 --map-by ppr:1:node ./operator_action_mpi_example
sbatch submit.sh
User guide¶
More information and user documentation on cuQuantum can be found here.