back to home

quantumlib / Cirq

Python framework for creating, editing, and running Noisy Intermediate-Scale Quantum (NISQ) circuits.

4,888 stars
1,192 forks
139 issues
PythonJupyter NotebookTypeScript

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing quantumlib/Cirq in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/quantumlib/Cirq)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

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: Python should then print output similar to this: 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 • [Video tutorials] on YouTube are an engaging way to learn Cirq. • [Jupyter notebook-based tutorials] let you learn Cirq from your browser – no installation needed. • [Text-based tutorials] on the Cirq home page are great when combined with a local [installation] of Cirq on your computer. After starting with the [basics], you'll be ready to dive into tutorials on circuit building and circuit simulation under the [Build] and [Simulate] tabs, respectively. Check out the other tabs for more! [Video tutorials]: https://www.youtube.com/playlist?list=PLpO2pyKisOjLVt_tDJ2K6ZTapZtHXPLB4 [Jupyter notebook-based tutorials]: https://colab.research.google.com/github/quantumlib/Cirq [Text-based tutorials]: https://quantumai.google/cirq [installation]: https://quantumai.google/cirq/start/install [basics]: https://quantumai.google/cirq/start/basics [Build]: https://quantumai.google/cirq/build [Simulate]: https://quantumai.google/cirq/simula Reference Documentation • Docs for the [current stable release] correspond to what you get with . • Docs for the [pre-release] correspond to what you get with . [current stable release]: https://quantumai.google/reference/python/cirq/all_symbols [pre-release]: https://quantumai.google/reference/python/cirq/all_symbols?version=nightly 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 interests | Software 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? | [OpenFermion] [OpenFermion-FQE] [OpenFermion-PySCF] [OpenFermion-Psi4] | | Quantum machine learning (QML)? | [TensorFlow Quantum] | | Real experiments using Cirq? | [ReCirq] | [Qualtran]: https://github.com/quantumlib/qualtran [qsim]: https://github.com/quantumlib/qsim [Stim]: https://github.com/quantumlib/stim [OpenFermion]: https://github.com/quantumlib/openfermion [OpenFermion-FQE]: https://github.com/quantumlib/OpenFermion-FQE [OpenFermion-PySCF]: https://github.com/quantumlib/OpenFermion-PySCF [OpenFermion-Psi4]: https://github.com/quantumlib/OpenFermion-Psi4 [TensorFlow Quantum]: https://github.com/tensorflow/quantum [ReCirq]: https://github.com/quantumlib/ReCirq Community 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]. [contributions]: https://github.com/quantumlib/Cirq/graphs/contributors [code of conduct]: https://github.com/quantumlib/cirq/blob/main/CODE_OF_CONDUCT.md Announcements Stay on top of Cirq developments using the approach that best suits your needs: • For releases and major announcements: sign up to the low-volume mailing list [ ]. • For releases only: • Via GitHub notifications: configure [repository notifications] for Cirq. • Via Atom/RSS from GitHub: subscribe to the GitHub [Cirq releases Atom feed]. • Via RSS from PyPI: subscribe to the [PyPI releases RSS feed] for Cirq. Cirq releases take place approximately every quarter. [ ]: https://groups.google.com/forum/#!forum/cirq-announce [repository notifications]: https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/configuring-notifications [Cirq releases Atom feed]: https://github.com/quantumlib/Cirq/releases.atom [PyPI releases RSS feed]: https://pypi.org/rss/project/cirq/releases.xml Questions and Discussions • Have que…