Error Model and Syndrome Extraction

Error Model

We have 2 types of error models. IndependentFlipError is for the case that the error model is independent flip error. IndependentDepolarizingError is the error model for the case that the error model is independent depolarizing error. We can use iid_error to easily generate an independent and identically distributed error model.

using TensorQEC
iide = iid_error(0.05,0.05,0.05,7)
IndependentDepolarizingError{Float64}([0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05], [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05], [0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05])

We can generate a random error pattern with random_error_qubits.

for _ in 1:10
    print(random_error_qubits(iide))
end
IIIYIIZ
IIIIIII
IIZXIII
IXIIZII
YXIIIII
IIIIZII
IIIIIII
IIIIIII
IIIIIXI
IIIIIYI

This is the same for IndependentFlipError.

random_error_qubits(iid_error(0.3,7))
7-element Vector{Mod2}:
 0₂
 0₂
 1₂
 1₂
 1₂
 1₂
 0₂

Syndrome Extraction

First, we define a Tanner graph and a error pattern.

tanner = CSSTannerGraph(SteaneCode())
using Random;Random.seed!(123)
error_qubits = random_error_qubits(iide)
IIIIIIY

Then, we can extract the syndrome from the error pattern with syndrome_extraction.

syndrome = syndrome_extraction(error_qubits, tanner)
CSSSyndrome(Mod2[1₂, 1₂, 1₂], Mod2[1₂, 1₂, 1₂])

This page was generated using Literate.jl.