From 7cf74846ad5a0908fb080741ac98003097ade4e1 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Sat, 30 Nov 2024 01:36:56 +0500 Subject: [PATCH 1/4] fix broken doctests --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 66bd35ed6..7ebbc45fb 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -219,6 +219,10 @@ julia> import Hecke: group_algebra, GF, abelian_group, gens; # hide julia> l=4; m=6; +julia> GA = group_algebra(GF(2), abelian_group([l, m])); + +julia> x, y = gens(GA); + julia> z = x*y; julia> A = x^3 + y^5; @@ -252,6 +256,10 @@ julia> πœ‹ = gens(GA)[1]; julia> A = πœ‹^2 + πœ‹^5 + πœ‹^44; julia> B = πœ‹^8 + πœ‹^14 + πœ‹^47; + +julia> c = two_block_group_algebra_codes(A, B); + +julia> code_n(c), code_k(c) (108, 12) ``` From 056a4b092e43c7fc72b1d8cf9bfb04d1815db4fa Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Sat, 30 Nov 2024 02:21:48 +0500 Subject: [PATCH 2/4] fix typo --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 7ebbc45fb..a4b3d74d1 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -52,7 +52,7 @@ julia> code_n(c1), code_k(c1) (882, 24) ``` -A [[175, 19, d ≀ 0]] code from Eq. (18) in Appendix A of [raveendran2022finite](@cite), +A [[175, 19, d ≀ 10]] code from Eq. (18) in Appendix A of [raveendran2022finite](@cite), following the 4th constructor. ```jldoctest From d851e621be12023a04b999eaa34036222a3554d9 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Fri, 20 Dec 2024 12:56:28 -0500 Subject: [PATCH 3/4] make sure doctests actually run --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 24 ++++++++++++------- test/test_doctests.jl | 10 ++++++-- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index a4b3d74d1..e5c957229 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -28,7 +28,7 @@ During the construction, we do arithmetic operations to get the group algebra el Here `x` is the generator of the group algebra, i.e., offset-1 cyclic permutation, and `GA(1)` is the unit element. ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens; import LinearAlgebra: diagind; +julia> import Hecke: group_algebra, GF, abelian_group, gens; import LinearAlgebra: diagind; using QuantumClifford.ECC; julia> l = 63; GA = group_algebra(GF(2), abelian_group(l)); x = gens(GA)[]; @@ -56,6 +56,8 @@ A [[175, 19, d ≀ 10]] code from Eq. (18) in Appendix A of [raveendran2022finit following the 4th constructor. ```jldoctest +julia> import Hecke; using QuantumClifford.ECC; + julia> base_matrix = [0 0 0 0; 0 1 2 5; 0 6 3 1]; l = 7; julia> c2 = LPCode(base_matrix, l .- base_matrix', l); @@ -162,15 +164,15 @@ Here is an example of a [[56, 28, 2]] 2BGA code from Table 2 of [lin2024quantum] with direct product of `Cβ‚„ x Cβ‚‚`. ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens +julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC; julia> GA = group_algebra(GF(2), abelian_group([14,2])); julia> x, s = gens(GA); -julia> A = 1 + x^7 +julia> A = 1 + x^7; -julia> B = 1 + x^7 + s + x^8 + s*x^7 + x +julia> B = 1 + x^7 + s + x^8 + s*x^7 + x; julia> c = two_block_group_algebra_codes(A,B); @@ -189,7 +191,7 @@ The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/qcga A [[756, 16, ≀ 34]] code from Table 3 of [bravyi2024high](@cite): ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens +julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC; julia> l=21; m=18; @@ -215,7 +217,7 @@ where `𝐺ᡣ = β„€/l₁ Γ— β„€/lβ‚‚ Γ— ... Γ— β„€/lα΅£`. A [[48, 4, 6]] Weight-6 TB-QLDPC code from Appendix A Table 2 of [voss2024multivariatebicyclecodes](@cite). ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens; # hide +julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC; julia> l=4; m=6; @@ -242,10 +244,10 @@ where `𝑙` and `π‘š` are coprime, and can be expressed as univariate polynomi with generator `πœ‹ = π‘₯𝑦`. They can be viewed as a special case of Lifted Product construction based on abelian group `β„€β‚— x β„€β‚˜` where `β„€β±Ό` cyclic group of order `j`. -[108, 12, 6]] coprime-bivariate bicycle (BB) code from Table 2 of [wang2024coprime](@cite). +[[108, 12, 6]] coprime-bivariate bicycle (BB) code from Table 2 of [wang2024coprime](@cite). ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens; +julia> import Hecke: group_algebra, GF, abelian_group, gens; using QuantumClifford.ECC; julia> l=2; m=27; @@ -279,6 +281,8 @@ See also: [`two_block_group_algebra_codes`](@ref), [`bicycle_codes`](@ref). A [[254, 28, 14 ≀ d ≀ 20]] code from (A1) in Appendix B of [panteleev2021degenerate](@cite). ```jldoctest +julia> import Hecke; using QuantumClifford.ECC + julia> c = generalized_bicycle_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 127); julia> code_n(c), code_k(c) @@ -289,6 +293,8 @@ An [[70, 8, 10]] *abelian* 2BGA code from Table 1 of [lin2024quantum](@cite), wi order `l = 35`, illustrates that *abelian* 2BGA codes can be viewed as GB codes. ```jldoctest +julia> import Hecke; using QuantumClifford.ECC + julia> l = 35; julia> c1 = generalized_bicycle_codes([0, 15, 16, 18], [0, 1, 24, 27], l); @@ -325,6 +331,8 @@ code with the group `G = ℀₃ˣ³` corresponds to a cubic code. The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/haah_cubic). ```jldoctest +julia> import Hecke; using QuantumClifford.ECC; + julia> c = haah_cubic_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 6); julia> code_n(c), code_k(c) diff --git a/test/test_doctests.jl b/test/test_doctests.jl index 0ef1a0f23..86c2c7582 100644 --- a/test/test_doctests.jl +++ b/test/test_doctests.jl @@ -1,12 +1,18 @@ @testitem "Doctests" tags=[:doctests] begin using Documenter using QuantumClifford + using QuantumClifford.Experimental.NoisyCircuits + using QuantumInterface + + ENV["HECKE_PRINT_BANNER"] = "false" + import Hecke + const QuantumCliffordHeckeExt = Base.get_extension(QuantumClifford, :QuantumCliffordHeckeExt) ENV["LINES"] = 80 # for forcing `displaysize(io)` to be big enough ENV["COLUMNS"] = 80 - DocMeta.setdocmeta!(QuantumClifford, :DocTestSetup, :(using QuantumClifford; using QuantumClifford.ECC); recursive=true) + modules = [QuantumClifford, QuantumClifford.Experimental.NoisyCircuits, QuantumClifford.ECC, QuantumInterface, QuantumCliffordHeckeExt] doctestfilters = [r"(QuantumClifford\.|)"] - doctest(QuantumClifford; + doctest(nothing, modules; doctestfilters #fix=true ) From 3057b2f99c9246654be5103955c3d34fae55ea33 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Fri, 20 Dec 2024 14:06:38 -0500 Subject: [PATCH 4/4] maybe I should not have removed DocMeta? --- test/test_doctests.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_doctests.jl b/test/test_doctests.jl index 86c2c7582..b3b1ceb32 100644 --- a/test/test_doctests.jl +++ b/test/test_doctests.jl @@ -10,6 +10,7 @@ ENV["LINES"] = 80 # for forcing `displaysize(io)` to be big enough ENV["COLUMNS"] = 80 + DocMeta.setdocmeta!(QuantumClifford, :DocTestSetup, :(using QuantumClifford; using QuantumClifford.ECC); recursive=true) modules = [QuantumClifford, QuantumClifford.Experimental.NoisyCircuits, QuantumClifford.ECC, QuantumInterface, QuantumCliffordHeckeExt] doctestfilters = [r"(QuantumClifford\.|)"] doctest(nothing, modules;