|
1 | 1 | @testitem "ECC 2BGA" begin |
2 | 2 | using Hecke |
3 | 3 | 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 |
5 | 5 |
|
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 |
7 | 7 | # codes taken from Table 2 of [lin2024quantum](@cite) |
8 | 8 |
|
9 | 9 | # m = 4 |
10 | 10 | 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) |
16 | 15 | # [[16, 2, 4]] 2BGA code |
17 | 16 | @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) |
21 | 20 | # [[16, 4, 4]] 2BGA code |
22 | 21 | @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) |
26 | 25 | # [[16, 8, 2]] 2BGA code |
27 | 26 | @test code_n(c) == 16 && code_k(c) == 8 |
28 | 27 |
|
29 | 28 | # m = 6 |
30 | 29 | 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) |
36 | 34 | # [[24, 4, 5]] 2BGA code |
37 | 35 | @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) |
41 | 39 | # [[24, 12, 2]] 2BGA code |
42 | 40 | @test code_n(c) == 24 && code_k(c) == 12 |
43 | 41 |
|
44 | 42 | # m = 8 |
45 | 43 | 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) |
51 | 48 | # [[32, 8, 4]] 2BGA code |
52 | 49 | @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) |
56 | 53 | # [[32, 16, 2]] 2BGA code |
57 | 54 | @test code_n(c) == 32 && code_k(c) == 16 |
58 | 55 |
|
59 | 56 | # m = 10 |
60 | 57 | 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) |
66 | 62 | # [[40, 4, 8]] 2BGA code |
67 | 63 | @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) |
71 | 67 | # [[40, 8, 5]] 2BGA code |
72 | 68 | @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) |
76 | 72 | # [[40, 20, 2]] 2BGA code |
77 | 73 | @test code_n(c) == 40 && code_k(c) == 20 |
78 | 74 |
|
79 | 75 | # m = 12 |
80 | 76 | 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) |
86 | 81 | # [[48, 8, 6]] 2BGA code |
87 | 82 | @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) |
91 | 86 | # [[48, 12, 4]] 2BGA code |
92 | 87 | @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) |
96 | 91 | # [[48, 16, 3]] 2BGA code |
97 | 92 | @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) |
101 | 96 | # [[48, 24, 2]] 2BGA code |
102 | 97 | @test code_n(c) == 48 && code_k(c) == 24 |
103 | 98 |
|
104 | 99 | # m = 14 |
105 | 100 | 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) |
111 | 105 | # [[56, 8, 7]] 2BGA code |
112 | 106 | @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) |
116 | 110 | # [[56, 28, 2]] 2BGA code |
117 | 111 | @test code_n(c) == 56 && code_k(c) == 28 |
118 | 112 | end |
|
0 commit comments