Skip to content

Commit 5f2ef93

Browse files
Fe-r-ozKrastanov
andauthored
Implementing Bivariate Bicycle Codes using 2BGA as the parent via Hecke's Group Algebra (#399)
Co-authored-by: Stefan Krastanov <[email protected]> Co-authored-by: Stefan Krastanov <[email protected]>
1 parent 40924b8 commit 5f2ef93

File tree

5 files changed

+250
-4
lines changed

5 files changed

+250
-4
lines changed

docs/src/references.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,3 +523,14 @@ @article{lin2024quantum
523523
year={2024},
524524
publisher={APS}
525525
}
526+
527+
@article{bravyi2024high,
528+
title={High-threshold and low-overhead fault-tolerant quantum memory},
529+
author={Bravyi, Sergey and Cross, Andrew W and Gambetta, Jay M and Maslov, Dmitri and Rall, Patrick and Yoder, Theodore J},
530+
journal={Nature},
531+
volume={627},
532+
number={8005},
533+
pages={778--782},
534+
year={2024},
535+
publisher={Nature Publishing Group UK London}
536+
}

docs/src/references.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ For quantum code construction routines:
4040
- [steane1999quantum](@cite)
4141
- [campbell2012magic](@cite)
4242
- [anderson2014fault](@cite)
43+
- [lin2024quantum](@cite)
44+
- [bravyi2024high](@cite)
4345

4446
For classical code construction routines:
4547
- [muller1954application](@cite)

ext/QuantumCliffordHeckeExt/lifted_product.jl

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,18 @@ code_n(c::LPCode) = size(c.repr(zero(c.GA)), 2) * (size(c.A, 2) * size(c.B, 1) +
150150
code_s(c::LPCode) = size(c.repr(zero(c.GA)), 1) * (size(c.A, 1) * size(c.B, 1) + size(c.A, 2) * size(c.B, 2))
151151

152152
"""
153-
Two-block group algebra (2GBA) codes, which are a special case of lifted product codes
153+
Two-block group algebra (2BGA) codes, which are a special case of lifted product codes
154154
from two group algebra elements `a` and `b`, used as `1x1` base matrices.
155155
156+
## Examples of 2BGA code subfamilies
157+
158+
### `C₄ x C₂`
159+
156160
Here is an example of a [[56, 28, 2]] 2BGA code from Table 2 of [lin2024quantum](@cite)
157161
with direct product of `C₄ x C₂`.
158162
159163
```jldoctest
160-
julia> import Hecke: group_algebra, GF, abelian_group, gens;
164+
julia> import Hecke: group_algebra, GF, abelian_group, gens
161165
162166
julia> GA = group_algebra(GF(2), abelian_group([14,2]));
163167
@@ -175,7 +179,36 @@ julia> code_n(c), code_k(c)
175179
(56, 28)
176180
```
177181
178-
See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref)
182+
### Bivariate Bicycle codes
183+
184+
Bivariate Bicycle codes are a class of Abelian 2BGA codes formed by the direct product
185+
of two cyclic groups `ℤₗ × ℤₘ`. The parameters `l` and `m` represent the orders of the
186+
first and second cyclic groups, respectively.
187+
188+
The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/qcga).
189+
190+
A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite):
191+
192+
```jldoctest
193+
julia> import Hecke: group_algebra, GF, abelian_group, gens
194+
195+
julia> l=21; m=18;
196+
197+
julia> GA = group_algebra(GF(2), abelian_group([l, m]));
198+
199+
julia> x, y = gens(GA);
200+
201+
julia> A = x^3 + y^10 + y^17;
202+
203+
julia> B = y^5 + x^3 + x^19;
204+
205+
julia> c = two_block_group_algebra_codes(A,B);
206+
207+
julia> code_n(c), code_k(c)
208+
(756, 16)
209+
```
210+
211+
See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref).
179212
"""
180213
function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem)
181214
LPCode([a;;], [b;;])

test/test_ecc_base.jl

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,41 @@ A[LinearAlgebra.diagind(A, 5)] .= GA(1)
5858
B = reshape([1 + x + x^6], (1, 1))
5959
push!(other_lifted_product_codes, LPCode(A, B))
6060

