From 632ec1f2f556193bff0eff3de729d2642785c286 Mon Sep 17 00:00:00 2001 From: Fe-r-oz <feroz.ahmad.email@gmail.com> Date: Mon, 21 Oct 2024 12:41:18 +0500 Subject: [PATCH 1/8] implement Bivaraite Bicycle codes using 2BGA as parent --- docs/src/references.bib | 11 ++ .../QuantumCliffordHeckeExt.jl | 5 +- ext/QuantumCliffordHeckeExt/lifted_product.jl | 44 ++++- src/ecc/ECC.jl | 1 + src/ecc/codes/lifted_product.jl | 3 + test/test_ecc_base.jl | 30 ++- test/test_ecc_bivaraite_bicycle_as_twobga.jl | 173 ++++++++++++++++++ 7 files changed, 260 insertions(+), 7 deletions(-) create mode 100644 test/test_ecc_bivaraite_bicycle_as_twobga.jl diff --git a/docs/src/references.bib b/docs/src/references.bib index 29500a034..b8d1116a0 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -487,3 +487,14 @@ @article{anderson2014fault year={2014}, publisher={APS} } + +@article{bravyi2024high, + title={High-threshold and low-overhead fault-tolerant quantum memory}, + author={Bravyi, Sergey and Cross, Andrew W and Gambetta, Jay M and Maslov, Dmitri and Rall, Patrick and Yoder, Theodore J}, + journal={Nature}, + volume={627}, + number={8005}, + pages={778--782}, + year={2024}, + publisher={Nature Publishing Group UK London} +} diff --git a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl index 29e9de8ce..3a3035f72 100644 --- a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl +++ b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl @@ -5,13 +5,14 @@ using DocStringExtensions import QuantumClifford, LinearAlgebra import Hecke: Group, GroupElem, AdditiveGroup, AdditiveGroupElem, GroupAlgebra, GroupAlgebraElem, FqFieldElem, representation_matrix, dim, base_ring, - multiplication_table, coefficients, abelian_group, group_algebra + multiplication_table, coefficients, abelian_group, group_algebra, + FinGenAbGroup, FinGenAbGroupElem, one import Nemo import Nemo: characteristic, matrix_repr, GF, ZZ, lift import QuantumClifford.ECC: AbstractECC, CSS, ClassicalCode, hgp, code_k, code_n, code_s, iscss, parity_checks, parity_checks_x, parity_checks_z, parity_checks_xz, - two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes + two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, bivariate_bicycle_codes include("types.jl") include("lifted.jl") diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index ef09eddbb..223465f4e 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -153,7 +153,7 @@ code_s(c::LPCode) = size(c.repr(zero(c.GA)), 1) * (size(c.A, 1) * size(c.B, 1) + Two-block group algebra (2GBA) codes, which are a special case of lifted product codes from two group algebra elements `a` and `b`, used as `1x1` base matrices. -See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref) +See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), [`bivariate_bicycle_codes`](@ref) """ # TODO doctest example function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) A = reshape([a], (1, 1)) @@ -166,7 +166,7 @@ Generalized bicycle codes, which are a special case of 2GBA codes (and therefore Here the group is chosen as the cyclic group of order `l`, and the base matrices `a` and `b` are the sum of the group algebra elements corresponding to the shifts `a_shifts` and `b_shifts`. -See also: [`two_block_group_algebra_codes`](@ref), [`bicycle_codes`](@ref). +See also: [`two_block_group_algebra_codes`](@ref), [`bicycle_codes`](@ref), [`bivariate_bicycle_codes`](@ref) A [[254, 28, 14 ≤ d ≤ 20]] code from (A1) in Appendix B of [panteleev2021degenerate](@cite). @@ -189,10 +189,48 @@ Bicycle codes are a special case of generalized bicycle codes, where `a` and `b` are conjugate to each other. The order of the cyclic group is `l`, and the shifts `a_shifts` and `b_shifts` are reverse to each other. -See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref). +See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`bivariate_bicycle_codes`](@ref) """ # TODO doctest example function bicycle_codes(a_shifts::Array{Int}, l::Int) GA = group_algebra(GF(2), abelian_group(l)) a = sum(GA[n÷l+1] for n in a_shifts) two_block_group_algebra_codes(a, group_algebra_conj(a)) end + +""" +Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct product +of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the +first and second cyclic groups, respectively. + +The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/q-ary_bch). + +See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), +[`bicycle_codes`](@ref), [`LPCode`](@ref) + +A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite). + +```jldoctest +julia> import Hecke: group_algebra, GF, abelian_group, gens; # hide + +julia> l=21; m=18; + +julia> GA = group_algebra(GF(2), abelian_group([l, m])); + +julia> x, y = gens(GA); + +julia> A = [x^3 , y^10 , y^17]; + +julia> B = [y^5 , x^3 , x^19]; + +julia> c = bivariate_bicycle_codes(A,B,GA); + +julia> code_n(c), code_k(c) +(756, 16) +``` +""" +function bivariate_bicycle_codes(A::Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}}}, B::Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}}}, GA::GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}) + a = sum(GA(x) for x in A) + b = sum(GA(x) for x in B) + c = two_block_group_algebra_codes(a,b) + return c +end diff --git a/src/ecc/ECC.jl b/src/ecc/ECC.jl index cdda7742e..5a29f136f 100644 --- a/src/ecc/ECC.jl +++ b/src/ecc/ECC.jl @@ -22,6 +22,7 @@ export parity_checks, parity_checks_x, parity_checks_z, iscss, Shor9, Steane7, Cleve8, Perfect5, Bitflip3, Toric, Gottesman, Surface, Concat, CircuitCode, QuantumReedMuller, LPCode, two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, + bivariate_bicycle_codes, random_brickwork_circuit_code, random_all_to_all_circuit_code, evaluate_decoder, CommutationCheckECCSetup, NaiveSyndromeECCSetup, ShorSyndromeECCSetup, diff --git a/src/ecc/codes/lifted_product.jl b/src/ecc/codes/lifted_product.jl index 338880702..955bc3ff5 100644 --- a/src/ecc/codes/lifted_product.jl +++ b/src/ecc/codes/lifted_product.jl @@ -17,3 +17,6 @@ function generalized_bicycle_codes end """Implemented in a package extension with Hecke.""" function bicycle_codes end + +"""Implemented in a package extension with Hecke.""" +function bivariate_bicycle_codes end diff --git a/test/test_ecc_base.jl b/test/test_ecc_base.jl index 9f4a5ec9e..0c20e6c31 100644 --- a/test/test_ecc_base.jl +++ b/test/test_ecc_base.jl @@ -5,7 +5,7 @@ using InteractiveUtils import Nemo: GF import LinearAlgebra -import Hecke: group_algebra, abelian_group, gens +import Hecke: group_algebra, abelian_group, gens, one # generate instances of all implemented codes to make sure nothing skips being checked @@ -56,6 +56,32 @@ A[LinearAlgebra.diagind(A, 5)] .= GA(1) B = reshape([1 + x + x^6], (1, 1)) push!(other_lifted_product_codes, LPCode(A, B)) +# A [[72, 12, 6]] code from Table 3 of [bravyi2024high](@cite). +l=6; m=6 +GA = group_algebra(GF(2), abelian_group([l, m])) +x, y = gens(GA) +A = [x^3, y, y^2] +B = [y^3, x, x^2] +bb1 = bivariate_bicycle_codes(A,B,GA) + +# A [[90, 8, 10]] code from Table 3 of [bravyi2024high](@cite). +l=15; m=3 +GA = group_algebra(GF(2), abelian_group([l, m])) +x, y = gens(GA) +A = [x^9 , y , y^2] +B = [one(x), x^2 , x^7] +bb2 = bivariate_bicycle_codes(A,B,GA) + +# A [[360, 12, ≤ 24]] code from Table 3 of [bravyi2024high](@cite). +l=30; m=6 +GA = group_algebra(GF(2), abelian_group([l, m])) +x, y = gens(GA) +A = [x^9 , y , y^2] +B = [y^3 , x^25 , x^26] +bb3 = bivariate_bicycle_codes(A,B,GA) + +test_bb_codes = [bb1, bb2, bb3] + const code_instance_args = Dict( :Toric => [(3,3), (4,4), (3,6), (4,3), (5,5)], :Surface => [(3,3), (4,4), (3,6), (4,3), (5,5)], @@ -63,7 +89,7 @@ const code_instance_args = Dict( :CSS => (c -> (parity_checks_x(c), parity_checks_z(c))).([Shor9(), Steane7(), Toric(4, 4)]), :Concat => [(Perfect5(), Perfect5()), (Perfect5(), Steane7()), (Steane7(), Cleve8()), (Toric(2, 2), Shor9())], :CircuitCode => random_circuit_code_args, - :LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, other_lifted_product_codes)), + :LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, test_bb_codes, other_lifted_product_codes)), :QuantumReedMuller => [3, 4, 5] ) diff --git a/test/test_ecc_bivaraite_bicycle_as_twobga.jl b/test/test_ecc_bivaraite_bicycle_as_twobga.jl new file mode 100644 index 000000000..cee31f642 --- /dev/null +++ b/test/test_ecc_bivaraite_bicycle_as_twobga.jl @@ -0,0 +1,173 @@ +@testitem "ECC Bivaraite Bicycle as 2BGA" begin + using Hecke + using Hecke: group_algebra, GF, abelian_group, gens, one + using QuantumClifford.ECC: bivariate_bicycle_codes, code_k, code_n + + @testset "Reproduce Table 3 bravyi2024high" begin + # [[72, 12, 6]] + l=6; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3, y, y^2] + B = [y^3, x, x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 72 && code_k(c) == 12 + + # [[90, 8, 10]] + l=15; m=3 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^9 , y , y^2] + B = [one(x), x^2 , x^7] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 90 && code_k(c) == 8 + + # [[108, 8, 10]] + l=9; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3 , y , y^2] + B = [y^3 , x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 108 && code_k(c) == 8 + + # [[144, 12, 12]] + l=12; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3 , y , y^2] + B = [y^3 , x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 144 && code_k(c) == 12 + + # [[288, 12, 12]] + l=12; m=12 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3 , y^2, y^7] + B = [y^3 , x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 288 && code_k(c) == 12 + + # [[360, 12, ≤ 24]] + l=30; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^9 , y , y^2] + B = [y^3 , x^25 , x^26] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 360 && code_k(c) == 12 + + # [[756, 16, ≤ 34]] + l=21; m=18 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3 , y^10 , y^17] + B = [y^5 , x^3 , x^19] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 756 && code_k(c) == 16 + end + + @testset "Reproduce Table 1 berthusen2024toward" begin + # [[72, 8, 6]] + l=12; m=3 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^9 , y , y^2] + B = [one(x), x , x^11] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 72 && code_k(c) == 8 + + # [[90, 8, 6]] + l=9; m=5 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^8 , y^4 , y] + B = [y^5 , x^8 , x^7] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 90 && code_k(c) == 8 + + # [[120, 8, 8]] + l=12; m=5 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^10 , y^4, y] + B = [one(x), x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 120 && code_k(c) == 8 + + # [[150, 8, 8]] + l=15; m=5 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^5 , y^2 , y^3] + B = [y^2 , x^7 , x^6] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 150 && code_k(c) == 8 + + # [[196, 12, 8]] + l=14; m=7 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^6 , y^5 , y^6] + B = [one(x), x^4 , x^13] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 196 && code_k(c) == 12 + end + + @testset "Reproduce Table 1 wang2024coprime" begin + # [[54, 8, 6]] + l=3; m=9 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [one(x), y^2, y^4] + B = [y^3 , x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 54 && code_k(c) == 8 + + # [[98, 6, 12]] + l=7; m=7 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3 , y^5 , y^6] + B = [y^2 , x^3 , x^5] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 98 && code_k(c) == 6 + + # [[126, 8, 10]] + l=3; m=21 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [one(x), y^2, y^10] + B = [y^3 , x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 126 && code_k(c) == 8 + + # [[150, 16, 8]] + l=5; m=15 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [one(x), y^6, y^8] + B = [y^5 , x , x^4] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 150 && code_k(c) == 16 + + # [[162, 8, 14]] + l=3; m=27 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [one(x), y^10, y^14] + B = [y^12 , x , x^2] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 162 && code_k(c) == 8 + + # [[180, 8, 16]] + l=6; m=15 + GA = group_algebra(GF(2), abelian_group([l, m])) + x, y = gens(GA) + A = [x^3 , y , y^2] + B = [y^6 , x^4 , x^5] + c = bivariate_bicycle_codes(A,B,GA) + @test code_n(c) == 180 && code_k(c) == 8 + end +end From 554bd24afeadfad8e5eb40c68e95b4a969f3040b Mon Sep 17 00:00:00 2001 From: Fe-r-oz <feroz.ahmad.email@gmail.com> Date: Tue, 29 Oct 2024 12:39:58 +0500 Subject: [PATCH 2/8] improve code quality by defining const types for FinGenAbGroup, FinGenAbGroupElem --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 2 +- ext/QuantumCliffordHeckeExt/types.jl | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 223465f4e..4708d3899 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -228,7 +228,7 @@ julia> code_n(c), code_k(c) (756, 16) ``` """ -function bivariate_bicycle_codes(A::Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}}}, B::Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}}}, GA::GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}) +function bivariate_bicycle_codes(A::VectorGroupAlgebraElem, B::VectorGroupAlgebraElem, GA::FqFieldFinGenAbGroupElemGroupAlgebra) a = sum(GA(x) for x in A) b = sum(GA(x) for x in B) c = two_block_group_algebra_codes(a,b) diff --git a/ext/QuantumCliffordHeckeExt/types.jl b/ext/QuantumCliffordHeckeExt/types.jl index ecd0d7a68..6c22c8935 100644 --- a/ext/QuantumCliffordHeckeExt/types.jl +++ b/ext/QuantumCliffordHeckeExt/types.jl @@ -10,6 +10,10 @@ const FqFieldGroupAlgebraElemMatrix = Union{ LinearAlgebra.Adjoint{<:GroupAlgebraElem{FqFieldElem,<:GroupAlgebra},<:Matrix{<:GroupAlgebraElem{FqFieldElem,<:GroupAlgebra}}} } +const VectorGroupAlgebraElem = Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}}} + +const FqFieldFinGenAbGroupElemGroupAlgebra = GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem} + """ Compute the conjugate of a group algebra element. The conjugate is defined by inversing elements in the associated group. From a245163db006c84aae3fcc283750d551e0c10f10 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov <github.acc@krastanov.org> Date: Mon, 4 Nov 2024 22:51:32 -0500 Subject: [PATCH 3/8] fix ECC zoo link --- 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 4708d3899..b0df73c74 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -202,7 +202,7 @@ Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct p of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the first and second cyclic groups, respectively. -The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/q-ary_bch). +The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/qcga). See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), [`LPCode`](@ref) From 8b5813f27e143ee61c48ed059a2d8d7c212198d6 Mon Sep 17 00:00:00 2001 From: Fe-r-oz <feroz.ahmad.email@gmail.com> Date: Tue, 5 Nov 2024 10:49:24 +0500 Subject: [PATCH 4/8] add wonderful codereview suggestion --- docs/src/references.bib | 21 ++-- docs/src/references.md | 2 + .../QuantumCliffordHeckeExt.jl | 7 +- ext/QuantumCliffordHeckeExt/lifted_product.jl | 12 +- ext/QuantumCliffordHeckeExt/types.jl | 4 - test/test_ecc_base.jl | 20 ++-- test/test_ecc_bivaraite_bicycle_as_twobga.jl | 108 +++++++++--------- 7 files changed, 85 insertions(+), 89 deletions(-) diff --git a/docs/src/references.bib b/docs/src/references.bib index e1a3c9521..635ca65ee 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -513,16 +513,6 @@ @article{anderson2014fault publisher={APS} } -@article{bravyi2024high, - title={High-threshold and low-overhead fault-tolerant quantum memory}, - author={Bravyi, Sergey and Cross, Andrew W and Gambetta, Jay M and Maslov, Dmitri and Rall, Patrick and Yoder, Theodore J}, - journal={Nature}, - volume={627}, - number={8005}, - pages={778--782}, - year={2024}, - publisher={Nature Publishing Group UK London} - @article{lin2024quantum, title={Quantum two-block group algebra codes}, author={Lin, Hsiang-Ku and Pryadko, Leonid P}, @@ -533,3 +523,14 @@ @article{lin2024quantum year={2024}, publisher={APS} } + +@article{bravyi2024high, + title={High-threshold and low-overhead fault-tolerant quantum memory}, + author={Bravyi, Sergey and Cross, Andrew W and Gambetta, Jay M and Maslov, Dmitri and Rall, Patrick and Yoder, Theodore J}, + journal={Nature}, + volume={627}, + number={8005}, + pages={778--782}, + year={2024}, + publisher={Nature Publishing Group UK London} +} diff --git a/docs/src/references.md b/docs/src/references.md index 35e944a21..049f222b5 100644 --- a/docs/src/references.md +++ b/docs/src/references.md @@ -40,6 +40,8 @@ For quantum code construction routines: - [steane1999quantum](@cite) - [campbell2012magic](@cite) - [anderson2014fault](@cite) +- [lin2024quantum](@cite) +- [bravyi2024high](@cite) For classical code construction routines: - [muller1954application](@cite) diff --git a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl index d6157d1fc..99540362d 100644 --- a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl +++ b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl @@ -5,15 +5,14 @@ using DocStringExtensions import QuantumClifford, LinearAlgebra import Hecke: Group, GroupElem, AdditiveGroup, AdditiveGroupElem, GroupAlgebra, GroupAlgebraElem, FqFieldElem, representation_matrix, dim, base_ring, - multiplication_table, coefficients, abelian_group, group_algebra, rand, - FinGenAbGroup, FinGenAbGroupElem, one + multiplication_table, coefficients, abelian_group, group_algebra, rand import Nemo import Nemo: characteristic, matrix_repr, GF, ZZ, lift import QuantumClifford.ECC: AbstractECC, CSS, ClassicalCode, hgp, code_k, code_n, code_s, iscss, parity_checks, parity_checks_x, parity_checks_z, parity_checks_xz, - two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, bivariate_bicycle_codes, - check_repr_commutation_relation + two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation, + bivariate_bicycle_codes include("util.jl") include("types.jl") diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 807e4f9a8..9851d7585 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -238,19 +238,17 @@ julia> GA = group_algebra(GF(2), abelian_group([l, m])); julia> x, y = gens(GA); -julia> A = [x^3 , y^10 , y^17]; +julia> A = x^3 + y^10 + y^17; -julia> B = [y^5 , x^3 , x^19]; +julia> B = y^5 + x^3 + x^19; -julia> c = bivariate_bicycle_codes(A,B,GA); +julia> c = bivariate_bicycle_codes(A,B); julia> code_n(c), code_k(c) (756, 16) ``` """ -function bivariate_bicycle_codes(A::VectorGroupAlgebraElem, B::VectorGroupAlgebraElem, GA::FqFieldFinGenAbGroupElemGroupAlgebra) - a = sum(GA(x) for x in A) - b = sum(GA(x) for x in B) - c = two_block_group_algebra_codes(a,b) +function bivariate_bicycle_codes(A::GroupAlgebraElem, B::GroupAlgebraElem) + c = two_block_group_algebra_codes(A,B) return c end diff --git a/ext/QuantumCliffordHeckeExt/types.jl b/ext/QuantumCliffordHeckeExt/types.jl index 6c22c8935..ecd0d7a68 100644 --- a/ext/QuantumCliffordHeckeExt/types.jl +++ b/ext/QuantumCliffordHeckeExt/types.jl @@ -10,10 +10,6 @@ const FqFieldGroupAlgebraElemMatrix = Union{ LinearAlgebra.Adjoint{<:GroupAlgebraElem{FqFieldElem,<:GroupAlgebra},<:Matrix{<:GroupAlgebraElem{FqFieldElem,<:GroupAlgebra}}} } -const VectorGroupAlgebraElem = Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem}}} - -const FqFieldFinGenAbGroupElemGroupAlgebra = GroupAlgebra{FqFieldElem, FinGenAbGroup, FinGenAbGroupElem} - """ Compute the conjugate of a group algebra element. The conjugate is defined by inversing elements in the associated group. diff --git a/test/test_ecc_base.jl b/test/test_ecc_base.jl index 1884f4ce8..bfa759fe7 100644 --- a/test/test_ecc_base.jl +++ b/test/test_ecc_base.jl @@ -6,7 +6,7 @@ using InteractiveUtils import Nemo: GF import LinearAlgebra -import Hecke: group_algebra, abelian_group, gens, one +import Hecke: group_algebra, abelian_group, gens # generate instances of all implemented codes to make sure nothing skips being checked @@ -62,25 +62,25 @@ push!(other_lifted_product_codes, LPCode(A, B)) l=6; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) -A = [x^3, y, y^2] -B = [y^3, x, x^2] -bb1 = bivariate_bicycle_codes(A,B,GA) +A = x^3 + y + y^2 +B = y^3 + x + x^2 +bb1 = bivariate_bicycle_codes(A,B) # A [[90, 8, 10]] code from Table 3 of [bravyi2024high](@cite). l=15; m=3 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) -A = [x^9 , y , y^2] -B = [one(x), x^2 , x^7] -bb2 = bivariate_bicycle_codes(A,B,GA) +A = x^9 + y + y^2 +B = 1 + x^2 + x^7 +bb2 = bivariate_bicycle_codes(A,B) # A [[360, 12, ≤ 24]] code from Table 3 of [bravyi2024high](@cite). l=30; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) -A = [x^9 , y , y^2] -B = [y^3 , x^25 , x^26] -bb3 = bivariate_bicycle_codes(A,B,GA) +A = x^9 + y + y^2 +B = y^3 + x^25 + x^26 +bb3 = bivariate_bicycle_codes(A,B) test_bb_codes = [bb1, bb2, bb3] diff --git a/test/test_ecc_bivaraite_bicycle_as_twobga.jl b/test/test_ecc_bivaraite_bicycle_as_twobga.jl index cee31f642..670533b9e 100644 --- a/test/test_ecc_bivaraite_bicycle_as_twobga.jl +++ b/test/test_ecc_bivaraite_bicycle_as_twobga.jl @@ -8,63 +8,63 @@ l=6; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3, y, y^2] - B = [y^3, x, x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y + y^2 + B = y^3 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 72 && code_k(c) == 12 # [[90, 8, 10]] l=15; m=3 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^9 , y , y^2] - B = [one(x), x^2 , x^7] - c = bivariate_bicycle_codes(A,B,GA) + A = x^9 + y + y^2 + B = 1 + x^2 + x^7 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 90 && code_k(c) == 8 # [[108, 8, 10]] l=9; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3 , y , y^2] - B = [y^3 , x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y + y^2 + B = y^3 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 108 && code_k(c) == 8 # [[144, 12, 12]] l=12; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3 , y , y^2] - B = [y^3 , x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y + y^2 + B = y^3 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 144 && code_k(c) == 12 # [[288, 12, 12]] l=12; m=12 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3 , y^2, y^7] - B = [y^3 , x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y^2 + y^7 + B = y^3 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 288 && code_k(c) == 12 # [[360, 12, ≤ 24]] l=30; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^9 , y , y^2] - B = [y^3 , x^25 , x^26] - c = bivariate_bicycle_codes(A,B,GA) + A = x^9 + y + y^2 + B = y^3 + x^25 + x^26 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 360 && code_k(c) == 12 # [[756, 16, ≤ 34]] l=21; m=18 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3 , y^10 , y^17] - B = [y^5 , x^3 , x^19] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y^10 + y^17 + B = y^5 + x^3 + x^19 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 756 && code_k(c) == 16 end @@ -73,45 +73,45 @@ l=12; m=3 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^9 , y , y^2] - B = [one(x), x , x^11] - c = bivariate_bicycle_codes(A,B,GA) + A = x^9 + y + y^2 + B = 1 + x + x^11 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 72 && code_k(c) == 8 # [[90, 8, 6]] l=9; m=5 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^8 , y^4 , y] - B = [y^5 , x^8 , x^7] - c = bivariate_bicycle_codes(A,B,GA) + A = x^8 + y^4 + y + B = y^5 + x^8 + x^7 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 90 && code_k(c) == 8 # [[120, 8, 8]] l=12; m=5 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^10 , y^4, y] - B = [one(x), x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = x^10 + y^4 + y + B = 1 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 120 && code_k(c) == 8 # [[150, 8, 8]] l=15; m=5 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^5 , y^2 , y^3] - B = [y^2 , x^7 , x^6] - c = bivariate_bicycle_codes(A,B,GA) + A = x^5 + y^2 + y^3 + B = y^2 + x^7 + x^6 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 150 && code_k(c) == 8 # [[196, 12, 8]] l=14; m=7 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^6 , y^5 , y^6] - B = [one(x), x^4 , x^13] - c = bivariate_bicycle_codes(A,B,GA) + A = x^6 + y^5 + y^6 + B = 1 + x^4 + x^13 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 196 && code_k(c) == 12 end @@ -120,54 +120,54 @@ l=3; m=9 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [one(x), y^2, y^4] - B = [y^3 , x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = 1 + y^2 + y^4 + B = y^3 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 54 && code_k(c) == 8 # [[98, 6, 12]] l=7; m=7 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3 , y^5 , y^6] - B = [y^2 , x^3 , x^5] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y^5 + y^6 + B = y^2 + x^3 + x^5 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 98 && code_k(c) == 6 # [[126, 8, 10]] l=3; m=21 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [one(x), y^2, y^10] - B = [y^3 , x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = 1 + y^2 + y^10 + B = y^3 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 126 && code_k(c) == 8 # [[150, 16, 8]] l=5; m=15 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [one(x), y^6, y^8] - B = [y^5 , x , x^4] - c = bivariate_bicycle_codes(A,B,GA) + A = 1 + y^6 + y^8 + B = y^5 + x + x^4 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 150 && code_k(c) == 16 # [[162, 8, 14]] l=3; m=27 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [one(x), y^10, y^14] - B = [y^12 , x , x^2] - c = bivariate_bicycle_codes(A,B,GA) + A = 1 + y^10 + y^14 + B = y^12 + x + x^2 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 162 && code_k(c) == 8 # [[180, 8, 16]] l=6; m=15 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) - A = [x^3 , y , y^2] - B = [y^6 , x^4 , x^5] - c = bivariate_bicycle_codes(A,B,GA) + A = x^3 + y + y^2 + B = y^6 + x^4 + x^5 + c = bivariate_bicycle_codes(A,B) @test code_n(c) == 180 && code_k(c) == 8 end end From 3082dbd140ac2d0f7da4c220132cabea3b42d83f Mon Sep 17 00:00:00 2001 From: Fe-r-oz <feroz.ahmad.email@gmail.com> Date: Tue, 5 Nov 2024 11:58:16 +0500 Subject: [PATCH 5/8] further simplification --- .../QuantumCliffordHeckeExt.jl | 3 +- ext/QuantumCliffordHeckeExt/lifted_product.jl | 71 ++++++++---------- src/ecc/ECC.jl | 1 - src/ecc/codes/lifted_product.jl | 3 - test/test_ecc_base.jl | 7 +- test/test_ecc_bivaraite_bicycle_as_twobga.jl | 74 +++++++++---------- 6 files changed, 74 insertions(+), 85 deletions(-) diff --git a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl index 99540362d..b8508ff66 100644 --- a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl +++ b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl @@ -11,8 +11,7 @@ import Nemo: characteristic, matrix_repr, GF, ZZ, lift import QuantumClifford.ECC: AbstractECC, CSS, ClassicalCode, hgp, code_k, code_n, code_s, iscss, parity_checks, parity_checks_x, parity_checks_z, parity_checks_xz, - two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation, - bivariate_bicycle_codes + two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation include("util.jl") include("types.jl") diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 9851d7585..1a9f04bb3 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -175,7 +175,36 @@ julia> code_n(c), code_k(c) (56, 28) ``` -See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), [`bivariate_bicycle_codes`](@ref) +# Examples of 2BGA Code subfamilies + +Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct product +of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the +first and second cyclic groups, respectively. + +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; # hide + +julia> l=21; m=18; + +julia> GA = group_algebra(GF(2), abelian_group([l, m])); + +julia> x, y = gens(GA); + +julia> A = x^3 + y^10 + y^17; + +julia> B = y^5 + x^3 + x^19; + +julia> c = two_block_group_algebra_codes(A,B); + +julia> code_n(c), code_k(c) +(756, 16) +``` + +See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref). """ function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) LPCode([a;;], [b;;]) @@ -186,7 +215,7 @@ Generalized bicycle codes, which are a special case of 2GBA codes (and therefore Here the group is chosen as the cyclic group of order `l`, and the base matrices `a` and `b` are the sum of the group algebra elements corresponding to the shifts `a_shifts` and `b_shifts`. -See also: [`two_block_group_algebra_codes`](@ref), [`bicycle_codes`](@ref), [`bivariate_bicycle_codes`](@ref) +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). @@ -209,46 +238,10 @@ Bicycle codes are a special case of generalized bicycle codes, where `a` and `b` are conjugate to each other. The order of the cyclic group is `l`, and the shifts `a_shifts` and `b_shifts` are reverse to each other. -See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`bivariate_bicycle_codes`](@ref) +See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref). """ # TODO doctest example function bicycle_codes(a_shifts::Array{Int}, l::Int) GA = group_algebra(GF(2), abelian_group(l)) a = sum(GA[n÷l+1] for n in a_shifts) two_block_group_algebra_codes(a, group_algebra_conj(a)) end - -""" -Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct product -of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the -first and second cyclic groups, respectively. - -The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/qcga). - -See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), -[`bicycle_codes`](@ref), [`LPCode`](@ref) - -A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite). - -```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens; # hide - -julia> l=21; m=18; - -julia> GA = group_algebra(GF(2), abelian_group([l, m])); - -julia> x, y = gens(GA); - -julia> A = x^3 + y^10 + y^17; - -julia> B = y^5 + x^3 + x^19; - -julia> c = bivariate_bicycle_codes(A,B); - -julia> code_n(c), code_k(c) -(756, 16) -``` -""" -function bivariate_bicycle_codes(A::GroupAlgebraElem, B::GroupAlgebraElem) - c = two_block_group_algebra_codes(A,B) - return c -end diff --git a/src/ecc/ECC.jl b/src/ecc/ECC.jl index 2e236c09f..ff4444694 100644 --- a/src/ecc/ECC.jl +++ b/src/ecc/ECC.jl @@ -29,7 +29,6 @@ export parity_checks, parity_checks_x, parity_checks_z, iscss, Shor9, Steane7, Cleve8, Perfect5, Bitflip3, Toric, Gottesman, Surface, Concat, CircuitCode, QuantumReedMuller, LPCode, two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, - bivariate_bicycle_codes, random_brickwork_circuit_code, random_all_to_all_circuit_code, evaluate_decoder, CommutationCheckECCSetup, NaiveSyndromeECCSetup, ShorSyndromeECCSetup, diff --git a/src/ecc/codes/lifted_product.jl b/src/ecc/codes/lifted_product.jl index 955bc3ff5..338880702 100644 --- a/src/ecc/codes/lifted_product.jl +++ b/src/ecc/codes/lifted_product.jl @@ -17,6 +17,3 @@ function generalized_bicycle_codes end """Implemented in a package extension with Hecke.""" function bicycle_codes end - -"""Implemented in a package extension with Hecke.""" -function bivariate_bicycle_codes end diff --git a/test/test_ecc_base.jl b/test/test_ecc_base.jl index bfa759fe7..ca423aa25 100644 --- a/test/test_ecc_base.jl +++ b/test/test_ecc_base.jl @@ -58,13 +58,14 @@ A[LinearAlgebra.diagind(A, 5)] .= GA(1) B = reshape([1 + x + x^6], (1, 1)) push!(other_lifted_product_codes, LPCode(A, B)) +# Bivariate Bicycle codes # A [[72, 12, 6]] code from Table 3 of [bravyi2024high](@cite). l=6; m=6 GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) A = x^3 + y + y^2 B = y^3 + x + x^2 -bb1 = bivariate_bicycle_codes(A,B) +bb1 = two_block_group_algebra_codes(A,B) # A [[90, 8, 10]] code from Table 3 of [bravyi2024high](@cite). l=15; m=3 @@ -72,7 +73,7 @@ GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) A = x^9 + y + y^2 B = 1 + x^2 + x^7 -bb2 = bivariate_bicycle_codes(A,B) +bb2 = two_block_group_algebra_codes(A,B) # A [[360, 12, ≤ 24]] code from Table 3 of [bravyi2024high](@cite). l=30; m=6 @@ -80,7 +81,7 @@ GA = group_algebra(GF(2), abelian_group([l, m])) x, y = gens(GA) A = x^9 + y + y^2 B = y^3 + x^25 + x^26 -bb3 = bivariate_bicycle_codes(A,B) +bb3 = two_block_group_algebra_codes(A,B) test_bb_codes = [bb1, bb2, bb3] diff --git a/test/test_ecc_bivaraite_bicycle_as_twobga.jl b/test/test_ecc_bivaraite_bicycle_as_twobga.jl index 670533b9e..ffeac975a 100644 --- a/test/test_ecc_bivaraite_bicycle_as_twobga.jl +++ b/test/test_ecc_bivaraite_bicycle_as_twobga.jl @@ -1,7 +1,7 @@ @testitem "ECC Bivaraite Bicycle as 2BGA" begin using Hecke using Hecke: group_algebra, GF, abelian_group, gens, one - using QuantumClifford.ECC: bivariate_bicycle_codes, code_k, code_n + using QuantumClifford.ECC: two_block_group_algebra_codes, code_k, code_n @testset "Reproduce Table 3 bravyi2024high" begin # [[72, 12, 6]] @@ -10,8 +10,8 @@ x, y = gens(GA) A = x^3 + y + y^2 B = y^3 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 72 && code_k(c) == 12 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 72 && code_k(c) == 12 # [[90, 8, 10]] l=15; m=3 @@ -19,8 +19,8 @@ x, y = gens(GA) A = x^9 + y + y^2 B = 1 + x^2 + x^7 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 90 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 90 && code_k(c) == 8 # [[108, 8, 10]] l=9; m=6 @@ -28,8 +28,8 @@ x, y = gens(GA) A = x^3 + y + y^2 B = y^3 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 108 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 108 && code_k(c) == 8 # [[144, 12, 12]] l=12; m=6 @@ -37,8 +37,8 @@ x, y = gens(GA) A = x^3 + y + y^2 B = y^3 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 144 && code_k(c) == 12 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 144 && code_k(c) == 12 # [[288, 12, 12]] l=12; m=12 @@ -46,8 +46,8 @@ x, y = gens(GA) A = x^3 + y^2 + y^7 B = y^3 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 288 && code_k(c) == 12 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 288 && code_k(c) == 12 # [[360, 12, ≤ 24]] l=30; m=6 @@ -55,8 +55,8 @@ x, y = gens(GA) A = x^9 + y + y^2 B = y^3 + x^25 + x^26 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 360 && code_k(c) == 12 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 360 && code_k(c) == 12 # [[756, 16, ≤ 34]] l=21; m=18 @@ -64,8 +64,8 @@ x, y = gens(GA) A = x^3 + y^10 + y^17 B = y^5 + x^3 + x^19 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 756 && code_k(c) == 16 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 756 && code_k(c) == 16 end @testset "Reproduce Table 1 berthusen2024toward" begin @@ -75,8 +75,8 @@ x, y = gens(GA) A = x^9 + y + y^2 B = 1 + x + x^11 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 72 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 72 && code_k(c) == 8 # [[90, 8, 6]] l=9; m=5 @@ -84,8 +84,8 @@ x, y = gens(GA) A = x^8 + y^4 + y B = y^5 + x^8 + x^7 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 90 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 90 && code_k(c) == 8 # [[120, 8, 8]] l=12; m=5 @@ -93,8 +93,8 @@ x, y = gens(GA) A = x^10 + y^4 + y B = 1 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 120 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 120 && code_k(c) == 8 # [[150, 8, 8]] l=15; m=5 @@ -102,8 +102,8 @@ x, y = gens(GA) A = x^5 + y^2 + y^3 B = y^2 + x^7 + x^6 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 150 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 150 && code_k(c) == 8 # [[196, 12, 8]] l=14; m=7 @@ -111,8 +111,8 @@ x, y = gens(GA) A = x^6 + y^5 + y^6 B = 1 + x^4 + x^13 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 196 && code_k(c) == 12 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 196 && code_k(c) == 12 end @testset "Reproduce Table 1 wang2024coprime" begin @@ -122,8 +122,8 @@ x, y = gens(GA) A = 1 + y^2 + y^4 B = y^3 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 54 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 54 && code_k(c) == 8 # [[98, 6, 12]] l=7; m=7 @@ -131,8 +131,8 @@ x, y = gens(GA) A = x^3 + y^5 + y^6 B = y^2 + x^3 + x^5 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 98 && code_k(c) == 6 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 98 && code_k(c) == 6 # [[126, 8, 10]] l=3; m=21 @@ -140,8 +140,8 @@ x, y = gens(GA) A = 1 + y^2 + y^10 B = y^3 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 126 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 126 && code_k(c) == 8 # [[150, 16, 8]] l=5; m=15 @@ -149,8 +149,8 @@ x, y = gens(GA) A = 1 + y^6 + y^8 B = y^5 + x + x^4 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 150 && code_k(c) == 16 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 150 && code_k(c) == 16 # [[162, 8, 14]] l=3; m=27 @@ -158,8 +158,8 @@ x, y = gens(GA) A = 1 + y^10 + y^14 B = y^12 + x + x^2 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 162 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 162 && code_k(c) == 8 # [[180, 8, 16]] l=6; m=15 @@ -167,7 +167,7 @@ x, y = gens(GA) A = x^3 + y + y^2 B = y^6 + x^4 + x^5 - c = bivariate_bicycle_codes(A,B) - @test code_n(c) == 180 && code_k(c) == 8 + c = two_block_group_algebra_codes(A,B) + @test code_n(c) == 180 && code_k(c) == 8 end end From 3f932143996fd928540bb6ada6efed1a6f6c85ab Mon Sep 17 00:00:00 2001 From: Fe-r-oz <feroz.ahmad.email@gmail.com> Date: Tue, 5 Nov 2024 12:21:58 +0500 Subject: [PATCH 6/8] formatting fix: use code not Code --- 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 1a9f04bb3..8c07be309 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -175,7 +175,7 @@ julia> code_n(c), code_k(c) (56, 28) ``` -# Examples of 2BGA Code subfamilies +# Examples of 2BGA code subfamilies Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct product of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the From 0e8c8fbf46c87eede517daf44b9b04ebd10a5514 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov <github.acc@krastanov.org> Date: Tue, 5 Nov 2024 07:46:08 -0500 Subject: [PATCH 7/8] more consistent use of headers --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 8c07be309..31e76bd05 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -150,14 +150,18 @@ code_n(c::LPCode) = size(c.repr(zero(c.GA)), 2) * (size(c.A, 2) * size(c.B, 1) + code_s(c::LPCode) = size(c.repr(zero(c.GA)), 1) * (size(c.A, 1) * size(c.B, 1) + size(c.A, 2) * size(c.B, 2)) """ -Two-block group algebra (2GBA) codes, which are a special case of lifted product codes +Two-block group algebra (2BGA) codes, which are a special case of lifted product codes from two group algebra elements `a` and `b`, used as `1x1` base matrices. +## Examples of 2BGA code subfamilies + +### [lin2024quantum](@cite) + Here is an example of a [[56, 28, 2]] 2BGA code from Table 2 of [lin2024quantum](@cite) 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 julia> GA = group_algebra(GF(2), abelian_group([14,2])); @@ -175,7 +179,7 @@ julia> code_n(c), code_k(c) (56, 28) ``` -# Examples of 2BGA code subfamilies +### Bivariate Bicycle codes Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct product of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the @@ -183,10 +187,10 @@ first and second cyclic groups, respectively. 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). +A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite): ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens; # hide +julia> import Hecke: group_algebra, GF, abelian_group, gens julia> l=21; m=18; From 2f57c531dacd315c589f950ceaa7978b42814a9e Mon Sep 17 00:00:00 2001 From: Stefan Krastanov <github.acc@krastanov.org> Date: Tue, 5 Nov 2024 07:50:32 -0500 Subject: [PATCH 8/8] maybe a more descriptive name, I do not know, I am not knowledgeable about this --- 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 31e76bd05..f67bf9d39 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -155,7 +155,7 @@ from two group algebra elements `a` and `b`, used as `1x1` base matrices. ## Examples of 2BGA code subfamilies -### [lin2024quantum](@cite) +### `C₄ x C₂` Here is an example of a [[56, 28, 2]] 2BGA code from Table 2 of [lin2024quantum](@cite) with direct product of `C₄ x C₂`.