Utility functions for finite Abelian groups

Utility functions

dual_pairs.group_structure.find_group_structure(T)

Return the Abelian group structure with pairing matrix T.

INPUT:

  • T – a square matrix with rational entries in \([0,1)\)

OUTPUT:

A quadruple (M, E, p, q) consisting of

  • M – a finite Abelian group \(C_{d_0} \times C_{d_1} \times \ldots \times C_{d_{r-1}}\)

  • E – the matrix of the standard pairing \(M \times M^* \to \mathbf{Q}/\mathbf{Z}\), where M is ordered lexicographically and the dual group \(M^*\) is identified with M

  • p, q – permutations such that E is obtained by permuting the rows and columns of T according to p and q, respectively

TESTS:

sage: from dual_pairs.group_structure import find_group_structure, standard_group_structure
sage: T = matrix([[0, 0], [0, 1/2]])
sage: find_group_structure(T)
(
                                          [  0   0]
Additive abelian group isomorphic to Z/2, [  0 1/2],
[1, 2], [1, 2]
)
sage: T = matrix([[2/3, 1/3, 0], [0, 0, 0], [1/3, 2/3, 0]])
sage: find_group_structure(T)
(
                                          [  0   0   0]
                                          [  0 1/3 2/3]
Additive abelian group isomorphic to Z/3, [  0 2/3 1/3],
[2, 1, 3], [3, 2, 1]
)

sage: T = matrix([[0, 0, 0, 0], [0, 1/2, 0, 1/2],
....:             [0, 0, 1/2, 1/2], [0, 1/2, 1/2, 0]])
sage: find_group_structure(T)
(
                                                [  0   0   0   0]
                                                [  0 1/2   0 1/2]
                                                [  0   0 1/2 1/2]
Additive abelian group isomorphic to Z/2 + Z/2, [  0 1/2 1/2   0],
[1, 3, 2, 4], [1, 3, 2, 4]
)

A random example:

sage: d = [8, 4, 2]
sage: n = prod(d)
sage: S_n = SymmetricGroup(n)
sage: M, E = standard_group_structure(d)
sage: T = copy(E)
sage: T.permute_rows(S_n.random_element())
sage: T.permute_columns(S_n.random_element())
sage: M1, E1, p, q = find_group_structure(T)
sage: M1 == M
True
sage: E1 == E
True
sage: T.permute_rows(p)
sage: T.permute_columns(q)
sage: T == E
True
dual_pairs.group_structure.find_group_structure_old(T)

Old version of find_group_structure() (much slower, useless except maybe for debugging).

dual_pairs.group_structure.find_perm(x, y)

Return the permutation that when applied to x gives y.

dual_pairs.group_structure.mod1(x)

Return the fractional part of x.

dual_pairs.group_structure.standard_group_structure(d)

Return the standard Abelian group with the given structure.

INPUT:

  • d – list or tuple of integers \((d_0, d_1, \ldots, d_{r-1})\) with \(d_i\) dividing \(d_{i-1}\)

OUTPUT:

A pair (M, E) consisting of

  • M – the finite Abelian group \(C_{d_0} \times C_{d_1} \times \ldots \times C_{d_{r-1}}\)

  • E – the matrix \((\langle x,y\rangle)_{x\in M,y\in M^*}\) of the canonical pairing \(M \times M^* \to \mathbf{Q}/\mathbf{Z}\), where M is ordered lexicographically and the dual group \(M^*\) is identified with M, so that E is symmetric

TESTS:

sage: from dual_pairs.group_structure import standard_group_structure
sage: standard_group_structure([3])
(
                                          [  0   0   0]
                                          [  0 1/3 2/3]
Additive abelian group isomorphic to Z/3, [  0 2/3 1/3]
)
sage: standard_group_structure([2, 2])
(
                                                [  0   0   0   0]
                                                [  0 1/2   0 1/2]
                                                [  0   0 1/2 1/2]
Additive abelian group isomorphic to Z/2 + Z/2, [  0 1/2 1/2   0]
)