Skip to content

Commit

Permalink
Enhancements: fix QuantumSavory#405, new API, decoder testing for non…
Browse files Browse the repository at this point in the history
…-abelian 2BGA, and misc polish
  • Loading branch information
Fe-r-oz committed Oct 26, 2024
1 parent de9b0f3 commit eb74d23
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 9 deletions.
27 changes: 27 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,30 @@ @article{lin2024quantum
year={2024},
publisher={APS}
}

@inproceedings{wang2023abelian,
title={Abelian and non-Abelian quantum two-block codes},
author={Wang, Renyu and Lin, Hsiang-Ku and Pryadko, Leonid P},
booktitle={2023 12th International Symposium on Topics in Coding (ISTC)},
pages={1--5},
year={2023},
organization={IEEE}
}

@article{naghipour2015quantum,
title={Quantum stabilizer codes from Abelian and non-Abelian groups association schemes},
author={Naghipour, Avaz and Jafarizadeh, Mohammad Ali and Shahmorad, Sedaghat},
journal={International Journal of Quantum Information},
volume={13},
number={03},
pages={1550021},
year={2015},
publisher={World Scientific}
}

@article{willenborg2023dihedral,
title={Dihedral Quantum Codes},
author={Willenborg, Nadja and Borello, Martino and Horlemann, Anna-Lena and Islam, Habibul},
journal={arXiv preprint arXiv:2310.15092},
year={2023}
}
3 changes: 3 additions & 0 deletions docs/src/references.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ For quantum code construction routines:
- [campbell2012magic](@cite)
- [anderson2014fault](@cite)
- [lin2024quantum](@cite)
- [wang2023abelian](@cite)
- [naghipour2015quantum](@cite)
- [willenborg2023dihedral](@cite)

For classical code construction routines:
- [muller1954application](@cite)
Expand Down
7 changes: 5 additions & 2 deletions ext/QuantumCliffordOscarExt/QuantumCliffordOscarExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ using DocStringExtensions

import Nemo
import Nemo: FqFieldElem
import Hecke: group_algebra, GF, abelian_group, gens, quo, one, GroupAlgebra
import Hecke: group_algebra, GF, abelian_group, gens, quo, one, GroupAlgebra, GroupAlgebraElem
import Oscar
import Oscar: free_group, small_group_identification, describe, order, FPGroupElem, FPGroup, FPGroupElem
import Oscar: free_group, small_group_identification, describe, order, FPGroupElem, FPGroup, FPGroupElem,
semidirect_product, automorphism_group, hom, gen, cyclic_group, SemidirectProductGroup, PcGroup,
BasicGAPGroupElem, normal_subgroup

import QuantumClifford.ECC: two_block_group_algebra_codes

include("group_presentation.jl")
include("semidirect_product.jl")

