Skip to content

Commit

Permalink
Check representation matrix commutation relation for the CSS orthogon…
Browse files Browse the repository at this point in the history
…ality condition of the 2BGA code
  • Loading branch information
Fe-r-oz committed Oct 23, 2024
1 parent 6a8dbb4 commit cb8cc64
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ext/QuantumCliffordHeckeExt/QuantumCliffordHeckeExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ 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
multiplication_table, coefficients, abelian_group, group_algebra, rand
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
two_block_group_algebra_codes, generalized_bicycle_codes, bicycle_codes, check_repr_commutation_relation

include("util.jl")
include("types.jl")
include("lifted.jl")
include("lifted_product.jl")
Expand Down
15 changes: 15 additions & 0 deletions ext/QuantumCliffordHeckeExt/util.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"""
Checks the commutation relation between the left and right representation matrices
for two elements `a` and `b` in the group algebra `ℱ[G]` with a general group `G`.
It verifies the commutation relation that states, `L(a) R(b) = R(b) L(a)`. This
property shows that matrices from the left and right representation sets commute
with each other, which is an important property related to the CSS orthogonality
condition.
"""
function check_repr_commutation_relation(GA::GroupAlgebra)
a, b = rand(GA), rand(GA)
# Check commutation relation: L(a) R(b) == R(b) L(a)
L_a = representation_matrix(a)
R_a = representation_matrix(b, :right)
return L_a * R_a == R_a * L_a
end
2 changes: 1 addition & 1 deletion src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ abstract type AbstractECC end

export parity_checks, parity_checks_x, parity_checks_z, iscss,
code_n, code_s, code_k, rate, distance,
isdegenerate, faults_matrix,
isdegenerate, faults_matrix, check_repr_commutation_relation,
naive_syndrome_circuit, shor_syndrome_circuit, naive_encoding_circuit,
RepCode, LiftedCode,
CSS,
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 @@ -17,3 +17,6 @@ function generalized_bicycle_codes end

"""Implemented in a package extension with Hecke."""
function bicycle_codes end

"""Implemented in a package extension with Hecke."""
function check_repr_commutation_relation end
1 change: 1 addition & 0 deletions test/test_ecc_base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,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_commutation_relation(GA) == true
A = zeros(GA, 7, 7)
x = gens(GA)[]
A[LinearAlgebra.diagind(A)] .= x^27
Expand Down

0 comments on commit cb8cc64

Please sign in to comment.