cirq

Google quantum computing framework. Use when targeting Google Quantum AI hardware, designing noise-aware circuits, or running quantum characterization experiments. Best for Google hardware, noise modeling, and low-level circuit design. For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

Install

Hot:4

Download and extract to your skills directory

Copy command and send to OpenClaw for auto-install:

Download and install this skill https://openskills.cc/api/download?slug=k-dense-ai-scientific-skills-cirq&locale=en&source=copy

Cirq - Google's quantum computing framework

Overview

Cirq is a Python quantum computing framework developed by Google Quantum AI for designing, simulating, and running quantum circuits. It supports Google quantum hardware and various third-party quantum computing platforms.

Use cases

1. Google quantum hardware development

When you need to run quantum circuits directly on Google Quantum AI's Sycamore or Weber processors, Cirq provides native support. It handles device topology constraints, qubit selection, and gate decomposition to help your code run smoothly on real quantum hardware.

2. Noise-aware circuit design

If your research involves quantum noise modeling, error characterization, or error mitigation, Cirq's noise simulation features can help you build realistic noise models. It supports depolarizing noise, amplitude damping, phase damping, and other noise channels, suitable for quantum fidelity analysis and noise benchmarking.

3. Development of quantum algorithm experiments

When you need to implement variational quantum algorithms (such as VQE, QAOA) or perform parameter sweep experiments, Cirq's parameterized circuits and sweep functionality can greatly simplify your code. Combined with the ReCirq framework, you can quickly build reproducible quantum experiment workflows.

Core features

Quantum circuit construction and simulation

Cirq provides an intuitive API for building quantum circuits and supports various qubit types (LineQubit, GridQubit, NamedQubit) and standard quantum gate operations. It includes built-in state-vector and density-matrix simulators that can accurately simulate circuit behavior, and supports parameterized circuit design and batched parameter sweeps.

Multi-hardware platform integration

In addition to Google Quantum AI, Cirq also supports hardware providers such as IonQ (ion traps), Azure Quantum, AQT, Pasqal, and others. Through a unified interface, you can switch code between different platforms without rewriting core logic.

Circuit optimization and compilation

Cirq's Transformer framework provides a set of circuit optimization tools, including gate merging, Z-gate elimination, removal of negligible operations, and more. For specific hardware, it can also perform qubit routing and SWAP insertion, automatically compiling circuits into the native gate set of the target device.

Frequently asked questions

What is the difference between Cirq and Qiskit? Which should I choose?

Cirq is primarily optimized for Google quantum hardware and excels in noise modeling and low-level circuit design. If your target is Google Quantum AI or you need to study noise characteristics in depth, Cirq is the better choice. Qiskit is more suited for IBM quantum hardware and is more mature in quantum machine learning integration. They are similar in basic circuit design functionality; the main differences lie in hardware ecosystems and the surrounding toolchains.

How many qubits can Cirq simulate?

Theoretically there is no hard limit, but in practice it is constrained by memory. State-vector simulation requires memory proportional to 2^n (n is the number of qubits); an ordinary computer can typically simulate 20–25 qubits. Density-matrix simulation (used for noisy scenarios) requires more memory, usually limiting you to 15–20 qubits. For Clifford circuits, you can use more efficient stabilizer simulators to simulate larger numbers of qubits.

Is Cirq suitable for beginners learning quantum computing?

Cirq's Python API is relatively concise and developer-friendly for those with a Python background, and can serve as a starting point for learning quantum computing. However, note that Cirq is closer to a "low-level" framework, focusing on precise control of quantum circuits and not providing high-level algorithm templates like some other frameworks. If you're mainly interested in quantum machine learning or automatic differentiation, you might consider more specialized frameworks such as PennyLane. For pure physical simulations, Qutip may be more suitable.