Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honeycomb color code via Hecke's Group Algebra #436

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
1 change: 1 addition & 0 deletions docs/src/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ For quantum code construction routines:
- [lin2024quantum](@cite)
- [bravyi2024high](@cite)
- [haah2011local](@cite)
- [eberhardt2024logical](@cite)

For classical code construction routines:
- [muller1954application](@cite)
Expand Down
4 changes: 2 additions & 2 deletions ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
37 changes: 34 additions & 3 deletions ext/QuantumCliffordHeckeExt/lifted_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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;;])
Expand Down Expand Up @@ -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))
Expand All @@ -323,11 +325,40 @@ 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]))
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

"""
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
2 changes: 1 addition & 1 deletion src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/ecc/codes/lifted_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion test/test_ecc_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]
)

Expand Down
Loading