## Tutorials and examples

Cirq comes with a collection of example implementations of beginner, intermediate, and advanced quantum algorithms that demonstrate the main features of the library.

## Beginner

Explore Cirq through introductory quantum information examples.

### Basics

Learn the basics of Cirq.

## Intermediate

Use Cirq for intermediate-level subroutines and algorithms.

### Quantum variational algorithm

Use the variational quantum eigensolver to find the ground state of the Ising model.

### Approximate optimization

Use a quantum computer to find approximately optimal cuts in a graph.

### Quantum walks

Demonstration of classical and quantum random walks on a graph.

## Advanced

Utilize Cirq features to implement advanced quantum algorithms.

### Hidden linear function problem

Find a hidden vector with a constant depth quantum circuit.

### Rabi oscillation experiment

Example of using sweeps and symbols to show rotation of a qubit by different angles.

### Shor's algorithm

Factor numbers using a quantum computer.

## GitHub

See more examples on the Cirq GitHub.

## Beginner

### Hello qubit

Simple first program showing how to create a quantum circuit.

### Deutsch's algorithm

Textbook example of the simplest quantum advantage.

### Bernstein-Vazirani algorithm

Textbook algorithm determining a global property of a function with surprisingly few calls to it.

### Bell inequality

Demonstration of a Bell inequality which shows impossibility of local hidden variable theories.

### BB84

Textbook algorithm for Quantum Key Distribution.

### Noisy simulation

How to use a noisy simulator to execute quantum circuits.

### Qubit placement

How to find a line of adjacent qubits on a device.

### Quantum teleportation

A demonstration of using 2 classical bits to transport a quantum state from one qubit to another.

### Superdense coding

Transmit 2 classical bits using one quantum bit.

### Heatmaps

Visualize single qubit and two-qubit interaction metrics

## Intermediate

### Arithmetic

Algorithms for adding and multiplying numbers represented by quantum states.

### Grover's algorithm

Use a quantum computer to find a needle in a haystack.

### Shor's code

Quantum error correction with Shor's nine-qubit code.

### Quantum Fourier transform

Change from the computational basis to the frequency basis and vice versa.

### Phase estimation

Find the eigenvalues of a unitary operator.

### Swap networks

Algorithm for efficiently emulating full connectivity on a limited connectivity grid of qubits.

## Advanced

### Direct fidelity estimation

Direct fidelity estimation to distinguish a desired state fromt he actual state using few Pauli measurements.

### XEB

Fidelity estimation using cross-entropy benchmarking (XEB).

### HHL

Algorithm for solving linear systems using quantum phase estimation.

### Stabilizer code

An illustration of quantum error correction using stabilizer code, following the PhD thesis of Daniel Gottesman.