Decoder Interface
Decoding Problems
We have 3 types of decoding problems. ClassicalDecodingProblem
is for the case that the error model is independent flip error. IndependentDepolarizingDecodingProblem
is the decoding problem for the case that the error model is independent depolarizing error. GeneralDecodingProblem
is the decoding problem for the case that error model on different qubits are correlated. We use a tensor network to represent the error probability distribution. Here is an example of how to construct a decoding problem.
using TensorQEC
tanner = CSSTannerGraph(SurfaceCode(3,3))
problem = IndependentDepolarizingDecodingProblem(tanner,iid_error(0.05,0.05,0.05,9))
IndependentDepolarizingDecodingProblem(CSSTannerGraph(SimpleTannerGraph(9, 4, [[1], [1], [3], [1, 4], [1, 2], [2, 3], [4], [2], [2]], [[1, 2, 4, 5], [5, 6, 8, 9], [3, 6], [4, 7]], Mod2[1₂ 1₂ … 0₂ 0₂; 0₂ 0₂ … 1₂ 1₂; 0₂ 0₂ … 0₂ 0₂; 0₂ 0₂ … 0₂ 0₂]), SimpleTannerGraph(9, 4, [[3], [1, 3], [1], [2], [1, 2], [1], [2], [2, 4], [4]], [[2, 3, 5, 6], [4, 5, 7, 8], [1, 2], [8, 9]], Mod2[0₂ 1₂ … 0₂ 0₂; 0₂ 0₂ … 1₂ 0₂; 1₂ 1₂ … 0₂ 0₂; 0₂ 0₂ … 1₂ 1₂])), 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, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05]))
Decoding Process
Decoders
There are 2 types of decoders. AbstractClassicalDecoder
and AbstractGeneralDecoder
solve ClassicalDecodingProblem
and GeneralDecodingProblem
, respectively. For IndependentDepolarizingDecodingProblem
, we can transfer it to GeneralDecodingProblem
and use AbstractGeneralDecoder
to solve it. Also, for an IndependentDepolarizingDecodingProblem
of a CSS code, we can transfer it to two ClassicalDecodingProblem
and use AbstractClassicalDecoder
to solve them. Here is a list of supported decoders.
Decoder | API | Classification |
---|---|---|
Minimum Weight Perfect Matching [Dennis][Higgott] | MatchingDecoder | AbstractClassicalDecoder |
Belief Propagation [Yao] | BPDecoder | AbstractClassicalDecoder |
Lookup Table | TableDecoder | AbstractGeneralDecoder |
Integer Programming [Landahl] | IPDecoder | AbstractGeneralDecoder |
Tensor Network Decoders [Chubb] | TNMAP | AbstractGeneralDecoder |
Here we use the integer programming decoder to solve the decoding problem.
decoder = IPDecoder()
IPDecoder(SCIP.Optimizer, false)
Compilation
Usually, we use decoders to run monte carlo simulations to estimate the code capacity. We use the same decoder to solve the decoding problem of the same QEC code and error model for different error and syndrome configurations. Ones the error model and the QEC code are fixed, we can compile the decoder to avoid the overhead of decoding. For example, in Lookup Table decoder, we can make the truth table once and use it for all the decoding problems. And in tensor network decoders, we can make the tensor network once and connect it to different syndrome configurations when decoding. This is also the reason why there is no syndrome information in the decoding problem or in the decoder.
compiled_decoder = compile(decoder, problem);
Decoding
Now we randomly generate an error configuration.
using Random
Random.seed!(123)
error_qubits = random_error_qubits(problem.pvec)
IIIIIIYII
The corresponding syndrome is
syndrome = syndrome_extraction(error_qubits, tanner)
CSSSyndrome(Mod2[0₂, 0₂, 0₂, 1₂], Mod2[0₂, 1₂, 0₂, 0₂])
We can use the compiled decoder to decode the syndrome with decode
. The decoding result is a DecodingResult
object.
res = decode(compiled_decoder, syndrome)
Success
IIIIIIYII
We can check the result by comparing the syndrome of the decoding result.
syndrome == syndrome_extraction(res.error_qubits, tanner)
true
Also, to check wether there is a logical error, we can first generate the logical operators with logical_operator
.
logicalx_operators,logicalz_operators = logical_operator(tanner)
(Mod2[0₂ 0₂ … 1₂ 1₂], Mod2[1₂ 0₂ … 0₂ 1₂])
Then we can check the syndrome of the logical operators with check_logical_error
.
check_logical_error(error_qubits, res.error_qubits, logicalx_operators, logicalz_operators)
false
Simply decode
function can also be used to decode the syndrome. The compilation step is contained in the function.
decode(decoder,problem,syndrome)
Success
IIIIIIYII
This page was generated using Literate.jl.
- DennisDennis, E.; Kitaev, A.; Landahl, A.; Preskill, J. Topological Quantum Memory. Journal of Mathematical Physics 2002, 43 (9), 4452–4505. https://doi.org/10.1063/1.1499754.
- HiggottHiggott, O.; Gidney, C. Sparse Blossom: Correcting a Million Errors per Core Second with Minimum-Weight Matching. Quantum 2025, 9, 1600. https://doi.org/10.22331/q-2025-01-20-1600.
- YaoYao, H.; Laban, W. A.; Häger, C.; Amat, A. G. i; Pfister, H. D. Belief Propagation Decoding of Quantum LDPC Codes with Guided Decimation. arXiv June 21, 2024. http://arxiv.org/abs/2312.10950 (accessed 2024-10-31).
- LandahlLandahl, A. J.; Anderson, J. T.; Rice, P. R. Fault-Tolerant Quantum Computing with Color Codes. arXiv August 29, 2011. https://doi.org/10.48550/arXiv.1108.5738.
- Chubb(1) Chubb, C. T. General Tensor Network Decoding of 2D Pauli Codes. arXiv October 13, 2021. https://doi.org/10.48550/arXiv.2101.04125.