Skip to main content

A client library for accessing IonQ Cloud Platform API

Project description

ionq-core

A client library for accessing IonQ Cloud Platform API.

PyPI Python versions License CI Docs

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:

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

License

Apache License 2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ionq_core-0.1.0.tar.gz (123.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ionq_core-0.1.0-py3-none-any.whl (167.9 kB view details)

Uploaded Python 3

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

Hashes for ionq_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 420df25ac90fd24158bb827b9f3909213d9487153e8b61e984c284bbc6b32f02
MD5 7a28619e5da2aa2090db3d18ec7d474b
BLAKE2b-256 c40e74ee0508900682127f31f27a165f23286492b156f07f53a6d66ebc6e9f0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ionq_core-0.1.0.tar.gz:

Publisher: release.yml on ionq/ionq-core-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for ionq_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 105f5756567450e6274f73de7c18a9abf5fd060545a86ff3ac13662482ab2ece
MD5 122e537005fa0e5ad7c43aea83a79a7c
BLAKE2b-256 4b87b019cbc6070b1af9389b15797351a85b08434e82a81593221b3448cfe898

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page