Skip to content
Skillpedia
Misc51k · #1846

cirq

Allows creating and running circuits on Google's quantum computers. It's ideal for those working with quantum hardware and noise modeling.

What it does

Cirq is a tool for building and testing quantum computer programs. It lets you create quantum circuits, simulate how they would work, and run them on real quantum computers, especially Google's.

When to use it

  • ✓You want to build and test quantum circuits in Python.
  • ✓You need to run experiments on Google's quantum hardware.
  • ✓You want to simulate how a quantum circuit behaves, including potential errors.

Example of what to ask your AI

“Create a simple quantum circuit with two qubits, apply a Hadamard gate to one and a CNOT gate between them, and tell me the measurement outcome.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/cirq/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/cirq/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

Cirq allows you to define the basic building blocks of a quantum computer, like qubits and logic gates. You can then assemble these blocks into a circuit and use simulators or real hardware to see what happens.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add K-Dense-AI/scientific-agent-skills --skill cirq

Or download just the file:

curl -L https://raw.githubusercontent.com/K-Dense-AI/scientific-agent-skills/main/skills/cirq/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Cirq - Quantum Computing with Python

Cirq is Google Quantum AI's open-source framework for designing, simulating, and running quantum circuits on quantum computers and simulators.

When to Use This Skill

Use this skill when:

  • Building, simulating, or optimizing NISQ circuits in Python
  • Running jobs on Google Quantum AI processors (via cirq-google) or partner backends (IonQ, Azure Quantum, AQT, Pasqal)
  • Modeling noise, compiling to hardware gatesets, or designing characterization experiments
  • Using parameter sweeps, transformers, or the ReCirq experiment patterns

For IBM hardware use qiskit; for quantum ML with autodiff use pennylane; for physics simulations use qutip.

Installation

Examples target Cirq 1.7.0 on Python 3.11+. Keep Cirq vendor packages on the matching release; independently versioned integrations such as Azure Quantum need their own compatibility check.

uv pip install "cirq-core==1.7.0"
# Optional OpenQASM import dependency
uv pip install ply

For hardware integration (pin matching versions for reproducibility):

# Google Quantum Engine (requires approved GCP project access)
uv pip install "cirq-google==1.7.0"

# IonQ
uv pip install "cirq-ionq==1.7.0"

# AQT (Alpine Quantum Technologies)
uv pip install "cirq-aqt==1.7.0"

# Pasqal
uv pip install "cirq-pasqal==1.7.0"

# Azure: use a SEPARATE environment; its current extras require Cirq <1.7.
uv pip install "qdk[azure,cirq]==1.32.3" "azure-quantum==3.13.0"

Pin all cirq-* packages in an environment to the same release. The Azure example targets its supported Cirq 1.6.1 stack separately; do not force Cirq 1.7.0 into it. Cirq 1.7.0 updates the IonQ adapter to API v0.4.

Local examples were checked with synthetic circuits. Hardware examples are illustrative and were checked against released source and provider documentation, without submitting cloud jobs. See review evidence.

Quick Start

Basic Circuit

import cirq
import numpy as np

# Create qubits
q0, q1 = cirq.LineQubit.range(2)

# Build circuit
circuit = cirq.Circuit(
    cirq.H(q0),              # Hadamard on q0
    cirq.CNOT(q0, q1),       # CNOT with q0 control, q1 target
    cirq.measure(q0, q1, key='result')
)

print(circuit)

# Simulate
simulator = cirq.Simulator(seed=42)
result = simulator.run(circuit, repetitions=1000)

# Display results
print(result.histogram(key='result'))

Parameterized Circuit

import sympy

# Define symbolic parameter
theta = sympy.Symbol('theta')

# Create parameterized circuit
circuit = cirq.Circuit(
    cirq.ry(theta)(q0),
    cirq.measure(q0, key='m')
)

# Sweep over parameter values
sweep = cirq.Linspace('theta', start=0, stop=2*np.pi, length=20)
results = simulator.run_sweep(circuit, params=sweep, repetitions=1000)

# Process results
for params, result in zip(sweep, results):
    theta_val = params['theta']
    counts = result.histogram(key='m')
    print(f"θ={theta_val:.2f}: {counts}")

Core Capabilities

Circuit Building

For comprehensive information about building quantum circuits, including qubits, gates, operations, custom gates, and circuit patterns, see:

Common topics:

  • Qubit types (GridQubit, LineQubit, NamedQubit)
  • Single and two-qubit gates
  • Parameterized gates and operations
  • Custom gate decomposition
  • Circuit organization with moments
  • Standard circuit patterns (Bell states, GHZ, QFT)
  • Import/export (OpenQASM, JSON)
  • Working with qudits and observables

Simulation

For detailed information about simulating quantum circuits, including exact simulation, noisy simulation, parameter sweeps, and the Quantum Virtual Machine, see:

Common topics:

  • Exact simulation (state vector, density matrix)
  • Sampling and measurements
  • Parameter sweeps (single and multiple parameters)
  • Noisy simulation
  • State histograms and visualization
  • Quantum Virtual Machine (QVM)
  • Expectation values and observables
  • Performance optimization

Circuit Transformation

For information about optimizing, compiling, and manipulating quantum circuits, see:

Common topics:

  • Transformer framework
  • Gate decomposition

…

FAQ

What are quantum circuits?

Quantum circuits are like programs for quantum computers. They are made up of qubits (the basic unit of quantum information) and quantum gates (operations that change the state of qubits).

Can I use Cirq on any quantum computer?

Cirq is optimized for Google's hardware but can also be used with other providers like IonQ and Azure Quantum. For IBM hardware, it's best to use Qiskit.

What is noise simulation?

Quantum computers are sensitive to errors (noise). Noise simulation in Cirq helps predict how these errors might affect your circuit's outcome.

Details

Original description by the author

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.

repo: K-Dense-AI/scientific-agent-skills

Popularity

GitHub stars
51k
Ranking position
#1846
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills