Skip to content

[python] Add IonQ observe broadcast regression test#4410

Merged
1tnguyen merged 1 commit intoNVIDIA:mainfrom
splch:fix/ionq-observe-broadcast-rest
Apr 29, 2026
Merged

[python] Add IonQ observe broadcast regression test#4410
1tnguyen merged 1 commit intoNVIDIA:mainfrom
splch:fix/ionq-observe-broadcast-rest

Conversation

@splch
Copy link
Copy Markdown
Contributor

@splch splch commented Apr 29, 2026

Summary

Follow-up to #4395 (which fixed cudaq.observe broadcast on REST QPU targets). That PR added regression tests for OQC and Quantinuum but not IonQ, even though #4363 explicitly listed IonQ as affected. IonQ uses the same BaseRemoteRESTQPU path, so an analogous test in test_IonQ.py closes the coverage gap.

The new test mirrors test_OQC_observe_broadcast / test_quantinuum_observe_broadcast exactly: a 4-sample parameter sweep through cudaq.observe(...) on spin.z(0), with results compared to the analytical cos(theta) answer.

Verification

I reproduced the original TypeError against target='ionq' (both emulate=True and the real cloud qpu='simulator'), applied the fix from #4395, and confirmed the broadcast call now returns correct expectation values within shot noise. The new test passes on the post-#4395 main.

Test plan

  • yapf --style google clean
  • Manually verified against the real IonQ cloud simulator (broadcast observe, 3 parameter sets, 200 shots, results within 0.02 of analytical cos(theta))
  • CI: python/tests/backends/test_IonQ.py::test_ionq_observe_broadcast

PR NVIDIA#4395 fixed `cudaq.observe` broadcast on REST QPU targets but only
added regression coverage for OQC and Quantinuum. IonQ uses the same
`BaseRemoteRESTQPU` path and was explicitly listed as affected in NVIDIA#4363,
so add the equivalent test against the IonQ mock server.

Signed-off-by: Spencer Churchill <[email protected]>
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented Apr 29, 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.

@1tnguyen
Copy link
Copy Markdown
Collaborator

1tnguyen commented Apr 29, 2026

/ok to test 7f57e15

Command Bot: Processing...

@1tnguyen 1tnguyen added the testing Relates to testing label Apr 29, 2026
Copy link
Copy Markdown
Collaborator

@1tnguyen 1tnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks @splch

@1tnguyen 1tnguyen added this pull request to the merge queue Apr 29, 2026
@splch
Copy link
Copy Markdown
Contributor Author

splch commented Apr 29, 2026

Thank you for the NVQLink-fast review!

Merged via the queue into NVIDIA:main with commit 33abdcc Apr 29, 2026
197 checks passed
github-actions Bot pushed a commit that referenced this pull request Apr 29, 2026
@splch splch deleted the fix/ionq-observe-broadcast-rest branch April 29, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testing Relates to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants