40.1 Congruence subgroups of SL2(Z)

Module: sage.modular.congroup

Congruence subgroups of SL2(Z)

Sage can compute with the congruence subgroups $ \Gamma_0(N)$ , $ \Gamma_1(N)$ , and $ \Gamma_H(N)$ .

Author: William Stein

Module-level Functions

GammaH( level, H)

Return the congruence subgroup $ \Gamma_H(N)$ .

Input:

level
- an integer
H
- either 0, 1, or a list * If H is a list, return $ \Gamma_H(N)$ , where $ H$ is the subgroup of $ (\mathbf{Z}/N\mathbf{Z})^*$ *generated* by the elements of the list. * If H = 0, returns $ \Gamma_0(N)$ . * If H = 1, returns $ \Gamma_1(N)$ .

sage: GammaH(11,0)
Congruence Subgroup Gamma0(11)
sage: GammaH(11,1)
Congruence Subgroup Gamma1(11)
sage: GammaH(11,[2])
Congruence Subgroup Gamma_H(11) with H generated by [2]
sage: GammaH(11,[2,1])
Congruence Subgroup Gamma_H(11) with H generated by [2]

get_gcd( order)

get_inverse_mod( order)

is_CongruenceSubgroup( x)

is_Gamma0( x)

is_Gamma1( x)

is_GammaH( x)

is_SL2Z( x)

lift_to_sl2z( c, d, N)

If this Manin symbol is (c,d) viewed modulo N, this function computes and returns a list [a,b, c',d'] that defines a 2x2 matrix with determinant 1 and integer entries, such that c=c'(mod N) and d=d'(mod N).

Class: CongruenceSubgroup

class CongruenceSubgroup
CongruenceSubgroup( self, level)

Functions: are_equivalent,$  $ coset_reps,$  $ generators,$  $ is_abelian,$  $ is_even,$  $ is_finite,$  $ is_odd,$  $ is_subgroup,$  $ level,$  $ modular_abelian_variety,$  $ modular_symbols,$  $ order

is_even( self)

Return True precisely if this subgroup contains the matrix -1.

is_odd( self)

Return True precisely if this subgroup does not contain the matrix -1.

modular_abelian_variety( self)

Return the corresponding modular abelian variety.

sage: Gamma0(11).modular_abelian_variety()
Abelian variety J0(11) of dimension 1
sage: Gamma1(11).modular_abelian_variety()
Abelian variety J1(11) of dimension 1
sage: GammaH(11,[3]).modular_abelian_variety()
Abelian variety JH(11,[3]) of dimension 1

modular_symbols( self, [sign=0], [weight=2], [base_ring=Rational Field])

sage: G = Gamma0(23)
sage: G.modular_symbols()
Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign
0 over Rational Field
sage: G.modular_symbols(weight=4)
Modular Symbols space of dimension 12 for Gamma_0(23) of weight 4 with sign
0 over Rational Field
sage: G.modular_symbols(base_ring=GF(7))
Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign
0 over Finite Field of size 7
sage: G.modular_symbols(sign=1)
Modular Symbols space of dimension 3 for Gamma_0(23) of weight 2 with sign
1 over Rational Field

Special Functions: __call__,$  $ __cmp__,$  $ __init__,$  $ _new_group_from_level,$  $ _repr_

_new_group_from_level( self, level)

Return a new group of the same type (Gamma0, Gamma1, or GammaH) as self of the given level. In the case that self is of type GammaH, we take the largest H inside 1989#412 which maps to H, namely its inverse image under the natural map.

sage: G = Gamma0(20)
sage: G._new_group_from_level(4)
Congruence Subgroup Gamma0(4)
sage: G._new_group_from_level(40)
Congruence Subgroup Gamma0(40)

sage: G = Gamma1(10)
sage: G._new_group_from_level(6)
Traceback (most recent call last):
...
ValueError: one level must divide the other

sage: G = GammaH(50,[3,37])
sage: G
Congruence Subgroup Gamma_H(50) with H generated by [3, 37]
sage: G._new_group_from_level(25)
Congruence Subgroup Gamma_H(25) with H generated by [3, 12]
sage: G._new_group_from_level(100)
Congruence Subgroup Gamma_H(100) with H generated by [3, 37, 53, 87]

Class: Gamma0

class Gamma0
The congruence subgroup $ \Gamma_0(N)$ .

sage: G = Gamma0(11); G
Congruence Subgroup Gamma0(11)
sage: loads(G.dumps()) == G
True
Gamma0( self, level)

Functions: coset_reps,$  $ gamma_h_subgroups,$  $ generators,$  $ is_even,$  $ is_subgroup

coset_reps( self)

Return representatives for the right cosets of this congruence subgroup in $ {\rm SL}_2(\mathbf{Z})$ as a generator.

Use list(self.coset_reps()) to obtain coset reps as a list.

gamma_h_subgroups( self)

Return the subgrops of the form $ \Gamma_H(N)$ contained in self, where $ N$ is the level of self.

sage: G = Gamma0(11)
sage: G.gamma_h_subgroups()
[Congruence Subgroup Gamma_H(11) with H generated by [2], Congruence
Subgroup Gamma_H(11) with H generated by [4], Congruence Subgroup
Gamma_H(11) with H generated by [10], Congruence Subgroup Gamma_H(11) with
H generated by []]
sage: G = Gamma0(12)
sage: G.gamma_h_subgroups()
[Congruence Subgroup Gamma_H(12) with H generated by [5, 7], Congruence
Subgroup Gamma_H(12) with H generated by [7], Congruence Subgroup
Gamma_H(12) with H generated by [5], Congruence Subgroup Gamma_H(12) with H
generated by []]

generators( self)

Return generators for this congruence subgroup.

sage: for g in Gamma0(3).generators():
...     print g
...     print '---'
[1 1]
[0 1]
---
[-1  0]
[ 0 -1]
---
...
---
[-2  1]
[-3  1]
---

is_even( self)

Return True precisely if this subgroup contains the matrix -1.

is_subgroup( self, right)

Return True if self is a subgroup of right.

Special Functions: __cmp__,$  $ __init__,$  $ _generators_for_H,$  $ _latex_,$  $ _list_of_elements_in_H,$  $ _repr_

_generators_for_H( self)

sage: Gamma0(15)._generators_for_H()
[11, 7]

_list_of_elements_in_H( self)

Returns a sorted list of Python ints that are representatives between 0 and N-1 of the elements of H.

sage: G = Gamma0(11)
sage: G._list_of_elements_in_H()
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Class: Gamma1

class Gamma1
The congruence subgroup $ \Gamma_1(N)$ .

sage: G = Gamma1(11); G
Congruence Subgroup Gamma1(11)
sage: loads(G.dumps()) == G
True
Gamma1( self, level)

Functions: generators,$  $ is_even,$  $ is_subgroup

generators( self)

Return generators for this congruence subgroup.

sage: for g in Gamma1(3).generators():
...     print g
...     print '---'
[1 1]
[0 1]
---
[ 31 -14]
[ 51 -23]
---
[-5  4]
[-9  7]
---
...
---
[4 3]
[9 7]
---
[ -5  -2]
[-12  -5]
---

is_even( self)

Return True precisely if this subgroup contains the matrix -1.

is_subgroup( self, right)

Return True if self is a subgroup of right.

sage: Gamma1(3).is_subgroup(SL2Z())
True
sage: Gamma1(3).is_subgroup(Gamma1(5))
False
sage: Gamma1(3).is_subgroup(Gamma1(6))
False
sage: Gamma1(6).is_subgroup(Gamma1(3))
True

Special Functions: __cmp__,$  $ __init__,$  $ _latex_,$  $ _repr_

Class: GammaH_class

class GammaH_class
The congruence subgroup $ \Gamma_H(N)$ .
GammaH_class( self, level, H)

Functions: divisor_subgroups,$  $ generators,$  $ is_even,$  $ restrict

