Cirq


Cirq is an open-source framework for Noisy Intermediate Scale Quantum computers.

History

Cirq was developed by the Google AI Quantum Team, and the public alpha was announced at the International Workshop on Quantum Software and Quantum Machine Learning on July 18, 2018. A demo by QC Ware showed an implementation of QAOA solving an example of the maximum cut problem being solved on a Cirq simulator.

Usage

Quantum programs in Cirq are represented by "Circuit" and "Schedule" where "Circuit" represents a Quantum circuit and "Schedule" represents a Quantum circuit with timing information. The programs can be executed on local simulators.
The following example shows how to create and measure a Bell state in Cirq.

import cirq
  1. Pick qubits
qubit0 = cirq.GridQubit
qubit1 = cirq.GridQubit
  1. Create a circuit
circuit = cirq.Circuit.from_ops,
cirq.CNOT,
cirq.measure,
cirq.measure

Printing the circuit displays its diagram

print
  1. prints
  2. : ───H───@───M───
  3. : ───────X───M───

Simulating the circuit repeatedly shows that the measurements of the qubits are correlated.

simulator = cirq.Simulator
result = simulator.run
print
  1. prints
  2. m0=11010
  3. m1=11010

Projects

OpenFermion-Cirq

OpenFermion-Cirq is a library that compiles quantum simulation algorithms to Cirq.