Overview¶
Introduction¶
qecsim is a Python 3 package for simulating quantum error correction using stabilizer codes.
It is lightweight, modular and extensible, allowing additional codes, error models and decoders to be plugged in.
Components¶
qecsim includes three key abstract classes: qecsim.model.StabilizerCode
, qecsim.model.ErrorModel
and
qecsim.model.Decoder
.
StabilizerCode |
---|
n_k_d
stabilizers
logical_xs
logical_zs
logicals
validate()
|
ErrorModel |
---|
probability_distribution(probability):tuple
generate(code, probability):error
|
Decoder |
---|
decode(syndrome):recovery
|
A simulation run is executed by passing implementations of the key classes, along with an error_probability
to the
function qecsim.app.run_once()
.
app |
---|
run_once(code, error_model, decoder, error_probability):run_data
1. \(S \leftarrow\) code.stabilizers
2. \(L \leftarrow\) code.logicals
3. \(e \leftarrow\) error_model.generate(code, error_probability)
4. \(y \leftarrow e \odot S^T\)
5. \(r \leftarrow\) decoder.decode(code, \(y\))
6. sanity check \(r \odot S^T = y\)
7. success \(\iff (r \oplus e) \odot L^T = 0\)
run(code, error_model, decoder, error_probabilities, max_runs, max_failures):runs_data
merge(runs_data_list, …):runs_data_list
|
Notes¶
The binary symplectic product \(\odot\) is defined as \(A \odot B \equiv A \Lambda B \bmod 2\) where \(\Lambda = \left[\begin{matrix} 0 & I \\ I & 0 \end{matrix}\right]\).
Pauli operators -
stabilizers
,logicals
,error
,recovery
- are represented in binary symplectic form by NumPy arrays:numpy.array([0, 0, 1, 1, 0, 1, 1, 0]) # [0 0 1 1 | 0 1 1 0] = IZYX
The
qecsim.app
module also includes functions to execute fault-tolerant simulations, seeqecsim.app.run_once_ftp()
andqecsim.app.run_ftp()
, which delegate to a fault-tolerant decoder implementation ofqecsim.model.DecoderFTP
.The
qecsim.paulitools
module provides utility functions for manipulating Pauli operators in string and binary symplectic form.The
qecsim.graphtools
andqecsim.tensortools
modules provide support for graph matching and tensor network contraction as used by some decoder implementations.
Implementations¶
Stablizer code implementations include:
5-qubit code
qecsim.models.basic.FiveQubitCode
7-qubit Steane code
qecsim.models.basic.SteaneCode
Color 6.6.6 code
qecsim.models.color.Color666Code
Planar code
qecsim.models.planar.PlanarCode
Rotated planar code
qecsim.models.rotatedplanar.RotatedPlanarCode
Rotated toric code
qecsim.models.rotatedtoric.RotatedToricCode
Toric code
qecsim.models.toric.ToricCode
Error model implementations include:
Biased-depolarizing error model
qecsim.models.generic.BiasedDepolarizingErrorModel
Biased-Y-X error model
qecsim.models.generic.BiasedYXErrorModel
Bit-flip error model
qecsim.models.generic.BitFlipErrorModel
Bit-phase-flip error model
qecsim.models.generic.BitPhaseFlipErrorModel
Center slice error model
qecsim.models.generic.CenterSliceErrorModel
Depolarizing error model
qecsim.models.generic.DepolarizingErrorModel
File error model
qecsim.models.generic.FileErrorModel
Phase-flip error model
qecsim.models.generic.PhaseFlipErrorModel
Decoder implementations include:
Color 6.6.6 MPS decoder
qecsim.models.color.Color666MPSDecoder
Naive decoder
qecsim.models.generic.NaiveDecoder
Planar Converging MWPM decoder
qecsim.models.planar.PlanarCMWPMDecoder
Planar MPS decoder
qecsim.models.planar.PlanarMPSDecoder
Planar MWPM decoder
qecsim.models.planar.PlanarMWPMDecoder
Planar Rotated MPS decoder
qecsim.models.planar.PlanarRMPSDecoder
Planar Y-noise decoder
qecsim.models.planar.PlanarYDecoder
Rotated planar MPS decoder
qecsim.models.rotatedplanar.RotatedPlanarMPSDecoder
Rotated planar Rotated MPS decoder
qecsim.models.rotatedplanar.RotatedPlanarRMPSDecoder
Rotated planar Symmetry MWPM decoder
qecsim.models.rotatedplanar.RotatedPlanarSMWPMDecoder
Rotated toric Symmetry MWPM decoder
qecsim.models.rotatedtoric.RotatedToricSMWPMDecoder
Toric MWPM decoder
qecsim.models.toric.ToricMWPMDecoder
Further implementations can be added by extending the key abstract models.