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" which is made up of a series of "Moments" representing slices of quantum gates that should be applied at the same time. The programs can be executed on local simulators or against hardware supplied by IonQ, Pasqal, Rigetti, and Alpine Quantum TechnologiesThe following example shows how to create and measure a Bell state in Cirq.
import cirq
- Pick qubits
qubit1 = cirq.GridQubit
- Create a circuit
cirq.CNOT,
cirq.measure,
cirq.measure
Printing the circuit displays its diagram
- prints
- : ───H───@───M───
- │
- : ───────X───M───
Simulating the circuit repeatedly shows that the measurements of the qubits are correlated.
simulator = cirq.Simulator
result = simulator.run
- prints
- m0=11010
- m1=11010