Skip to content

Commit

Permalink
add consistency check to verify F-linear regular representation for G…
Browse files Browse the repository at this point in the history
…roup Algebra elements
  • Loading branch information
Fe-r-oz committed Oct 29, 2024
1 parent f3eb7cd commit ba14529
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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

include("util.jl")
include("types.jl")
include("lifted.jl")
include("lifted_product.jl")
Expand Down
17 changes: 17 additions & 0 deletions ext/QuantumCliffordHeckeExt/util.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
""""
Verifies that the specified group elements constitute a regular F-linear representation
of the group G by checking the properties L(a)L(b) = L(ab) and R(a)R(b) = R(ba) for any

Check warning on line 3 in ext/QuantumCliffordHeckeExt/util.jl

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"ba" should be "by" or "be".
elements a, b in the group algebra F[G].
"""
function check_repr_regular_linear(GA::GroupAlgebra)
a, b = rand(GA), rand(GA)
# L(a)L(b) = L(ab)
L_a = representation_matrix(a)
L_b = representation_matrix(b)
L_ab = representation_matrix(a*b)
# R(a)R(b) = R(ba)

Check warning on line 12 in ext/QuantumCliffordHeckeExt/util.jl

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"ba" should be "by" or "be".
R_a = representation_matrix(a, :right)
R_b = representation_matrix(b, :right)
R_ba = representation_matrix(b*a, :right)

Check warning on line 15 in ext/QuantumCliffordHeckeExt/util.jl

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"ba" should be "by" or "be".
return L_a * L_b == L_ab && R_a * R_b == R_ba

Check warning on line 16 in ext/QuantumCliffordHeckeExt/util.jl

View workflow job for this annotation

GitHub Actions / Spell Check with Typos

"ba" should be "by" or "be".
end
3 changes: 3 additions & 0 deletions src/ecc/codes/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ function hgp(h₁,h₂)
hz = hcat(kron(LinearAlgebra.I(n₁), h₂), kron(h₁', LinearAlgebra.I(r₂)))
hx, hz
end

"""Implemented in a package extension with Hecke."""
function check_repr_regular_linear end
2 changes: 2 additions & 0 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Test
using QuantumClifford
using QuantumClifford.ECC
using QuantumClifford.ECC: check_repr_regular_linear
using InteractiveUtils

import Nemo: GF
Expand Down Expand Up @@ -46,6 +47,7 @@ other_lifted_product_codes = []
# [[882, 24, d≤24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite)
l = 63
GA = group_algebra(GF(2), abelian_group(l))
@test check_repr_regular_linear(GA)
A = zeros(GA, 7, 7)
x = gens(GA)[]
A[LinearAlgebra.diagind(A)] .= x^27
Expand Down

0 comments on commit ba14529

Please sign in to comment.