Registry / ai-ml / cirq-ionq

cirq-ionq

JSON →
library1.6.1pypypi✓ verified 84d ago

A Cirq package to simulate and connect to IonQ quantum computers. Version 1.6.1, released as part of Cirq v1.6.1. Supports Python >=3.11.0. Releases follow Cirq's release cadence, approximately quarterly.

pip install cirq-ionq
INSTALL
IMPORT
SIG · CIRQ-IONQ
C
cirq-ionq
ai-mlpythonv1.6.1
Install
23.8s avg
Import
Disk
515MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 491.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 23.8s · import 0.000s · 475MB
515MB installed
● package 515MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Service
from cirq_ionq import Service
from cirq_ionq import IonQDevice
Sampler
from cirq_ionq import Sampler
Job
from cirq_ionq import Job

Run a Bell state circuit on the IonQ simulator.

import cirq from cirq_ionq import IonQSimulator # Get API key from environment (set IONQ_API_KEY) import os api_key = os.environ.get('IONQ_API_KEY', '') if not api_key: print('Set IONQ_API_KEY environment variable') exit(1) simulator = IonQSimulator(api_key=api_key) q0, q1 = cirq.LineQubit.range(2) circuit = cirq.Circuit(cirq.H(q0), cirq.CNOT(q0, q1), cirq.measure(q0, q1)) result = simulator.run(circuit, repetitions=100) print(result.histogram(key='0,1'))
Debug
Known issues
breakingPython 3.11 minimum: From version 1.6.0, cirq-ionq requires Python >=3.11.0. Older Python versions will fail to install.
fix
Upgrade Python to 3.11 or later.
affects: >=1.6.0
gotchaImport from cirq_ionq not cirq.ionq: The correct import path is `from cirq_ionq import ...`. Using `cirq.ionq` will raise ImportError.
fix
Use `from cirq_ionq import IonQSimulator`.
affects: all
deprecatedAPI key via environment variable: The IonQ API key must be set via the `IONQ_API_KEY` environment variable or passed to the sampler constructor. Passing via `cirq_ionq.Service` constructor is deprecated.
fix
Set `IONQ_API_KEY` env var or use `IonQSimulator(api_key=...)` as documented.
affects: >=1.6.0
Upgrade
Version history
1.6.1latest on PyPI · released Aug 14, 2025
Audit
Dependencies
cirq-corerequiredRequired for core Cirq functionality.
Agent activity
26 hits · last 30 days
node
20
OpenAI (training)
1
Resources