|
| 1 | +@testitem "ECC 2BGA" begin |
| 2 | + using Hecke |
| 3 | + using Hecke: group_algebra, GF, abelian_group, gens |
| 4 | + using QuantumClifford.ECC: LPCode, code_k, code_n |
| 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 |
| 7 | + # codes taken from Table 2 of [lin2024quantum](@cite) |
| 8 | + |
| 9 | + # m = 4 |
| 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) |
| 16 | + # [[16, 2, 4]] 2BGA code |
| 17 | + @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) |
| 21 | + # [[16, 4, 4]] 2BGA code |
| 22 | + @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) |
| 26 | + # [[16, 8, 2]] 2BGA code |
| 27 | + @test code_n(c) == 16 && code_k(c) == 8 |
| 28 | + |
| 29 | + # m = 6 |
| 30 | + 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) |
| 36 | + # [[24, 4, 5]] 2BGA code |
| 37 | + @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) |
| 41 | + # [[24, 12, 2]] 2BGA code |
| 42 | + @test code_n(c) == 24 && code_k(c) == 12 |
| 43 | + |
| 44 | + # m = 8 |
| 45 | + 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) |
| 51 | + # [[32, 8, 4]] 2BGA code |
| 52 | + @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) |
| 56 | + # [[32, 16, 2]] 2BGA code |
| 57 | + @test code_n(c) == 32 && code_k(c) == 16 |
| 58 | + |
| 59 | + # m = 10 |
| 60 | + 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) |
| 66 | + # [[40, 4, 8]] 2BGA code |
| 67 | + @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) |
| 71 | + # [[40, 8, 5]] 2BGA code |
| 72 | + @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) |
| 76 | + # [[40, 20, 2]] 2BGA code |
| 77 | + @test code_n(c) == 40 && code_k(c) == 20 |
| 78 | + |
| 79 | + # m = 12 |
| 80 | + 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) |
| 86 | + # [[48, 8, 6]] 2BGA code |
| 87 | + @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) |
| 91 | + # [[48, 12, 4]] 2BGA code |
| 92 | + @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) |
| 96 | + # [[48, 16, 3]] 2BGA code |
| 97 | + @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) |
| 101 | + # [[48, 24, 2]] 2BGA code |
| 102 | + @test code_n(c) == 48 && code_k(c) == 24 |
| 103 | + |
| 104 | + # m = 14 |
| 105 | + 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) |
| 111 | + # [[56, 8, 7]] 2BGA code |
| 112 | + @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) |
| 116 | + # [[56, 28, 2]] 2BGA code |
| 117 | + @test code_n(c) == 56 && code_k(c) == 28 |
| 118 | + end |
| 119 | +end |
0 commit comments