# ============================================================================ #
# 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.     #
# ============================================================================ #

name: "braket"
description: "CUDA-Q target for Amazon Braket."

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 pipeline
  jit-mid-level-pipeline: "lower-to-cfg,decomposition{basis=h,rx,ry,rz,x,y,z,x(1)},quake-to-cc-prep,func.func(expand-control-veqs,combine-quantum-alloc,canonicalize,combine-measurements)"
  # Tell the rest-qpu that we are generating OpenQASM 2.0.
  codegen-emission: qasm2

target-arguments:
  - key: machine
    required: false
    type: string
    platform-arg: machine
    help-string: "Specify the Amazon Braket QPU."
  - key: default_bucket
    required: false
    type: string
    platform-arg: default_bucket
    help-string: "Specify a default S3 bucket for Amazon Braket results."
  - key: polling_interval_ms
    required: false
    type: integer
    platform-arg: polling_interval_ms
    help-string: "Specify the polling interval (in milliseconds) for checking task completion status on Amazon Braket."
  - key: noise-model
    required: false
    type: string
    platform-arg: noise 
    help-string: "Specify the noise model for simulation."
