A high-performance Julia module for sampling stabilizer circuits by symbolizing the phases of Pauli strings. See the arXiv paper describing SymPhase.
To install it, run Julia 1.9+ REPL and use:
] add https://github.com/njuwfang/SymPhase.jl.git
We have compared SymPhase.jl with Stim in the arXiv paper.
To reproduce the experiment, follow the procedure:
-
Install Stim (as of 7/11/2023, the latest stable version is 1.12.0) with
pip
.pip install stim==1.12.0
-
Follow the instruction Installation to install Symphase.jl.
-
Clone this repo and go to the
example
directory.git clone https://github.com/njuwfang/SymPhase.jl.git && cd ./SymPhase.jl/example/
-
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.
- for
-
Benchmark Stim and SymPhase.jl.
python3 benchmark_stim.py
julia benchmark_symphase.jl
The benchmark results are stored in files with the
.dat
suffix.