Skip to content

Add an examples/ directory demonstrating downstream-SDK integration via the extension API #56

Description

@splch

Background

ionq-core is the low-level client that higher-level SDKs (qiskit-ionq, cirq-ionq, pennylane-ionq) build on, through the extension API — a ClientExtension bundle plus the EventHook / AsyncEventHook protocols passed to IonQClient(extension=...). It's documented in ionq_core/extensions.py, but there's no runnable example and no examples/ directory.

What to build

A top-level examples/ directory with a sync and an async example that act as a downstream SDK wrapping ionq-core, run against the free simulator (sign up: https://identity.ionq.com/create-account).

  • downstream_integration.py (sync): build an IonQClient(extension=...) that sets a user_agent_token, default_headers, an EventHook (logging), and an error_mapper (wrap APIError / RateLimitError into an SDK-defined type); then submit a Bell state, wait_for_job, and print the probabilities.
  • downstream_integration_async.py: the same flow with an AsyncEventHook and the asyncio endpoint variants.

Definition of done

  • examples/ with both scripts and a README.md (setup: pip install ionq-core, export IONQ_API_KEY=...), linked from the top-level README.md.
  • Sync example exercises user_agent_token, default_headers, an EventHook, and the error_mapper; async example uses AsyncEventHook + asyncio variants.
  • Uses only public API (ionq_core.__all__); SPDX header on each file (AGENTS.md).
  • uv run ruff check, uv run ruff format --check, and uv run ty check examples/ pass. (Needn't run in CI — no API key — but must lint and type-check.)

Notes

httpx-only; auth prefix is apiKey, not Bearer; no new runtime deps. References: extension API docs, ionq_core/extensions.py, ionq_core/ionq_client.py, and the Bell-state quickstart in README.md.

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentationgood first issueGood for newcomersunitaryHACK26unitaryHACK 2026 bounty issue

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions