Skip to content

Commit

Permalink
test minimum distance in test_ecc_2bga
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Nov 30, 2024
1 parent 71b5f9e commit 76327ce
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GLPK = "60bf3e95-4087-53dc-ae20-288a0d20c6a6"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21"
HostCPUFeatures = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0"
ILog2 = "2cd5bd5f-40a1-5050-9e10-fc8cdb6109f5"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
JuMP = "4076af6c-e467-56ae-b986-b466b2749572"
LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Expand Down
20 changes: 19 additions & 1 deletion test/test_ecc_2bga.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
@testitem "ECC 2BGA" begin
using Hecke
using JuMP
using GLPK
using Hecke: group_algebra, GF, abelian_group, gens
using QuantumClifford.ECC: two_block_group_algebra_codes, code_k, code_n
using QuantumClifford.ECC: two_block_group_algebra_codes, code_k, code_n, minimum_distance

@testset "Reproduce Table 2 lin2024quantum" begin
# codes taken from Table 2 of [lin2024quantum](@cite)
Expand All @@ -13,16 +15,19 @@
B = 1 + x + s + x^2 + s*x + s*x^3
c = two_block_group_algebra_codes(A,B)
# [[16, 2, 4]] 2BGA code
@test minimum_distance(c) == 4
@test code_n(c) == 16 && code_k(c) == 2
A = 1 + x
B = 1 + x + s + x^2 + s*x + x^3
c = two_block_group_algebra_codes(A,B)
# [[16, 4, 4]] 2BGA code
@test minimum_distance(c) == 4
@test code_n(c) == 16 && code_k(c) == 4
A = 1 + s
B = 1 + x + s + x^2 + s*x + x^2
c = two_block_group_algebra_codes(A,B)
# [[16, 8, 2]] 2BGA code
@test minimum_distance(c) == 2
@test code_n(c) == 16 && code_k(c) == 8

# m = 6
Expand All @@ -32,11 +37,13 @@
B = 1 + x^3 + s + x^4 + x^2 + s*x
c = two_block_group_algebra_codes(A,B)
# [[24, 4, 5]] 2BGA code
@test minimum_distance(c) == 5
@test code_n(c) == 24 && code_k(c) == 4
A = 1 + x^3
B = 1 + x^3 + s + x^4 + s*x^3 + x
c = two_block_group_algebra_codes(A,B)
# [[24, 12, 2]] 2BGA code
@test minimum_distance(c) == 2
@test code_n(c) == 24 && code_k(c) == 12

# m = 8
Expand All @@ -46,11 +53,13 @@
B = 1 + s*x^7 + s*x^4 + x^6 + s*x^5 + s*x^2
c = two_block_group_algebra_codes(A,B)
# [[32, 8, 4]] 2BGA code
@test minimum_distance(c) == 4
@test code_n(c) == 32 && code_k(c) == 8
A = 1 + s*x^4
B = 1 + s*x^7 + s*x^4 + x^6 + x^3 + s*x^2
c = two_block_group_algebra_codes(A,B)
# [[32, 16, 2]] 2BGA code
@test minimum_distance(c) == 2
@test code_n(c) == 32 && code_k(c) == 16

# m = 10
Expand All @@ -60,16 +69,19 @@
B = 1 + x^5 + x^6 + s*x^6 + x^7 + s*x^3
c = two_block_group_algebra_codes(A,B)
# [[40, 4, 8]] 2BGA code
@test minimum_distance(c) == 8
@test code_n(c) == 40 && code_k(c) == 4
A = 1 + x^6
B = 1 + x^5 + s + x^6 + x + s*x^2
c = two_block_group_algebra_codes(A,B)
# [[40, 8, 5]] 2BGA code
@test minimum_distance(c) == 5
@test code_n(c) == 40 && code_k(c) == 8
A = 1 + x^5
B = 1 + x^5 + s + x^6 + s*x^5 + x
c = two_block_group_algebra_codes(A,B)
# [[40, 20, 2]] 2BGA code
@test minimum_distance(c) == 2
@test code_n(c) == 40 && code_k(c) == 20

# m = 12
Expand All @@ -79,21 +91,25 @@
B = 1 + x^3 + s*x^6 + x^4 + x^7 + x^8
c = two_block_group_algebra_codes(A,B)
# [[48, 8, 6]] 2BGA code
@test minimum_distance(c) == 6
@test code_n(c) == 48 && code_k(c) == 8
A = 1 + x^3
B = 1 + x^3 + s*x^6 + x^4 + s*x^9 + x^7
c = two_block_group_algebra_codes(A,B)
# [[48, 12, 4]] 2BGA code
@test minimum_distance(c) == 4
@test code_n(c) == 48 && code_k(c) == 12
A = 1 + x^4
B = 1 + x^3 + s*x^6 + x^4 + x^7 + s*x^10
c = two_block_group_algebra_codes(A,B)
# [[48, 16, 3]] 2BGA code
@test minimum_distance(c) == 3
@test code_n(c) == 48 && code_k(c) == 16
A = 1 + s*x^6
B = 1 + x^3 + s*x^6 + x^4 + s*x^9 + s*x^10
c = two_block_group_algebra_codes(A,B)
# [[48, 24, 2]] 2BGA code
@test minimum_distance(c) == 2
@test code_n(c) == 48 && code_k(c) == 24

# m = 14
Expand All @@ -103,11 +119,13 @@
B = 1 + x^7 + s + x^8 + x^9 + s*x^4
c = two_block_group_algebra_codes(A,B)
# [[56, 8, 7]] 2BGA code
@test minimum_distance(c) == 7
@test code_n(c) == 56 && code_k(c) == 8
A = 1 + x^7
B = 1 + x^7 + s + x^8 + s*x^7 + x
c = two_block_group_algebra_codes(A,B)
# [[56, 28, 2]] 2BGA code
@test minimum_distance(c) == 2
@test code_n(c) == 56 && code_k(c) == 28
end
end

0 comments on commit 76327ce

Please sign in to comment.