hongyehu / PyClifford

An intuitive programming package for simulating and analyzing Clifford circuits, quantum measurement, and stabilizer states with applications to many-body localization, classical shadows, quantum chemistry and error correction code.
https://hongyehu.github.io/PyCliffordPages/intro.html
BSD 3-Clause "New" or "Revised" License
69 stars 13 forks source link
classical-shadow clifford-gates many-body-physics numba python quantum-chemistry quantum-computing stabilizer-code t-gates
Alt text

Unitary Fund

license version

About

This is a python based clifford circuit simulation package which not only offers the fast simulation but also supports analytical level manipulation of pauli operators and stabilizer states. And we are working on quantum circuit (strong/weak) simulations that include a few T-gates. To get started, in PyClifford Jupyter Book, we have made several jupyter notebooks to illustrate the basics of PyClifford.

Installation of PyClifford also installs TorchClifford a parallel package that contains the same functionality but in a vectorized and GPU-friendly format. To use TorchClifford, simply import torchclifford rather than import pyclifford.

Also, there are several application shows cases below that are helpful.

:fire: New Feature :fire:

We're excited to introduce our latest feature!: :sparkles:

Quotes from our first few users:

Application show cases:

Alt text

(We are still working on making detailed examples in those jupyter notebooks)

  1. Solving strong disordered Hamiltonian by Spectrum Bifurcation Renormalization Group (Condensed Matter Physics) Link
  2. Measurement induced phase transition (Condensed Matter Physics/Quantum Error Correction) Link
  3. Classical shadow tomography with shallow layers (Quantum Computation & Information) Link
  4. Clifford ansatz for quantum chemistry (Quantum Computation & Quantum Chemistry) Link

Structure of PyClifford:

The structure of PyClifford is illustrated below. Pauli strings, stabilizer states, and Clifford maps are represented by binary or integer strings. All the low-level calculation is in the utils.py with JIT compliation. Then paulialg.py handles all the Pauli algebra and manipulation of Pauli string lists. On top of that, we have built stabilizer.py to handle stabilizer states and Clifford maps. Finally, circuit.py gives user an easy access to all the functions.

In addition, we are interested in developing PyCliffordExt as an extension to PyClifford, where we would like to include few-T gate into the package. If you are interested in its physics or contributing to the code, please feel free to contact us!

Alt text

Dependence of PyClifford and TorchClifford:

What will in the next release (Mid-March):