|
| 1 | +@testitem "ECC QLDPC minimum distance" begin |
| 2 | + using Hecke |
| 3 | + using JuMP |
| 4 | + using GLPK |
| 5 | + using Hecke: group_algebra, GF, abelian_group, gens |
| 6 | + using QuantumClifford.ECC: two_block_group_algebra_codes, generalized_bicycle_codes, code_k, code_n, distance |
| 7 | + |
| 8 | + @testset "minimum distance properties: 2BGA" begin |
| 9 | + # [[56, 8, 7]] 2BGA code code taken from Table 2 of [lin2024quantum](@cite) |
| 10 | + # m = 14 |
| 11 | + GA = group_algebra(GF(2), abelian_group([14,2])) |
| 12 | + x, s = gens(GA) |
| 13 | + A = 1 + x^8 |
| 14 | + B = 1 + x^7 + s + x^8 + x^9 + s*x^4 |
| 15 | + c = two_block_group_algebra_codes(A,B) |
| 16 | + # [[56, 8, 7]] 2BGA code |
| 17 | + # minimum distance is exact, d = 7 |
| 18 | + for i in 1:code_k(c) |
| 19 | + @test distance(c, logical_qubit=i) == 7 |
| 20 | + # By default, the minimum distance for the Z-type logical operator is computed. |
| 21 | + # The minimum distance for X-type logical operators is the same. |
| 22 | + @test distance(c, logical_qubit=i) == distance(c, logical_qubit=i, logical_operator_type=:Z) == 7 |
| 23 | + end |
| 24 | + end |
| 25 | + |
| 26 | + @testset "minimum distance properties: GB" begin |
| 27 | + # [48, 6, 8]] GB code, # minimum distance is exact, d = 8 |
| 28 | + l = 24 |
| 29 | + c = generalized_bicycle_codes([0, 2, 8, 15], [0, 2, 12, 17], l) |
| 30 | + # minimum distance is exact, d = 8 |
| 31 | + for i in 1:code_k(c) |
| 32 | + @test distance(c, logical_qubit=i) == 8 |
| 33 | + # By default, the minimum distance for the Z-type logical operator is computed. |
| 34 | + # The minimum distance for X-type logical operators is the same. |
| 35 | + @test distance(c, logical_qubit=i) == distance(c, logical_qubit=i, logical_operator_type=:Z) == 8 |
| 36 | + end |
| 37 | + end |
| 38 | + |
| 39 | + @testset "minimum distance properties: BB" begin |
| 40 | + # [[72, 12, 6]] BB code from Table 3 [bravyi2024high](@cite) |
| 41 | + l=6; m=6 |
| 42 | + GA = group_algebra(GF(2), abelian_group([l, m])) |
| 43 | + x, y = gens(GA) |
| 44 | + A = x^3 + y + y^2 |
| 45 | + B = y^3 + x + x^2 |
| 46 | + c = two_block_group_algebra_codes(A,B) |
| 47 | + # minimum distance is exact, d = 6 |
| 48 | + for i in 1:code_k(c) |
| 49 | + @test distance(c, logical_qubit=i) == 6 |
| 50 | + # By default, the minimum distance for the Z-type logical operator is computed. |
| 51 | + # The minimum distance for X-type logical operators is the same. |
| 52 | + @test distance(c, logical_qubit=i) == distance(c, logical_qubit=i, logical_operator_type=:Z) == 6 |
| 53 | + end |
| 54 | + end |
| 55 | + |
| 56 | + @testset "minimum distance properties: coprime BB" begin |
| 57 | + # [[70, 6, 8]] coprime BB code from Table 2 [wang2024coprime](@cite) |
| 58 | + l=5; m=7; |
| 59 | + GA = group_algebra(GF(2), abelian_group([l*m])) |
| 60 | + 𝜋 = gens(GA)[1] |
| 61 | + A = 1 + 𝜋 + 𝜋^5; |
| 62 | + B = 1 + 𝜋 + 𝜋^12; |
| 63 | + c = two_block_group_algebra_codes(A, B) |
| 64 | + # minimum distance is exact, d = 8 |
| 65 | + for i in 1:code_k(c) |
| 66 | + @test code_n(c) == 70 && code_k(c) == 6 |
| 67 | + @test distance(c, logical_qubit=i) == 8 |
| 68 | + # By default, the minimum distance for the Z-type logical operator is computed. |
| 69 | + # The minimum distance for X-type logical operators is the same. |
| 70 | + @test distance(c, logical_qubit=i) == distance(c, logical_qubit=i, logical_operator_type=:Z) == 8 |
| 71 | + end |
| 72 | + end |
| 73 | + |
| 74 | + @testset "minimum distance properties: Weight-7 MB" begin |
| 75 | + # [[30, 4, 5]] MB code from Table 1 of [voss2024multivariatebicyclecodes](@cite) |
| 76 | + l=5; m=3 |
| 77 | + GA = group_algebra(GF(2), abelian_group([l, m])) |
| 78 | + x, y = gens(GA) |
| 79 | + z = x*y |
| 80 | + A = x^4 + x^2 |
| 81 | + B = x + x^2 + y + z^2 + z^3 |
| 82 | + c = two_block_group_algebra_codes(A, B) |
| 83 | + # minimum distance is exact, d = 5 |
| 84 | + for i in 1:code_k(c) |
| 85 | + @test code_n(c) == 30 && code_k(c) == 4 |
| 86 | + @test distance(c, logical_qubit=i) == 5 |
| 87 | + # By default, the minimum distance for the Z-type logical operator is computed. |
| 88 | + # The minimum distance for X-type logical operators is the same. |
| 89 | + @test distance(c, logical_qubit=i) == distance(c, logical_qubit=i, logical_operator_type=:Z) == 5 |
| 90 | + end |
| 91 | + end |
| 92 | +end |
0 commit comments