divisor_subgroups( self)

Given this congruence subgroup $ \Gamma_H(N)$ , return all subgroups $ \Gamma_G(M)$ for $ M$ a divisor of $ N$ and such that $ G$ is equal to the image of $ H$ modulo $ M$ .

sage: G = GammaH(33,[2]); G
Congruence Subgroup Gamma_H(33) with H generated by [2]
sage: G._list_of_elements_in_H()
[1, 2, 4, 8, 16, 17, 25, 29, 31, 32]
sage: G.divisor_subgroups()
[Congruence Subgroup Gamma_H(1) with H generated by [],
 Congruence Subgroup Gamma_H(3) with H generated by [2],
 Congruence Subgroup Gamma_H(11) with H generated by [2],
 Congruence Subgroup Gamma_H(33) with H generated by [2]]

generators( self)

Return generators for this congruence subgroup.

sage: for g in GammaH(3, [2]).generators():
...     print g
...     print '---'
[1 1]
[0 1]
---
[-1  0]
[ 0 -1]
---
[ 1 -1]
[ 0  1]
---
[ 1 -1]
[ 3 -2]
---
[ 2 -1]
[ 3 -1]
---
[-2  1]
[-3  1]
---

is_even( self)

Return True precisely if this subgroup contains the matrix -1.

restrict( self, M)

Return the subgroup of $ \Gamma_0(M)$ obtained by taking $ H$ to be the image of the $ H$ at level $ N$ modulo $ M$ .

sage: G = GammaH(33,[2])
sage: G.restrict(11)
Congruence Subgroup Gamma_H(11) with H generated by [2]
sage: G.restrict(1)
Congruence Subgroup Gamma_H(1) with H generated by []
sage: G.restrict(15)
Traceback (most recent call last):
...
ValueError: M (=15) must be a divisor of the level (33) of self

Special Functions: __cmp__,$  $ __init__,$  $ _coset_reduction_data,$  $ _coset_reduction_data_first_coord,$  $ _coset_reduction_data_second_coord,$  $ _generators_for_H,$  $ _latex_,$  $ _list_of_elements_in_H,$  $ _reduce_coset,$  $ _reduce_cusp,$  $ _repr_

_coset_reduction_data( self)

Compute data used for determining the canonical coset representative of an element of SL_2(Z) modulo G.

sage: G = GammaH(12,[-1,7]); G
Congruence Subgroup Gamma_H(12) with H generated by [-1, 7]
sage: G._coset_reduction_data()
([(0, 12, 0), (1, 1, 1), (2, 2, 1), (3, 3, 1), (4, 4, 1), (1, 1, 5), (6, 6,
1),
  (1, 1, 7), (4, 4, 5), (3, 3, 7), (2, 2, 5), (1, 1, 11)],
  {1: [1], 2: [1, 7], 3: [1, 5]})

_coset_reduction_data_first_coord( G)

Compute data used for determining the canonical coset representative of an element of SL_2(Z) modulo G. This function specfically returns data needed for the first part of the reduction step (the first coordinate).

Input:

G
- a congruence subgroup Gamma_0(N), Gamma_1(N), or Gamma_H(N).

Output: A list v such that v[u] = (min(u*h: h in H), gcd(u,N) , an h such that h*u = min(u*h: h in H)).

sage: G = GammaH(12,[-1,5]); G
Congruence Subgroup Gamma_H(12) with H generated by [-1, 5]
sage: G._coset_reduction_data_first_coord()
[(0, 12, 0), (1, 1, 1), (2, 2, 1), (3, 3, 1), (4, 4, 1), (1, 1, 5), (6, 6,
1),
(1, 1, 7), (4, 4, 5), (3, 3, 7), (2, 2, 5), (1, 1, 11)]

_coset_reduction_data_second_coord( G)

Compute data used for determining the canonical coset representative of an element of SL_2(Z) modulo G. This function specfically returns data needed for the first part of the reduction step (the first coordinate).

Input:

