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",
        "qubits": 2,
        "circuit": [
            {"gate": "h", "target": 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.1.tar.gz (131.5 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.1-py3-none-any.whl (167.8 kB view details)

Uploaded Python 3

File details

Details for the file ionq_core-0.1.1.tar.gz.

File metadata

  • Download URL: ionq_core-0.1.1.tar.gz
  • Upload date:
  • Size: 131.5 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.1.tar.gz
Algorithm Hash digest
SHA256 a269525e09c76022174b3c4fc7651e06fd33bf97235c457ed3233723193d7fbe
MD5 c9fce081478f572bc01377638d521f65
BLAKE2b-256 9723037cc48053e171ae39a34373170486ec2a134ede4de6f8e849f34764dddb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ionq_core-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: ionq_core-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 167.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f781d651eb25bebdfe91208ea35ba9826e52cb9262cff262c01ed8699c0103c2
MD5 06a33d6f8282697e77fe734ec6389c15
BLAKE2b-256 2d15113f37f08fdba8d60d765efc6c5cd09efa895b3e1a6d7991b57f2de9d332

See more details on using hashes here.

Provenance

The following attestation bundles were made for ionq_core-0.1.1-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