Skip to content
A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
check Make bash_scripts_test more tolerant to different git tool versions (#… Nov 23, 2018
cirq fixed docstring for CZPowGate (#1453) Mar 21, 2019
continuous-integration
dev_tools XmonSimulator now requires given circuits to have an XmonDevice that … Mar 20, 2019
docs XmonSimulator now requires given circuits to have an XmonDevice that … Mar 20, 2019
examples
.gitignore
.readthedocs.yml
.travis.yml
AUTHORS
CONTRIBUTING.md
Dockerfile
LICENSE Restores the generic apache 2 license file Mar 28, 2018
MANIFEST.in
README.rst Add readthedocs build badge and fix requirements file path (#1196) Nov 27, 2018
WORKSPACE
apt-system-requirements.txt Make it clearer dev-requirements does not contain dependencies by mov… Aug 8, 2018
release.md
requirements.txt
setup.cfg
setup.py
style.md Make it clearer dev-requirements does not contain dependencies by mov… Aug 8, 2018

README.rst

Cirq

Cirq is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators.

Build Status Documentation Status

Installation

Follow these instructions.

Hello Qubit

A simple example to get you up and running:

import cirq

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

# Create a circuit
circuit = cirq.Circuit.from_ops(
    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)

Example output:

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

Documentation

See here or jump into the tutorial.

Contributing

We welcome contributions. Please follow these guidelines.

We use Github issues for tracking requests and bugs. Please post questions to the Quantum Computing Stack Exchange with a 'cirq' tag.

See Also

For those interested in using quantum computers to solve problems in chemistry and materials science, we encourage exploring OpenFermion and its sister library for compiling quantum simulation algorithms in Cirq, OpenFermion-Cirq.

Alpha Disclaimer

Cirq is currently in alpha. We are still making breaking changes. We will break your code when we make new releases. We recommend that you target a specific version of Cirq, and periodically bump to the latest release. That way you have control over when a breaking change affects you.

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

You can’t perform that action at this time.