From 656d5e886b4221dc01eb841142909171678f88b3 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Sun, 29 Sep 2024 15:34:04 +0500 Subject: [PATCH 1/4] Lifted Product construction of bivariate bicycle using LPCode --- docs/Project.toml | 1 + docs/src/references.bib | 11 ++++++++ docs/src/references.md | 1 + ext/QuantumCliffordHeckeExt/lifted_product.jl | 27 +++++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/docs/Project.toml b/docs/Project.toml index 8ef02232a..f11b76a30 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -9,6 +9,7 @@ Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" PyQDecoders = "17f5de1a-9b79-4409-a58d-4d45812840f7" Quantikz = "b0d11df0-eea3-4d79-b4a5-421488cbf74b" QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1" diff --git a/docs/src/references.bib b/docs/src/references.bib index 29500a034..b8d1116a0 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -487,3 +487,14 @@ @article{anderson2014fault year={2014}, publisher={APS} } + +@article{bravyi2024high, + title={High-threshold and low-overhead fault-tolerant quantum memory}, + author={Bravyi, Sergey and Cross, Andrew W and Gambetta, Jay M and Maslov, Dmitri and Rall, Patrick and Yoder, Theodore J}, + journal={Nature}, + volume={627}, + number={8005}, + pages={778--782}, + year={2024}, + publisher={Nature Publishing Group UK London} +} diff --git a/docs/src/references.md b/docs/src/references.md index 35e944a21..a5cb325ca 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) +- [bravyi2024high](@cite) For classical code construction routines: - [muller1954application](@cite) diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 97e41b044..3ec78dbda 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -70,6 +70,33 @@ julia> code_n(c2), code_k(c2) - When the base matrices of the `LPCode` are 1×1 and their elements are sums of cyclic permutations, the code is called a generalized bicycle code [`generalized_bicycle_codes`](@ref). - When the two matrices are adjoint to each other, the code is called a bicycle code [`bicycle_codes`](@ref). +# Examples + +Bivariate Bicycle codes belong to a wider class of generalized bicycle (GB) codes, which are further generalized into of two block group algebra (2GBA) codes. They can be viewed as a special case of Lifted Product construction based on abelian group `ℤₗ x ℤₘ` where `ℤⱼ` cyclic group of order `j`. + +A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite). + +```jldoctest +julia> import Hecke: group_algebra, GF, abelian_group, gens; import Oscar: PcGroup; + +julia> l=21; m=18; + +julia> GA = group_algebra(GF(2), abelian_group(PcGroup, [l, m])); + +julia> x = gens(GA)[1]; + +julia> y = gens(GA)[2]; + +julia> A = reshape([x^3 + y^10 + y^17], (1, 1)); + +julia> B = reshape([y^5 + x^3 + x^19], (1, 1)); + +julia> c1 = LPCode(A, B); + +julia> code_n(c1), code_k(c1) +(756, 16) +``` + ## The representation function We use the default representation function `Hecke.representation_matrix` to convert a `GF(2)`-group algebra element to a binary matrix. From ff55563a723dc7728767104b7b84b4dcd28a690f Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Thu, 10 Oct 2024 22:19:29 +0500 Subject: [PATCH 2/4] significant simplification --- docs/Project.toml | 1 - ext/QuantumCliffordHeckeExt/lifted_product.jl | 9 ++++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index f11b76a30..8ef02232a 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -9,7 +9,6 @@ Hecke = "3e1990a7-5d81-5526-99ce-9ba3ff248f21" LDPCDecoders = "3c486d74-64b9-4c60-8b1a-13a564e77efb" Nemo = "2edaba10-b0f1-5616-af89-8c11ac63239a" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -Oscar = "f1435218-dba5-11e9-1e4d-f1a5fab5fc13" PyQDecoders = "17f5de1a-9b79-4409-a58d-4d45812840f7" Quantikz = "b0d11df0-eea3-4d79-b4a5-421488cbf74b" QuantumClifford = "0525e862-1e90-11e9-3e4d-1b39d7109de1" diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 3ec78dbda..195532666 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -72,16 +72,19 @@ julia> code_n(c2), code_k(c2) # Examples -Bivariate Bicycle codes belong to a wider class of generalized bicycle (GB) codes, which are further generalized into of two block group algebra (2GBA) codes. They can be viewed as a special case of Lifted Product construction based on abelian group `ℤₗ x ℤₘ` where `ℤⱼ` cyclic group of order `j`. +Bivariate Bicycle codes belong to a wider class of generalized bicycle (GB) codes, +which are further generalized into of two block group algebra (2GBA) codes. They +can be viewed as a special case of Lifted Product construction based on abelian +group `ℤₗ x ℤₘ` where `ℤⱼ` cyclic group of order `j`. A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite). ```jldoctest -julia> import Hecke: group_algebra, GF, abelian_group, gens; import Oscar: PcGroup; +julia> import Hecke: group_algebra, GF, abelian_group, gens; julia> l=21; m=18; -julia> GA = group_algebra(GF(2), abelian_group(PcGroup, [l, m])); +julia> GA = group_algebra(GF(2), abelian_group([l, m])); julia> x = gens(GA)[1]; From 6533defe0331acb7a45857259e9c8197a1285b5d Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Thu, 17 Oct 2024 11:39:01 +0500 Subject: [PATCH 3/4] Pardon for delay - Reproduce Tables from papers as well --- ext/QuantumCliffordHeckeExt/lifted_product.jl | 8 +- test/test_ecc_bivaraite_bicycle_lp.txt | 191 ++++++++++++++++++ 2 files changed, 195 insertions(+), 4 deletions(-) create mode 100644 test/test_ecc_bivaraite_bicycle_lp.txt diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 195532666..b63e9944a 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -72,10 +72,10 @@ julia> code_n(c2), code_k(c2) # Examples -Bivariate Bicycle codes belong to a wider class of generalized bicycle (GB) codes, -which are further generalized into of two block group algebra (2GBA) codes. They -can be viewed as a special case of Lifted Product construction based on abelian -group `ℤₗ x ℤₘ` where `ℤⱼ` cyclic group of order `j`. +Bivariate Bicycle codes belong to a wider class of generalized bicycle (GB) codes, which +are further generalized into of two block group algebra (2BGA) codes. They can be viewed +as a special case of Lifted Product construction based on abelian group `ℤₗ x ℤₘ` where `ℤⱼ` +cyclic group of order `j`. A [[756, 16, ≤ 34]] code from Table 3 of [bravyi2024high](@cite). diff --git a/test/test_ecc_bivaraite_bicycle_lp.txt b/test/test_ecc_bivaraite_bicycle_lp.txt new file mode 100644 index 000000000..a76efedcf --- /dev/null +++ b/test/test_ecc_bivaraite_bicycle_lp.txt @@ -0,0 +1,191 @@ +@testitem "ECC Bivaraite Bicycle LP" begin + using Hecke + using Hecke: group_algebra, GF, abelian_group, gens + using QuantumClifford.ECC: LPCode, code_k, code_n + + @testset "Reproduce Table 3 bravyi2024high" begin + # [[72, 12, 6]] + l=6; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y + y^2], (1, 1)) + B = reshape([y^3 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 72 && code_k(c) == 12 + + # [[90, 8, 10]] + l=15; m=3 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^9 + y + y^2], (1, 1)) + B = reshape([1 + x^2 + x^7], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 90 && code_k(c) == 8 + + # [[108, 8, 10]] + l=9; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y + y^2], (1, 1)) + B = reshape([y^3 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 108 && code_k(c) == 8 + + # [[144, 12, 12]] + l=12; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y + y^2], (1, 1)) + B = reshape([y^3 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 144 && code_k(c) == 12 + + # [[288, 12, 12]] + l=12; m=12 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y^2 + y^7], (1, 1)) + B = reshape([y^3 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 288 && code_k(c) == 12 + + # [[360, 12, ≤ 24]] + l=30; m=6 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^9 + y + y^2], (1, 1)) + B = reshape([y^3 + x^25 + x^26], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 360 && code_k(c) == 12 + + # [[756, 16, ≤ 34]] + l=21; m=18 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y^10 + y^17], (1, 1)) + B = reshape([y^5 + x^3 + x^19], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 756 && code_k(c) == 16 + end + + @testset "Reproduce Table 1 berthusen2024toward" begin + # [[72, 8, 6]] + l=12; m=3 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^9 + y + y^2], (1, 1)) + B = reshape([1 + x + x^11], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 72 && code_k(c) == 8 + + # [[90, 8, 6]] + l=9; m=5 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^8 + y^4 + y], (1, 1)) + B = reshape([y^5 + x^8 + x^7], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 90 && code_k(c) == 8 + + # [[120, 8, 8]] + l=12; m=5 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^10 + y^4 + y], (1, 1)) + B = reshape([1 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 120 && code_k(c) == 8 + + # [[150, 8, 8]] + l=15; m=5 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^5 + y^2 + y^3], (1, 1)) + B = reshape([y^2 + x^7 + x^6], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 150 && code_k(c) == 8 + + # [[196, 12, 8]] + l=14; m=7 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^6 + y^5 + y^6], (1, 1)) + B = reshape([1 + x^4 + x^13], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 196 && code_k(c) == 12 + end + + @testset "Reproduce Table 1 wang2024coprime" begin + # [[54, 8, 6]] + l=3; m=9 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([1 + y^2 + y^4], (1, 1)) + B = reshape([y^3 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 54 && code_k(c) == 8 + + # [[98, 6, 12]] + l=7; m=7 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y^5 + y^6], (1, 1)) + B = reshape([y^2 + x^3 + x^5], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 98 && code_k(c) == 6 + + # [[126, 8, 10]] + l=3; m=21 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([1 + y^2 + y^10], (1, 1)) + B = reshape([y^3 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 126 && code_k(c) == 8 + + # [[150, 16, 8]] + l=5; m=15 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([1 + y^6 + y^8], (1, 1)) + B = reshape([y^5 + x + x^4], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 150 && code_k(c) == 16 + + # [[162, 8, 14]] + l=3; m=27 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([1 + y^10 + y^14], (1, 1)) + B = reshape([y^12 + x + x^2], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 162 && code_k(c) == 8 + + # [[180, 8, 16]] + l=6; m=15 + GA = group_algebra(GF(2), abelian_group([l, m])) + x = gens(GA)[1] + y = gens(GA)[2] + A = reshape([x^3 + y + y^2], (1, 1)) + B = reshape([y^6+ x^4 + x^5], (1, 1)) + c = LPCode(A, B) + @test code_n(c) == 180 && code_k(c) == 8 + end +end From 3fa084399df362bd3f0fdd60d90ba65df2484610 Mon Sep 17 00:00:00 2001 From: Fe-r-oz Date: Fri, 18 Oct 2024 20:06:52 +0500 Subject: [PATCH 4/4] My Bad ... added .txt file instead of .jl extension as test file --- ...c_bivaraite_bicycle_lp.txt => test_ecc_bivaraite_bicycle.jl} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename test/{test_ecc_bivaraite_bicycle_lp.txt => test_ecc_bivaraite_bicycle.jl} (99%) diff --git a/test/test_ecc_bivaraite_bicycle_lp.txt b/test/test_ecc_bivaraite_bicycle.jl similarity index 99% rename from test/test_ecc_bivaraite_bicycle_lp.txt rename to test/test_ecc_bivaraite_bicycle.jl index a76efedcf..651f63a5f 100644 --- a/test/test_ecc_bivaraite_bicycle_lp.txt +++ b/test/test_ecc_bivaraite_bicycle.jl @@ -1,4 +1,4 @@ -@testitem "ECC Bivaraite Bicycle LP" begin +@testitem "ECC Bivaraite Bicycle" begin using Hecke using Hecke: group_algebra, GF, abelian_group, gens using QuantumClifford.ECC: LPCode, code_k, code_n