61+
# Bivariate Bicycle codes
62+
# A [[72, 12, 6]] code from Table 3 of [bravyi2024high](@cite).
63+
l=6; m=6
64+
GA = group_algebra(GF(2), abelian_group([l, m]))
65+
x, y = gens(GA)
66+
A = x^3 + y + y^2
67+
B = y^3 + x + x^2
68+
bb1 = two_block_group_algebra_codes(A,B)
69+
70+
# A [[90, 8, 10]] code from Table 3 of [bravyi2024high](@cite).
71+
l=15; m=3
72+
GA = group_algebra(GF(2), abelian_group([l, m]))
73+
x, y = gens(GA)
74+
A = x^9 + y + y^2
75+
B = 1 + x^2 + x^7
76+
bb2 = two_block_group_algebra_codes(A,B)
77+
78+
# A [[360, 12, ≤ 24]] code from Table 3 of [bravyi2024high](@cite).
79+
l=30; m=6
80+
GA = group_algebra(GF(2), abelian_group([l, m]))
81+
x, y = gens(GA)
82+
A = x^9 + y + y^2
83+
B = y^3 + x^25 + x^26
84+
bb3 = two_block_group_algebra_codes(A,B)
85+
86+
test_bb_codes = [bb1, bb2, bb3]
87+
6188
const code_instance_args = Dict(
6289
:Toric => [(3,3), (4,4), (3,6), (4,3), (5,5)],
6390
:Surface => [(3,3), (4,4), (3,6), (4,3), (5,5)],
6491
:Gottesman => [3, 4, 5],
6592
:CSS => (c -> (parity_checks_x(c), parity_checks_z(c))).([Shor9(), Steane7(), Toric(4, 4)]),
6693
:Concat => [(Perfect5(), Perfect5()), (Perfect5(), Steane7()), (Steane7(), Cleve8()), (Toric(2, 2), Shor9())],
6794
:CircuitCode => random_circuit_code_args,
68-
:LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, other_lifted_product_codes)),
95+
:LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, test_bb_codes, other_lifted_product_codes)),
6996
:QuantumReedMuller => [3, 4, 5]
7097
)
7198

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
@testitem "ECC Bivaraite Bicycle as 2BGA" begin
2+
using Hecke
3+
using Hecke: group_algebra, GF, abelian_group, gens, one
4+
using QuantumClifford.ECC: two_block_group_algebra_codes, code_k, code_n
5+
6+
@testset "Reproduce Table 3 bravyi2024high" begin
7+
# [[72, 12, 6]]
8+
l=6; m=6
9+
GA = group_algebra(GF(2), abelian_group([l, m]))
10+
x, y = gens(GA)
11+
A = x^3 + y + y^2
12+
B = y^3 + x + x^2
13+
c = two_block_group_algebra_codes(A,B)
14+
@test code_n(c) == 72 && code_k(c) == 12
15+
16+
# [[90, 8, 10]]
17+
l=15; m=3
18+
GA = group_algebra(GF(2), abelian_group([l, m]))
19+
x, y = gens(GA)
20+
A = x^9 + y + y^2
21+
B = 1 + x^2 + x^7
22+
c = two_block_group_algebra_codes(A,B)
23+
@test code_n(c) == 90 && code_k(c) == 8
24+
25+
# [[108, 8, 10]]
26+
l=9; m=6
27+
GA = group_algebra(GF(2), abelian_group([l, m]))
28+
x, y = gens(GA)
29+
A = x^3 + y + y^2
30+
B = y^3 + x + x^2
31+
c = two_block_group_algebra_codes(A,B)
32+
@test code_n(c) == 108 && code_k(c) == 8
33+
34+
# [[144, 12, 12]]
35+
l=12; m=6
36+
GA = group_algebra(GF(2), abelian_group([l, m]))
37+
x, y = gens(GA)
38+
A = x^3 + y + y^2
39+
B = y^3 + x + x^2
40+
c = two_block_group_algebra_codes(A,B)
41+
@test code_n(c) == 144 && code_k(c) == 12
42+
43+
# [[288, 12, 12]]
44+
l=12; m=12
45+
GA = group_algebra(GF(2), abelian_group([l, m]))
46+
x, y = gens(GA)
47+
A = x^3 + y^2 + y^7
48+
B = y^3 + x + x^2
49+
c = two_block_group_algebra_codes(A,B)
50+
@test code_n(c) == 288 && code_k(c) == 12
51+
52+
# [[360, 12, ≤ 24]]
53+
l=30; m=6
54+
GA = group_algebra(GF(2), abelian_group([l, m]))
55+
x, y = gens(GA)
56+
A = x^9 + y + y^2
57+
B = y^3 + x^25 + x^26
58+
c = two_block_group_algebra_codes(A,B)
59+
@test code_n(c) == 360 && code_k(c) == 12
60+
61+
# [[756, 16, ≤ 34]]
62+
l=21; m=18
63+
GA = group_algebra(GF(2), abelian_group([l, m]))
64+
x, y = gens(GA)
65+
A = x^3 + y^10 + y^17
66+
B = y^5 + x^3 + x^19
67+
c = two_block_group_algebra_codes(A,B)
68+
@test code_n(c) == 756 && code_k(c) == 16
69+
end
70+
71+
@testset "Reproduce Table 1 berthusen2024toward" begin
72+
# [[72, 8, 6]]
73+
l=12; m=3
74+
GA = group_algebra(GF(2), abelian_group([l, m]))
75+
x, y = gens(GA)
76+
A = x^9 + y + y^2
77+
B = 1 + x + x^11
78+
c = two_block_group_algebra_codes(A,B)
79+
@test code_n(c) == 72 && code_k(c) == 8
80+
81+
# [[90, 8, 6]]
82+
l=9; m=5
83+
GA = group_algebra(GF(2), abelian_group([l, m]))
84+
x, y = gens(GA)
85+
A = x^8 + y^4 + y
86+
B = y^5 + x^8 + x^7
87+
c = two_block_group_algebra_codes(A,B)
88+
@test code_n(c) == 90 && code_k(c) == 8
89+
90+
# [[120, 8, 8]]
91+
l=12; m=5
92+
GA = group_algebra(GF(2), abelian_group([l, m]))
93+
x, y = gens(GA)
94+
A = x^10 + y^4 + y
95+
B = 1 + x + x^2
96+
c = two_block_group_algebra_codes(A,B)
97+
@test code_n(c) == 120 && code_k(c) == 8
98+
99+
# [[150, 8, 8]]
100+
l=15; m=5
101+
GA = group_algebra(GF(2), abelian_group([l, m]))
102+
x, y = gens(GA)
103+
A = x^5 + y^2 + y^3
104+
B = y^2 + x^7 + x^6
105+
c = two_block_group_algebra_codes(A,B)
106+
@test code_n(c) == 150 && code_k(c) == 8
107+
108+
# [[196, 12, 8]]
109+
l=14; m=7
110+
GA = group_algebra(GF(2), abelian_group([l, m]))
111+
x, y = gens(GA)
112+
A = x^6 + y^5 + y^6
113+
B = 1 + x^4 + x^13
114+
c = two_block_group_algebra_codes(A,B)
115+
@test code_n(c) == 196 && code_k(c) == 12
116+
end
117+
118+
@testset "Reproduce Table 1 wang2024coprime" begin
119+
# [[54, 8, 6]]
120+
l=3; m=9
121+
GA = group_algebra(GF(2), abelian_group([l, m]))
122+
x, y = gens(GA)
123+
A = 1 + y^2 + y^4
124+
B = y^3 + x + x^2
125+
c = two_block_group_algebra_codes(A,B)
126+
@test code_n(c) == 54 && code_k(c) == 8
127+
128+
# [[98, 6, 12]]
129+
l=7; m=7
130+
GA = group_algebra(GF(2), abelian_group([l, m]))
131+
x, y = gens(GA)
132+
A = x^3 + y^5 + y^6
133+
B = y^2 + x^3 + x^5
134+
c = two_block_group_algebra_codes(A,B)
135+
@test code_n(c) == 98 && code_k(c) == 6
136+
137+
# [[126, 8, 10]]
138+
l=3; m=21
139+
GA = group_algebra(GF(2), abelian_group([l, m]))
140+
x, y = gens(GA)
141+
A = 1 + y^2 + y^10
142+
B = y^3 + x + x^2
143+
c = two_block_group_algebra_codes(A,B)
144+
@test code_n(c) == 126 && code_k(c) == 8
145+
146+
# [[150, 16, 8]]
147+
l=5; m=15
148+
GA = group_algebra(GF(2), abelian_group([l, m]))
149+
x, y = gens(GA)
150+
A = 1 + y^6 + y^8
151+
B = y^5 + x + x^4
152+
c = two_block_group_algebra_codes(A,B)
153+
@test code_n(c) == 150 && code_k(c) == 16
154+
155+
# [[162, 8, 14]]
156+
l=3; m=27
157+
GA = group_algebra(GF(2), abelian_group([l, m]))
158+
x, y = gens(GA)
159+
A = 1 + y^10 + y^14
160+
B = y^12 + x + x^2
161+
c = two_block_group_algebra_codes(A,B)
162+
@test code_n(c) == 162 && code_k(c) == 8
163+
164+
# [[180, 8, 16]]
165+
l=6; m=15
166+
GA = group_algebra(GF(2), abelian_group([l, m]))
167+
x, y = gens(GA)
168+
A = x^3 + y + y^2
169+
B = y^6 + x^4 + x^5
170+
c = two_block_group_algebra_codes(A,B)
171+
@test code_n(c) == 180 && code_k(c) == 8
172+
end
173+
end

0 commit comments

Comments
 (0)