feat(executors): add IonQ Direct API executor#42
Open
Adithyaphani wants to merge 1 commit into
Open
Conversation
4 tasks
Author
|
@ddri looking forward to your review and response on the opened PR , happy to make further changes if needed. |
Author
|
@ddri looking forward to your review & response, and happy to make further changes if needed. |
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.
Closes #1.
Summary
IonQExecutor/IonQExecutorConfigfor direct IonQ v0.3 REST APIsubmission (no AWS Braket routing required).
circuit.to_qiskit()-> OpenQASM 2.0 -> IonQ "qasm"input format.
ExecutionResult.counts(bitstring counts, matching BraketExecutor's output shape).
failure.error/failure.code) to a descriptiveRuntimeError.reserved/offline) to
DeviceStatusper CONTRIBUTING.md §2 (device-level,not job-level).
"IonQ Direct"inExecutorFactory, export frommarqov/executors/__init__.py.available.
execution, polling to completion, job failure handling, cancel
(success/failure), backend status mapping for all documented states,
probability->counts bit-ordering, factory registration, and missing-API-key
error handling.
Here's the architecture, in two diagrams, IonQExecutor sits in the codebase:
Now the request/data flow inside execute():
Design note
The issue references the
ionqPyPI package, which is currently pre-release(0.0.0a15) and doesn't yet cover job polling, results retrieval, cancellation,
or backend status -- all required by the acceptance criteria. Rather than
depend on an unstable alpha SDK, this implements a small injectable REST
client (
_IonQRestClient) against IonQ's documented v0.3 API(https://docs.ionq.com/guides/direct-api-submission). No new dependency is
required --
requestsis already a transitive dependency (viaazure-core,ibm-cloud-sdk-core,qiskit-ibm-runtime). The client is a thin, swappablelayer if the official SDK matures.
Verification
ruff check marqov/executors/ionq.py marqov/executors/factory.py marqov/executors/__init__.py tests/test_ionq_executor.py-- all checks passedpytest tests/test_ionq_executor.py -v-- 15 passedpytest tests/ -q-- 283 passed, 13 skipped, 0 failed (after excluding 3pre-existing failures, see note below)
https://api.ionq.co/v0.3/jobs(with aninvalid placeholder key) and confirmed the client correctly surfaces IonQ's
401 Unauthorizedviarequests.HTTPError-- the request/auth/error-propagation path is exercised against the live API, not just mocks.
Pre-existing test failures (unrelated)
tests/test_activity_heartbeat.py,tests/test_decorators.py, andtests/test_temporal_activities.pyfail withRecursionError: Stack overflow(cloudpickle serialization) on Python 3.14 in this environment. Confirmed via
git stashthat these fail identically onmainwithout this change -- apre-existing environment issue unrelated to this PR.
AI disclosure
Claude helped draft the initial IonQExecutor implementation and tests. I reviewed every method, ran the full suite, debugged and isolated three pre-existing environment failures unrelated to this change (confirmed via git stash), verified the dependency claims, checked the live API's error response, and updated the README.