Skip to content

Adds qBraid as a remote REST target in CUDA-Q#4328

Open
TheGupta2012 wants to merge 8 commits intoNVIDIA:mainfrom
qBraid:migrate-cudaq-v2
Open

Adds qBraid as a remote REST target in CUDA-Q#4328
TheGupta2012 wants to merge 8 commits intoNVIDIA:mainfrom
qBraid:migrate-cudaq-v2

Conversation

@TheGupta2012
Copy link
Copy Markdown

Summary

Adds qBraid as a remote REST target in CUDA-Q. Kernels authored via
cudaq.set_target("qbraid", ...) are lowered to OpenQASM 2.0, submitted to the qBraid v2
API, and results are parsed back into cudaq::sample_result — with zero dependency on
the external qbraid-sdk Python package.

What's included

  • Target qbraid registered via runtime/cudaq/platform/default/rest/helpers/qbraid/
    • QbraidServerHelper.cpp — v2 API client (submit, poll, fetch, parse)
    • qbraid.yml — target config, declares machine and api_key arguments
    • CMake gated behind -DCUDAQ_ENABLE_QBRAID_BACKEND=ON
  • Compiler pipeline qbraid-gate-set-mapping in lib/Optimizer/CodeGen/Passes.cpp
  • QASM normalization — merges nvq++'s multi-creg output into a single creg
    qbraid__creg__[N];. Required to unblock hardware routes (Rigetti, IQM Garnet,
    IonQ-via-Braket); see helper comment for the per-backend failure modes fixed.
  • Retry-with-backoff in processResults absorbs qBraid v2's COMPLETED→result-queryable
    race.

Testing

  • C++ unit tests (unittests/backends/qbraid/): sample sync/async, observe sync/async,
    future serialization, api_key-via-target-arg, job failure, result retry, retry
    exhaustion
  • Python tests (python/tests/backends/test_Qbraid.py): full Python-binding coverage
    against the mock
  • Target tests (targettests/qbraid/*.cpp): 13 C++ lit tests shared with other QASM2
    backends

ryanhill1 and others added 6 commits April 14, 2026 12:03
* working implementation using openQasm

* modified and added test files(incomplete)

* fix emulate command alignment

* update polling + format

* update polling interval and make code more readable

* remove ionq fields from target-arguments

* fix formatting

* Add qBraid mock python server for testing

Signed-off-by: Ryan Hill <ryanjh88@gmail.com>

* Update __init__.py

Signed-off-by: Ryan Hill <ryanjh88@gmail.com>

* QbraidTester running correctly

* added documentation for qbraid

---------

Signed-off-by: Ryan Hill <ryanjh88@gmail.com>
Co-authored-by: feelerx <superfeelerxx@gmail.com>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Apr 15, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants