Skip to content

General-purpose SDKs

Cirq

Maintained by quantumlib

Cirq is a major Python framework for circuit design, simulation, and research workflows, with a strong emphasis on circuit structure and hardware-aware experimentation.

PythonApache-2.0Flagship
Cirq illustration

Resource snapshot

Category

General-purpose SDKs

Stars

5K

Last pushed

May 27, 2026Updated 3mo ago

Open issues

118

Quickstart

Get running in a few lines.

Quickstart
import cirq

# Pick a qubit.
qubit = cirq.GridQubit(0, 0)

# Create a circuit.
circuit = cirq.Circuit(
    cirq.X(qubit)**0.5,  # Square root of NOT.
    cirq.measure(qubit, key='m')  # Measurement.
)
print("Circuit:")
print(circuit)

# Simulate the circuit several times.
simulator = cirq.Simulator()
result = simulator.run(circuit, repetitions=20)
print("Results:")
print(result)

What it is

Cirq is one of the core reference ecosystems in quantum software. For many developers, it offers a useful contrast to Qiskit because it highlights a different style of circuit construction, decomposition, and hardware-aware workflow design.

Understanding Cirq helps readers see that the ecosystem is not monolithic. Major SDKs solve similar problems with noticeably different abstractions, conventions, and strengths.

Last verified by Qtangl on May 27, 2026

Who it's for

Developers and researchers who want to compare major gate-model frameworks and understand device-aware circuit workflows.

What you can build or learn

  • Prototype circuits and simulation workloads in a major Python framework.
  • Compare circuit abstractions and decomposition strategies against Qiskit or PennyLane.
  • Learn how hardware-aware research code is often structured.

Code samples

Examples from the repository.

Quantum Utility Sim 4A (examples/advanced/quantum_utility_sim_4a.ipynb)
# Copyright 2023 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Quantum Utility Sim 4B (examples/advanced/quantum_utility_sim_4b.ipynb)
# Copyright 2023 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Quantum Volume (examples/advanced/quantum_volume.ipynb)
try:
    import cirq
except ImportError:
    print("installing cirq...")
    !pip install --quiet cirq
    print("installed cirq.")

Plays well with

Citation

BibTeX
@software{cirq,
  title = {Cirq},
  author = {Unknown},
  year = {2025},
}

License

Apache-2.0

SPDX identifier detected from the repository metadata or license files.

Repository README

Preview from the project README.

Rendered as Markdown inside a scrollable preview. Long READMEs stay contained; expand or open on GitHub for the full document.

~1,078 words · about 5 min readOpen on GitHub

Python package for writing, manipulating, and running quantum circuits on quantum computers and simulators.

Features – Installation – Quick Start – Documentation – Integrations – Community – Citing Cirq – Contact

Features

Cirq provides useful abstractions for dealing with today’s noisy intermediate-scale quantum (NISQ) computers, where the details of quantum hardware are vital to achieving state-of-the-art results. Some of its features include:

  • Flexible gate definitions and custom gates
  • Parameterized circuits with symbolic variables
  • Circuit transformation, compilation and optimization
  • Hardware device modeling
  • Noise modeling
  • Multiple built-in quantum circuit simulators
  • Integration with qsim for high-performance simulation
  • Interoperability with NumPy and SciPy
  • Cross-platform compatibility

Installation

Cirq supports Python version 3.11 and later, and can be used on Linux, MacOS, and Windows, as well as Google Colab. For complete installation instructions, please refer to the Install section of the online Cirq documentation.

Quick Start – “Hello Qubit” Example

Here is a simple example to get you up and running with Cirq after you have installed it. Start a Python interpreter, and then type the following:

import cirq

# Pick a qubit.
qubit = cirq.GridQubit(0, 0)

# Create a circuit.
circuit = cirq.Circuit(
    cirq.X(qubit)**0.5,  # Square root of NOT.
    cirq.measure(qubit, key='m')  # Measurement.
)
print("Circuit:")
print(circuit)

# Simulate the circuit several times.
simulator = cirq.Simulator()
result = simulator.run(circuit, repetitions=20)
print("Results:")
print(result)

Python should then print output similar to this:

Circuit:
(0, 0): ───X^0.5───M('m')───
Results:
m=11000111111011001000

Congratulations! You have run your first quantum simulation in Cirq. You can continue to learn more by exploring the many Cirq tutorials described below.

Cirq Documentation

The primary documentation site for Cirq is the Cirq home page on the Quantum AI website. There and elsewhere, a variety of documentation for Cirq is available.

Tutorials

Reference Documentation

  • Docs for the current stable release correspond to what you get with pip install cirq.
  • Docs for the pre-release correspond to what you get with pip install --upgrade cirq~=1.0.dev.

Examples

  • The examples subdirectory of the Cirq GitHub repo has many programs illustrating the application of Cirq to everything from common textbook algorithms to more advanced methods.
  • The Experiments page on the Cirq documentation site has yet more examples, from simple to advanced.

Change log

  • The Cirq releases page on GitHub lists the changes in each release.

Integrations

Google Quantum AI has a suite of open-source software that lets you do more with Cirq. From high-performance simulators, to novel tools for expressing and analyzing fault-tolerant quantum algorithms, our software stack lets you develop quantum programs for a variety of applications.

Your interestsSoftware to explore
Quantum algorithms?Fault-tolerant quantum computing (FTQC)?Qualtran
Large circuits and/or a lot of simulations?qsim
Circuits with thousands of qubits and millions of Clifford operations?Stim
Quantum error correction (QEC)?Stim
Chemistry and/or material science?OpenFermionOpenFermion-FQEOpenFermion-PySCFOpenFermion-Psi4
Quantum machine learning (QML)?TensorFlow Quantum
Real experiments using Cirq?ReCirq

Community

<img width="150em" alt="Total number of contributors to Cirq"

Cirq has benefited from contributions by over 200 people and counting. We are dedicated to cultivating an open and inclusive community to build software for quantum computers, and have a community code of conduct.

Announcements

Stay on top of Cirq developments using the approach that best suits your needs:

Cirq releases take place approximately every quarter.

Questions and Discussions

  • Have questions about Cirq? Post them to the Quantum Computing Stack Exchange and tag them with cirq. You can also search past questions using that tag – it's a great way to learn!
  • Want meet other Cirq developers and participate in discussions? Join Cirq Cynq, our biweekly virtual meeting of contributors. Sign up to cirq-dev to get an automatic meeting invitation!

Contributions

Citing Cirq

When publishing articles or otherwise writing about Cirq, please cite the Cirq version you use – it will help others reproduce your results. We use Zenodo to preserve releases. The following links let you download the bibliographic record for the latest stable release of Cirq in some popular formats:

release](https://img.shields.io/badge/Download%20record-e0e0e0.svg?style=flat-square&logo=LaTeX&label=BibTeX&labelColor=106f6e)](https://citation.doi.org/format?doi=10.5281/zenodo.4062499&style=bibtex)  

For formatted citations and records in other formats, as well as records for all releases of Cirq past and present, please visit the Cirq page on Zenodo.

Contact

For any questions or concerns not addressed here, please email quantum-oss-maintainers@google.com.

Disclaimer

This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.

Copyright 2019 The Cirq Developers.

Read on GitHub

Activity

Latest release

—

Watchers

191

Python support

—

Learn digest

Get monthly updates when library entries change.

Monthly digest: new library entries, updated flagships, and one editorial pick.

Related resources

Keep exploring nearby tools.

XanaduAI

pennylane

PennyLane is an open-source quantum software platform for quantum computing, quantum machine learning, and quantum chemistry.

PythonApache-2.0FlagshipQtangl relevant

3,229 stars · Updated 3mo ago

ProjectQ-Framework

ProjectQ

ProjectQ: An open source software framework for quantum computing

PythonApache-2.0Flagship

975 stars · Updated 3mo ago

QISKit

qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

PythonApache-2.0FlagshipQtangl relevant

7,412 stars · Updated 3mo ago

Qiskit

qiskit-terra

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.

PythonApache-2.0

7,412 stars · Updated 3mo ago

Microsoft

QuantumKatas

Tutorials and programming exercises for learning Q# and quantum computing

Jupyter NotebookMITFlagshipArchive

4,862 stars · Updated 2y ago

QuantumBFS

Yao.jl

Extensible, Efficient Quantum Algorithm Design for Humans.

JuliaApache-2.0Flagship

1,032 stars · Updated 3mo ago