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.0a0.tar.gz (22.1 kB view details)

Uploaded Source

Built Distribution

ionq-0.0.0a0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ionq-0.0.0a0.tar.gz
  • Upload date:
  • Size: 22.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/24.1.0

File hashes

Hashes for ionq-0.0.0a0.tar.gz
Algorithm Hash digest
SHA256 79ba779b794c477087344eb73ff5f563adc9ae73fab683ebfad0e28da0d047af
MD5 d48087fadbe6f0b580a1c03005fb49a0
BLAKE2b-256 c6dafc0488e325ea49fae59e25a5d7935a4adb58196adbd069b4da0f94abc51f

See more details on using hashes here.

File details

Details for the file ionq-0.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: ionq-0.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/24.1.0

File hashes

Hashes for ionq-0.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 56b7abacfcbd59e30c157fc7ddc4e459c3a4995ab7849bf9d3f39a89158c6b14
MD5 9d8df0049168027b55d0e41196afee58
BLAKE2b-256 efe3312393ddebf5856fc74e093474567079184793b52cd286429f42c8d89f5a

See more details on using hashes here.

Supported by

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