Cirq is an
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
framework
A framework is a generic term commonly referring to an essential supporting structure which other things are built on top of.
Framework may refer to:
Computing
* Application framework, used to implement the structure of an application for an op ...
for
noisy intermediate scale quantum (NISQ) 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
QC Ware is a quantum-computing-as-a-service company based in Palo Alto, California.
History
QC Ware was founded in 2014 by Matt Johnson, KJ Sham, and Randall Correll after Johnson met a group of researchers at NASA Ames interested in quantum c ...
showed an implementation of QAOA solving an example of the
maximum cut
For a graph, a maximum cut is a cut whose size is at least the size of any other cut. That is, it is a partition of the graph's vertices into two complementary sets and , such that the number of edges between and is as large as possible. F ...
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
IonQ is a quantum computing hardware and software company based in College Park, Maryland. They are developing a general-purpose trapped ion quantum computer and software to generate, optimize, and execute quantum circuits.
History
IonQ was co-f ...
,
Pasqal,
Rigetti
Rigetti Computing is a Berkeley, California-based developer of quantum integrated circuits used for quantum computers. The company also develops a cloud platform called Forest that enables programmers to write quantum algorithms.
History
Rigett ...
, and
Alpine Quantum Technologies
Alpine may refer to any mountainous region. It may also refer to:
Places Europe
* Alps, a European mountain range
** Alpine states, which overlap with the European range
Australia
* Alpine, New South Wales, a Northern Village
* Alpine Nationa ...
The following example shows how to create and measure a
Bell state
The Bell states or EPR pairs are specific quantum states of two qubits that represent the simplest (and maximal) examples of quantum entanglement; conceptually, they fall under the study of quantum information science. The Bell states are a fo ...
in Cirq.
import cirq
# Pick qubits
qubit0 = cirq.GridQubit(0, 0)
qubit1 = cirq.GridQubit(0, 1)
# Create a circuit
circuit = cirq.Circuit.from_ops(
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
Projects
OpenFermion
OpenFermion is a library that compiles quantum simulation algorithms to Cirq.
TensorFlow Quantum
TensorFlow Quantum is an extension of
TensorFlow
TensorFlow is a free and open-source software library for machine learning and artificial intelligence. It can be used across a range of tasks but has a particular focus on training and inference of deep neural networks. "It is machine learning ...
that allows TensorFlow to be used to explore hybrid classical-quantum machine learning algorithms.
ReCirq
ReCirq is a repository of research projects done using Cirq.
Qsim Cirq
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.
References
{{quantum computing
Quantum programming