Experiments using quantum circuits

This is a collection of algorithms and experiments written in and using Cirq. A couple of them use only base Cirq, but the rest use additional code stored in ReCirq, a Github repository for research code that uses and builds upon Cirq.

Algorithms in base Cirq

Algorithms and experiments executable using only default Cirq code.
A workshop notebook with examples that covers algorithms commonly shown in quantum textbooks.
The famous integer factorization algorithm by Peter Shor.
Compute the ground state of a Hamiltonian using the variational principle.
The quantum analog of a random walk algorithm.
Demonstrate the separation between quantum and classical computers.
Show quantum separation with a constant depth solution.

ReCirq Experiments

Research experiments that use additional library code that resides in the external ReCirq repository.

ReCirq Guide

How to use and contribute to ReCirq.
How to use this code.
How ReCirq experiments are structured.
How ReCirq experiments collect data.
How ReCirq experiments analyze data.
Additional advice on writing ReCirq experiments.


Tutorials and examples with the Quantum Approximate Optimization Algorithm.
Introductory QAOA problems.
QAOA experiment Task object.
QAOA analysis with precomputed optimal angles.
QAOA analysis with a hardware landscape.
QAOA analysis with an optimization path.
QAOA on grid-shaped hardware.
Use t|ket> to map QAOA to a generic device.

Hartree-Fock VQE

How to run the Hartree-Fock Variational Quantum Eigensolver experiment.
A short tutorial to show HFVQE in action.
How to make molecule files for use with HFVQE.


Simulating spin and charge dynamics with a Fermi-Hubbard model.
End-to-end with a single instance of the Fermi-Hubbard experiment.
Experimental data collected and analyzed.

Quantum Scrambling

Use out-of-time-order (OTOC) correlators to demonstrate quantum scrambling.
Build, run and plot an OTOC circuit.

Toric Code

Explore the toric code model of interacting qubits.
Create a toric code ground state.