..nodoctest

Symplectic matrices

x.__init__(...) initializes x; see help(type(x)) for signature

recip.symplectic_matrices.ABCD(M, m=None, n=None)

Returns matrices A, B, C, D such that M equals ( A B ) ( C D ) and A is mxn. If m (resp. n) is not specified, then it is half the number of rows (resp. columns) of M.

class recip.symplectic_matrices.GSp_element(arg1, arg2=None, ring=None)
A matrix
M = iota(nu^-1) * S

where iota(t) = diag(1,1,...,1,t^-1,t^-1,...,t^-1) and S is in Sp_{2g} It acts from the right on theta_ring, where iota(t) acts as t on coefficients, and S acts via the usual action.

Sp_part()
action_on_theta_generators(den)

EXAMPLES:

sage: class Foo:
....:     def __init__(self, x):
....:         self._x = x
....:     @cached_method
....:     def f(self,*args):
....:         return self._x^2
sage: a = Foo(2)
sage: a.f.cache
{}
sage: a.f()
4
sage: a.f.cache
{((), ()): 4}
base_ring()

Returns the base ring of self.

g()
matrix(base_ring=None)
nu()
parent()
transpose()

Returns the transpose of self.

EXAMPLE:

sage: from recip import *
sage: M = GSp_element([[0,-1,1,1],[5,0,4,-5],[0,-2,2,1],[1,0,1,-1]])
sage: M.transpose()
[ 0  5  0  1]
[-1  0 -2  0]
[ 1  4  2  1]
[ 1 -5  1 -1]
class recip.symplectic_matrices.GSp_group(n, m)

The group GSp(n, R) for R = Zmod(m).

EXAMPLES:

sage: from recip import *
sage: l = GSp_group(4, 2).list() # long time, 2 seconds
sage: len(l) # long time
720
list()

Returns a list of all elements of self. Slow!

EXAMPLES:

sage: from recip import *
sage: GSp_group(2, 2).list()
[
[1 0]  [0 1]  [1 1]  [1 1]  [1 0]  [0 1]
[0 1], [1 0], [0 1], [1 0], [1 1], [1 1]
]
order()

Returns the order of self. Way too slow!!

EXAMPLES:

sage: from recip import *
sage: GSp_group(2, 5).order() # long time, 1 second
480
recip.symplectic_matrices.Omega(g)

Returns the 2g x 2g matrix given in terms of gxg blocks as ((0, -1) (1, 0))

class recip.symplectic_matrices.Sp_group(n, m)

The group Sp(n, R) for R = Zmod(m).

EXAMPLES:

sage: from recip import *
sage: l = Sp_group(4, 2).list() # long time, 2 seconds
sage: len(l) # depends on previous line with long time
720
list()

Returns a list of all elements of self. Slow!

This uses that Sp_2n(ZZ) maps surjectively to Sp_2n(ZZ/mZZ), hence the generators of Sp_2n(ZZ) generate Sp_2n(ZZ/mZZ)

EXAMPLES:

sage: from recip import *
sage: Sp_group(2, 2).list()
[
[1 0]  [0 1]  [1 1]  [1 1]  [1 0]  [0 1]
[0 1], [1 0], [0 1], [1 0], [1 1], [1 1]
]
order()

Returns the order of self. Way too slow!!

EXAMPLES:

sage: from recip import *
sage: Sp_group(2, 5).order()
120
recip.symplectic_matrices.Zmod_to_SL(a)

Given a in (ZZ/mu*ZZ)^*, outputs A in SL_2(ZZ) with A = ((a 0) (0 a^-1)) mod mu

recip.symplectic_matrices.diag(a)

Given a square matrix a, returns the list of diagonal entries of a.

EXAMPLES:

sage: from recip import *
sage: g = Matrix(Zmod(8),[(5,0,7,1),(6,6,0,7),(1,2,2,3),(2,3,5,4)])
sage: diag(g)
[5, 6, 2, 4]
recip.symplectic_matrices.group_generators_to_list(gens, G=None)

Given a finite list \(gens\) of elements of a group \(G\), assuming \(gens\) generates a finite subgroup \(H\) of \(G\), returns a list of all elements of \(H\).

recip.symplectic_matrices.matrix_from_blocks(A, B, C, D)

Given matrices A,B,C,D, returns a single matrix ( A B ) ( C D )

recip.symplectic_matrices.minimal_generating_subset(gens, G=None, order=None, k=0)

Given a finite list \(gens\) of elements of a group \(G\), assuming \(gens\) generates a finite subgroup \(H\) of \(G\), returns a minimal subset \(s\) of \(gens\) that generates \(H\).

Here minimal is with respect to inclusion, so it may not be the smallest such subset.

\(order\) is the order of \(H\), and \(s\) must gens[:k]

recip.symplectic_matrices.nu(m)

Given a 2g x 2g matrix m, returns a scalar nu such that m.transpose() * Omega(g) * m = nu * Omega(g) if it exists. Otherwise returns None.

recip.symplectic_matrices.random_symplectic_matrix(g, n, subgroup=None, level=None)

Returns the product of n random elements of symplectic_generators(g) and inverses of such.

See symplectic_generators for which subgroups are possible.

EXAMPLE:

sage: from recip import *
sage: M = random_symplectic_matrix(2, 20)
sage: M # random output
[ 0 -1  1  1]
[ 5  0  4 -5]
[ 0 -2  2  1]
[ 1  0  1 -1]
sage: is_symplectic(Matrix(M))
True
recip.symplectic_matrices.symplectic_generators(g, subgroup=None, level=None)

Returns a set of generators of Sp_2g(ZZ)

WARNING: I doubt the correctness of this function, I don’t get all the invariants that I expected to get.

recip.symplectic_matrices.zero_matrix(m, n=None, base_ring=Integer Ring)

Returns the m x n matrix with all zero coefficients over base_ring.

If n is unspecified, then n=m, if base_ring is unspecified, then base_ring = ZZ.