diff --git a/docs/Project.toml b/docs/Project.toml index 99bc958..135de1a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,5 +1,16 @@ [deps] +BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232" +CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" +Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" CodingTheory = "7ca085cf-10e4-43da-ad7d-8f62f68877b3" +DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8" +Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" +Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" +Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/docs/make.jl b/docs/make.jl index 3c9dc88..ede7741 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -9,7 +9,7 @@ Documenter.makedocs(; modules = Module[CodingTheory], repo = "", highlightsig = true, - sitename = "Coding Theory Documentation", + sitename = "CodingTheory.jl", expandfirst = [], warnonly = [:missing_docs], pages = ["Introduction" => "index.md", diff --git a/docs/src/Tutorials/Weight Reduction.md b/docs/src/Tutorials/Weight Reduction.md index 997b1a8..4692787 100644 --- a/docs/src/Tutorials/Weight Reduction.md +++ b/docs/src/Tutorials/Weight Reduction.md @@ -678,42 +678,27 @@ Dict(78 => 28, 56 => 2894, 16 => 13428, 20 => 24654, 58 => 15616, 52 => 7728, 60 ## Lifted Products Classical weight reduction also applies to other types of inputs, although with the current function, the row and column indices must be specified explicitly either as a vector or a range. ``` -julia> F = GF(2); - -julia> S, x = PolynomialRing(F, "x"); +julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), "x"); julia> l = 63; -julia> R = ResidueRing(S, x^l - 1); +julia> R, = residue_ring(S, x^l - 1); julia> A = matrix(R, 7, 7, - [x^27, 0, 0, 1, x^18, x^27, 1, - 1, x^27, 0, 0, 1, x^18, x^27, - x^27, 1, x^27, 0, 0, 1, x^18, - x^18, x^27, 1, x^27, 0, 0, 1, - 1, x^18, x^27, 1, x^27, 0, 0, - 0, 1, x^18, x^27, 1, x^27, 0, - 0, 0, 1, x^18, x^27, 1, x^27]) -[x^27 0 0 1 x^18 x^27 1] -[ 1 x^27 0 0 1 x^18 x^27] -[x^27 1 x^27 0 0 1 x^18] -[x^18 x^27 1 x^27 0 0 1] -[ 1 x^18 x^27 1 x^27 0 0] -[ 0 1 x^18 x^27 1 x^27 0] -[ 0 0 1 x^18 x^27 1 x^27] - -julia> b = R(1 + x + x^6) -x^6 + x + 1 - -julia> LiftedProductCode(A, b) -┌ Warning: Commutativity of A and b required but not yet enforced. -└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:354 -[[882, 48]]_2 CSS stabilizer code + [x^27, 0 , 0 , 1 , x^18, x^27, 1 , + 1 , x^27, 0 , 0 , 1 , x^18, x^27, + x^27, 1 , x^27, 0 , 0 , 1 , x^18, + x^18, x^27, 1 , x^27, 0 , 0 , 1 , + 1 , x^18, x^27, 1 , x^27, 0 , 0 , + 0 , 1 , x^18, x^27, 1 , x^27, 0 , + 0 , 0 , 1 , x^18, x^27, 1 , x^27]); -julia> A_wtred = weight_reduction(A, row_indices = 1:4, column_indices = 1:4, permute_rows = false, permute_columns = false); +julia> b = R(1 + x + x^6); -julia> LiftedProductCode(A_wtred, b) +julia> code = LiftedProductCode(A, b); ┌ Warning: Commutativity of A and b required but not yet enforced. -└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:354 -[[4914, 48]]_2 CSS stabilizer code +└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:340 + +julia> length(code), dimension(code) +(882, 48) ``` diff --git a/docs/src/references.bib b/docs/src/references.bib index cf8ad04..4de5f4f 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -109,6 +109,17 @@ @misc{Vasmer_2020 year={2020} } +@article{poulin2005stabilizer, + title={Stabilizer formalism for operator quantum error correction}, + author={Poulin, David}, + journal={Physical review letters}, + volume={95}, + number={23}, + pages={230504}, + year={2005}, + publisher={APS} +} + % Product Codes @article{bacon2006quantum, @@ -202,6 +213,16 @@ @article{wang2024coprime year={2024} } +@article{ostrev2024classical, + title={Classical product code constructions for quantum Calderbank-Shor-Steane codes}, + author={Ostrev, Dimiter and Orsucci, Davide and L{\'a}zaro, Francisco and Matuz, Balazs}, + journal={Quantum}, + volume={8}, + pages={1420}, + year={2024}, + publisher={Verein zur F{\"o}rderung des Open Access Publizierens in den Quantenwissenschaften} +} + @book{kreher1999combinatorial, title={Combinatorial algorithms: generation, enumeration, and search}, author={Kreher, Donald L and Stinson, Douglas R}, diff --git a/ext/MakieExt/Classical/Tanner.jl b/ext/MakieExt/Classical/Tanner.jl index 445825c..89a9cd4 100644 --- a/ext/MakieExt/Classical/Tanner.jl +++ b/ext/MakieExt/Classical/Tanner.jl @@ -5,7 +5,7 @@ # LICENSE file in the root directory of this source tree. """ - Tanner_graph_plot(H::Union{CTMatrixTypes, Matrix{Int}}) +$TYPEDSIGNATURES Return the Tanner graph of the matrix `H` as a `Figure` object. diff --git a/ext/MakieExt/Classical/weight_dist.jl b/ext/MakieExt/Classical/weight_dist.jl index 9028b08..b195f92 100644 --- a/ext/MakieExt/Classical/weight_dist.jl +++ b/ext/MakieExt/Classical/weight_dist.jl @@ -9,7 +9,7 @@ ############################# """ - weight_plot(C::AbstractLinearCode; alg::Symbol = :auto) +$TYPEDSIGNATURES Return a bar graph of the weight distribution of `C`. diff --git a/ext/MakieExt/LDPC/analysis.jl b/ext/MakieExt/LDPC/analysis.jl index 719f18b..46d9e3a 100644 --- a/ext/MakieExt/LDPC/analysis.jl +++ b/ext/MakieExt/LDPC/analysis.jl @@ -9,7 +9,7 @@ ############################# """ - EXIT_chart_plot(E::LDPCEnsemble, Ch::AbstractClassicalNoiseChannel; tol::Float64 = 1e-9) +$TYPEDSIGNATURES Return a plot of the EXIT chart for the ensemble given the channel up to a numerical tolerance of `tol`. diff --git a/ext/MakieExt/LDPC/codes.jl b/ext/MakieExt/LDPC/codes.jl index b67942f..964676d 100644 --- a/ext/MakieExt/LDPC/codes.jl +++ b/ext/MakieExt/LDPC/codes.jl @@ -9,7 +9,7 @@ ############################# """ - degree_distributions_plot(C::AbstractLDPCCode) +$TYPEDSIGNATURES Return a bar plot of the column and row degree distributions of `C`. @@ -44,7 +44,7 @@ function CodingTheory.degree_distributions_plot(C::AbstractLDPCCode) end """ - count_short_cycles_plot(C::AbstractLDPCCode) +$TYPEDSIGNATURES Return a bar graph and a dictionary of (length, count) pairs for unique short cycles in the Tanner graph of `C`. An empty graph and dictionary are returned @@ -82,7 +82,7 @@ function CodingTheory.count_short_cycles_plot(C::AbstractLDPCCode) end """ - count_elementary_cycles_plot(C::AbstractLDPCCode) +$TYPEDSIGNATURES Return a bar graph and a dictionary of (length, count) pairs for unique elementary cycles in the Tanner graph of `C`. An empty graph and dictionary are returned @@ -120,7 +120,7 @@ function CodingTheory.count_elementary_cycles_plot(C::AbstractLDPCCode) end """ - ACE_spectrum(C::AbstractLDPCCode) +$TYPEDSIGNATURES Return an interactive figure and data for the ACE spectrum of the Tanner graph of `C`. @@ -171,7 +171,7 @@ end # doesn't seem to be a point in making this dynamic with a slider, as it simply # continues in the same tree shape and no useful information is gained from watching it """ - computation_graph(C::AbstractLDPCCode, lvl::Int, v::Int, v_type::Symbol=:v) +$TYPEDSIGNATURES Return a figure representing the expansion of the Tanner graph of `C` to level `lvl` for node `v`. If `v_type` is `:v`, `v` is interpreted as a variable node; otherwise, diff --git a/ext/MakieExt/Quantum/weight_dist.jl b/ext/MakieExt/Quantum/weight_dist.jl index ca1d34d..ed552d6 100644 --- a/ext/MakieExt/Quantum/weight_dist.jl +++ b/ext/MakieExt/Quantum/weight_dist.jl @@ -9,7 +9,7 @@ ############################# """ - weight_plot(S::AbstractStabilizerCode; alg::Symbol = :auto, type::Symbol = :stabilizer) +$TYPEDSIGNATURES Return a bar graph of the weight distribution related to `S`. @@ -49,7 +49,7 @@ function CodingTheory.weight_plot(S::AbstractStabilizerCode; alg::Symbol = :auto end """ - weight_plot_CSS_X(S::AbstractStabilizerCodeCSS; alg::Symbol = :auto) +$TYPEDSIGNATURES Return a bar graph of the weight distribution of the `X` stabilizers. @@ -73,7 +73,7 @@ function CodingTheory.weight_plot_CSS_X(S::AbstractStabilizerCodeCSS; alg::Symbo end """ - weight_plot_CSS_Z(S::AbstractStabilizerCodeCSS; alg::Symbol = :auto) +$TYPEDSIGNATURES Return a bar graph of the weight distribution of the `Z` stabilizers. @@ -97,7 +97,7 @@ function CodingTheory.weight_plot_CSS_Z(S::AbstractStabilizerCodeCSS; alg::Symbo end """ - weight_plot_CSS(S::AbstractStabilizerCodeCSS; alg::Symbol = :auto) +$TYPEDSIGNATURES Return bar graphs of the weight distribution of both the `X` and 'Z' stabilizers, separately. diff --git a/src/Quantum/product_codes.jl b/src/Quantum/product_codes.jl index a883560..bda0bd0 100644 --- a/src/Quantum/product_codes.jl +++ b/src/Quantum/product_codes.jl @@ -12,6 +12,29 @@ HypergraphProductCode(A::CTMatrixTypes, B::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing}= missing, logs_alg::Symbol = :stnd_frm) Return the hypergraph product code of matrices `A` and `B`. + +# Example + +[[1922, 50, 16]] Hypergraph Product Code from Appendix B, Example C2 of [panteleev2021degenerate](@cite). + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> F, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x); + +julia> l = 31; + +julia> R, = residue_ring(F, x^l -1); + +julia> h = R(1 + x^2 + x^5); + +julia> A = residue_polynomial_to_circulant_matrix(h); + +julia> code = HypergraphProductCode(A, A); + +julia> length(code), dimension(code) +(1922, 50) +``` """ function HypergraphProductCode(A::CTMatrixTypes, B::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) @@ -153,6 +176,31 @@ Return the hyperbicycle CSS code of `a` and `b` given `χ`. - b: A vector of length `c` of binary matrices of the same dimensions, potentially different from those of `a`. - χ: A strictly positive integer coprime with `c`. + +# Example + +[[900, 50, 14]] CSS Hyperbicycle Code from Example 6 of [Kovalev_2013](@cite). + +```jldoctest +julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x); + +julia> l = 30; χ = 1; + +julia> R, = residue_ring(S, x^l - 1); + +julia> h = R(1 + x + x^3 + x^5); + +julia> A = residue_polynomial_to_circulant_matrix(h); + +julia> a1 = A[1:15, 1:15]; + +julia> a2 = A[1:15, 16:30]; + +julia> code = HyperBicycleCodeCSS([a1, a2], [a1, a2], χ); + +julia> length(code), dimension(code) +(900, 50) +``` """ function HyperBicycleCodeCSS(a::Vector{T}, b::Vector{T}, χ::Int; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: CTMatrixTypes @@ -209,6 +257,29 @@ Return the hyperbicycle non-CSS code of `a` and `b` given `χ`. - b: A vector of length `c` of binary matrices of the same dimensions, potentially different from those of `a`. - χ: A strictly positive integer coprime with `c`. + +# Example + +[[289, 81, 5]] non-CSS Hyperbicycle Code from Example 13 of [Kovalev_2013](@cite). + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> S, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x); + +julia> l = 17; χ = 1; + +julia> R, = residue_ring(S, x^l - 1); + +julia> h = R(x^4 * (1 + x + x^3 + x^6 + x^8 + x^9)); + +julia> A = residue_polynomial_to_circulant_matrix(h); + +julia> code = HyperBicycleCode([A], [A], χ); + +julia> length(code), dimension(code) +(289, 81) +``` """ function HyperBicycleCode(a::Vector{T}, b::Vector{T}, χ::Int, char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: CTMatrixTypes @@ -258,6 +329,31 @@ end GeneralizedBicycleCode(A::CTMatrixTypes, B::CTMatrixTypes; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) Return the generealized bicycle code given by `A` and `B`. + +# Example + +[[254, 28, 14 ≤ d ≤ 20]] Generalized Bicycle Code from Appendix B, Example A1 of [panteleev2021degenerate](@cite). + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> F = Oscar.Nemo.Native.GF(2); + +julia> S, x = polynomial_ring(F, :x); + +julia> l = 127; + +julia> R, _ = residue_ring(S, x^l - 1); + +julia> a = 1 + x^15 + x^20 + x^28 + x^66; + +julia> b = 1 + x^58 + x^59 + x^100 + x^121; + +julia> code = GeneralizedBicycleCode(R(a), R(b)); + +julia> length(code), dimension(code) +(254, 28) +``` """ function GeneralizedBicycleCode(A::T, B::T; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: CTMatrixTypes @@ -508,6 +604,40 @@ end LiftedProductCode(A::MatElem{T}, B::MatElem{T}; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: Union{ResElem, CTGroupAlgebra} Return the lifted product code given by the matrices `A` and `B`. + +# Example + +[[882, 24, 18 ≤ d ≤ 24]] Lifted Product Code from Appendix B, Example B1 of [panteleev2021degenerate](@cite). + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> F = Oscar.Nemo.Native.GF(2); + +julia> S, x = polynomial_ring(F, :x); + +julia> l = 63; + +julia> R, _ = residue_ring(S, x^l - 1); + +julia> A = matrix(R, 7, 7, + [x^27, 0 , 0 , 0 , 0 , 1 , x^54, + x^54, x^27, 0 , 0 , 0 , 0 , 1 , + 1 , x^54, x^27, 0 , 0 , 0 , 0 , + 0 , 1 , x^54, x^27, 0 , 0 , 0 , + 0 , 0 , 1 , x^54, x^27, 0 , 0 , + 0 , 0 , 0 , 1 , x^54, x^27, 0 , + 0 , 0 , 0 , 0 , 1 , x^54, x^27]); + +julia> b = R(1 + x + x^6); + +julia> code = LiftedProductCode(A, b); +┌ Warning: Commutativity of A and b required but not yet enforced. +└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:340 + +julia> length(code), dimension(code) +(882, 24) +``` """ function LiftedProductCode(A::MatElem{T}, B::MatElem{T}; char_vec::Union{Vector{zzModRingElem}, Missing} = missing, logs_alg::Symbol = :stnd_frm) where T <: Union{ResElem, CTGroupAlgebra} @@ -553,7 +683,7 @@ function bias_tailored_lifted_product_matrices(A::MatElem{T}, B::MatElem{T}) whe A13 = En1 ⊗ B A21 = A ⊗ En2 A24 = Ek1 ⊗ B_tr - return vcat(hcat(zeros(A21), A12, A13, zeros(A24)), hcat(A21, zeros(A12), zeros(A13), A24)) + return vcat(hcat(zero(A21), A12, A13, zero(A24)), hcat(A21, zero(A12), zero(A13), A24)) end """ @@ -567,6 +697,40 @@ Return the pre-lifted stabilizer matrix for bias-tailored lifted product code of # Notes - Use `BiasTailoredLiftedProductCode` to return a quantum code over the base ring directly. + +# Example + +[[882, 24, d ≤ 24]] BiasTailored Lifted Product Code from Appendix B of [roffe2023bias](@cite). + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> F = Oscar.Nemo.Native.GF(2); + +julia> S, x = polynomial_ring(F, :x); + +julia> l = 63; + +julia> R, _ = residue_ring(S, x^l - 1); + +julia> A1 = matrix(R, 1, 1, [1 + x^1 + x^6]); + +julia> A2 = matrix(R, 7, 7, + [x^36, 0 , 0 , 0 , 0 , 1 , x^9 , + x^9 , x^36, 0 , 0 , 0 , 0 , 1 , + 1 , x^9 , x^36, 0 , 0 , 0 , 0 , + 0 , 1 , x^9 , x^36, 0 , 0 , 0 , + 0 , 0 , 1 , x^9 , x^36, 0 , 0 , + 0 , 0 , 0 , 1 , x^9 , x^36, 0 , + 0 , 0 , 0 , 0 , 1 , x^9 , x^36]); + +julia> code = BiasTailoredLiftedProductCode(A1, A2); +┌ Warning: Commutativity of A and b required but not yet enforced. +└ @ CodingTheory ~/Documents/GitHub/CodingTheory/src/Quantum/product_codes.jl:60 + +julia> length(code), dimension(code) +(882, 24) +``` """ function bias_tailored_lifted_product_matrices(A::MatElem{T}, B::MatElem{T}) where T <: CTGroupAlgebra @@ -587,7 +751,7 @@ function bias_tailored_lifted_product_matrices(A::MatElem{T}, B::MatElem{T}) whe A13 = En1 ⊗ B A21 = A ⊗ En2 A24 = Ek1 ⊗ B_tr - return vcat(hcat(zeros(A21), A12, A13, zeros(A24)), hcat(A21, zeros(A12), zeros(A13), A24)) + return vcat(hcat(zero(A21), A12, A13, zero(A24)), hcat(A21, zero(A12), zero(A13), A24)) end """ @@ -614,6 +778,35 @@ Return the single-parity-check `D`-fold product code. # Note - This is defined in https://arxiv.org/abs/2209.13474 + +# Example + +[512, 174, 8]] Symmetric 2-fold product CSS code from [ostrev2024classical](@cite) + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> F = Oscar.Nemo.Native.GF(2); + +julia> h = matrix(F, [1 1]); + +julia> id = identity_matrix(F, 2); + +julia> H_X = vcat( + h ⊗ h ⊗ h ⊗ id ⊗ id ⊗ id ⊗ id ⊗ id ⊗ id, + id ⊗ id ⊗ id ⊗ h ⊗ h ⊗ h ⊗ id ⊗ id ⊗ id, + id ⊗ id ⊗ id ⊗ id ⊗ id ⊗ id ⊗ h ⊗ h ⊗ h); + +julia> H_Z = vcat( + h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id, + id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id, + id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h); + +julia> code = SPCDFoldProductCode(3); + +julia> length(code), dimension(code) +(512, 174) +``` """ function SPCDFoldProductCode(D::Int, s::Int = 1) vec_S = Vector{AbstractStabilizerCode}() @@ -894,6 +1087,29 @@ Return the bivariate bicycle code defined by the residue ring elements `a` and ` # Note - This is defined in https://arxiv.org/pdf/2308.07915 + +# Example + +[[360, 12, ≤24]] Bivariate Bicycle Code from Table 3 of [bravyi2024high](@cite). + +```jldoctest +julia> using CodingTheory, Oscar; + +julia> S, (x, y) = polynomial_ring(Oscar.Nemo.Native.GF(2), [:x, :y]); + +julia> l = 30; m = 6; + +julia> R, _ = quo(S, ideal(S, [x^l - 1, y^m - 1])); + +julia> a = R(x^9 + y + y^2); + +julia> b = R(y^3 + x^25 + x^26); + +julia> code = BivariateBicycleCode(a, b); + +julia> length(code), dimension(code) +(360, 12) +``` """ function BivariateBicycleCode(a::T, b::T) where T <: Union{MPolyQuoRingElem{FqMPolyRingElem}, MPolyQuoRingElem{fpMPolyRingElem}} R = parent(a) @@ -953,7 +1169,8 @@ end Return the coprime bivariate bicycle code defined by the residue ring elements `a` and `b`. # Note -- This is defined in https://arxiv.org/pdf/2408.10001 + +- This is defined in https://arxiv.org/pdf/2408.10001. """ function CoprimeBivariateBicycleCode(a::ResElem, b::ResElem) R = parent(a) diff --git a/test/Quantum/product_codes_test.jl b/test/Quantum/product_codes_test.jl index 6c0ed72..efa4994 100644 --- a/test/Quantum/product_codes_test.jl +++ b/test/Quantum/product_codes_test.jl @@ -196,10 +196,9 @@ # takes awhile to run # Example C2 - F = Oscar.Nemo.Native.GF(2) - S, x = polynomial_ring(F, :x) + F, x = polynomial_ring(Oscar.Nemo.Native.GF(2), :x) l = 31 - R, _ = residue_ring(S, x^l - 1) + R, = residue_ring(F, x^l -1) h = R(1 + x^2 + x^5) A = residue_polynomial_to_circulant_matrix(h) Q = HypergraphProductCode(A, A) @@ -384,7 +383,7 @@ end @testset "Product Codes" begin - # should list that paper here + # [512, 174, 8]] SPCDFoldProductCode from Section 4 of https://arxiv.org/pdf/2209.13474 F = Oscar.Nemo.Native.GF(2) h = matrix(F, [1 1]) id = identity_matrix(F, 2) @@ -396,9 +395,10 @@ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id, id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id, id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h ⊗ id ⊗ id ⊗ h) - SPCtest = CodingTheory.SPCDFoldProductCode(3) + SPCtest = SPCDFoldProductCode(3) @test length(SPCtest) == 512 @test dimension(SPCtest) == 174 + @test_broken minimum_distance(SPCtest) == 8 @test H_X == SPCtest.X_stabs @test H_Z == SPCtest.Z_stabs end @@ -666,4 +666,40 @@ @test dimension(Q) == 12 @test_broken minimum_distance(Q) == 10 end + + @testset "BiasTailoredLiftedProductCode" begin + # [[882, 24, d ≤ 24]] from Appendix B of https://arxiv.org/pdf/2202.01702 + F = Oscar.Nemo.Native.GF(2) + S, x = polynomial_ring(F, :x) + l = 63 + R, _ = residue_ring(S, x^l - 1) + A1 = matrix(R, 1, 1, [1 + x^1 + x^6]) + A2 = matrix(R, 7, 7, + [x^36, 0 , 0 , 0 , 0 , 1 , x^9 , + x^9 , x^36, 0 , 0 , 0 , 0 , 1 , + 1 , x^9 , x^36, 0 , 0 , 0 , 0 , + 0 , 1 , x^9 , x^36, 0 , 0 , 0 , + 0 , 0 , 1 , x^9 , x^36, 0 , 0 , + 0 , 0 , 0 , 1 , x^9 , x^36, 0 , + 0 , 0 , 0 , 0 , 1 , x^9 , x^36]) + Q = BiasTailoredLiftedProductCode(A1, A2) + @test length(Q) == 882 + @test dimension(Q) == 24 + @test_broken minimum_distance(Q) == 24 + + # [[416, 18, d ≤ 20]] from Example 4.1 of https://arxiv.org/pdf/2202.01702 + S, x = polynomial_ring(F, :x) + l = 13 + R, _ = residue_ring(S, x^l - 1) + A1 = matrix(R, 4, 4, + [1 , x^11, x^7 , x^12, + x^1 , x^8 , x^2 , x^8 , + x^11, 1 , x^4 , x^8 , + x^6 , x^1 , x^4 , x^12,]) + A2 = A1 + Q = BiasTailoredLiftedProductCode(A1, A2) + @test length(Q) == 416 + @test dimension(Q) == 18 + @test_broken minimum_distance(Q) == 20 + end end