cuDensityMat (CUDA 13)
raw JSON → 0.5.2 verified Fri May 01 auth: no python
cuDensityMat is a component of the NVIDIA cuQuantum SDK for density matrix operations on GPU, optimized for CUDA 13. Version 0.5.2 focuses on high-performance tensor operations for quantum computing simulations. Release cadence is tied to cuQuantum SDK updates.
pip install cudensitymat-cu13 Common errors
error ImportError: No module named 'cudensitymat' ↓
cause Attempting to import the package name with hyphen or wrong module name.
fix
Use 'import cudensitymat' (no hyphen, no suffix).
error ModuleNotFoundError: No module named 'cupy' ↓
cause cuDensityMat depends on CuPy for GPU array operations.
fix
Install CuPy matching your CUDA version: 'pip install cupy-cuda13x'.
error RuntimeError: cuDensityMat initialization failed: CUDA driver version is insufficient ↓
cause The installed NVIDIA driver does not support CUDA 13.
fix
Update your NVIDIA driver to version 530.00.00 or later, or install a compatible cuDensityMat-cuXX package for your CUDA version.
Warnings
gotcha Package name includes a hyphen, but Python modules use underscores or no prefix. The correct import is 'import cudensitymat', not 'cudensitymat-cu13'. ↓
fix Use 'import cudensitymat' instead of the package name as-is.
deprecated Version 0.5.x may have breaking changes from earlier pre-release versions. Check migration notes if upgrading from 0.4.x. ↓
fix Refer to official cuQuantum SDK release notes for API changes.
gotcha cuDensityMat requires a compatible CUDA 13 driver and GPU. Ensure your system has the correct NVIDIA driver (R530+) and a supported GPU (Volta or later). ↓
fix Verify with 'nvidia-smi' that driver supports CUDA 13.
breaking The module name changed from 'cudensitymat' to 'cudensitymat'? Actually consistent, but be aware of potential name changes across cuQuantum versions. ↓
fix Always use the documented import as per the latest cuQuantum SDK.
Imports
- DensityMatrix wrong
from cudensitymat_cu13 import DensityMatrixcorrectfrom cudensitymat import DensityMatrix - cudensitymat wrong
import cudensitymat-cu13correctimport cudensitymat
Quickstart
import cudensitymat
import cupy as cp
# Create a simple density matrix on GPU
n_qubits = 2
matrix = cp.eye(2**n_qubits, dtype=cp.complex128) / (2**n_qubits)
dm = cudensitymat.DensityMatrix(matrix)
# Apply a gate (example: X gate on qubit 0)
x_gate = cp.array([[0,1],[1,0]], dtype=cp.complex128)
dm.apply_gate(x_gate, [0])
result = dm.get_matrix()
print(result)