G
- a congruence subgroup Gamma_0(N), Gamma_1(N), or Gamma_H(N).

Output: dictionary v with keys the divisors of N that are < sqrt(N) such that v[d] is the subgroup h in H : h = 1 (mod N/d).

sage: G = GammaH(1200,[-1,7]); G
Congruence Subgroup Gamma_H(1200) with H generated by [-1, 7]
sage: G._coset_reduction_data_second_coord()
{1: [1], 2: [1], 3: [1], 4: [1], 5: [1], 6: [1], 8: [1], 10: [1], 12: [1],
15: [1], 16: [1], 20: [1], 24: [1, 1151], 25: [1, 49], 30: [1]}

_list_of_elements_in_H( self)

Returns a sorted list of Python ints that are representatives between 0 and N-1 of the elements of H.

WARNING: Do not change this returned list.

sage: G = GammaH(11,[3]); G
Congruence Subgroup Gamma_H(11) with H generated by [3]
sage: G._list_of_elements_in_H()
[1, 3, 4, 5, 9]

_reduce_coset( self, uu, vv)

Compute a canonical form for a given Manin symbol.

Input: Two integers (uu,vv) that define an element of 1993#413 .

uu
- an integer
vv
- an integer

Output: pair of integers that are equivalent to (uu,vv).

NOTE: We do *not* require that gcd(uu,vv,N) = 1. If the gcd is not 1, we return (0,0).

An example at level 9.

sage: G = GammaH(9,[7]); G
Congruence Subgroup Gamma_H(9) with H generated by [7]
sage: a = []
sage: for i in range(G.level()):
...     for j in range(G.level()):
...       a.append(G._reduce_coset(i,j))
sage: v = list(set(a))
sage: v.sort()
sage: v
[(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),
(1, 6), (1, 7), (1, 8), (2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2,
6), (2, 7), (2, 8), (3, 1), (3, 2), (6, 1), (6, 2)]

An example at level 100.

sage: G = GammaH(100,[3,7]); G
Congruence Subgroup Gamma_H(100) with H generated by [3, 7]
sage: a = []
sage: for i in range(G.level()):
...   for j in range(G.level()):
...       a.append(G._reduce_coset(i,j))
sage: v = list(set(a))
sage: v.sort()
sage: len(v)
361

_reduce_cusp( self, c)

Compute a canonical form for the cusp $ uu/vv$ .

Input: cusp Output: cusp

Output:

bool
- True if self and other are equivalent
int
- $ 1$ , 0 , or $ -1$ , If the two cusps are $ u1/v1$ and $ u2/v2$ , then they are equivalent modulo Gamma_H(N) if and only if $ v1 = h*v2 (mod N)$ and $ u1 = h^(-1)*u2 (mod gcd(v1,N))$ or $ v1 = -h*v2 (mod N)$ and $ u1 = -h^(-1)*u2 (mod gcd(v1,N))$ where $ h \in H$ . In the first case we return $ 1$ , and in the second we return $ -1$ . We return 0 if the two cusps are not equivalent.

Class: SL2Z

class SL2Z
The modular group $ {\rm SL}_2(\mathbf{Z})$ .

sage: G = SL2Z(); G
Modular Group SL(2,Z)
sage: G.gens()
([ 0 -1]
[ 1  0], [1 1]
[0 1])
sage: G.0
[ 0 -1]
[ 1  0]
sage: G.1
[1 1]
[0 1]
sage: latex(G)
\mbox{\rm SL}_2(\mathbf{Z})
sage: G([1,-1,0,1])
[ 1 -1]
[ 0  1]
sage: loads(G.dumps()) == G
True
SL2Z( self)

Functions: gen,$  $ gens,$  $ is_even,$  $ is_subgroup,$  $ ngens

is_even( self)

Return True precisely if this subgroup contains the matrix -1.

is_subgroup( self, right)

Return True if self is a subgroup of right.

Special Functions: __call__,$  $ __init__,$  $ _latex_,$  $ _repr_

See About this document... for information on suggesting changes.