Skip to content

Commit 5531336

Browse files
Fe-r-ozKrastanov
andauthored
add check_repr_commutation_relation to test the CSS orthogonality condition for 2BGA's Group Algebra with a General Group G (#403)
Co-authored-by: Stefan Krastanov <[email protected]>
1 parent 406e5ea commit 5531336

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ using DocStringExtensions
55
import QuantumClifford, LinearAlgebra
66
import Hecke: Group, GroupElem, AdditiveGroup, AdditiveGroupElem,
77
GroupAlgebra, GroupAlgebraElem, FqFieldElem, representation_matrix, dim, base_ring,
8-
multiplication_table, coefficients, abelian_group, group_algebra
8+
multiplication_table, coefficients, abelian_group, group_algebra, rand
99
import Nemo
1010
import Nemo: characteristic, matrix_repr, GF, ZZ, lift
1111

1212
import QuantumClifford.ECC: AbstractECC, CSS, ClassicalCode,
1313
hgp, code_k, code_n, code_s, iscss, parity_checks, parity_checks_x, parity_checks_z, parity_checks_xz,
14-
two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes
14+
two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation
1515

16+
include("util.jl")
1617
include("types.jl")
1718
include("lifted.jl")
1819
include("lifted_product.jl")

ext/QuantumCliffordHeckeExt/util.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Checks the commutation relation between the left and right representation matrices
3+
for two randomly-sampled elements `a` and `b` in the group algebra `ℱ[G]` with a general group `G`.
4+
It verifies the commutation relation that states, `L(a)·R(b) = R(b)·L(a)`. This
5+
property shows that matrices from the left and right representation sets commute
6+
with each other, which is an important property related to the CSS orthogonality
7+
condition.
8+
"""
9+
function check_repr_commutation_relation(GA::GroupAlgebra)
10+
a, b = rand(GA), rand(GA)
11+
# Check commutation relation: L(a)R(b) = R(b)L(a)
12+
L_a = representation_matrix(a)
13+
R_b = representation_matrix(b, :right)
14+
return L_a * R_b == R_b * L_a
15+
end

src/ecc/codes/util.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ function hgp(h₁,h₂)
66
hz = hcat(kron(LinearAlgebra.I(n₁), h₂), kron(h₁', LinearAlgebra.I(r₂)))
77
hx, hz
88
end
9+
10+
"""Implemented in a package extension with Hecke."""
11+
function check_repr_commutation_relation end

test/test_ecc_base.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Test
22
using QuantumClifford
33
using QuantumClifford.ECC
4+
using QuantumClifford.ECC: check_repr_commutation_relation
45
using InteractiveUtils
56

67
import Nemo: GF
@@ -46,6 +47,7 @@ other_lifted_product_codes = []
4647
# [[882, 24, d≤24]] code from (B1) in Appendix B of [panteleev2021degenerate](@cite)
4748
l = 63
4849
GA = group_algebra(GF(2), abelian_group(l))
50+
@test check_repr_commutation_relation(GA) # TODO use this check more pervasively throughout the test suite
4951
A = zeros(GA, 7, 7)
5052
x = gens(GA)[]
5153
A[LinearAlgebra.diagind(A)] .= x^27

0 commit comments

Comments
 (0)