| Cirq | |
|---|---|
| Developers | quantumlib |
| Implementation language | Python |
| License | Apache license |
| Website | GitHub |
Cirq is anopen-sourceframework fornoisy intermediate scale quantum (NISQ) computers.[1]
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.[2] A demo byQC Ware showed an implementation of QAOA solving an example of themaximum cut problem being solved on a Cirq simulator.[3]
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.[4] The programs can be executed on local simulators[5] or against hardware supplied byIonQ,Pasqal,[6]Rigetti, andAlpine Quantum Technologies[7]
The following example shows how to create and measure aBell state in Cirq.
importcirq# Pick qubitsqubit0=cirq.GridQubit(0,0)qubit1=cirq.GridQubit(0,1)# Create a circuitcircuit=cirq.Circuit(cirq.H(qubit0),cirq.CNOT(qubit0,qubit1),cirq.measure(qubit0,key="m0"),cirq.measure(qubit1,key="m1"))
Printing the circuit displays its diagram
print(circuit)# prints# (0, 0): ───H───@───M('m0')───# │# (0, 1): ───────X───M('m1')───
Simulating the circuit repeatedly shows that the measurements of the qubits are correlated.
simulator=cirq.Simulator()result=simulator.run(circuit,repetitions=5)print(result)# prints# m0=11010# m1=11010
OpenFermion is a library that compiles quantum simulation algorithms to Cirq.[2]
TensorFlow Quantum is an extension ofTensorFlow that allows TensorFlow to be used to explore hybrid classical-quantum machine learning algorithms.[8]
ReCirq is a repository of research projects done using Cirq.[9]
Qsim is a high performance wave function simulator that leverages gate fusing, AVS/FMA instructions, and OpenMP to achieve fast simulation rates. Qsimcirq allows one to use qsim from within Cirq.[10]