This repo contains the code for the paper Learning quantum states and unitaries of bounded gate complexity.
The code implements the state learning algorithm detailed in the paper and study how its sample complexity
Thanks to the features of TensorCircuit and JAX, our implementation support automatic vectorization and just-in-time (JIT) compilation. It can be executed on CPU, GPU, or TPU.
The code is written in Python3 and built upon TensorCircuit and JAX.
To execute it, we need to first install numpy
, jax
, tensorcircuit
, qiskit
, tqdm
. To plot figures, we also need matplotlib
and SciencePlots
.
They can all be installed using PyPI.
circuit.py
contains elementary circuit functions including generating random circuit architectures and gate sequences, simulate circuits, computing fidelity, and junta learning.
shadow.py
implements Clifford classical shadow using JAX and TensorCircuit.
One can choose to replace Clifford gates with Haar random unitaries to reduce statistical fluctuation.
We also implement "shallow shadows" where global Clifford rotations are replaced by brickwork Clifford circuits with depth
learn.py
implements the learning algorithm.
test.py
contains the pipeline for mass production that reproduces the data in the paper.
plot.py
plots the figures.