{"id":26868,"library":"cudensitymat-cu13","title":"cuDensityMat (CUDA 13)","description":"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.","status":"active","version":"0.5.2","language":"python","source_language":"en","source_url":"https://github.com/NVIDIA/cuQuantum","tags":["quantum","cuda","gpu","density-matrix","nvidia","cuquantum"],"install":[{"cmd":"pip install cudensitymat-cu13","lang":"bash","label":"Install"}],"dependencies":[{"reason":"Required for CUDA 13 runtime support","package":"nvidia-cuda-runtime-cu13","optional":false},{"reason":"Required for cuBLAS operations","package":"nvidia-cublas-cu13","optional":true},{"reason":"Required if using state vector operations from cuQuantum","package":"nvidia-custatevec-cu13","optional":true}],"imports":[{"note":"The correct import uses 'cudensitymat' not the package name with suffix.","wrong":"from cudensitymat_cu13 import DensityMatrix","symbol":"DensityMatrix","correct":"from cudensitymat import DensityMatrix"},{"note":"Python import does not hyphenate; use underscore? Actually the package name uses hyphen but import uses module name without hyphen.","wrong":"import cudensitymat-cu13","symbol":"cudensitymat","correct":"import cudensitymat"}],"quickstart":{"code":"import cudensitymat\nimport cupy as cp\n\n# Create a simple density matrix on GPU\nn_qubits = 2\nmatrix = cp.eye(2**n_qubits, dtype=cp.complex128) / (2**n_qubits)\ndm = cudensitymat.DensityMatrix(matrix)\n\n# Apply a gate (example: X gate on qubit 0)\nx_gate = cp.array([[0,1],[1,0]], dtype=cp.complex128)\ndm.apply_gate(x_gate, [0])\nresult = dm.get_matrix()\nprint(result)","lang":"python","description":"Minimal example using cuDensityMat with CuPy for density matrix operations."},"warnings":[{"fix":"Use 'import cudensitymat' instead of the package name as-is.","message":"Package name includes a hyphen, but Python modules use underscores or no prefix. The correct import is 'import cudensitymat', not 'cudensitymat-cu13'.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to official cuQuantum SDK release notes for API changes.","message":"Version 0.5.x may have breaking changes from earlier pre-release versions. Check migration notes if upgrading from 0.4.x.","severity":"deprecated","affected_versions":"0.4.x -> 0.5.x"},{"fix":"Verify with 'nvidia-smi' that driver supports CUDA 13.","message":"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).","severity":"gotcha","affected_versions":"all"},{"fix":"Always use the documented import as per the latest cuQuantum SDK.","message":"The module name changed from 'cudensitymat' to 'cudensitymat'? Actually consistent, but be aware of potential name changes across cuQuantum versions.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'import cudensitymat' (no hyphen, no suffix).","cause":"Attempting to import the package name with hyphen or wrong module name.","error":"ImportError: No module named 'cudensitymat'"},{"fix":"Install CuPy matching your CUDA version: 'pip install cupy-cuda13x'.","cause":"cuDensityMat depends on CuPy for GPU array operations.","error":"ModuleNotFoundError: No module named 'cupy'"},{"fix":"Update your NVIDIA driver to version 530.00.00 or later, or install a compatible cuDensityMat-cuXX package for your CUDA version.","cause":"The installed NVIDIA driver does not support CUDA 13.","error":"RuntimeError: cuDensityMat initialization failed: CUDA driver version is insufficient"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}