Skip to content

Commit

Permalink
Add BitFlipDecoder for quantum ReedMuller codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Sep 27, 2024
1 parent 026e483 commit c4992b1
Showing 1 changed file with 51 additions and 23 deletions.
74 changes: 51 additions & 23 deletions test/test_ecc_decoder_all_setups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,58 @@
end
end
end
end

@testset "belief prop decoders, good for sparse codes" begin
codes = vcat(LP04, LP118, test_gb_codes, other_lifted_product_codes)

noise = 0.001

setups = [
CommutationCheckECCSetup(noise),
NaiveSyndromeECCSetup(noise, 0),
ShorSyndromeECCSetup(noise, 0),
]
# lifted product codes currently trigger errors in syndrome circuits

for c in codes
for s in setups
for d in [c -> PyBeliefPropOSDecoder(c, maxiter=10)]
nsamples = code_n(c) > 400 ? 1000 : 100000
# take fewer samples for larger codes to save time
e = evaluate_decoder(d(c), s, nsamples)
# @show c
# @show s
# @show e
@assert max(e...) < noise / 4 (c, s, e)
@testset "belief prop decoders, good for sparse codes" begin
codes = vcat(LP04, LP118, test_gb_codes, other_lifted_product_codes)

noise = 0.001

setups = [
CommutationCheckECCSetup(noise),
NaiveSyndromeECCSetup(noise, 0),
ShorSyndromeECCSetup(noise, 0),
]
# lifted product codes currently trigger errors in syndrome circuits

for c in codes
for s in setups
for d in [c -> PyBeliefPropOSDecoder(c, maxiter=10)]
nsamples = code_n(c) > 400 ? 1000 : 100000
# take fewer samples for larger codes to save time
e = evaluate_decoder(d(c), s, nsamples)
# @show c
# @show s
# @show e
@assert max(e...) < noise / 4 (c, s, e)
end
end
end
end

@testset "BitFlipDecoder decoder, good for sparse codes" begin
codes = [
QuantumReedMuller(3),
QuantumReedMuller(4),
QuantumReedMuller(5)
]

noise = 0.001

setups = [
CommutationCheckECCSetup(noise),
NaiveSyndromeECCSetup(noise, 0),
ShorSyndromeECCSetup(noise, 0),
]

for c in codes
for s in setups
for d in [c->BitFlipDecoder(c)]
e = evaluate_decoder(d(c), s, 100000)
@show c
@show s
@show e
@assert max(e...) < noise/4
end
end
end
end
Expand Down

0 comments on commit c4992b1

Please sign in to comment.