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

add check_repr_commutation_relation to test the CSS orthogonality condition for 2BGA's Group Algebra with a General Group G #403

Merged
merged 5 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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)
Fe-r-oz marked this conversation as resolved.
Show resolved Hide resolved
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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's not export it for now, just keep it as an internal check

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
Fe-r-oz marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this check expected to be used anywhere else if merged?

Also, you do not need to do == true -- the result is already a boolean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check will be used by all the tests PRs. Since we are extending the functionality to a finite general group via group presentation, usually non-abelian, this checks whether this commutation relation holds for such groups.

A = zeros(GA, 7, 7)
x = gens(GA)[]
A[LinearAlgebra.diagind(A)] .= x^27
Expand Down
Loading