Skip to content

Commit 45e9f4d

Browse files
authored
todo: simplify tests for 2BGA codes (#421)
1 parent c3aa055 commit 45e9f4d

File tree

2 files changed

+57
-65
lines changed

2 files changed

+57
-65
lines changed

ext/QuantumCliffordHeckeExt/lifted_product.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ julia> import Hecke: group_algebra, GF, abelian_group, gens
165165
166166
julia> GA = group_algebra(GF(2), abelian_group([14,2]));
167167
168-
julia> x = gens(GA)[1];
169-
170-
julia> s = gens(GA)[2];
168+
julia> x, s = gens(GA);
171169
172170
julia> A = 1 + x^7
173171

test/test_ecc_2bga.jl

Lines changed: 56 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,112 @@
11
@testitem "ECC 2BGA" begin
22
using Hecke
33
using Hecke: group_algebra, GF, abelian_group, gens
4-
using QuantumClifford.ECC: LPCode, code_k, code_n
4+
using QuantumClifford.ECC: two_block_group_algebra_codes, code_k, code_n
55

6-
@testset "Reproduce Table 2 lin2024quantum" begin # TODO these tests should probably just use the `two_block_group_algebra_codes` function as that would make them much shorter and simpler
6+
@testset "Reproduce Table 2 lin2024quantum" begin
77
# codes taken from Table 2 of [lin2024quantum](@cite)
88

99
# m = 4
1010
GA = group_algebra(GF(2), abelian_group([4,2]))
11-
x = gens(GA)[1]
12-
s = gens(GA)[2]
13-
A = [1 + x;;]
14-
B = [1 + x + s + x^2 + s*x + s*x^3;;]
15-
c = LPCode(A,B)
11+
x, s = gens(GA)
12+
A = 1 + x
13+
B = 1 + x + s + x^2 + s*x + s*x^3
14+
c = two_block_group_algebra_codes(A,B)
1615
# [[16, 2, 4]] 2BGA code
1716
@test code_n(c) == 16 && code_k(c) == 2
18-
A = [1 + x;;]
19-
B = [1 + x + s + x^2 + s*x + x^3;;]
20-
c = LPCode(A,B)
17+
A = 1 + x
18+
B = 1 + x + s + x^2 + s*x + x^3
19+
c = two_block_group_algebra_codes(A,B)
2120
# [[16, 4, 4]] 2BGA code
2221
@test code_n(c) == 16 && code_k(c) == 4
23-
A = [1 + s;;]
24-
B = [1 + x + s + x^2 + s*x + x^2;;]
25-
c = LPCode(A,B)
22+
A = 1 + s
23+
B = 1 + x + s + x^2 + s*x + x^2
24+
c = two_block_group_algebra_codes(A,B)
2625
# [[16, 8, 2]] 2BGA code
2726
@test code_n(c) == 16 && code_k(c) == 8
2827

2928
# m = 6
3029
GA = group_algebra(GF(2), abelian_group([6,2]))
31-
x = gens(GA)[1]
32-
s = gens(GA)[2]
33-
A = [1 + x;;]
34-
B = [1 + x^3 + s + x^4 + x^2 + s*x;;]
35-
c = LPCode(A,B)
30+
x, s = gens(GA)
31+
A = 1 + x
32+
B = 1 + x^3 + s + x^4 + x^2 + s*x
33+
c = two_block_group_algebra_codes(A,B)
3634
# [[24, 4, 5]] 2BGA code
3735
@test code_n(c) == 24 && code_k(c) == 4
38-
A = [1 + x^3;;]
39-
B = [1 + x^3 + s + x^4 + s*x^3 + x;;]
40-
c = LPCode(A,B)
36+
A = 1 + x^3
37+
B = 1 + x^3 + s + x^4 + s*x^3 + x
38+
c = two_block_group_algebra_codes(A,B)
4139
# [[24, 12, 2]] 2BGA code
4240
@test code_n(c) == 24 && code_k(c) == 12
4341

4442
# m = 8
4543
GA = group_algebra(GF(2), abelian_group([8,2]))
46-
x = gens(GA)[1]
47-
s = gens(GA)[2]
48-
A = [1 + x^6;;]
49-
B = [1 + s*x^7 + s*x^4 + x^6 + s*x^5 + s*x^2;;]
50-
c = LPCode(A,B)
44+
x, s = gens(GA)
45+
A = 1 + x^6
46+
B = 1 + s*x^7 + s*x^4 + x^6 + s*x^5 + s*x^2
47+
c = two_block_group_algebra_codes(A,B)
5148
# [[32, 8, 4]] 2BGA code
5249
@test code_n(c) == 32 && code_k(c) == 8
53-
A = [1 + s*x^4;;]
54-
B = [1 + s*x^7 + s*x^4 + x^6 + x^3 + s*x^2;;]
55-
c = LPCode(A,B)
50+
A = 1 + s*x^4
51+
B = 1 + s*x^7 + s*x^4 + x^6 + x^3 + s*x^2
52+
c = two_block_group_algebra_codes(A,B)
5653
# [[32, 16, 2]] 2BGA code
5754
@test code_n(c) == 32 && code_k(c) == 16
5855

5956
# m = 10
6057
GA = group_algebra(GF(2), abelian_group([10,2]))
61-
x = gens(GA)[1]
62-
s = gens(GA)[2]
63-
A = [1 + x;;]
64-
B = [1 + x^5 + x^6 + s*x^6 + x^7 + s*x^3;;]
65-
c = LPCode(A,B)
58+
x, s = gens(GA)
59+
A = 1 + x
60+
B = 1 + x^5 + x^6 + s*x^6 + x^7 + s*x^3
61+
c = two_block_group_algebra_codes(A,B)
6662
# [[40, 4, 8]] 2BGA code
6763
@test code_n(c) == 40 && code_k(c) == 4
68-
A = [1 + x^6;;]
69-
B = [1 + x^5 + s + x^6 + x + s*x^2;;]
70-
c = LPCode(A,B)
64+
A = 1 + x^6
65+
B = 1 + x^5 + s + x^6 + x + s*x^2
66+
c = two_block_group_algebra_codes(A,B)
7167
# [[40, 8, 5]] 2BGA code
7268
@test code_n(c) == 40 && code_k(c) == 8
73-
A = [1 + x^5;;]
74-
B = [1 + x^5 + s + x^6 + s*x^5 + x;;]
75-
c = LPCode(A,B)
69+
A = 1 + x^5
70+
B = 1 + x^5 + s + x^6 + s*x^5 + x
71+
c = two_block_group_algebra_codes(A,B)
7672
# [[40, 20, 2]] 2BGA code
7773
@test code_n(c) == 40 && code_k(c) == 20
7874

7975
# m = 12
8076
GA = group_algebra(GF(2), abelian_group([12,2]))
81-
x = gens(GA)[1]
82-
s = gens(GA)[2]
83-
A = [1 + s*x^10;;]
84-
B = [1 + x^3 + s*x^6 + x^4 + x^7 + x^8;;]
85-
c = LPCode(A,B)
77+
x, s = gens(GA)
78+
A = 1 + s*x^10
79+
B = 1 + x^3 + s*x^6 + x^4 + x^7 + x^8
80+
c = two_block_group_algebra_codes(A,B)
8681
# [[48, 8, 6]] 2BGA code
8782
@test code_n(c) == 48 && code_k(c) == 8
88-
A = [1 + x^3;;]
89-
B = [1 + x^3 + s*x^6 + x^4 + s*x^9 + x^7;;]
90-
c = LPCode(A,B)
83+
A = 1 + x^3
84+
B = 1 + x^3 + s*x^6 + x^4 + s*x^9 + x^7
85+
c = two_block_group_algebra_codes(A,B)
9186
# [[48, 12, 4]] 2BGA code
9287
@test code_n(c) == 48 && code_k(c) == 12
93-
A = [1 + x^4;;]
94-
B = [1 + x^3 + s*x^6 + x^4 + x^7 + s*x^10;;]
95-
c = LPCode(A,B)
88+
A = 1 + x^4
89+
B = 1 + x^3 + s*x^6 + x^4 + x^7 + s*x^10
90+
c = two_block_group_algebra_codes(A,B)
9691
# [[48, 16, 3]] 2BGA code
9792
@test code_n(c) == 48 && code_k(c) == 16
98-
A = [1 + s*x^6;;]
99-
B = [1 + x^3 + s*x^6 + x^4 + s*x^9 + s*x^10;;]
100-
c = LPCode(A,B)
93+
A = 1 + s*x^6
94+
B = 1 + x^3 + s*x^6 + x^4 + s*x^9 + s*x^10
95+
c = two_block_group_algebra_codes(A,B)
10196
# [[48, 24, 2]] 2BGA code
10297
@test code_n(c) == 48 && code_k(c) == 24
10398

10499
# m = 14
105100
GA = group_algebra(GF(2), abelian_group([14,2]))
106-
x = gens(GA)[1]
107-
s = gens(GA)[2]
108-
A = [1 + x^8;;]
109-
B = [1 + x^7 + s + x^8 + x^9 + s*x^4;;]
110-
c = LPCode(A,B)
101+
x, s = gens(GA)
102+
A = 1 + x^8
103+
B = 1 + x^7 + s + x^8 + x^9 + s*x^4
104+
c = two_block_group_algebra_codes(A,B)
111105
# [[56, 8, 7]] 2BGA code
112106
@test code_n(c) == 56 && code_k(c) == 8
113-
A = [1 + x^7;;]
114-
B = [1 + x^7 + s + x^8 + s*x^7 + x;;]
115-
c = LPCode(A,B)
107+
A = 1 + x^7
108+
B = 1 + x^7 + s + x^8 + s*x^7 + x
109+
c = two_block_group_algebra_codes(A,B)
116110
# [[56, 28, 2]] 2BGA code
117111
@test code_n(c) == 56 && code_k(c) == 28
118112
end

0 commit comments

Comments
 (0)