end # module
6 changes: 3 additions & 3 deletions ext/QuantumCliffordOscarExt/group_presentation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
For quantum error-correcting codes, such as the two-block algebra (2BGA) code, functionalities
like designing specific group presentations for both abelian and non-abelian groups are crucial.
These specific presentations are the key ingredient for construction of group algebra of 2BGA
These specific presentations are the key ingredient for the construction of group algebra of 2BGA
with abelian and non-abelian groups.
# Example
Expand Down Expand Up @@ -80,13 +80,13 @@ julia> code_n(c), code_k(c)
Dihedral groups with specific group presentations `Dₘ = ⟨r, s|rᵐ = s² = (rs)² = 1⟩` where order
is `2m` are supported.
To construct a group algebra for non-abelian Dihedral groups, specify the group's presentation
To construct a group algebra for non-abelian dihedral groups, specify the group's presentation
`⟨S|R⟩` using its generators `S` and defining relations `R`.
# Example
[[24, 8, 3]] 2BGA code from Appendix C, Table III of [lin2024quantum](@cite) for non-abelian
Dihedral group `D₆`.
dihedral group `D₆`.
```jldoctest finitegrp
julia> m = 6;
Expand Down
58 changes: 58 additions & 0 deletions ext/QuantumCliffordOscarExt/semidirect_product.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
"""
# Semidirect Product of Groups
The semidirect product of groups `Gₘ ⋉ Gₙ` is supported, where `m` and `n` represent
the orders of the groups `Gₘ` and `Gₙ`, respectively. This functionality enhances the
capabilities of 2BGA codes, as the resulting group is used to construct the group
algebra for these codes.
# Example:`Cₘ ⋉ C₂`
The non-abelian [[24, 8, 3]] 2BGA code is constructed from the dihedral group
`Dₘ = Cₘ ⋉ C₂`, with an order of `l = 12` and a standard group presentation, as
defined in Appendix C, Table III of [lin2024quantum](@cite).
```jldoctest semidirectproduct
julia> using Nemo: FqFieldElem # hide
julia> using Hecke: group_algebra, GF, abelian_group, gens, quo, one, GroupAlgebra, GroupAlgebraElem # hide
julia> using Oscar: small_group_identification, describe, order, FPGroupElem, FPGroup, FPGroupElem, semidirect_product, automorphism_group, hom, gen, cyclic_group, SemidirectProductGroup, PcGroup, BasicGAPGroupElem, normal_subgroup # hide
julia> m = 6;
julia> Cₘ = cyclic_group(m);
julia> C₂ = cyclic_group(2);
julia> A = automorphism_group(Cₘ); # Given dihedral group presentation, choose r -> r⁻¹
julia> au = A(hom(Cₘ,Cₘ,[Cₘ[1]],[Cₘ[1]^-1]));
julia> f = hom(C₂,A,[C₂[1]],[au]);
julia> G = semidirect_product(Cₘ,f,C₂);
julia> GA = group_algebra(GF(2), G);
julia> r, s = gens(GA)[2], gens(GA)[3];
julia> a = [one(r), r^4];
julia> b = [one(r), s*r^4, r^3, r^4, s*r^2, r];
julia> c = twobga_via_semidirect_product(a, b, GA);
julia> order(G), describe(G)
(12, "D12")
julia> describe(normal_subgroup(G)), small_group_identification(G)
("C6", (12, 4))
```
"""
function twobga_via_semidirect_product(a_elts::Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, SemidirectProductGroup{PcGroup, PcGroup}, BasicGAPGroupElem{SemidirectProductGroup{PcGroup, PcGroup}}}}}, b_elts::Vector{GroupAlgebraElem{FqFieldElem, GroupAlgebra{FqFieldElem, SemidirectProductGroup{PcGroup, PcGroup}, BasicGAPGroupElem{SemidirectProductGroup{PcGroup, PcGroup}}}}}, GA::GroupAlgebra{FqFieldElem, SemidirectProductGroup{PcGroup, PcGroup}, BasicGAPGroupElem{SemidirectProductGroup{PcGroup, PcGroup}}})
a = sum(GA(x) for x in a_elts)
b = sum(GA(x) for x in b_elts)
c = two_block_group_algebra_codes(a,b)
return c
end
7 changes: 5 additions & 2 deletions src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export parity_checks, parity_checks_x, parity_checks_z, iscss,
Toric, Gottesman, Surface, Concat, CircuitCode, QuantumReedMuller,
LPCode, two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes,
random_brickwork_circuit_code, random_all_to_all_circuit_code,
twobga_from_fp_group,
twobga_from_fp_group, twobga_via_semidirect_product,
evaluate_decoder,
CommutationCheckECCSetup, NaiveSyndromeECCSetup, ShorSyndromeECCSetup,
TableDecoder,
Expand Down Expand Up @@ -387,6 +387,9 @@ include("codes/classical/lifted.jl")
include("codes/lifted_product.jl")

# group presentation
include("codes/group_presentation.jl")
include("codes/twobga_extension/group_presentation.jl")

# semidirect product
include("codes/twobga_extension/semidirect_product.jl")

end #module
File renamed without changes.
12 changes: 12 additions & 0 deletions src/ecc/codes/twobga_extension/semidirect_product.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
"""
The `twobga_via_semidirect_product` method constructs the semidirect product `Gₘ ⋉ Gₙ` of groups, where `m` and `n` represent the order of each group, respectively.
Implemented as a package extension with Oscar. Check the [QuantumClifford documentation](http://qc.quantumsavory.org/stable/ECC_API/) for more details on that extension.
"""
function twobga_via_semidirect_product(args...)
ext = Base.get_extension(QuantumClifford, :QuantumCliffordOscarExt)
if isnothing(ext)
throw("The `twobga_via_semidirect_product` depends on the package `Oscar` but you have not installed or imported it yet. Immediately after you import `Oscar`, the `twobga_via_semidirect_product` will be available.")
end
return ext.twobga_via_semidirect_product(args...)
end
32 changes: 30 additions & 2 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using InteractiveUtils
import Nemo: GF
import LinearAlgebra
import Hecke: group_algebra, abelian_group, gens, quo, one
import Oscar: free_group
import Oscar: free_group, semidirect_product, automorphism_group, hom, cyclic_group

# generate instances of all implemented codes to make sure nothing skips being checked

Expand Down Expand Up @@ -97,7 +97,35 @@ a = [one(G), x^6]
b = [one(G), s * x^7, s * x^4, x^6, s * x^5, s * x^2]
tb22 = twobga_from_fp_group(a, b, GA)

test_twobga_codes = [t1b1, t1b3, tb21, tb22]
# [[24, 8, 3]] dihedral 2BGA taken from Appendix C, Table III of [lin2024quantum](@cite)
m = 6
Cₘ = cyclic_group(m)
C₂ = cyclic_group(2)
A = automorphism_group(Cₘ); # Given dihedral group presentation, choose r -> r⁻¹
au = A(hom(Cₘ,Cₘ,[Cₘ[1]],[Cₘ[1]^-1]))
f = hom(C₂,A,[C₂[1]],[au])
G = semidirect_product(Cₘ,f,C₂)
GA = group_algebra(GF(2), G)
r, s = gens(GA)[2], gens(GA)[3]
a = [one(r), r^4]
b = [one(r), s*r^4, r^3, r^4, s*r^2, r]
tb31 = twobga_via_semidirect_product(a, b, GA)

# [[64, 32, 2]] dihedral 2BGA taken from Appendix C, Table III of [lin2024quantum](@cite)
m = 16
Cₘ = cyclic_group(m)
C₂ = cyclic_group(2)
A = automorphism_group(Cₘ); # Given dihedral group presentation, choose r -> r⁻¹
au = A(hom(Cₘ,Cₘ,[Cₘ[1]],[Cₘ[1]^-1]))
f = hom(C₂,A,[C₂[1]],[au])
G = semidirect_product(Cₘ,f,C₂)
GA = group_algebra(GF(2), G)
r, s = gens(GA)[2], gens(GA)[3]
a = [one(r), r^8]
b = [one(r), s*r^11, s*r^12, r^8, s*r^3, s*r^4]
tb32 = twobga_via_semidirect_product(a, b, GA)

test_twobga_codes = [t1b1, t1b3, tb21, tb22, tb31, tb32]

const code_instance_args = Dict(
:Toric => [(3,3), (4,4), (3,6), (4,3), (5,5)],
Expand Down

0 comments on commit eb74d23

Please sign in to comment.