Cirq

Run Cirq Circuits on Real Quantum Hardware Beta

Keep your hardware-aware Cirq circuits, swap in one sampler, and run on real QPUs from IonQ, Rigetti, IQM, and AQT. Running in under a minute.

The Cirq plugin is in beta. Tell us what works and what doesn’t in the Open Quantum community.

What is Cirq?

Cirq is an open-source Python framework for writing, manipulating, and optimizing quantum circuits, created and maintained by Google Quantum AI. Rather than abstracting the hardware away, Cirq gives you direct control over the circuit itself, which is exactly what you need for NISQ-era algorithms where the precise arrangement of gates drives fidelity.

Its distinguishing strength is fine-grained, hardware-aware control: explicit qubit placement with LineQubit and GridQubit, precise Moment-level scheduling that dictates when each gate executes, and device and gate-set constraints that mirror real hardware. Cirq is the native framework behind Google’s quantum processors and experiments, and it underpins libraries like OpenFermion for quantum chemistry, TensorFlow Quantum for quantum machine learning, and ReCirq for research.

Open Quantum provides OpenQuantumSampler, a drop-in cirq.Sampler that plugs into the standard execution paths — run, sample, run_sweep, and run_batch. Your cirq.Circuit stays exactly the same; you simply hand it an Open Quantum sampler and it executes on real QPUs.

How to Run Cirq on Real Quantum Hardware

STEP 1

Install the Plugin

pip install "openquantum-sdk[cirq]". Set your OPENQUANTUM_CLIENT_ID and OPENQUANTUM_CLIENT_SECRET environment variables. Done.

STEP 2

Build Circuits with Cirq

Use LineQubit, GridQubit, and Moments for hardware-aware control. No vendor-specific code, no new syntax to learn. Your existing cirq.Circuit objects work as-is.

STEP 3

Run on Any QPU

Pick a backend (IonQ, Rigetti, IQM, or AQT) and call sampler.run(). Open Quantum handles conversion, submission, and result formatting.

Your First Cirq Circuit on a QPU in 60 Seconds

A complete example: pip install the plugin, build a Bell state with Cirq LineQubits, and run it on IonQ Forte-1 trapped ion hardware. No credit card required.

pip install "openquantum-sdk[cirq]"
import cirq
from cirq_openquantum import OpenQuantumSampler

# Auth via OPENQUANTUM_CLIENT_ID and OPENQUANTUM_CLIENT_SECRET env vars
sampler = OpenQuantumSampler(backend="ionq:forte-1")

q = cirq.LineQubit.range(2)
circuit = cirq.Circuit([cirq.H(q[0]), cirq.CNOT(q[0], q[1]), cirq.measure(*q, key="m")])

result = sampler.run(circuit, repetitions=1024)
print(result.histogram(key="m"))

Quantum Hardware Available for Cirq

Run your Cirq circuits on trapped ion and superconducting QPUs from IonQ, Rigetti, IQM, and AQT. No vendor lock-in — switch backends with a single string change.

QPUQubitsTechnologyHighlightsProvider
IonQ Forte-136 qubitsTrapped Ion99.6% 2Q fidelity, software-configurable topologyLearn more
Rigetti Cepheus-1108 qubitsSuperconducting99.1% CZ fidelity, modular chiplet architectureLearn more
IQM Emerald54 qubitsSuperconducting99.5% CZ fidelity, European HPC integrationLearn more
IQM Garnet20 qubitsSuperconducting99.5% CZ fidelity, European HPC integrationLearn more
AQT Ibex-Q112 qubitsTrapped IonFully-connected, room temperature, rack-mountedLearn more

Frequently Asked Questions