diff --git a/docs/src/references.bib b/docs/src/references.bib index 88cf79fe1..fb042b24f 100644 --- a/docs/src/references.bib +++ b/docs/src/references.bib @@ -584,3 +584,10 @@ @article{bhatia2018mceliece journal={arXiv preprint arXiv:1811.06246}, year={2018} } + +@article{eberhardt2024logical, + title={Logical operators and fold-transversal gates of bivariate bicycle codes}, + author={Eberhardt, Jens Niklas and Steffan, Vincent}, + journal={arXiv preprint arXiv:2407.03973}, + year={2024} +} diff --git a/docs/src/references.md b/docs/src/references.md index 54ce2a679..a02078cc5 100644 --- a/docs/src/references.md +++ b/docs/src/references.md @@ -45,6 +45,7 @@ For quantum code construction routines: - [lin2024quantum](@cite) - [bravyi2024high](@cite) - [haah2011local](@cite) +- [eberhardt2024logical](@cite) For classical code construction routines: - [muller1954application](@cite) diff --git a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl index 89d7bae0c..5a3c862a4 100644 --- a/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl +++ b/ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl @@ -5,14 +5,14 @@ using DocStringExtensions import QuantumClifford, LinearAlgebra import Hecke: Group, GroupElem, AdditiveGroup, AdditiveGroupElem, GroupAlgebra, GroupAlgebraElem, FqFieldElem, representation_matrix, dim, base_ring, - multiplication_table, coefficients, abelian_group, group_algebra, rand + multiplication_table, coefficients, abelian_group, group_algebra, rand, gens import Nemo 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, - haah_cubic_codes + haah_cubic_codes, honeycomb_color_codes include("util.jl") include("types.jl") diff --git a/ext/QuantumCliffordHeckeExt/lifted_product.jl b/ext/QuantumCliffordHeckeExt/lifted_product.jl index 66bd35ed6..7edf12057 100644 --- a/ext/QuantumCliffordHeckeExt/lifted_product.jl +++ b/ext/QuantumCliffordHeckeExt/lifted_product.jl @@ -255,7 +255,8 @@ julia> B = šœ‹^8 + šœ‹^14 + šœ‹^47; (108, 12) ``` -See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), [`haah_cubic_codes`](@ref). +See also: [`LPCode`](@ref), [`generalized_bicycle_codes`](@ref), [`bicycle_codes`](@ref), [`haah_cubic_codes`](@ref), +[`honeycomb_color_codes`](@ref). """ function two_block_group_algebra_codes(a::GroupAlgebraElem, b::GroupAlgebraElem) LPCode([a;;], [b;;]) @@ -301,7 +302,8 @@ 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), [`haah_cubic_codes`](@ref). +See also: [`two_block_group_algebra_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`haah_cubic_codes`](@ref), +[`honeycomb_color_codes`](@ref). """ # TODO doctest example function bicycle_codes(a_shifts::Array{Int}, l::Int) GA = group_algebra(GF(2), abelian_group(l)) @@ -323,7 +325,8 @@ julia> code_n(c), code_k(c) (432, 8) ``` -See also: [`bicycle_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`two_block_group_algebra_codes`](@ref). +See also: [`bicycle_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`two_block_group_algebra_codes`](@ref), +[`honeycomb_color_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])) @@ -331,3 +334,31 @@ function haah_cubic_codes(a_shifts::Array{Int}, b_shifts::Array{Int}, l::Int) b = sum(GA[n%dim(GA)+1] for n in b_shifts) two_block_group_algebra_codes(a, b) end + +""" +The honeycomb color codes [eberhardt2024logical](@cite) are exactly the Bivariate +Bicycle (BB) codes defined by the polynomials `c = 1 + x + xy` and `d = 1 + y + xy`, +provided that both `ā„“` and `m` are divisible by three. + +The ECC Zoo has an [entry for this family](https://errorcorrectionzoo.org/c/triangular_color). + +```jldoctest +julia> ā„“ = 9; m = 6; + +julia> c = honeycomb_color_codes(ā„“, m); + +julia> code_n(c), code_k(c) +(108, 4) +``` + +See also: [`bicycle_codes`](@ref), [`generalized_bicycle_codes`](@ref), [`two_block_group_algebra_codes`](@ref), +[`honeycomb_color_codes`](@ref). +""" +function honeycomb_color_codes(ā„“::Int, m::Int) + (ā„“ % 3 == 0 && m % 3 == 0) || throw(ArgumentError("Both ā„“ and m must be divisible by 3")) + GA = group_algebra(GF(2), abelian_group([ā„“, m])) + x, y = gens(GA) + c = 1 + x + x*y + d = 1 + y + x*y + two_block_group_algebra_codes(c, d) +end diff --git a/src/ecc/ECC.jl b/src/ecc/ECC.jl index 9d6568c72..643818bbe 100644 --- a/src/ecc/ECC.jl +++ b/src/ecc/ECC.jl @@ -29,7 +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, + haah_cubic_codes, honeycomb_color_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 2a0c2c36f..b3831f765 100644 --- a/src/ecc/codes/lifted_product.jl +++ b/src/ecc/codes/lifted_product.jl @@ -20,3 +20,6 @@ function bicycle_codes end """Implemented in a package extension with Hecke.""" function haah_cubic_codes end + +"""Implemented in a package extension with Hecke.""" +function honeycomb_color_codes end diff --git a/test/test_ecc_base.jl b/test/test_ecc_base.jl index 7c1d12ef5..9a55de6e8 100644 --- a/test/test_ecc_base.jl +++ b/test/test_ecc_base.jl @@ -46,6 +46,12 @@ test_hcubic_codes = [ haah_cubic_codes([0, 15, 20, 28, 66], [0, 58, 59, 100, 121], 3) ] +# honeycomb color codes from [eberhardt2024logical](@cite). +test_honeycomb_color_codes = [ + honeycomb_color_codes(6 , 6), honeycomb_color_codes(9 , 6), + honeycomb_color_codes(12, 6), honeycomb_color_codes(12, 9), +] + other_lifted_product_codes = [] # [[882, 24, dā‰¤24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite) @@ -154,7 +160,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, test_hcubic_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, test_honeycomb_color_codes, other_lifted_product_codes)), :QuantumReedMuller => [3, 4, 5] )