# ============================================================================ #
# Copyright (c) 2022 - 2026 NVIDIA Corporation & Affiliates and Contributors.  #
# 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.     #
# ============================================================================ #

name: "tii"
description: "CUDA-Q target for TII."

config:
  # Tell DefaultQuantumPlatform what QPU subtype to use
  platform-qpu: remote_rest
  # Add the rest-qpu library to the link list
  link-libs: ["-lcudaq-rest-qpu"]
  # Tell NVQ++ to generate glue code to set the target backend name
  gen-target-backend: true
  # Add preprocessor defines to compilation
  preprocessor-defines: ["-D CUDAQ_QUANTUM_DEVICE"]
  # Define the JIT lowering pipelines
  jit-high-level-pipeline: "expand-measurements"
  jit-mid-level-pipeline: "lower-to-cfg,func.func(canonicalize,multicontrol-decomposition),decomposition{basis=h,s,t,r1,rx,ry,rz,x,y,z,x(1)},quake-to-cc-prep,func.func(expand-control-veqs,canonicalize),symbol-dce"
  codegen-emission: qasm2

target-arguments:
  - key: api-key
    required: false
    type: string
    platform-arg: api_key
    help-string: "API key for TII."
  - key: url
    required: false
    type: string
    platform-arg: url
    help-string: "Specify TII API server URL."
  - key: version
    required: false
    type: string
    platform-arg: version
    help-string: "Qibo version running on the TII server."
  - key: device
    required: true
    type: string
    platform-arg: device
    help-string: "Specify the TII quantum device to use."
  - key: project
    required: true
    type: string
    platform-arg: project
    help-string: "Specify the TII project to use."
  - key: verbatim
    required: false
    type: string
    platform-arg: verbatim
    help-string: "Whether to let the client hang until server results are ready or not. Defaults to false."
