Skip to content

Commit

Permalink
Direct Products of Groups via Hecke for 2BGA codes to reproduce Table…
Browse files Browse the repository at this point in the history
… 2 by H.K.Lin et al.
  • Loading branch information
Fe-r-oz committed Oct 15, 2024
1 parent 2b8e81f commit 97ed183
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -487,3 +487,14 @@ @article{anderson2014fault
year={2014},
publisher={APS}
}

@article{lin2024quantum,
title={Quantum two-block group algebra codes},
author={Lin, Hsiang-Ku and Pryadko, Leonid P},
journal={Physical Review A},
volume={109},
number={2},
pages={022407},
year={2024},
publisher={APS}
}
24 changes: 23 additions & 1 deletion ext/QuantumCliffordHeckeExt/lifted_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,30 @@ 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.
[[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> GA = group_algebra(GF(2), abelian_group([14,2]));
julia> x = gens(GA)[1];
julia> s = gens(GA)[2];
julia> A = reshape([1 + x^7], (1, 1));
julia> B = reshape([1 + x^7 + s + x^8 + s*x^7 + x], (1, 1));
julia> c = LPCode(A,B);
julia> code_n(c), code_k(c)
(56, 28)
```
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))
Expand Down
119 changes: 119 additions & 0 deletions test/test_ecc_2bga.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
@testitem "ECC 2BGA" begin
using Hecke
using Hecke: group_algebra, GF, abelian_group, gens
using QuantumClifford.ECC: LPCode, code_k, code_n

@testset "Reproduce Table 2 lin2024quantum" begin
# codes taken from Table 2 of [lin2024quantum](@cite)

# m = 4
GA = group_algebra(GF(2), abelian_group([4,2]))
x = gens(GA)[1]
s = gens(GA)[2]
A = reshape([1 + x], (1, 1))
B = reshape([1 + x + s + x^2 + s*x + s*x^3], (1, 1))
c = LPCode(A,B)
# [[16, 2, 4]] 2BGA code
@test code_n(c) == 16 && code_k(c) == 2
A = reshape([1 + x], (1, 1))
B = reshape([1 + x + s + x^2 + s*x + x^3], (1, 1))
c = LPCode(A,B)
# [[16, 4, 4]] 2BGA code
@test code_n(c) == 16 && code_k(c) == 4
A = reshape([1 + s], (1, 1))
B = reshape([1 + x + s + x^2 + s*x + x^2], (1, 1))
c = LPCode(A,B)
# [[16, 8, 2]] 2BGA code
@test code_n(c) == 16 && code_k(c) == 8

# m = 6
GA = group_algebra(GF(2), abelian_group([6,2]))
x = gens(GA)[1]
s = gens(GA)[2]
A = reshape([1 + x], (1, 1))
B = reshape([1 + x^3 + s + x^4 + x^2 + s*x], (1, 1))
c = LPCode(A,B)
# [[24, 4, 5]] 2BGA code
@test code_n(c) == 24 && code_k(c) == 4
A = reshape([1 + x^3], (1, 1))
B = reshape([1 + x^3 + s + x^4 + s*x^3 + x], (1, 1))
c = LPCode(A,B)
# [[24, 12, 2]] 2BGA code
@test code_n(c) == 24 && code_k(c) == 12

# m = 8
GA = group_algebra(GF(2), abelian_group([8,2]))
x = gens(GA)[1]
s = gens(GA)[2]
A = reshape([1 + x^6], (1, 1))
B = reshape([1 + s*x^7 + s*x^4 + x^6 + s*x^5 + s*x^2], (1, 1))
c = LPCode(A,B)
# [[32, 8, 4]] 2BGA code
@test code_n(c) == 32 && code_k(c) == 8
A = reshape([1 + s*x^4], (1, 1))
B = reshape([1 + s*x^7 + s*x^4 + x^6 + x^3 + s*x^2], (1, 1))
c = LPCode(A,B)
# [[32, 16, 2]] 2BGA code
@test code_n(c) == 32 && code_k(c) == 16

# m = 10
GA = group_algebra(GF(2), abelian_group([10,2]))
x = gens(GA)[1]
s = gens(GA)[2]
A = reshape([1 + x], (1, 1))
B = reshape([1 + x^5 + x^6 + s*x^6 + x^7 + s*x^3], (1, 1))
c = LPCode(A,B)
# [[40, 4, 8]] 2BGA code
@test code_n(c) == 40 && code_k(c) == 4
A = reshape([1 + x^6], (1, 1))
B = reshape([1 + x^5 + s + x^6 + x + s*x^2], (1, 1))
c = LPCode(A,B)
# [[40, 8, 5]] 2BGA code
@test code_n(c) == 40 && code_k(c) == 8
A = reshape([1 + x^5], (1, 1))
B = reshape([1 + x^5 + s + x^6 + s*x^5 + x], (1, 1))
c = LPCode(A,B)
# [[40, 20, 2]] 2BGA code
@test code_n(c) == 40 && code_k(c) == 20

# m = 12
GA = group_algebra(GF(2), abelian_group([12,2]))
x = gens(GA)[1]
s = gens(GA)[2]
A = reshape([1 + s*x^10], (1, 1))
B = reshape([1 + x^3 + s*x^6 + x^4 + x^7 + x^8], (1, 1))
c = LPCode(A,B)
# [[48, 8, 6]] 2BGA code
@test code_n(c) == 48 && code_k(c) == 8
A = reshape([1 + x^3], (1, 1))
B = reshape([1 + x^3 + s*x^6 + x^4 + s*x^9 + x^7], (1, 1))
c = LPCode(A,B)
# [[48, 12, 4]] 2BGA code
@test code_n(c) == 48 && code_k(c) == 12
A = reshape([1 + x^4], (1, 1))
B = reshape([1 + x^3 + s*x^6 + x^4 + x^7 + s*x^10], (1, 1))
c = LPCode(A,B)
# [[48, 16, 3]] 2BGA code
@test code_n(c) == 48 && code_k(c) == 16
A = reshape([1 + s*x^6], (1, 1))
B = reshape([1 + x^3 + s*x^6 + x^4 + s*x^9 + s*x^10], (1, 1))
c = LPCode(A,B)
# [[48, 24, 2]] 2BGA code
@test code_n(c) == 48 && code_k(c) == 24

# m = 14
GA = group_algebra(GF(2), abelian_group([14,2]))
x = gens(GA)[1]
s = gens(GA)[2]
A = reshape([1 + x^8], (1, 1))
B = reshape([1 + x^7 + s + x^8 + x^9 + s*x^4], (1, 1))
c = LPCode(A,B)
# [[56, 8, 7]] 2BGA code
@test code_n(c) == 56 && code_k(c) == 8
A = reshape([1 + x^7], (1, 1))
B = reshape([1 + x^7 + s + x^8 + s*x^7 + x], (1, 1))
c = LPCode(A,B)
# [[56, 28, 2]] 2BGA code
@test code_n(c) == 56 && code_k(c) == 28
end
end

0 comments on commit 97ed183

Please sign in to comment.