A client library for accessing IonQ Cloud Platform API
Project description
ionq-core
A client library for accessing IonQ Cloud Platform API.
ionq-core is a typed, async-capable Python client for the IonQ Cloud Platform REST API. The HTTP layer is generated from IonQ's OpenAPI specification with openapi-python-client; a small set of hand-written extensions wraps it with retries, polling, pagination, structured exceptions, and an extension API for downstream SDKs.
The full API reference is published at ionq.github.io/ionq-core-python.
Looking for a higher-level interface?
ionq-core is the low-level HTTP client. Most users should pick the integration that matches their existing stack:
- Qiskit users ->
qiskit-ionq - Cirq users ->
cirq-ionq - PennyLane users ->
pennylane-ionq - CUDA-Q users -> IonQ is configured as a backend in NVIDIA CUDA-Q.
- Multi-vendor users -> IonQ is reachable via
qbraid.
Use this package directly if you want programmatic access to the IonQ REST API close to the wire, or if you are building a downstream SDK on top of it.
Installation
pip install ionq-core
Quickstart
Submit a Bell-state circuit on the cloud simulator and read the result probabilities:
from ionq_core import IonQClient, wait_for_job
from ionq_core.api.default import create_job, get_job_probabilities
from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayload
client = IonQClient() # reads IONQ_API_KEY from the environment
body = CircuitJobCreationPayload.from_dict({
"type": "ionq.circuit.v1",
"backend": "simulator",
"shots": 100,
"input": {
"gateset": "qis",
"circuit": [
{"gate": "h", "targets": [0]},
{"gate": "cnot", "control": 0, "target": 1},
],
},
})
job = create_job.sync(client=client, body=body)
completed = wait_for_job(client, job.id)
probs = get_job_probabilities.sync(uuid=job.id, client=client)
print(probs.additional_properties)
Each generated endpoint module exposes four callables: sync, sync_detailed, asyncio, and asyncio_detailed. The sync and asyncio variants return the parsed body; the _detailed variants return a Response[T] with the status code, headers, and parsed body.
For options (api_key, base_url, max_retries, timeout, extension), error classes, retry behavior, pagination, polling, sessions, and downstream-SDK extension hooks, see the API reference.
Versioning
This package follows SemVer 2.0, independent of the upstream REST API version - pass an explicit base_url to IonQClient to pin against a different API. Print the installed version with:
import ionq_core
print(ionq_core.__version__)
The full release history is in CHANGELOG.md.
Contributing
Most of ionq_core/ is generated from the OpenAPI spec and overwritten on every regeneration. See CONTRIBUTING.md for the boundary between generated and hand-written code, development setup, and the regeneration command.
Support
- Bug reports and feature requests: GitHub Issues
- Security disclosures: see SECURITY.md
- Account, billing, or hardware-access questions: ionq.com/contact
License
Apache License 2.0. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ionq_core-0.1.0.tar.gz.
File metadata
- Download URL: ionq_core-0.1.0.tar.gz
- Upload date:
- Size: 123.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
420df25ac90fd24158bb827b9f3909213d9487153e8b61e984c284bbc6b32f02
|
|
| MD5 |
7a28619e5da2aa2090db3d18ec7d474b
|
|
| BLAKE2b-256 |
c40e74ee0508900682127f31f27a165f23286492b156f07f53a6d66ebc6e9f0e
|
Provenance
The following attestation bundles were made for ionq_core-0.1.0.tar.gz:
Publisher:
release.yml on ionq/ionq-core-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ionq_core-0.1.0.tar.gz -
Subject digest:
420df25ac90fd24158bb827b9f3909213d9487153e8b61e984c284bbc6b32f02 - Sigstore transparency entry: 1405709311
- Sigstore integration time:
-
Permalink:
ionq/ionq-core-python@07a346f2e4476ef4ba3aefa5210c6588a4bb60e5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ionq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07a346f2e4476ef4ba3aefa5210c6588a4bb60e5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ionq_core-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ionq_core-0.1.0-py3-none-any.whl
- Upload date:
- Size: 167.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
105f5756567450e6274f73de7c18a9abf5fd060545a86ff3ac13662482ab2ece
|
|
| MD5 |
122e537005fa0e5ad7c43aea83a79a7c
|
|
| BLAKE2b-256 |
4b87b019cbc6070b1af9389b15797351a85b08434e82a81593221b3448cfe898
|
Provenance
The following attestation bundles were made for ionq_core-0.1.0-py3-none-any.whl:
Publisher:
release.yml on ionq/ionq-core-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ionq_core-0.1.0-py3-none-any.whl -
Subject digest:
105f5756567450e6274f73de7c18a9abf5fd060545a86ff3ac13662482ab2ece - Sigstore transparency entry: 1405709319
- Sigstore integration time:
-
Permalink:
ionq/ionq-core-python@07a346f2e4476ef4ba3aefa5210c6588a4bb60e5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/ionq
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07a346f2e4476ef4ba3aefa5210c6588a4bb60e5 -
Trigger Event:
push
-
Statement type: