SymPhase.jl

A high-performance module for sampling stabilizer circuits by symbolizing the phases of Pauli strings.
Author njuwfang
Popularity
7 Stars
Updated Last
8 Months Ago
Started In
October 2023

SymPhase.jl

Stable Dev Build Status Coverage

A high-performance Julia module for sampling stabilizer circuits by symbolizing the phases of Pauli strings. See the arXiv paper describing SymPhase.

Installation

To install it, run Julia 1.9+ REPL and use:

] add https://github.com/njuwfang/SymPhase.jl.git

Benchmarks

We have compared SymPhase.jl with Stim in the arXiv paper.

To reproduce the experiment, follow the procedure:

  1. Install Stim (as of 7/11/2023, the latest stable version is 1.12.0) with pip.

    pip install stim==1.12.0
  2. Follow the instruction Installation to install Symphase.jl.

  3. Clone this repo and go to the example directory.

    git clone https://github.com/njuwfang/SymPhase.jl.git && cd ./SymPhase.jl/example/
  4. Generate benchmark files (in .stim format).

    julia generate_randomcircuits.jl

    Each circuit is made up of $n$ qubits with $n$ layers. Each layer randomly applies an $H$, $S$ and $I$ gate to each qubit, then applies $\mathit{CNOT}$ gates, then samples 5% of the qubits to measure in the computational basis. At the end of the circuit, each qubit is measured in the computational basis.

    • for ./stim_benchmark/randomxxx.stim, each layer randomly selects 5 pairs (1 pair in Stim's paper) of qubits to apply $\mathit{CNOT}$ gates.
    • for ./stim_benchmark/randomxxx_xxxCNOT.stim, each layer randomly selects $\lfloor\frac{n}{2}\rfloor$ pairs of qubits to apply $\mathit{CNOT}$ gates.
    • for ./stim_benchmark/randomxxx_xxxCNOT_dep.stim, each layer randomly selects $\lfloor\frac{n}{2}\rfloor$ pairs of qubits to apply $\mathit{CNOT}$ gates and additionally applies single-qubit depolarize noise to each qubit.
  5. Benchmark Stim and SymPhase.jl.

    python3 benchmark_stim.py
    julia benchmark_symphase.jl

    The benchmark results are stored in files with the .dat suffix.