Skip to content

A Julia library for Pauli propagation simulation of quantum circuits and quantum systems.

License

Notifications You must be signed in to change notification settings

MSRudolph/PauliPropagation.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PauliPropagation.jl

PauliPropagation.jl is a Julia package for Pauli propagation simulation of quantum circuits and quantum systems.

The package estimates expectation values of observables expressed in the Pauli basis under evolution of noiseless and noisy quantum circuits. For example, $Tr[\rho \mathcal{D}(\hat{O})]$ where $\hat{O}$ is an observable that is preferably sparse in Pauli basis, $\mathcal{D}$ is a quantum circuit, and $\rho$ a quantum state. For the case of unitary quantum circuits $U$, this is commonly written as $Tr[\rho U^\dagger \hat{O} U]$.

Installation

The PauliPropagation.jl package is not yet registered. But you can install it in at least the following two ways:

Install from GitHub

You can install the package using Pkg from the following link: https://github.com/MSRudolph/PauliPropagation.jl.git.
For example, if you are working with a Jupyter notebook, run

using Pkg
Pkg.add(url="https://github.com/MSRudolph/PauliPropagation.jl.git")

where you can use the keyword rev="branchname" to install the version on a particular branch if you want to contribute to the package.

Clone repository and install locally

Navigate to a local directory where you want to clone this repository into and run the following in a terminal

git clone git@github.com:MSRudolph/PauliPropagation.jl.git

Inside this cloned repository you can now freely import PauliPropagation or install it into your environment.
Alternatively, you can push the relative path to the cloned repository to the Julia package load path called LOAD_PATH via

rel_path = "your/relative/path/PauliPropagation"
push!(LOAD_PATH,rel_path);

Examples

You can find example notebooks in the examples folder.

Here is a tiny working example where we approximately simulate the expectation value of a quantum circuit.

using PauliPropagation

## number of qubits
nqubits = 32

## define the observable
# here I...IZI...I
observable = PauliString(nqubits, :Z, 16)

## define the circuit
# the number of layers
nlayers = 32

# bricklayertopology is also the default if you don't provide any
topology = bricklayertopology(nqubits; periodic=true)

# a circuit containing RX and RZZ Pauli gates on the topology
# derived from the Trotterization of a transverse field Ising Hamiltonian
circuit = tfitrottercircuit(nqubits, nlayers; topology=topology)

# time step
dt = 0.1
# count the number of parameters
nparams = countparameters(circuit)
# define the parameter vector
parameters = ones(nparams) * dt

## the truncations
# maximum Pauli weight
max_weight = 6
# minimal coefficient magnitude
min_abs_coeff = 1e-4

## propagate through the circuit with our best (and currently only propagation method)
pauli_sum = propagate(circuit, observable, parameters; max_weight=max_weight, min_abs_coeff=min_abs_coeff)

## overlap with the initial state
overlapwithzero(pauli_sum)
# yields 0.154596728241...

Important Notes and Caveats

All of the following points can be addressed by you writing the necessary missing code due to the nice extensibility of Julia.

  • The package is tested for Julia 1.10.
  • The default is the Heisenberg backpropagation (with Schrödinger propagation coming soon).
  • We currently do not support the strong simulation of quantum states in non-exponential time (even for Stabilizer states).
  • Sampling quantum states is currently not supported.
  • Many underlying data structures and functions can be used for other purposes involving Pauli operators.

Upcoming Features

This package is still work-in-progress. You will probably find certain features that you would like to have and that are currently missing.
Here are some features that we want to implement in the future. Feel free to contribute!

  • A documentation website!
  • Easier Schrödinger picture propagation. Currently, the default is Heisenberg and there is no easy way to transpose the gates.
  • Gates with several parameters. Currently, each parametrized gate takes exactly one parameter. Multi-parameter gates have to be decomposed.
  • A fast and flexible Surrogate version. Currently, we provide a version of the Pauli propagation Surrogate that is good and works, at least for Pauli gates and Clifford gates. Stay tuned for a whole lot more.

How to contribute

We have a Slack channel #pauli-propagation in the Julia Slack.

If something bothers you or you want to propose an enhancement, please open an Issue describing everything in detail.

For a concrete change of code, please fork this GitHub repository and submit a Pull Request.

Otherwise, feel free to reach out to the developers!

Authors

The main developer of this package is Manuel S. Rudolph in the Quantum Information and Computation Laboratory of Prof. Zoë Holmes at EPFL, Switzerland. Contact Manuel via manuel.rudolph@epfl.ch.

This package is the derivative of ongoing collaborations with Armando Angrisani and Tyson Jones at EPFL, supervised by Prof. Zoë Holmes at EPFL.

Further contributors to this package include Yanting Teng and Su Yeon Chang.

For more specific code issues, bug fixes, etc. please open a GitHub issue.

If you are publishing research using PauliPropagation.jl, please cite this library and our upcoming paper presenting it (coming soon(ish)).

Related publications

Some of the developers of this package are co-authors in the following papers using Pauli propagation and (at least parts of) this code: