Skip to content

Implement CUDA QR fallback when cuQuantum is unavailable #1111

Description

@IvanaGyro

Problem

NVIDIA supports cuTensorNet and cuStateVec on Linux only, so the Windows CUDA build in #1110 must use USE_CUQUANTUM=OFF. Most cuQuantum-gated paths already have another implementation: Gesvd_truncate and Rsvd fall back to the existing CUDA SVD path, and RegularNetwork falls back to Cytnx's contraction-order implementation. The clear remaining gap is linalg::Qr, which currently raises:

QR decomposition on GPU not implemented without cuQuantum support!

This makes a supported CUDA build lose a public operation solely because the optional cuQuantum backend is unavailable. The same gap is visible in the cuQuantum-disabled test configuration discussed in #1102.

NVIDIA support matrix: https://docs.nvidia.com/cuda/cuquantum/latest/getting-started/index.html#dependencies

Proposed scope

  • implement a CUDA QR path that does not depend on cuQuantum, preferably using existing CUDA/cuSOLVER primitives;
  • audit the other UNI_CUQUANTUM-gated public operations and document or fill any remaining functional gaps;
  • preserve the cuQuantum implementation when USE_CUQUANTUM=ON;
  • cover real and complex dtypes for both Tensor and applicable UniTensor entry points.

Acceptance criteria

  • linalg::Qr works on CUDA tensors in a USE_CUDA=ON, USE_CUQUANTUM=OFF build;
  • results satisfy reconstruction and orthogonality checks for float, double, complex float, and complex double;
  • tests run in a cuQuantum-disabled CUDA configuration and no longer skip solely because cuQuantum is absent;
  • behavior with cuQuantum enabled is unchanged.

Researched and authored by OpenAI Codex at @IvanaGyro's request while preparing #1110.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions