# ============================================================================ #
# Copyright (c) 2022 - 2026 NVIDIA Corporation & Affiliates.                   #
# All rights reserved.                                                         #
#                                                                              #
# This source code and the accompanying materials are made available under     #
# the terms of the Apache License 2.0 which accompanies this distribution.     #
# ============================================================================ #

[project]
name = "cuda-quantum-cu12"
dynamic = ["version"]
keywords = [ "cudaq", "cuda-quantum", "cuda", "quantum", "quantum computing", "nvidia", "high-performance computing" ]
description="Python bindings for the CUDA-Q toolkit for heterogeneous quantum-classical workflows."
authors = [{name = "NVIDIA Corporation & Affiliates"}]
maintainers = [{name = "NVIDIA Corporation & Affiliates"}]
readme = { file="python/README.md.in", content-type = "text/markdown"}
requires-python = ">=3.11"
license = "Apache-2.0"
license-files = ["LICENSE", "NOTICE", "CITATION.cff", "LICENSES/*"]
dependencies = [
  'astpretty ~= 3.0',
  'custatevec-cu12 ~= 1.14.0',
  'cutensornet-cu12 ~= 2.13.0',
  'cudensitymat-cu12 ~= 0.6.0',
  'numpy >= 1.24',
  'scipy >= 1.10.1',
  'requests >= 2.32.3',
  'nvidia-cublas-cu12 ~= 12.0',
  'nvidia-curand-cu12 ~= 10.3',
  'nvidia-cusparse-cu12 ~= 12.5',
  'nvidia-cuda-runtime-cu12 ~= 12.0',
  'nvidia-cusolver-cu12 ~= 11.4',
  'nvidia-cuda-nvrtc-cu12 ~= 12.0',
  'cupy-cuda12x ~= 13.6.0; python_version < "3.14"',
  'cupy-cuda12x >= 14.0.0; python_version >= "3.14"'
]
classifiers = [
    'Intended Audience :: Science/Research',
    'Intended Audience :: Developers',
    'Programming Language :: Python',
    'Programming Language :: Python :: 3',
    'Programming Language :: Python :: 3.11',
    'Programming Language :: Python :: 3.12',
    'Programming Language :: Python :: 3.13',
    'Programming Language :: Python :: 3.14',
    "Environment :: GPU :: NVIDIA CUDA",
    "Environment :: GPU :: NVIDIA CUDA :: 12",
    'Topic :: Software Development',
    'Topic :: Scientific/Engineering',
]

[project.urls]
Homepage = "https://developer.nvidia.com/cuda-q"
Documentation = "https://nvidia.github.io/cuda-quantum"
Repository = "https://github.com/NVIDIA/cuda-quantum"
Releases = "https://nvidia.github.io/cuda-quantum/latest/releases.html"

# We must use h5py<3.11 because 3.11 doesn't include aarch64 Linux wheels.
# https://github.com/h5py/h5py/issues/2408
[project.optional-dependencies]
chemistry = [ "openfermionpyscf==0.5; python_version < '3.14'", "h5py<3.11; python_version < '3.14'"  ]
visualization = [ "qutip>5" , "matplotlib>=3.5" ]
# Additional torch-based integrator
integrators = [ "torchdiffeq" ]

[build-system]
requires = ["scikit-build-core==0.11.6", "cmake>=4.0", "numpy>=1.24", "pytest==9.0.3", "nanobind>=2.12.0"]
build-backend = "scikit_build_core.build"

[tool.scikit-build]
wheel.packages = ["python/cudaq"]
build-dir = "_skbuild"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
cmake.version = ">=4.0"
cmake.build-type = "Release"
cmake.verbose = false
cmake.args = [
    "-DCUDAQ_ENABLE_PYTHON=TRUE",
    "-DCUDAQ_DISABLE_CPP_FRONTEND=TRUE",
    "-DCUDAQ_DISABLE_TOOLS=TRUE",
    "-DCUDAQ_BUILD_TESTS=TRUE",
    "-DCUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR=OFF",
    "-DCUDAQ_STATIC_DEPS=ON"
]

# Linux x86_64: enable Pasqal QRMI connector
[[tool.scikit-build.overrides]]
if.platform-system = "linux"
if.platform-machine = "x86_64"
inherit.cmake.args = "append"
cmake.args = ["-DCUDAQ_ENABLE_PASQAL_QRMI_CONNECTOR=ON"]

# Linux: use LLD as the linker
[[tool.scikit-build.overrides]]
if.platform-system = "linux"
inherit.cmake.args = "append"
cmake.args = [
    "-DLLVM_USE_LINKER=lld",
    "-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld -B/usr/local/llvm/bin",
    "-DCMAKE_SHARED_LINKER_FLAGS=-fuse-ld=lld -B/usr/local/llvm/bin",
    "-DCMAKE_MODULE_LINKER_FLAGS=-fuse-ld=lld -B/usr/local/llvm/bin",
]

[tool.setuptools_scm]
