Skip to content

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

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

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

Conversation

@TheGupta2012
Copy link
Copy Markdown

@TheGupta2012 TheGupta2012 commented Apr 15, 2026

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, compiler pipeline definition, declares machine and api_key arguments
  • Retry-with-backoff in processResults absorbs qBraid v2's COMPLETED→result-queryable
    race.

  • Specific error handling for 401 / 403 and 409 while processing job results

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.

I, Harshit <harshit.11235@gmail.com>, hereby add my Signed-off-by to this commit: 9cd62cf
I, Harshit <harshit.11235@gmail.com>, hereby add my Signed-off-by to this commit: 3b0a1e4
I, Harshit <harshit.11235@gmail.com>, hereby add my Signed-off-by to this commit: 1a24c66

Signed-off-by: Harshit <harshit.11235@gmail.com>
I, TheGupta2012 <harshit.11235@gmail.com>, hereby add my Signed-off-by to this commit: 925ae39
I, TheGupta2012 <harshit.11235@gmail.com>, hereby add my Signed-off-by to this commit: 41fe248
I, TheGupta2012 <harshit.11235@gmail.com>, hereby add my Signed-off-by to this commit: d74243d

Signed-off-by: TheGupta2012 <harshit.11235@gmail.com>
Comment thread .github/workflows/integration_tests.yml Outdated
Signed-off-by: TheGupta2012 <harshit.11235@gmail.com>
Signed-off-by: TheGupta2012 <harshit.11235@gmail.com>
@TheGupta2012
Copy link
Copy Markdown
Author

TheGupta2012 commented Apr 20, 2026

Thank you @mitchdz for giving the review comments. Could you please approve the test runs so that the changes can be validated?

@mitchdz
Copy link
Copy Markdown
Collaborator

mitchdz commented Apr 20, 2026

/ok to test f4907ac

Command Bot: Processing...

github-actions Bot pushed a commit that referenced this pull request Apr 20, 2026
@github-actions
Copy link
Copy Markdown

CUDA Quantum Docs Bot: A preview of the documentation can be found here.

…uild and skip remote tests for qbraid

Signed-off-by: TheGupta2012 <harshit.11235@gmail.com>
…piKey target param depend on emulate flag

Signed-off-by: TheGupta2012 <harshit.11235@gmail.com>
@TheGupta2012
Copy link
Copy Markdown
Author

Thanks @mitchdz for approving the tests, they were helpful in figuring out a couple of bugs. I've triaged the failures and CI should hopefully pass now

@mitchdz
Copy link
Copy Markdown
Collaborator

mitchdz commented Apr 22, 2026

/ok to test 39cfb72

Command Bot: Processing...

@mitchdz
Copy link
Copy Markdown
Collaborator

mitchdz commented Apr 22, 2026

@TheGupta2012 I just reran CI. Sorry for the delay, I missed the email of your notification.

@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@mitchdz mitchdz temporarily deployed to ghcr-deployment April 30, 2026 22:02 — with GitHub Actions Inactive
@TheGupta2012
Copy link
Copy Markdown
Author

TheGupta2012 commented May 1, 2026

The nightly integration test failed at https://github.com/NVIDIA/cuda-quantum/actions/runs/25186596807/job/73845759395#step:6:415 with:

Warning: File not found: targettests/qbraid/*.cpp
Warning: File not found: docs/sphinx/targets/cpp/qbraid.cpp
Warning: File not found: docs/sphinx/targets/python/qbraid.py

@mitchdz thank you for running the tests. It seems like they are failing because the integration tests specific to qBraid are picking up the base cuda quantum docker image, not the one built by this PR. See the integration test log for verification

This means that it won't contain the qbraid backend and that is why nvq++ produces the invalid target error for qbraid.

Ideally, we should be passing an image built from the PR branch (migrate-cudaq-v2, head a525bfb44…) inside the cudaq_test_image input var while launching the integration tests.

@TheGupta2012
Copy link
Copy Markdown
Author

TheGupta2012 commented May 1, 2026

After digging in a little with Claude I found that the CI also produced PR specific images -

A PR-specific image was pushed by Deployments run 25191512163: ghcr.io/nvidia/cuda-quantum:amd64-cu12-pr-4328-base@sha256:7519cf7d…, revision a525bfb….

Could you re-run integration tests with target=qbraid, cudaq_test_image=ghcr.io/nvidia/cuda-quantum:amd64-cu12-pr-4328-base@sha256:7519cf7d8fcb66a0f6be5123cb5b4184d76b0ee2991015ad522cf230539a36f7, and commit_sha=a525bfb447d3329dc2f47074b402aa94cfee8998?

Heads-up: the integration test setup job's regctl manifest parsing assumes a multi-arch manifest list — if the per-platform tag is a flat manifest, the setup step may need a tweak.

Not sure if this is supposed to be the target image, but hope this helps

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.

3 participants