From 723553beb189b1d53e2ae4d0f820d09ee7a0b102 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Mon, 7 Apr 2025 21:59:09 -0400 Subject: [PATCH 01/11] Add BP-OTS decoder implementation in LDPCDecodersext file --- .../QuantumCliffordLDPCDecodersExt.jl | 100 +++++++++++++++++- 1 file changed, 99 insertions(+), 1 deletion(-) diff --git a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl index e80c13af6..e25546b08 100644 --- a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl +++ b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl @@ -30,6 +30,99 @@ struct BitFlipDecoder <: AbstractSyndromeDecoder # TODO all these decoders have bfdecoderz end +# In QuantumCliffordLDPCDecodersExt.jl +# Here's the fixed BPOTSWrapperDecoder implementation for your extension module +struct BPOTSWrapperDecoder <: AbstractSyndromeDecoder + original_code # Store the original code object + H::SparseMatrixCSC{Bool,Int} + faults_matrix::Matrix{Bool} + n::Int + s::Int + k::Int + cx::Int + cz::Int + bpots_x::LDPCDecoders.BPOTSDecoder + bpots_z::LDPCDecoders.BPOTSDecoder +end + +function BPOTSWrapperDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) + # Get stabilizer matrices + Hx_raw = parity_checks_x(c) + Hz_raw = parity_checks_z(c) + H_raw = parity_checks(c) + + # Convert to proper matrices + if H_raw isa Stabilizer + H_gf2 = stab_to_gf2(H_raw) + H = sparse(Bool.(H_gf2)) + else + H = sparse(Bool.(H_raw)) + end + + # Convert X and Z matrices + if Hx_raw isa Stabilizer + Hx_gf2 = stab_to_gf2(Hx_raw) + Hz_gf2 = stab_to_gf2(Hz_raw) + Hx = sparse(Bool.(Hx_gf2)) + Hz = sparse(Bool.(Hz_gf2)) + else + Hx = sparse(Bool.(Hx_raw)) + Hz = sparse(Bool.(Hz_raw)) + end + + # Get dimensions + s, n = size(H) + + # For quantum codes, determine k + if c isa Toric || c isa Surface + k = c isa Toric ? 2 : 1 + else + k = n - s + end + + cx = size(Hx, 1) + cz = size(Hz, 1) + + # Create fault matrix + fm = BitMatrix(ones(Bool, s, 2*n)) + + # Create decoders + errorrate = something(errorrate, 0.0) + maxiter = something(maxiter, 200) + bpots_x = LDPCDecoders.BPOTSDecoder(Hx, errorrate, maxiter; T=T, C=C) + bpots_z = LDPCDecoders.BPOTSDecoder(Hz, errorrate, maxiter; T=T, C=C) + + # Pass the original code object as the first parameter + return BPOTSWrapperDecoder(c, H, fm, n, s, k, cx, cz, bpots_x, bpots_z) +end + +# Return the original code object +function parity_checks(d::BPOTSWrapperDecoder) + return d.original_code +end + +function decode(d::BPOTSWrapperDecoder, syndrome_sample::AbstractVector{Bool}) + # Validate input size + length(syndrome_sample) == d.cx + d.cz || + throw(DimensionMismatch("Syndrome length ($(length(syndrome_sample))) does not match expected size ($(d.cx + d.cz))")) + + # Split syndrome + row_x = @view syndrome_sample[1:d.cx] + row_z = @view syndrome_sample[d.cx+1:d.cx+d.cz] + + # Decode both parts + guess_z, conv_z = LDPCDecoders.decode!(d.bpots_x, Vector(row_x)) + guess_x, conv_x = LDPCDecoders.decode!(d.bpots_z, Vector(row_z)) + + # Return combined X and Z errors + return vcat(guess_x, guess_z) +end + +# Make sure to also implement the parity_checks method +function parity_checks(d::BPOTSWrapperDecoder) + return d.H +end + function BeliefPropDecoder(c; errorrate=nothing, maxiter=nothing) Hx = parity_checks_x(c) Hz = parity_checks_z(c) @@ -64,7 +157,7 @@ function BitFlipDecoder(c; errorrate=nothing, maxiter=nothing) isnothing(errorrate) || 0≤errorrate≤1 || error(lazy"BitFlipDecoder got an invalid error rate argument. `errorrate` must be in the range [0, 1].") errorrate = isnothing(errorrate) ? 0.0 : errorrate maxiter = isnothing(maxiter) ? n : maxiter - bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) + bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) # uses 2 classical bit flip decoders bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter) return BitFlipDecoder(H, fm, n, s, k, cx, cz, bfx, bfz) @@ -89,4 +182,9 @@ function decode(d::BitFlipDecoder, syndrome_sample) return vcat(guess_x, guess_z) end +#parity_checks method +function parity_checks(d::BPOTSWrapperDecoder) + return d.H +end + end From dc22784d59fe5e823b3b742b05edace39f9aba32 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Wed, 9 Apr 2025 16:14:02 -0400 Subject: [PATCH 02/11] Project.toml and LDPCDecodersExt file updated --- Project.toml | 2 +- .../QuantumCliffordLDPCDecodersExt.jl | 26 +++++-------------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Project.toml b/Project.toml index 0ebcc13e4..d4abd59fa 100644 --- a/Project.toml +++ b/Project.toml @@ -52,7 +52,7 @@ Hecke = "0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35" HostCPUFeatures = "0.1.6" ILog2 = "0.2.3, 1, 2" InteractiveUtils = "1.9" -LDPCDecoders = "0.3.2" +LDPCDecoders = "0.3.3" LinearAlgebra = "1.9" MacroTools = "0.5.9" Makie = "0.20, 0.21, 0.22" diff --git a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl index e25546b08..64edb4f0c 100644 --- a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl +++ b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl @@ -30,10 +30,8 @@ struct BitFlipDecoder <: AbstractSyndromeDecoder # TODO all these decoders have bfdecoderz end -# In QuantumCliffordLDPCDecodersExt.jl -# Here's the fixed BPOTSWrapperDecoder implementation for your extension module -struct BPOTSWrapperDecoder <: AbstractSyndromeDecoder - original_code # Store the original code object +struct BPOTSDecoder <: AbstractSyndromeDecoder + original_code H::SparseMatrixCSC{Bool,Int} faults_matrix::Matrix{Bool} n::Int @@ -45,7 +43,7 @@ struct BPOTSWrapperDecoder <: AbstractSyndromeDecoder bpots_z::LDPCDecoders.BPOTSDecoder end -function BPOTSWrapperDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) +function BPOTSDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) # Get stabilizer matrices Hx_raw = parity_checks_x(c) Hz_raw = parity_checks_z(c) @@ -93,15 +91,10 @@ function BPOTSWrapperDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) bpots_z = LDPCDecoders.BPOTSDecoder(Hz, errorrate, maxiter; T=T, C=C) # Pass the original code object as the first parameter - return BPOTSWrapperDecoder(c, H, fm, n, s, k, cx, cz, bpots_x, bpots_z) + return BPOTSDecoder(c, H, fm, n, s, k, cx, cz, bpots_x, bpots_z) end -# Return the original code object -function parity_checks(d::BPOTSWrapperDecoder) - return d.original_code -end - -function decode(d::BPOTSWrapperDecoder, syndrome_sample::AbstractVector{Bool}) +function decode(d::BPOTSDecoder, syndrome_sample::AbstractVector{Bool}) # Validate input size length(syndrome_sample) == d.cx + d.cz || throw(DimensionMismatch("Syndrome length ($(length(syndrome_sample))) does not match expected size ($(d.cx + d.cz))")) @@ -118,8 +111,7 @@ function decode(d::BPOTSWrapperDecoder, syndrome_sample::AbstractVector{Bool}) return vcat(guess_x, guess_z) end -# Make sure to also implement the parity_checks method -function parity_checks(d::BPOTSWrapperDecoder) +function parity_checks(d::BPOTSDecoder) return d.H end @@ -157,7 +149,6 @@ function BitFlipDecoder(c; errorrate=nothing, maxiter=nothing) isnothing(errorrate) || 0≤errorrate≤1 || error(lazy"BitFlipDecoder got an invalid error rate argument. `errorrate` must be in the range [0, 1].") errorrate = isnothing(errorrate) ? 0.0 : errorrate maxiter = isnothing(maxiter) ? n : maxiter - bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) # uses 2 classical bit flip decoders bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter) return BitFlipDecoder(H, fm, n, s, k, cx, cz, bfx, bfz) @@ -182,9 +173,4 @@ function decode(d::BitFlipDecoder, syndrome_sample) return vcat(guess_x, guess_z) end -#parity_checks method -function parity_checks(d::BPOTSWrapperDecoder) - return d.H -end - end From 22ce7117cfa2acd6dd39b03d82ba9871d4141c0a Mon Sep 17 00:00:00 2001 From: adhirajj Date: Mon, 15 Sep 2025 11:35:32 -0400 Subject: [PATCH 03/11] fixes --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58678cebf..52cd66345 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ # News +### Added +- BP-OTS (Belief Propagation with Oscillating Trapping Sets) decoder for quantum LDPC codes in the LDPCDecoders extension + ## v0.9.18 - 2025-02-19 - Fixes for rare crashes in the python BP decoders. From 0edd1294d73853e9ba3342d327980462226ca555 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Mon, 15 Sep 2025 11:39:29 -0400 Subject: [PATCH 04/11] Fixes --- .../QuantumCliffordLDPCDecodersExt.jl | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl index 64edb4f0c..4941f58ab 100644 --- a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl +++ b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl @@ -111,10 +111,6 @@ function decode(d::BPOTSDecoder, syndrome_sample::AbstractVector{Bool}) return vcat(guess_x, guess_z) end -function parity_checks(d::BPOTSDecoder) - return d.H -end - function BeliefPropDecoder(c; errorrate=nothing, maxiter=nothing) Hx = parity_checks_x(c) Hz = parity_checks_z(c) From 6921b458daedd79f0b41c25ad4f66e82ad5cccb9 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Mon, 13 Oct 2025 23:13:59 -0400 Subject: [PATCH 05/11] Fix BitFlipDecoder typo (missing bfx) and add parity_checks for BPOTSDecoder --- .../QuantumCliffordLDPCDecodersExt.jl | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl index 4941f58ab..661314d61 100644 --- a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl +++ b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl @@ -44,12 +44,11 @@ struct BPOTSDecoder <: AbstractSyndromeDecoder end function BPOTSDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) - # Get stabilizer matrices + Hx_raw = parity_checks_x(c) Hz_raw = parity_checks_z(c) H_raw = parity_checks(c) - # Convert to proper matrices if H_raw isa Stabilizer H_gf2 = stab_to_gf2(H_raw) H = sparse(Bool.(H_gf2)) @@ -57,7 +56,6 @@ function BPOTSDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) H = sparse(Bool.(H_raw)) end - # Convert X and Z matrices if Hx_raw isa Stabilizer Hx_gf2 = stab_to_gf2(Hx_raw) Hz_gf2 = stab_to_gf2(Hz_raw) @@ -68,46 +66,32 @@ function BPOTSDecoder(c; errorrate=nothing, maxiter=nothing, T=9, C=2.0) Hz = sparse(Bool.(Hz_raw)) end - # Get dimensions s, n = size(H) - - # For quantum codes, determine k - if c isa Toric || c isa Surface - k = c isa Toric ? 2 : 1 - else - k = n - s - end + k = code_k(c) cx = size(Hx, 1) cz = size(Hz, 1) - # Create fault matrix fm = BitMatrix(ones(Bool, s, 2*n)) - # Create decoders errorrate = something(errorrate, 0.0) maxiter = something(maxiter, 200) bpots_x = LDPCDecoders.BPOTSDecoder(Hx, errorrate, maxiter; T=T, C=C) bpots_z = LDPCDecoders.BPOTSDecoder(Hz, errorrate, maxiter; T=T, C=C) - # Pass the original code object as the first parameter return BPOTSDecoder(c, H, fm, n, s, k, cx, cz, bpots_x, bpots_z) end function decode(d::BPOTSDecoder, syndrome_sample::AbstractVector{Bool}) - # Validate input size length(syndrome_sample) == d.cx + d.cz || throw(DimensionMismatch("Syndrome length ($(length(syndrome_sample))) does not match expected size ($(d.cx + d.cz))")) - - # Split syndrome + row_x = @view syndrome_sample[1:d.cx] row_z = @view syndrome_sample[d.cx+1:d.cx+d.cz] - - # Decode both parts + guess_z, conv_z = LDPCDecoders.decode!(d.bpots_x, Vector(row_x)) guess_x, conv_x = LDPCDecoders.decode!(d.bpots_z, Vector(row_z)) - - # Return combined X and Z errors + return vcat(guess_x, guess_z) end @@ -146,12 +130,14 @@ function BitFlipDecoder(c; errorrate=nothing, maxiter=nothing) errorrate = isnothing(errorrate) ? 0.0 : errorrate maxiter = isnothing(maxiter) ? n : maxiter bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter) + bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) return BitFlipDecoder(H, fm, n, s, k, cx, cz, bfx, bfz) end parity_checks(d::BeliefPropDecoder) = d.H parity_checks(d::BitFlipDecoder) = d.H +parity_checks(d::BPOTSDecoder) = d.H function decode(d::BeliefPropDecoder, syndrome_sample) row_x = @view syndrome_sample[1:d.cx] From b6b3be4415bbe03206930d6f02f856f36becdec8 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Mon, 13 Oct 2025 23:16:30 -0400 Subject: [PATCH 06/11] Update CHANGELOG and add BPOTSDecoder tests --- CHANGELOG.md | 2 +- test/test_ecc_decoder_all_setups.jl | 30 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52cd66345..de908ada6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ # News -### Added +## Added - BP-OTS (Belief Propagation with Oscillating Trapping Sets) decoder for quantum LDPC codes in the LDPCDecoders extension ## v0.9.18 - 2025-02-19 diff --git a/test/test_ecc_decoder_all_setups.jl b/test/test_ecc_decoder_all_setups.jl index ecd747da3..a12b648b9 100644 --- a/test/test_ecc_decoder_all_setups.jl +++ b/test/test_ecc_decoder_all_setups.jl @@ -91,6 +91,36 @@ end end + ## + @testset "BPOTSDecoder decoder, good for topological codes" begin + codes = [ + Toric(6,6), + Toric(8,8), + Surface(6,6), + Surface(8,8) + ] + + noise = 0.01 + + setups = [ + CommutationCheckECCSetup(noise), + NaiveSyndromeECCSetup(noise, 0), + ShorSyndromeECCSetup(noise, 0), + ] + + for c in codes + for s in setups + for d in [c->BPOTSDecoder(c, errorrate=noise, maxiter=200, T=9, C=2.0)] + e = evaluate_decoder(d(c), s, 10000) + #@show c + #@show s + #@show e + @test max(e...) < noise/2 + end + end + end + end + ## using Test From 65303da21f537e0a1eac402fed827c09f99db442 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Tue, 14 Oct 2025 00:48:00 -0400 Subject: [PATCH 07/11] Add BPOTSDecoder export and stub to make it accessible from package namespace --- src/ecc/ECC.jl | 2 +- src/ecc/decoder_pipeline.jl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ecc/ECC.jl b/src/ecc/ECC.jl index bea9f1aec..ec86583af 100644 --- a/src/ecc/ECC.jl +++ b/src/ecc/ECC.jl @@ -34,7 +34,7 @@ export parity_checks, parity_checks_x, parity_checks_z, iscss, evaluate_decoder, CommutationCheckECCSetup, NaiveSyndromeECCSetup, ShorSyndromeECCSetup, TableDecoder, - BeliefPropDecoder, BitFlipDecoder, + BeliefPropDecoder, BitFlipDecoder, BPOTSDecoder, PyBeliefPropDecoder, PyBeliefPropOSDecoder, PyMatchingDecoder """Parity check tableau of a code. diff --git a/src/ecc/decoder_pipeline.jl b/src/ecc/decoder_pipeline.jl index aeb481851..eb94653ed 100644 --- a/src/ecc/decoder_pipeline.jl +++ b/src/ecc/decoder_pipeline.jl @@ -287,6 +287,15 @@ function BitFlipDecoder(args...; kwargs...) return ext.BitFlipDecoder(args...; kwargs...) end +"""A BP-OTS (Belief Propagation with Oscillating Trapping Sets) decoder built around tools from `LDPCDecoders.jl`. +""" +function BPOTSDecoder(args...; kwargs...) + ext = Base.get_extension(QuantumClifford, :QuantumCliffordLDPCDecodersExt) + if isnothing(ext) + throw("The `BPOTSDecoder` depends on the package `LDPCDecoders` but you have not installed or imported `LDPCDecoders` yet. Immediately after you import `LDPCDecoders`, the `BPOTSDecoder` will be available.") + end + return ext.BPOTSDecoder(args...; kwargs...) +end """A Belief Propagation decoder built around tools from the python package `ldpc` available from the julia package `PyQDecoders.jl`.""" function PyBeliefPropDecoder(args...; kwargs...) From faa92f4ef68366eeded2e79a8677baa5f71da3c6 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Tue, 14 Oct 2025 11:04:52 -0400 Subject: [PATCH 08/11] Add docstring to BPOTSDecoder struct in extension --- .../QuantumCliffordLDPCDecodersExt.jl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl index 661314d61..3a2234444 100644 --- a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl +++ b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl @@ -30,6 +30,24 @@ struct BitFlipDecoder <: AbstractSyndromeDecoder # TODO all these decoders have bfdecoderz end +""" + BPOTSDecoder(code; errorrate=nothing, maxiter=nothing, T=9, C=2.0) + +BP-OTS (Belief Propagation with Oscillating Trapping Sets) decoder for quantum LDPC codes. +This decoder uses oscillation tracking and biasing to escape trapping sets. + +# Arguments +- `code`: A quantum code (e.g., Toric, Surface) +- `errorrate`: Physical error rate (depolarizing probability) +- `maxiter`: Maximum number of iterations (default: 200) +- `T`: Biasing period (default: 9) +- `C`: Bias constant (default: 2.0) + +# Reference +Chytas et al., "Enhanced Message-Passing Decoding of Degenerate Quantum Codes +Utilizing Trapping Set Dynamics", IEEE Communications Letters, 2024 +""" + struct BPOTSDecoder <: AbstractSyndromeDecoder original_code H::SparseMatrixCSC{Bool,Int} From 8627fc4be46528526f00c788bf9cbb7fa22a5410 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Tue, 14 Oct 2025 12:15:53 -0400 Subject: [PATCH 09/11] Resolve merge conflicts with master --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d4abd59fa..5537f56c0 100644 --- a/Project.toml +++ b/Project.toml @@ -11,6 +11,7 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" HostCPUFeatures = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" ILog2 = "2cd5bd5f-40a1-5050-9e10-fc8cdb6109f5" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" +LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a" @@ -25,7 +26,6 @@ SumTypes = "8e1ec7a9-0e02-4297-b0fe-6433085c89f2" [weakdeps] CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" -LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" PyQDecoders = "17f5de1a-9b79-4409-a58d-4d45812840f7" From 7c0fda29511a75144a94fc3e04a0556e1b55c5ec Mon Sep 17 00:00:00 2001 From: adhirajj Date: Thu, 16 Oct 2025 16:25:27 -0400 Subject: [PATCH 10/11] Fix docstring attachment and move LDPCDecoders to weakdeps --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 1237ce69b..7cd814290 100644 --- a/Project.toml +++ b/Project.toml @@ -12,7 +12,6 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6" HostCPUFeatures = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" ILog2 = "2cd5bd5f-40a1-5050-9e10-fc8cdb6109f5" InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240" -LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a" @@ -33,6 +32,7 @@ GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" JuMP = "4076af6c-e467-56ae-b986-b466b2749572" KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" +LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" From 0f3bea15aa1830bc9786e8e878f13536e5c4ea00 Mon Sep 17 00:00:00 2001 From: adhirajj Date: Thu, 16 Oct 2025 16:26:18 -0400 Subject: [PATCH 11/11] Fixed docstring --- .../QuantumCliffordLDPCDecodersExt.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl index 6aea70cff..3068fbd8c 100644 --- a/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl +++ b/ext/QuantumCliffordLDPCDecodersExt/QuantumCliffordLDPCDecodersExt.jl @@ -48,7 +48,6 @@ This decoder uses oscillation tracking and biasing to escape trapping sets. Chytas et al., "Enhanced Message-Passing Decoding of Degenerate Quantum Codes Utilizing Trapping Set Dynamics", IEEE Communications Letters, 2024 """ - struct BPOTSDecoder <: AbstractSyndromeDecoder original_code H::SparseMatrixCSC{Bool,Int} @@ -148,8 +147,8 @@ function BitFlipDecoder(c; errorrate=nothing, maxiter=nothing) isnothing(errorrate) || 0≤errorrate≤1 || error(lazy"BitFlipDecoder got an invalid error rate argument. `errorrate` must be in the range [0, 1].") errorrate = isnothing(errorrate) ? 0.0 : errorrate maxiter = isnothing(maxiter) ? n : maxiter - bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter) bfx = LDPCDecoders.BitFlipDecoder(Hx, errorrate, maxiter) + bfz = LDPCDecoders.BitFlipDecoder(Hz, errorrate, maxiter) return BitFlipDecoder(H, fm, n, s, k, cx, cz, bfx, bfz) end