Skip to content
/ Cirq Public
forked from quantumlib/Cirq

A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.

License

Notifications You must be signed in to change notification settings

mhucka/Cirq

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cirq logo

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

Licensed under the Apache 2.0 license Compatible with Python versions 3.10 and higher Google Colab Cirq project on PyPI Archived in Zenodo
GitHub contributors GitHub stars Cirq continuous integration status Code coverage report

FeaturesInstallationQuick StartDocumentationIntegrationsCommunityCiting CirqContact

Features

Google's quantum computer

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
  • Parametrized 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.10 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 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)

You should see the following output printed by Python:

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

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

Cirq Documentation

Documentation for Cirq is available in a variety of formats.

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 cirq~=1.0.dev.

Examples

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 thats let 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
Large circuits and/or a lot of simulations?
Quantum algorithms?
Fault-tolerant quantum computing (FTQC)?
Quantum error correction (QEC)?
Chemistry and/or material science?
Quantum machine learning (QML)?
Real experiments using Cirq?

Community

Cirq has benefited from open-source 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 code of conduct for our community.

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

  • Do you have questions about using Cirq? Post them to the Quantum Computing Stack Exchange and tag them with the cirq tag.
  • Would you like to get more involved? Cirq Cynq is our biweekly virtual meeting of contributors to discuss everything from issues to ongoing efforts, as well as to ask questions. Join the cirq-dev Google Group to get an automatic meeting invitation.

Issues and Pull Requests

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 various popular formats:

Download BibTeX bibliography record for latest Cirq release    Download MARCXML bibliography record for latest Cirq release    Download CSL JSON bibliography record for latest Cirq release

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

Contact

For any questions or concerns not addressed here, please email [email protected].

Disclaimer

Cirq is not an official Google product. Copyright 2019 The Cirq Developers

About

A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 91.8%
  • Jupyter Notebook 6.7%
  • TypeScript 0.9%
  • Shell 0.6%
  • Dockerfile 0.0%
  • Scilab 0.0%