From cba74cbe49a53871354dc63824b8f4072439b1aa Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Sun, 27 Oct 2024 14:53:03 +0500 Subject: [PATCH 1/4] using Hecke's Small Groups without any extra relations for single cyclic groups --- .../QuantumCliffordHeckeExt.jl | 2 +- ext/QuantumCliffordHeckeExt/lifted_product.jl | 37 +++++++- test/test_ecc_small_groups.jl | 91 +++++++++++++++++++ 3 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 test/test_ecc_small_groups.jl diff --git a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl index 29e9de8ce..1b2ba1b38 100644 --- a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl +++ b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl @@ -5,7 +5,7 @@ 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, small_group, one import Nemo import Nemo: characteristic, matrix_repr, GF, ZZ, lift diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index ef09eddbb..358dcf828 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -153,8 +153,43 @@ 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. +# Example + +An abelian `[[60, 6, 10]]` 2BGA code of order `l = 30` with group ID `4`, represented +by the group presentation `⟨r | r³⁰⟩`, constructed via `Hecke.small_group`. + +```jldoctest +julia> import Hecke: group_algebra, GF, abelian_group, gens, small_group, one; # hide + +julia> l = 30; + +julia> group_id = 4; + +julia> G = small_group(l, group_id); + +julia> GA = group_algebra(GF(2), G); + +julia> r = prod(gens(GA)); + +julia> r^30 == 1 # presentation ⟨r|r³⁰⟩ satisfied +true + +julia> a_elts = [one(G), r^10, r^6, r^13]; + +julia> b_elts = [one(G), r^25, r^16, r^12]; + +julia> a = sum(GA(x) for x in a_elts); + +julia> b = sum(GA(x) for x in b_elts); + +julia> c = two_block_group_algebra_codes(a,b); + +julia> code_n(c), code_k(c) +(60, 6) +``` + See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref) -""" # TODO doctest example +""" function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) A = reshape([a], (1, 1)) B = reshape([b], (1, 1)) diff --git a/test/test_ecc_small_groups.jl b/test/test_ecc_small_groups.jl new file mode 100644 index 000000000..02b0159c5 --- /dev/null +++ b/test/test_ecc_small_groups.jl @@ -0,0 +1,91 @@ +@testitem "ECC 2BGA Hecke Small Groups" begin + using Hecke: group_algebra, GF, abelian_group, gens, quo, one, GroupAlgebra, small_group + using QuantumClifford.ECC + using QuantumClifford.ECC: code_k, code_n, two_block_group_algebra_codes + + @testset "Hecke Small Groups without extra relations for single cyclic groups" begin + # [[72, 8, 9]] + l = 36 + group_id = 2 + G = small_group(l, group_id) + GA = group_algebra(GF(2), G) + r = prod(gens(GA)) + @test r^36 == 1 # presentation ⟨r|r³⁶⟩ satisfied + a_elts = [one(G), r^28] + b_elts = [one(G), r, r^18, r^12, r^29, r^14] + a = sum(GA(x) for x in a_elts) + b = sum(GA(x) for x in b_elts) + c = two_block_group_algebra_codes(a,b) + @test code_n(c) == 72 && code_k(c) == 8 + + # [[54, 6, 9]] + l = 27 + group_id = 1 + G = small_group(l, group_id) + GA = group_algebra(GF(2), G) + r = prod(gens(GA)) + @test r^27 == 1 # presentation ⟨r|r²⁷⟩ satisfied + a_elts = [one(G), r, r^3, r^7] + b_elts = [one(G), r, r^12, r^19] + a = sum(GA(x) for x in a_elts) + b = sum(GA(x) for x in b_elts) + c = two_block_group_algebra_codes(a,b) + @test code_n(c) == 54 && code_k(c) == 6 + + # [[60, 6, 10]] + l = 30 + group_id = 4 + G = small_group(l, group_id) + GA = group_algebra(GF(2), G) + r = prod(gens(GA)) + @test r^30 == 1 # presentation ⟨r|r³⁰⟩ satisfied + a_elts = [one(G), r^10, r^6, r^13] + b_elts = [one(G), r^25, r^16, r^12] + a = sum(GA(x) for x in a_elts) + b = sum(GA(x) for x in b_elts) + c = two_block_group_algebra_codes(a,b) + @test code_n(c) == 60 && code_k(c) == 6 + + # [[70, 8, 10]] + l = 35 + group_id = 1 + G = small_group(l, group_id) + GA = group_algebra(GF(2), G) + r = prod(gens(GA)) + @test r^35 == 1 # presentation ⟨r|r³⁵⟩ satisfied + a_elts = [one(G), r^15, r^16, r^18] + b_elts = [one(G), r, r^24, r^27] + a = sum(GA(x) for x in a_elts) + b = sum(GA(x) for x in b_elts) + c = two_block_group_algebra_codes(a,b) + @test code_n(c) == 70 && code_k(c) == 8 + + # [[72, 8, 10]] + l = 36 + group_id = 2 + G = small_group(l, group_id) + GA = group_algebra(GF(2), G) + r = prod(gens(GA)) + @test r^36 == 1 # presentation ⟨r|r³⁶⟩ satisfied + a_elts = [one(G), r^9, r^28, r^31] + b_elts = [one(G), r, r^21, r^34] + a = sum(GA(x) for x in a_elts) + b = sum(GA(x) for x in b_elts) + c = two_block_group_algebra_codes(a,b) + @test code_n(c) == 72 && code_k(c) == 8 + + # [[72, 10, 9]] + l = 36 + group_id = 2 + G = small_group(l, group_id) + GA = group_algebra(GF(2), G) + r = prod(gens(GA)) + @test r^36 == 1 # presentation ⟨r|r³⁶⟩ satisfied + a_elts = [one(G), r^9, r^28, r^13] + b_elts = [one(G), r, r^3, r^22] + a = sum(GA(x) for x in a_elts) + b = sum(GA(x) for x in b_elts) + c = two_block_group_algebra_codes(a,b) + @test code_n(c) == 72 && code_k(c) == 10 + end +end From 36b39144222ab54b7760ae10ac3cf9cdb17b9220 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Wed, 27 Nov 2024 17:02:22 +0500 Subject: [PATCH 2/4] remove redundant code --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 2 +- test/test_ecc_small_groups.jl | 48 +++++++------------ 2 files changed, 19 insertions(+), 31 deletions(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 30b32053b..a77996fc0 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -282,7 +282,7 @@ groups, specifically for single cyclic groups, using a group presentation with no *extra relations*, such as `⟨r | r³⁰⟩`.For the construction of *general* groups with specific group presentations, the only effective method is to use *finitely presented groups* (`Oscar.FPGroup`), which allow for defining direct products of -two or more *general* groups—something not supported directly by Hecke. +two or more *general* groups—something not supported by Hecke. ```jldoctest sg julia> r^30 == 1 diff --git a/test/test_ecc_small_groups.jl b/test/test_ecc_small_groups.jl index 02b0159c5..f8b505d98 100644 --- a/test/test_ecc_small_groups.jl +++ b/test/test_ecc_small_groups.jl @@ -11,11 +11,9 @@ GA = group_algebra(GF(2), G) r = prod(gens(GA)) @test r^36 == 1 # presentation ⟨r|r³⁶⟩ satisfied - a_elts = [one(G), r^28] - b_elts = [one(G), r, r^18, r^12, r^29, r^14] - a = sum(GA(x) for x in a_elts) - b = sum(GA(x) for x in b_elts) - c = two_block_group_algebra_codes(a,b) + A = 1 + r^28 + B = 1 + r + r^18 + r^12 + r^29 + r^14 + c = two_block_group_algebra_codes(A,B) @test code_n(c) == 72 && code_k(c) == 8 # [[54, 6, 9]] @@ -25,11 +23,9 @@ GA = group_algebra(GF(2), G) r = prod(gens(GA)) @test r^27 == 1 # presentation ⟨r|r²⁷⟩ satisfied - a_elts = [one(G), r, r^3, r^7] - b_elts = [one(G), r, r^12, r^19] - a = sum(GA(x) for x in a_elts) - b = sum(GA(x) for x in b_elts) - c = two_block_group_algebra_codes(a,b) + A = 1 + r + r^3 + r^7 + B = 1 + r + r^12 + r^19 + c = two_block_group_algebra_codes(A,B) @test code_n(c) == 54 && code_k(c) == 6 # [[60, 6, 10]] @@ -39,11 +35,9 @@ GA = group_algebra(GF(2), G) r = prod(gens(GA)) @test r^30 == 1 # presentation ⟨r|r³⁰⟩ satisfied - a_elts = [one(G), r^10, r^6, r^13] - b_elts = [one(G), r^25, r^16, r^12] - a = sum(GA(x) for x in a_elts) - b = sum(GA(x) for x in b_elts) - c = two_block_group_algebra_codes(a,b) + A = 1 + r^10 + r^6 + r^13 + B = 1 + r^25 + r^16 + r^12 + c = two_block_group_algebra_codes(A,B) @test code_n(c) == 60 && code_k(c) == 6 # [[70, 8, 10]] @@ -53,11 +47,9 @@ GA = group_algebra(GF(2), G) r = prod(gens(GA)) @test r^35 == 1 # presentation ⟨r|r³⁵⟩ satisfied - a_elts = [one(G), r^15, r^16, r^18] - b_elts = [one(G), r, r^24, r^27] - a = sum(GA(x) for x in a_elts) - b = sum(GA(x) for x in b_elts) - c = two_block_group_algebra_codes(a,b) + A = 1 + r^15 + r^16 + r^18 + B = 1 + r + r^24 + r^27 + c = two_block_group_algebra_codes(A,B) @test code_n(c) == 70 && code_k(c) == 8 # [[72, 8, 10]] @@ -67,11 +59,9 @@ GA = group_algebra(GF(2), G) r = prod(gens(GA)) @test r^36 == 1 # presentation ⟨r|r³⁶⟩ satisfied - a_elts = [one(G), r^9, r^28, r^31] - b_elts = [one(G), r, r^21, r^34] - a = sum(GA(x) for x in a_elts) - b = sum(GA(x) for x in b_elts) - c = two_block_group_algebra_codes(a,b) + A = 1 + r^9 + r^28 + r^31 + B = 1 + r + r^21 + r^34 + c = two_block_group_algebra_codes(A,B) @test code_n(c) == 72 && code_k(c) == 8 # [[72, 10, 9]] @@ -81,11 +71,9 @@ GA = group_algebra(GF(2), G) r = prod(gens(GA)) @test r^36 == 1 # presentation ⟨r|r³⁶⟩ satisfied - a_elts = [one(G), r^9, r^28, r^13] - b_elts = [one(G), r, r^3, r^22] - a = sum(GA(x) for x in a_elts) - b = sum(GA(x) for x in b_elts) - c = two_block_group_algebra_codes(a,b) + A = 1 + r^9 + r^28 + r^13 + B = 1 + r + r^3 + r^22 + c = two_block_group_algebra_codes(A,B) @test code_n(c) == 72 && code_k(c) == 10 end end From 52d24a3ba70c742673f1940108deba86f917d4b0 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Fri, 29 Nov 2024 13:47:13 +0500 Subject: [PATCH 3/4] use * for emphasis --- 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 a77996fc0..a51175411 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -279,7 +279,7 @@ julia> r = prod(gens(GA)); presentation for the single cyclic group is satisfied before proceeding with the code construction. This method serves as a workaround for creating small groups, specifically for single cyclic groups, using a group presentation with -no *extra relations*, such as `⟨r | r³⁰⟩`.For the construction of *general* groups +*no extra relations*, such as `⟨r | r³⁰⟩`.For the construction of *general* groups with specific group presentations, the only effective method is to use *finitely presented groups* (`Oscar.FPGroup`), which allow for defining direct products of two or more *general* groups—something not supported by Hecke. From 9516be95b1b8cb3be8c03a235defc69aee3e0207 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Fri, 29 Nov 2024 22:59:05 +0500 Subject: [PATCH 4/4] polish --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index a51175411..30e5ef1f8 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -279,10 +279,10 @@ julia> r = prod(gens(GA)); presentation for the single cyclic group is satisfied before proceeding with the code construction. This method serves as a workaround for creating small groups, specifically for single cyclic groups, using a group presentation with -*no extra relations*, such as `⟨r | r³⁰⟩`.For the construction of *general* groups -with specific group presentations, the only effective method is to use *finitely -presented groups* (`Oscar.FPGroup`), which allow for defining direct products of -two or more *general* groups—something not supported by Hecke. +*no extra relations*, such as `⟨r | r³⁰⟩`. For the construction of *general* +groups with specific group presentations, the only effective method is to use +*finitely presented groups* (`Oscar.FPGroup`), which allow for defining direct +products of two or more *general* groups—something not supported by Hecke. ```jldoctest sg julia> r^30 == 1