Skip to content

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
Then create the python virtual environment with all the requirements:
python3 -m venv cuQuantum-env
Activate the environment and install all requirements:
source cuQuantum-env/bin/activate
python3 -m pip install -U pip setuptools wheel
Install cuQuantum python from sources:
cd cuQuantum/python
pip install .
There are other optional packages depending on your use case. Follow the installation guides for them:

Change directory to one of the samples directory:

cd samples/densitymat/
Create submit script submit.sh to run sample python script:
#!/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
Submit the script to slurm scheduler:
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/
Change directory to sample code you want to build and run make, e.g.:
cd cuQuantum/samples/cudensitymat
make
To run the example create a script and save it as submit.sh:
#!/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
Submit the script to slurm scheduler:
sbatch submit.sh

User guide

More information and user documentation on cuQuantum can be found here.

Created by: Jozef Federic