Skip to main content

A Python library for interacting with IonQ's quantum computing API

Project description

IonQ SDK

The IonQ SDK provides tools for interacting with the IonQ platform, enabling users to manage backends, jobs, and quantum circuits programmatically.

Features

  • Backend Management: Access and manage quantum computers.
  • Job Management: Submit, manage, and retrieve quantum jobs.
  • Quantum Circuit Design: Build and manipulate quantum circuits for execution (not a focus of this SDK).

Installation

This SDK requires Python 3.9 or later. Below are the steps to install and set it up using a virtual environment and Poetry.

Prerequisites

Ensure you have Python and Poetry installed. Poetry is a tool for dependency management and packaging in Python. To install Poetry, you can use the following command:

curl -sSL https://install.python-poetry.org | python3 -

Installing the SDK

To install the SDK, clone the repository, create a virtual environment, and install the dependencies using Poetry:

# Clone the repository
git clone https://github.com/ionq/python-ionq.git
cd python-ionq

# Create a virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`

# Install dependencies using Poetry
pip install poetry
poetry install

# Optional: Install with extras for development
poetry install -E all

Quick Start

Here is a quick example to get you started with the IonQ SDK.

Initialize the SDK

First, set up your API key and initialize the Backend object:

from ionq import Backend

backend = Backend(api_key='your_api_key_here')

List Available Backends

You can list the available backends like this:

backends = backend.get_backends()
print(backends)

Create and Submit a Job

To create a circuit and submit a job:

from ionq import Circuit, Job

circuit = Circuit(2)
circuit.h(0)
circuit.cx(0, 1)

job = Job(api_key='your_api_key_here')
job_details = job.create_job(circuit=circuit)
print(job_details)

Retrieve Job Results

To check the results of a submitted job:

results = job.get_job_results(job_id='your_job_id_here')
print(results)

Documentation

For more detailed information and API specifications, please refer to the official documentation.

Contributing

Contributions are welcome! Please read our contributing guidelines to get started.

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-0.0.0a14.tar.gz (26.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-0.0.0a14-py3-none-any.whl (36.6 kB view details)

Uploaded Python 3

File details

Details for the file ionq-0.0.0a14.tar.gz.

File metadata

  • Download URL: ionq-0.0.0a14.tar.gz
  • Upload date:
  • Size: 26.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ionq-0.0.0a14.tar.gz
Algorithm Hash digest
SHA256 23e7c5433145166107f71ba111e996fd6fd83acc95bdc89a7e00746de4925eda
MD5 0838b133b705ad24f264c465a087ab96
BLAKE2b-256 0c1240b8d605f87764647cf8f0b77aea4a08a7e78102411920186820193d6416

See more details on using hashes here.

Provenance

The following attestation bundles were made for ionq-0.0.0a14.tar.gz:

Publisher: build-and-publish.yaml on ionq/python-ionq

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-0.0.0a14-py3-none-any.whl.

File metadata

  • Download URL: ionq-0.0.0a14-py3-none-any.whl
  • Upload date:
  • Size: 36.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ionq-0.0.0a14-py3-none-any.whl
Algorithm Hash digest
SHA256 e4c7922121fb71e052a9825b93d37ffe75da8eb88b2cb074a85ce3d60f6e21b0
MD5 be4d86d11b5dfee62df4e8a49491d03a
BLAKE2b-256 96bb9905f8849e02d5344a36ef7b5a2195efa5a0219077dcfeb74b099375285c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ionq-0.0.0a14-py3-none-any.whl:

Publisher: build-and-publish.yaml on ionq/python-ionq

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