[python] Add IonQ observe broadcast regression test#4410
Merged
1tnguyen merged 1 commit intoNVIDIA:mainfrom Apr 29, 2026
Merged
[python] Add IonQ observe broadcast regression test#44101tnguyen merged 1 commit intoNVIDIA:mainfrom
1tnguyen merged 1 commit intoNVIDIA:mainfrom
Conversation
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]>
Collaborator
Command Bot: Processing... |
1tnguyen
approved these changes
Apr 29, 2026
Contributor
Author
|
Thank you for the NVQLink-fast review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #4395 (which fixed
cudaq.observebroadcast 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 sameBaseRemoteRESTQPUpath, so an analogous test intest_IonQ.pycloses the coverage gap.The new test mirrors
test_OQC_observe_broadcast/test_quantinuum_observe_broadcastexactly: a 4-sample parameter sweep throughcudaq.observe(...)onspin.z(0), with results compared to the analyticalcos(theta)answer.Verification
I reproduced the original
TypeErroragainsttarget='ionq'(bothemulate=Trueand the real cloudqpu='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 googlecleanobserve, 3 parameter sets, 200 shots, results within 0.02 of analyticalcos(theta))python/tests/backends/test_IonQ.py::test_ionq_observe_broadcast