Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Dec 1, 2024
1 parent 5b61678 commit a43d217
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ julia> code_n(c1), code_k(c1), distance(c1)
!!!note Since the [[48, 6, 8]] GB code does not have specific lower and upper
bounds (e.g., consider [[48, 6, 5 ≤ d ≤ 8]]), the minimum distance for all
`Z`-type and `X`-type logical operators remains the same. Here, the *exact*
minimum distance is provided.
minimum distance of `8` is provided.
```jldoctest examples
julia> distance(c1, all_logical_qubits=true)
Expand Down
36 changes: 11 additions & 25 deletions test/test_ecc_generalized_bicycle_codes.jl
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
@testitem "ECC GB" begin
using Hecke
using JuMP
using GLPK
using QuantumClifford.ECC: generalized_bicycle_codes, code_k, code_n, distance
using QuantumClifford.ECC: generalized_bicycle_codes, code_k, code_n

# codes taken from Table 1 of [lin2024quantum](@cite)
# Abelian 2BGA codes can be viewed as GB codes.

codes = [generalized_bicycle_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27), # [[54, 6, 9]]
generalized_bicycle_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30), # [[60, 6, 10]]
generalized_bicycle_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35), # [[70, 8, 10]]
generalized_bicycle_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36), # [[72, 8, 10]]
generalized_bicycle_codes([0 , 9, 28, 13], [0 , 1, 3, 22], 36)] # [[72, 8, 9]]

n_values = [54, 60, 70, 72, 72]
k_values = [6 , 6 , 8 , 8 , 10]
d_values = [9 , 10, 10, 10, 9]

for i in 1:length(n_values)
@test code_n(codes[i]) == n_values[i]
end

for i in 1:length(n_values)
@test code_k(codes[i]) == k_values[i]
end

for i in 1:length(d_values)
j = rand(1:code_k(codes[i]))
@test distance(codes[i], logical_qubit=j) == d_values[i]
@test code_n(generalized_bicycle_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35)) == 70
@test code_k(generalized_bicycle_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35)) == 8
@test code_n(generalized_bicycle_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27)) == 54
@test code_k(generalized_bicycle_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27)) == 6
@test code_n(generalized_bicycle_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30)) == 60
@test code_k(generalized_bicycle_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30)) == 6
@test code_n(generalized_bicycle_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36)) == 72
@test code_k(generalized_bicycle_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36)) == 8
@test code_n(generalized_bicycle_codes([0 , 9, 28, 13], [0 , 1, 21, 34], 36)) == 72
@test code_k(generalized_bicycle_codes([0 , 9, 28, 13], [0 , 1, 3, 22], 36)) == 10
end
end

0 comments on commit a43d217

Please sign in to comment.