Skip to content

Commit 0906620

Browse files
committed
add missing method for two-block group algebra (2BGA) codes
1 parent 2b8e81f commit 0906620

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

docs/src/references.bib

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,3 +487,14 @@ @article{anderson2014fault
487487
year={2014},
488488
publisher={APS}
489489
}
490+
491+
@article{lin2024quantum,
492+
title={Quantum two-block group algebra codes},
493+
author={Lin, Hsiang-Ku and Pryadko, Leonid P},
494+
journal={Physical Review A},
495+
volume={109},
496+
number={2},
497+
pages={022407},
498+
year={2024},
499+
publisher={APS}
500+
}

docs/src/references.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ For quantum code construction routines:
4040
- [steane1999quantum](@cite)
4141
- [campbell2012magic](@cite)
4242
- [anderson2014fault](@cite)
43+
- [lin2024quantum](@cite)
4344

4445
For classical code construction routines:
4546
- [muller1954application](@cite)

ext/QuantumCliffordHeckeExt/lifted_product.jl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,38 @@ code_n(c::LPCode) = size(c.repr(zero(c.GA)), 2) * (size(c.A, 2) * size(c.B, 1) +
139139
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))
140140

141141
"""
142-
Two-block group algebra (2GBA) codes, which are a special case of lifted product codes
142+
Two-block group algebra (2BGA) codes, which are a special case of lifted product codes
143143
from two group algebra elements `a` and `b`, used as `1x1` base matrices.
144144
145+
[[70, 8, 10]] 2BGA code from Table 1 of [lin2024quantum](@cite) with cyclic group of
146+
order `l = 35`.
147+
148+
```jldoctest
149+
julia> l = 35;
150+
151+
julia> c1 = two_block_group_algebra_codes([0, 15, 16, 18], [0, 1, 24, 27], l);
152+
153+
julia> code_n(c1), code_k(c1)
154+
(70, 8)
155+
```
156+
145157
See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref)
146-
""" # TODO doctest example
158+
"""
147159
function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem)
148160
A = reshape([a], (1, 1))
149161
B = reshape([b], (1, 1))
150162
LPCode(A, B)
151163
end
152164

165+
function two_block_group_algebra_codes(a_shifts::Array{Int}, b_shifts::Array{Int}, l::Int)
166+
GA = group_algebra(GF(2), abelian_group(l))
167+
a = sum(GA[n%l+1] for n in a_shifts)
168+
b = sum(GA[n%l+1] for n in b_shifts)
169+
two_block_group_algebra_codes(a, b)
170+
end
171+
153172
"""
154-
Generalized bicycle codes, which are a special case of 2GBA codes (and therefore of lifted product codes).
173+
Generalized bicycle codes, which are a special case of 2BGA codes (and therefore of lifted product codes).
155174
Here the group is chosen as the cyclic group of order `l`,
156175
and the base matrices `a` and `b` are the sum of the group algebra elements corresponding to the shifts `a_shifts` and `b_shifts`.
157176

test/test_ecc_2bga.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@testitem "ECC 2BGA" begin
2+
using Hecke
3+
using QuantumClifford.ECC: two_block_group_algebra_codes, code_k, code_n
4+
5+
# codes taken from Table 1 of [lin2024quantum](@cite)
6+
@test code_n(two_block_group_algebra_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35)) == 70
7+
@test code_k(two_block_group_algebra_codes([0 , 15, 16, 18], [0 , 1, 24, 27], 35)) == 8
8+
@test code_n(two_block_group_algebra_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27)) == 54
9+
@test code_k(two_block_group_algebra_codes([0 , 1, 3, 7], [0 , 1, 12, 19], 27)) == 6
10+
@test code_n(two_block_group_algebra_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30)) == 60
11+
@test code_k(two_block_group_algebra_codes([0 , 10, 6, 13], [0 , 25, 16, 12], 30)) == 6
12+
@test code_n(two_block_group_algebra_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36)) == 72
13+
@test code_k(two_block_group_algebra_codes([0 , 9, 28, 31], [0 , 1, 21, 34], 36)) == 8
14+
@test code_n(two_block_group_algebra_codes([0 , 9, 28, 13], [0 , 1, 21, 34], 36)) == 72
15+
@test code_k(two_block_group_algebra_codes([0 , 9, 28, 13], [0 , 1, 3, 22], 36)) == 10
16+
end

0 commit comments

Comments
 (0)