From ce1dc02c8255e644d3045a4809ed2b64ceb41e72 Mon Sep 17 00:00:00 2001 From: Feroz Ahmad Date: Tue, 5 Nov 2024 22:08:46 +0500 Subject: [PATCH] =?UTF-8?q?Haah's=20cubic=20code=20using=20abelian=20group?= =?UTF-8?q?=20=E2=84=A4=E2=82=83=CB=A3=C2=B3=20via=20Hecke's=20Group=20Alg?= =?UTF-8?q?ebra=20(#388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Stefan Krastanov --- docs/src/references.bib | 10 ++++++ docs/src/references.md | 1 + .../QuantumCliffordHeckeExt.jl | 3 +- ext/QuantumCliffordHeckeExt/lifted_product.jl | 32 ++++++++++++++++--- src/ecc/ECC.jl | 1 + src/ecc/codes/lifted_product.jl | 3 ++ test/test_ecc_base.jl | 6 +++- 7 files changed, 49 insertions(+), 7 deletions(-) diff --git a/docs/src/references.bib b/docs/src/references.bib index 83be080da..05276ff75 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -551,3 +551,13 @@ @article{bravyi2024high year={2024}, publisher={Nature Publishing Group UK London} } + +@article{haah2011local, + title={Local stabilizer codes in three dimensions without string logical operators}, + author={Haah, Jeongwan}, + journal={Physical Review A?Atomic, Molecular, and Optical Physics}, + volume={83}, + number={4}, + pages={042330}, + year={2011}, +} diff --git a/docs/src/references.md b/docs/src/references.md index 16f2195be..97c679136 100644 --- a/docs/src/references.md +++ b/docs/src/references.md @@ -44,6 +44,7 @@ For quantum code construction routines: - [voss2024multivariatebicyclecodes](@cite) - [lin2024quantum](@cite) - [bravyi2024high](@cite) +- [haah2011local](@cite) For classical code construction routines: - [muller1954application](@cite) diff --git a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl index b8508ff66..89d7bae0c 100644 --- a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl +++ b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl @@ -11,7 +11,8 @@ import Nemo: characteristic, matrix_repr, GF, ZZ, lift import QuantumClifford.ECC: AbstractECC, CSS, ClassicalCode, hgp, code_k, code_n, code_s, iscss, parity_checks, parity_checks_x, parity_checks_z, parity_checks_xz, - two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation + two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation, + haah_cubic_codes include("util.jl") include("types.jl") diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 9d5fa0d0c..66bd35ed6 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -77,7 +77,8 @@ The default representation, provided by `Hecke`, is the permutation representati We also accept a custom representation function as detailed in [`LiftedCode`](@ref). -See also: [`LiftedCode`](@ref), [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref). +See also: [`LiftedCode`](@ref), [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), +[`haah_cubic_codes`](@ref). $TYPEDFIELDS """ @@ -251,12 +252,10 @@ julia> ๐œ‹ = gens(GA)[1]; julia> A = ๐œ‹^2 + ๐œ‹^5 + ๐œ‹^44; julia> B = ๐œ‹^8 + ๐œ‹^14 + ๐œ‹^47; - - (108, 12) ``` -See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref). +See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), [`haah_cubic_codes`](@ref). """ function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) LPCode([a;;], [b;;]) @@ -302,10 +301,33 @@ Bicycle codes are a special case of generalized bicycle codes, where `a` and `b` are conjugate to each other. The order of the cyclic group is `l`, and the shifts `a_shifts` and `b_shifts` are reverse to each other. -See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref). +See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`haah_cubic_codes`](@ref). """ # TODO doctest example function bicycle_codes(a_shifts::Array{Int}, l::Int) GA = group_algebra(GF(2), abelian_group(l)) a = sum(GA[nรทl+1] for n in a_shifts) two_block_group_algebra_codes(a, group_algebra_conj(a)) end + +""" +Haahโ€™s cubic codes [haah2011local](@cite) can be viewed as generalized bicycle (GB) codes +with the group `G = Cโ‚— ร— Cโ‚— ร— Cโ‚—`, where `l` denotes the lattice size. In particular, a GB +code with the group `G = โ„คโ‚ƒหฃยณ` corresponds to a cubic code. + +The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/haah_cubic). + +```jldoctest +julia> c = haah_cubic_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 6); + +julia> code_n(c), code_k(c) +(432, 8) +``` + +See also: [`bicycle_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`two_block_group_algebra_codes`](@ref). +""" +function haah_cubic_codes(a_shifts::Array{Int}, b_shifts::Array{Int}, l::Int) + GA = group_algebra(GF(2), abelian_group([l,l,l])) + a = sum(GA[n%dim(GA)+1] for n in a_shifts) + b = sum(GA[n%dim(GA)+1] for n in b_shifts) + two_block_group_algebra_codes(a, b) +end diff --git a/src/ecc/ECC.jl b/src/ecc/ECC.jl index ff4444694..231816318 100644 --- a/src/ecc/ECC.jl +++ b/src/ecc/ECC.jl @@ -29,6 +29,7 @@ export parity_checks, parity_checks_x, parity_checks_z, iscss, Shor9, Steane7, Cleve8, Perfect5, Bitflip3, Toric, Gottesman, Surface, Concat, CircuitCode, QuantumReedMuller, LPCode, two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, + haah_cubic_codes, random_brickwork_circuit_code, random_all_to_all_circuit_code, evaluate_decoder, CommutationCheckECCSetup, NaiveSyndromeECCSetup, ShorSyndromeECCSetup, diff --git a/src/ecc/codes/lifted_product.jl b/src/ecc/codes/lifted_product.jl index 338880702..2a0c2c36f 100644 --- a/src/ecc/codes/lifted_product.jl +++ b/src/ecc/codes/lifted_product.jl @@ -17,3 +17,6 @@ function generalized_bicycle_codes end """Implemented in a package extension with Hecke.""" function bicycle_codes end + +"""Implemented in a package extension with Hecke.""" +function haah_cubic_codes end diff --git a/test/test_ecc_base.jl b/test/test_ecc_base.jl index ab247da71..7c1d12ef5 100644 --- a/test/test_ecc_base.jl +++ b/test/test_ecc_base.jl @@ -42,6 +42,10 @@ test_gb_codes = [ generalized_bicycle_codes([0, 1, 14, 16, 22], [0, 3, 13, 20, 42], 63), # (A2) [[126, 28, 8]] ] +test_hcubic_codes = [ + haah_cubic_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 3) +] + other_lifted_product_codes = [] # [[882, 24, dโ‰ค24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite) @@ -150,7 +154,7 @@ const code_instance_args = Dict( :CSS => (c -> (parity_checks_x(c), parity_checks_z(c))).([Shor9(), Steane7(), Toric(4, 4)]), :Concat => [(Perfect5(), Perfect5()), (Perfect5(), Steane7()), (Steane7(), Cleve8()), (Toric(2, 2), Shor9())], :CircuitCode => random_circuit_code_args, - :LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, test_bb_codes, test_mbb_codes, test_coprimeBB_codes, other_lifted_product_codes)), + :LPCode => (c -> (c.A, c.B)).(vcat(LP04, LP118, test_gb_codes, test_bb_codes, test_mbb_codes, test_coprimeBB_codes, test_hcubic_codes, other_lifted_product_codes)), :QuantumReedMuller => [3, 4, 5] )