From 60016df07ff9798ac666e3b01e1dea64a80b0a6f Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Mon, 14 Oct 2024 12:51:34 +0500 Subject: [PATCH 1/4] introduce tests for 2BGA code --- docs/src/references.bib | 11 +++++++++++ docs/src/references.md | 1 + ext/QuantumCliffordHeckeExt/lifted_product.jl | 18 +++++++++++++++--- test/test_ecc_2bga.jl | 16 ++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 test/test_ecc_2bga.jl diff --git a/docs/src/references.bib b/docs/src/references.bib index 29500a034..469e2a580 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -487,3 +487,14 @@ @article{anderson2014fault year={2014}, publisher={APS} } + +@article{lin2024quantum, + title={Quantum two-block group algebra codes}, + author={Lin, Hsiang-Ku and Pryadko, Leonid P}, + journal={Physical Review A}, + volume={109}, + number={2}, + pages={022407}, + year={2024}, + publisher={APS} +} diff --git a/docs/src/references.md b/docs/src/references.md index 35e944a21..415050bf9 100644 --- a/docs/src/references.md +++ b/docs/src/references.md @@ -40,6 +40,7 @@ For quantum code construction routines: - [steane1999quantum](@cite) - [campbell2012magic](@cite) - [anderson2014fault](@cite) +- [lin2024quantum](@cite) For classical code construction routines: - [muller1954application](@cite) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 97e41b044..f0092ad93 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -139,11 +139,23 @@ code_n(c::LPCode) = size(c.repr(zero(c.GA)), 2) * (size(c.A, 2) * size(c.B, 1) + 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)) """ -Two-block group algebra (2GBA) codes, which are a special case of lifted product codes +Two-block group algebra (2BGA) codes, which are a special case of lifted product codes from two group algebra elements `a` and `b`, used as `1x1` base matrices. +[[70, 8, 10]] 2BGA code from Table 1 of [lin2024quantum](@cite) with cyclic group of +order `l = 35`. + +```jldoctest +julia> l = 35; + +julia> c1 = generalized_bicycle_codes([0, 15, 16, 18], [0, 1, 24, 27], l); + +julia> code_n(c1), code_k(c1) +(70, 8) +``` + See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref) -""" # TODO doctest example +""" function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) A = reshape([a], (1, 1)) B = reshape([b], (1, 1)) @@ -151,7 +163,7 @@ function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) end """ -Generalized bicycle codes, which are a special case of 2GBA codes (and therefore of lifted product codes). +Generalized bicycle codes, which are a special case of 2BGA codes (and therefore of lifted product codes). Here the group is chosen as the cyclic group of order `l`, and the base matrices `a` and `b` are the sum of the group algebra elements corresponding to the shifts `a_shifts` and `b_shifts`. diff --git a/test/test_ecc_2bga.jl b/test/test_ecc_2bga.jl new file mode 100644 index 000000000..f05e6204b --- /dev/null +++ b/test/test_ecc_2bga.jl @@ -0,0 +1,16 @@ +@testitem "ECC 2BGA" begin + using Hecke + using QuantumClifford.ECC: generalized_bicycle_codes, code_k, code_n + + # codes taken from Table 1 of [lin2024quantum](@cite) + @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 From e39689c12a5fc8b1ab9fd1da65c8b6aae5346032 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Tue, 5 Nov 2024 14:58:46 +0500 Subject: [PATCH 2/4] add test_ecc_generalized_bicycle_codes --- docs/src/references.md | 1 - test/test_ecc_generalized_bicycle_codes.jl | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 test/test_ecc_generalized_bicycle_codes.jl diff --git a/docs/src/references.md b/docs/src/references.md index 415050bf9..35e944a21 100644 --- a/docs/src/references.md +++ b/docs/src/references.md @@ -40,7 +40,6 @@ For quantum code construction routines: - [steane1999quantum](@cite) - [campbell2012magic](@cite) - [anderson2014fault](@cite) -- [lin2024quantum](@cite) For classical code construction routines: - [muller1954application](@cite) diff --git a/test/test_ecc_generalized_bicycle_codes.jl b/test/test_ecc_generalized_bicycle_codes.jl new file mode 100644 index 000000000..c6e1f50bf --- /dev/null +++ b/test/test_ecc_generalized_bicycle_codes.jl @@ -0,0 +1,18 @@ +@testitem "ECC GB" begin + using Hecke + 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. + @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 From 5ddabbfe2e86bebc1dbb5280f1c24a7dd13feb55 Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Tue, 5 Nov 2024 08:10:44 -0500 Subject: [PATCH 3/4] do not use code block syntax for emphasis --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index e6d7e7355..182b0674d 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -182,7 +182,7 @@ function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) end """ -Generalized bicycle codes, which are a special case of `abelian` 2GBA codes (and therefore of lifted product codes). +Generalized bicycle codes, which are a special case of *abelian* 2GBA codes (and therefore of lifted product codes). Here the group is chosen as the cyclic group of order `l`, and the base matrices `a` and `b` are the sum of the group algebra elements corresponding to the shifts `a_shifts` and `b_shifts`. @@ -197,7 +197,7 @@ julia> code_n(c), code_k(c) (254, 28) ``` -An [[70, 8, 10]] `abelian` 2BGA code from Table 1 of [lin2024quantum](@cite), with cyclic group of +An [[70, 8, 10]] *abelian* 2BGA code from Table 1 of [lin2024quantum](@cite), with cyclic group of order `l = 35`, illustrates that `abelian` 2BGA codes can be viewed as GB codes. ```jldoctest From 693b5ba6f286e3481a453183ed81e361ebf5367e Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Tue, 5 Nov 2024 08:11:51 -0500 Subject: [PATCH 4/4] do not use code block syntax for emphasis --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 182b0674d..a6b2df125 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -198,7 +198,7 @@ julia> code_n(c), code_k(c) ``` An [[70, 8, 10]] *abelian* 2BGA code from Table 1 of [lin2024quantum](@cite), with cyclic group of -order `l = 35`, illustrates that `abelian` 2BGA codes can be viewed as GB codes. +order `l = 35`, illustrates that *abelian* 2BGA codes can be viewed as GB codes. ```jldoctest julia> l = 35;