0% found this document useful (0 votes)
164 views96 pages

Sage 9.1 Reference Manual: Arithmetic Subgroups of SL: Release 9.1

This document is a reference manual about arithmetic subgroups of SL2(Z), which are finite index subgroups of the modular group SL2(Z). It describes the basic functionality for arithmetic subgroups, including computing cusps, coset representatives, dimensions of spaces of modular forms and cusp forms, and more. The first chapter provides an overview and definitions of key concepts regarding arithmetic subgroups.

Uploaded by

Ankit Chatterjee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
164 views96 pages

Sage 9.1 Reference Manual: Arithmetic Subgroups of SL: Release 9.1

This document is a reference manual about arithmetic subgroups of SL2(Z), which are finite index subgroups of the modular group SL2(Z). It describes the basic functionality for arithmetic subgroups, including computing cusps, coset representatives, dimensions of spaces of modular forms and cusp forms, and more. The first chapter provides an overview and definitions of key concepts regarding arithmetic subgroups.

Uploaded by

Ankit Chatterjee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 96

Sage 9.

1 Reference Manual: Arithmetic


Subgroups of SL2(Z)
Release 9.1

The Sage Development Team

May 21, 2020


CONTENTS

1 Arithmetic subgroups (finite index subgroups of SL2 (Z)) 3

2 Arithmetic subgroups defined by permutations of cosets 17

3 Elements of Arithmetic Subgroups 37

4 Congruence arithmetic subgroups of SL2 (Z) 41

5 Congruence Subgroup Γ𝐻 (𝑁 ) 45

6 Congruence Subgroup Γ1 (𝑁 ) 53

7 Congruence Subgroup Γ0 (𝑁 ) 59

8 Congruence Subgroup Γ(𝑁 ) 65

9 The modular group SL2 (Z) 69

10 Farey Symbol for arithmetic subgroups of PSL2 (Z) 71

11 Cython helper functions for congruence subgroups 79

12 Indices and Tables 83

Python Module Index 85

Index 87

i
ii
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

This chapter describes the basic functionality for finite index subgroups of the modular group SL2 (Z).

CONTENTS 1
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

2 CONTENTS
CHAPTER

ONE

ARITHMETIC SUBGROUPS (FINITE INDEX SUBGROUPS OF SL2 (Z))

class sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup
Bases: sage.groups.old.Group
Base class for arithmetic subgroups of SL2 (Z). Not intended to be used directly, but still includes quite a
few general-purpose routines which compute data about an arithmetic subgroup assuming that it has a working
element testing routine.
Element
alias of sage.modular.arithgroup.arithgroup_element.
ArithmeticSubgroupElement
are_equivalent(x, y, trans=False)
Test whether or not cusps x and y are equivalent modulo self. If self has a reduce_cusp() method, use that;
otherwise do a slow explicit test.
If trans = False, returns True or False. If trans = True, then return either False or an element of self mapping
x onto y.
EXAMPLES:

sage: Gamma0(7).are_equivalent(Cusp(1/3), Cusp(0), trans=True)


[ 3 -1]
[-14 5]
sage: Gamma0(7).are_equivalent(Cusp(1/3), Cusp(1/7))
False

as_permutation_group()
Return self as an arithmetic subgroup defined in terms of the permutation action of 𝑆𝐿(2, Z) on its right
cosets.
This method uses Todd-Coxeter enumeration (via the method todd_coxeter()) which can be ex-
tremely slow for arithmetic subgroups with relatively large index in 𝑆𝐿(2, Z).
EXAMPLES:

sage: G = Gamma(3)
sage: P = G.as_permutation_group(); P
Arithmetic subgroup of index 24
sage: G.ncusps() == P.ncusps()
True
sage: G.nu2() == P.nu2()
True
sage: G.nu3() == P.nu3()
True
sage: G.an_element() in P
(continues on next page)

3
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


True
sage: P.an_element() in G
True

coset_reps(G=None)
Return right coset representatives for self \ G, where G is another arithmetic subgroup that contains self.
If G = None, default to G = SL2Z.
For generic arithmetic subgroups G this is carried out by Todd-Coxeter enumeration; here G is treated as a
black box, implementing nothing but membership testing.
EXAMPLES:
sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().coset_
˓→reps()

Traceback (most recent call last):


...
NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.
˓→arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.coset_
˓→reps(Gamma0(3))

[
[1 0] [ 0 -1] [ 0 -1] [ 0 -1]
[0 1], [ 1 0], [ 1 1], [ 1 2]
]

cusp_data(c)
Return a triple (g, w, t) where g is an element of self generating the stabiliser of the given cusp, w is the
width of the cusp, and t is 1 if the cusp is regular and -1 if not.
EXAMPLES:
sage: Gamma1(4).cusp_data(Cusps(1/2))
(
[ 1 -1]
[ 4 -3], 1, -1
)

cusp_width(c)
Return the width of the orbit of cusps represented by c.
EXAMPLES:
sage: Gamma0(11).cusp_width(Cusps(oo))
1
sage: Gamma0(11).cusp_width(0)
11
sage: [Gamma0(100).cusp_width(c) for c in Gamma0(100).cusps()]
[100, 1, 4, 1, 1, 1, 4, 25, 1, 1, 4, 1, 25, 4, 1, 4, 1, 1]

cusps(algorithm=’default’)
Return a sorted list of inequivalent cusps for self, i.e. a set of representatives for the orbits of self on
P1 (Q). These should be returned in a reduced form where this makes sense.
INPUT:
• algorithm – which algorithm to use to compute the cusps of self. 'default' finds represen-
tatives for a known complete set of cusps. 'modsym' computes the boundary map on the space of
weight two modular symbols associated to self, which finds the cusps for self in the process.

4 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

EXAMPLES:

sage: Gamma0(36).cusps()
[0, 1/18, 1/12, 1/9, 1/6, 1/4, 1/3, 5/12, 1/2, 2/3, 5/6, Infinity]
sage: Gamma0(36).cusps(algorithm='modsym') == Gamma0(36).cusps()
True
sage: GammaH(36, [19,29]).cusps() == Gamma0(36).cusps()
True
sage: Gamma0(1).cusps()
[Infinity]

dimension_cusp_forms(k=2)
Return the dimension of the space of weight k cusp forms for this group. For 𝑘 ≥ 2, this is given by
a standard formula in terms of k and various invariants of the group; see Diamond + Shurman, “A First
Course in Modular Forms”, section 3.5 and 3.6. If k is not given, default to k = 2.
For dimensions of spaces of cusp forms with character for Gamma1, use the dimension_cusp_forms
method of the Gamma1 class, or the standalone function dimension_cusp_forms().
For weight 1 cusp forms this generic implementation only works in cases where one can prove solely via
Riemann-Roch theory that there aren’t any cusp forms (i.e. when the number of regular cusps is strictly
greater than the degree of the canonical divisor). Otherwise a NotImplementedError is raised.
EXAMPLES:

sage: Gamma1(31).dimension_cusp_forms(2)
26
sage: Gamma(5).dimension_cusp_forms(1)
0
sage: Gamma1(4).dimension_cusp_forms(1) # irregular cusp
0
sage: Gamma(13).dimension_cusp_forms(1)
Traceback (most recent call last):
...
NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces
˓→not implemented in general

dimension_eis(k=2)
Return the dimension of the space of weight k Eisenstein series for this group, which is a subspace of the
space of modular forms complementary to the space of cusp forms.
INPUT:
• k - an integer (default 2).
EXAMPLES:

sage: GammaH(33,[2]).dimension_eis()
7
sage: GammaH(33,[2]).dimension_eis(3)
0
sage: GammaH(33, [2,5]).dimension_eis(2)
3
sage: GammaH(33, [4]).dimension_eis(1)
4

dimension_modular_forms(k=2)
Return the dimension of the space of weight k modular forms for this group. This is given by a standard
formula in terms of k and various invariants of the group; see Diamond + Shurman, “A First Course in
Modular Forms”, section 3.5 and 3.6. If k is not given, defaults to k = 2.

5
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

For dimensions of spaces of modular forms with character for Gamma1, use the dimension_modular_forms
method of the Gamma1 class, or the standalone function dimension_modular_forms().
For weight 1 modular forms this generic implementation only works in cases where one can prove solely
via Riemann-Roch theory that there aren’t any cusp forms (i.e. when the number of regular cusps is strictly
greater than the degree of the canonical divisor). Otherwise a NotImplementedError is raised.
EXAMPLES:

sage: Gamma1(31).dimension_modular_forms(2)
55
sage: Gamma1(3).dimension_modular_forms(1)
1
sage: Gamma1(4).dimension_modular_forms(1) # irregular cusp
1
sage: Gamma(13).dimension_modular_forms(1)
Traceback (most recent call last):
...
NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces
˓→not implemented in general

farey_symbol()
Return the Farey symbol associated to this subgroup. See the farey_symbol module for more informa-
tion.
EXAMPLES:

sage: Gamma1(4).farey_symbol()
FareySymbol(Congruence Subgroup Gamma1(4))

gen(i)
Return the i-th generator of self, i.e. the i-th element of the tuple self.gens().
EXAMPLES:

sage: SL2Z.gen(1)
[1 1]
[0 1]

generalised_level()
Return the generalised level of self, i.e. the least common multiple of the widths of all cusps.
If self is even, Wohlfart’s theorem tells us that this is equal to the (conventional) level of self when self is a
congruence subgroup. This can fail if self is odd, but the actual level is at most twice the generalised level.
See the paper by Kiming, Schuett and Verrill for more examples.
EXAMPLES:

sage: Gamma0(18).generalised_level()
18
sage: sage.modular.arithgroup.arithgroup_perm.HsuExample18().generalised_
˓→level()

24

In the following example, the actual level is twice the generalised level. This is the group 𝐺2 from Example
17 of K-S-V.

sage: G = CongruenceSubgroup(8, [ [1,1,0,1], [3,-1,4,-1] ])


sage: G.level()
(continues on next page)

6 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


8
sage: G.generalised_level()
4

generators(algorithm=’farey’)
Return a list of generators for this congruence subgroup. The result is cached.
INPUT:
• algorithm (string): either farey or todd-coxeter.
If algorithm is set to "farey", then the generators will be calculated using Farey symbols, which will
always return a minimal generating set. See farey_symbol for more information.
If algorithm is set to "todd-coxeter", a simpler algorithm based on Todd-Coxeter enumeration
will be used. This is exceedingly slow for general subgroups, and the list of generators will be far from
minimal (indeed it may contain repetitions).
EXAMPLES:
sage: Gamma(2).generators()
[
[1 2] [ 3 -2] [-1 0]
[0 1], [ 2 -1], [ 0 -1]
]
sage: Gamma(2).generators(algorithm="todd-coxeter")
[
[1 2] [-1 0] [ 1 0] [-1 0] [-1 2] [-1 0] [1 0]
[0 1], [ 0 -1], [-2 1], [ 0 -1], [-2 3], [ 2 -1], [2 1]
]

gens(*args, **kwds)
Return a tuple of generators for this congruence subgroup.
The generators need not be minimal. For arguments, see generators().
EXAMPLES:
sage: SL2Z.gens()
(
[ 0 -1] [1 1]
[ 1 0], [0 1]
)

genus()
Return the genus of the modular curve of self.
EXAMPLES:
sage: Gamma1(5).genus()
0
sage: Gamma1(31).genus()
26
sage: Gamma1(157).genus() == dimension_cusp_forms(Gamma1(157), 2)
True
sage: GammaH(7, [2]).genus()
0
sage: [Gamma0(n).genus() for n in [1..23]]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 2, 2]
(continues on next page)

7
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: [n for n in [1..200] if Gamma0(n).genus() == 1]
[11, 14, 15, 17, 19, 20, 21, 24, 27, 32, 36, 49]

index()
Return the index of self in the full modular group.
EXAMPLES:

sage: Gamma0(17).index()
18
sage: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(5).index()
Traceback (most recent call last):
...
NotImplementedError

is_abelian()
Return True if this arithmetic subgroup is abelian.
Since arithmetic subgroups are always nonabelian, this always returns False.
EXAMPLES:

sage: SL2Z.is_abelian()
False
sage: Gamma0(3).is_abelian()
False
sage: Gamma1(12).is_abelian()
False
sage: GammaH(4, [3]).is_abelian()
False

is_congruence()
Return True if self is a congruence subgroup.
EXAMPLES:

sage: Gamma0(5).is_congruence()
True
sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().is_
˓→congruence()

Traceback (most recent call last):


...
NotImplementedError

is_even()
Return True precisely if this subgroup contains the matrix -1.
EXAMPLES:

sage: SL2Z.is_even()
True
sage: Gamma0(20).is_even()
True
sage: Gamma1(5).is_even()
False
sage: GammaH(11, [3]).is_even()
False

8 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

is_finite()
Return True if this arithmetic subgroup is finite.
Since arithmetic subgroups are always infinite, this always returns False.
EXAMPLES:

sage: SL2Z.is_finite()
False
sage: Gamma0(3).is_finite()
False
sage: Gamma1(12).is_finite()
False
sage: GammaH(4, [3]).is_finite()
False

is_normal()
Return True precisely if this subgroup is a normal subgroup of SL2Z.
EXAMPLES:

sage: Gamma(3).is_normal()
True
sage: Gamma1(3).is_normal()
False

is_odd()
Return True precisely if this subgroup does not contain the matrix -1.
EXAMPLES:

sage: SL2Z.is_odd()
False
sage: Gamma0(20).is_odd()
False
sage: Gamma1(5).is_odd()
True
sage: GammaH(11, [3]).is_odd()
True

is_parent_of(x)
Check whether this group is a valid parent for the element x. Required by Sage’s testing framework.
EXAMPLES:

sage: Gamma(3).is_parent_of(ZZ(1))
False
sage: Gamma(3).is_parent_of([1,0,0,1])
False
sage: Gamma(3).is_parent_of(SL2Z([1,1,0,1]))
False
sage: Gamma(3).is_parent_of(SL2Z(1))
True

is_regular_cusp(c)
Return True if the orbit of the given cusp is a regular cusp for self, otherwise False. This is automatically
true if -1 is in self.
EXAMPLES:

9
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: Gamma1(4).is_regular_cusp(Cusps(1/2))
False
sage: Gamma1(4).is_regular_cusp(Cusps(oo))
True

is_subgroup(right)
Return True if self is a subgroup of right, and False otherwise. For generic arithmetic subgroups this is
done by the absurdly slow algorithm of checking all of the generators of self to see if they are in right.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().is_
˓→subgroup(SL2Z)

Traceback (most recent call last):


...
NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.
˓→arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.is_
˓→subgroup(Gamma1(18), Gamma0(6))

True

matrix_space()
Return the parent space of the matrices, which is always MatrixSpace(ZZ, 2).
EXAMPLES:

sage: Gamma(3).matrix_space()
Full MatrixSpace of 2 by 2 dense matrices over Integer Ring

ncusps()
Return the number of cusps of this arithmetic subgroup. This is provided as a separate function since for
dimension formulae in even weight all we need to know is the number of cusps, and this can be calculated
very quickly, while enumerating all cusps is much slower.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.
˓→ncusps(Gamma0(7))

ngens()
Return the size of the minimal generating set of self returned by generators().
EXAMPLES:

sage: Gamma0(22).ngens()
8
sage: Gamma1(14).ngens()
13
sage: GammaH(11, [3]).ngens()
3
sage: SL2Z.ngens()
2

nirregcusps()
Return the number of cusps of self that are “irregular”, i.e. their stabiliser can only be generated by
elements with both eigenvalues -1 rather than +1. If the group contains -1, every cusp is clearly regular.
EXAMPLES:

10 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.
˓→nirregcusps(Gamma1(4))

nregcusps()
Return the number of cusps of self that are “regular”, i.e. their stabiliser has a generator with both eigen-
values +1 rather than -1. If the group contains -1, every cusp is clearly regular.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.
˓→nregcusps(Gamma1(4))

nu2()
Return the number of orbits of elliptic points of order 2 for this arithmetic subgroup.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().nu2()
Traceback (most recent call last):
...
NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.
˓→arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.
˓→nu2(Gamma0(1105)) == 8

True

nu3()
Return the number of orbits of elliptic points of order 3 for this arithmetic subgroup.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().nu3()
Traceback (most recent call last):
...
NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.
˓→arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.
˓→nu3(Gamma0(1729)) == 8

True

We test that a bug in handling of subgroups not containing -1 is fixed:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup.
˓→nu3(GammaH(7, [2]))

order()
Return the number of elements in this arithmetic subgroup.
Since arithmetic subgroups are always infinite, this always returns infinity.
EXAMPLES:

sage: SL2Z.order()
+Infinity
sage: Gamma0(5).order()
(continues on next page)

11
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


+Infinity
sage: Gamma1(2).order()
+Infinity
sage: GammaH(12, [5]).order()
+Infinity

projective_index()
Return the index of the image of self in PSL2 (Z). This is equal to the index of self if self contains -1, and
half of this otherwise.
This is equal to the degree of the natural map from the modular curve of self to the 𝑗-line.
EXAMPLES:

sage: Gamma0(5).projective_index()
6
sage: Gamma1(5).projective_index()
12

reduce_cusp(c)
Given a cusp 𝑐 ∈ P1 (Q), return the unique reduced cusp equivalent to c under the action of self, where a
reduced cusp is an element 𝑟𝑠 with r,s coprime non-negative integers, s as small as possible, and r as small
as possible for that s.
NOTE: This function should be overridden by all subclasses.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().reduce_
˓→cusp(1/4)

Traceback (most recent call last):


...
NotImplementedError

sturm_bound(weight=2)
Returns the Sturm bound for modular forms of the given weight and level this subgroup.
INPUT:
• weight - an integer ≥ 2 (default: 2)
EXAMPLES:

sage: Gamma0(11).sturm_bound(2)
2
sage: Gamma0(389).sturm_bound(2)
65
sage: Gamma0(1).sturm_bound(12)
1
sage: Gamma0(100).sturm_bound(2)
30
sage: Gamma0(1).sturm_bound(36)
3
sage: Gamma0(11).sturm_bound()
2
sage: Gamma0(13).sturm_bound()
3
sage: Gamma0(16).sturm_bound()
(continues on next page)

12 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


4
sage: GammaH(16,[13]).sturm_bound()
8
sage: GammaH(16,[15]).sturm_bound()
16
sage: Gamma1(16).sturm_bound()
32
sage: Gamma1(13).sturm_bound()
28
sage: Gamma1(13).sturm_bound(5)
70

FURTHER DETAILS: This function returns a positive integer 𝑛 such that the Hecke operators 𝑇1 , . . . , 𝑇𝑛
acting on cusp forms generate the Hecke algebra as a Z-module when the character is trivial or quadratic.
Otherwise, 𝑇1 , . . . , 𝑇𝑛 generate the Hecke algebra at least as a Z[𝜀]-module, where Z[𝜀] is the ring gener-
ated by the values of the Dirichlet character 𝜀. Alternatively, this is a bound such that if two cusp forms
associated to this space of modular symbols are congruent modulo (𝜆, 𝑞 𝑛 ), then they are congruent modulo
𝜆.
REFERENCES:
• See the Agashe-Stein appendix to Lario and Schoof, Some computations with Hecke rings and defor-
mation rings, Experimental Math., 11 (2002), no. 2, 303-311.
• This result originated in the paper Sturm, On the congruence of modular forms, Springer LNM 1240,
275-280, 1987.
REMARK: Kevin Buzzard pointed out to me (William Stein) in Fall 2002 that the above bound is fine for
Γ1 (𝑁 ) with character, as one sees by taking a power of 𝑓 . More precisely, if 𝑓 ∼= 0 (mod 𝑝) for first 𝑠
coefficients, then 𝑓 𝑟 ∼
= 0 (mod 𝑝) for first 𝑠𝑟 coefficients. Since the weight of 𝑓 𝑟 is 𝑟 · 𝑘(𝑓 ), it follows
that if 𝑠 ≥ 𝑏, where 𝑏 is the Sturm bound for Γ0 (𝑁 ) at weight 𝑘(𝑓 ), then 𝑓 𝑟 has valuation large enough
to be forced to be 0 at 𝑟 * 𝑘(𝑓 ) by Sturm bound (which is valid if we choose 𝑟 correctly). Thus 𝑓 ∼ =0
(mod 𝑝). Conclusion: For Γ1 (𝑁 ) with fixed character, the Sturm bound is exactly the same as for Γ0 (𝑁 ).
A key point is that we are finding Z[𝜀] generators for the Hecke algebra here, not Z-generators. So if one
wants generators for the Hecke algebra over Z, this bound must be suitably modified (and I’m not sure
what the modification is).
AUTHORS:
• William Stein
to_even_subgroup()
Return the smallest even subgroup of 𝑆𝐿(2, Z) containing self.
EXAMPLES:

sage: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup().to_even_
˓→subgroup()

Traceback (most recent call last):


...
NotImplementedError: Please implement _contains_sl2 for <class 'sage.modular.
˓→arithgroup.arithgroup_generic.ArithmeticSubgroup_with_category'>

todd_coxeter(G=None, on_right=True)
Compute coset representatives for self \ G and action of standard generators on them via Todd-Coxeter
enumeration.
If G is None, default to SL2Z. The method also computes generators of the subgroup at same time.

13
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

INPUT:
• G - intermediate subgroup (currently not implemented if different from SL(2,Z))
• on_right - boolean (default: True) - if True return right coset enumeration, if False return left one.
This is extremely slow in general.
OUTPUT:
• a list of coset representatives
• a list of generators for the group
• l - list of integers that correspond to the action of the standard parabolic element [[1,1],[0,1]] of
𝑆𝐿(2, Z) on the cosets of self.
• s - list of integers that correspond to the action of the standard element of order 2 [[0,-1],[1,0]] on the
cosets of self.
EXAMPLES:

sage: L = SL2Z([1,1,0,1])
sage: S = SL2Z([0,-1,1,0])

sage: G = Gamma(2)
sage: reps, gens, l, s = G.todd_coxeter()
sage: len(reps) == G.index()
True
sage: all(reps[i] * L * ~reps[l[i]] in G for i in range(6))
True
sage: all(reps[i] * S * ~reps[s[i]] in G for i in range(6))
True

sage: G = Gamma0(7)
sage: reps, gens, l, s = G.todd_coxeter()
sage: len(reps) == G.index()
True
sage: all(reps[i] * L * ~reps[l[i]] in G for i in range(8))
True
sage: all(reps[i] * S * ~reps[s[i]] in G for i in range(8))
True

sage: G = Gamma1(3)
sage: reps, gens, l, s = G.todd_coxeter(on_right=False)
sage: len(reps) == G.index()
True
sage: all(~reps[l[i]] * L * reps[i] in G for i in range(8))
True
sage: all(~reps[s[i]] * S * reps[i] in G for i in range(8))
True

sage: G = Gamma0(5)
sage: reps, gens, l, s = G.todd_coxeter(on_right=False)
sage: len(reps) == G.index()
True
sage: all(~reps[l[i]] * L * reps[i] in G for i in range(6))
True
sage: all(~reps[s[i]] * S * reps[i] in G for i in range(6))
True

14 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage.modular.arithgroup.arithgroup_generic.is_ArithmeticSubgroup(x)
Return True if x is of type ArithmeticSubgroup.
EXAMPLES:

sage: from sage.modular.arithgroup.all import is_ArithmeticSubgroup


sage: is_ArithmeticSubgroup(GL(2, GF(7)))
False
sage: is_ArithmeticSubgroup(Gamma0(4))
True

15
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

16 Chapter 1. Arithmetic subgroups (finite index subgroups of SL2 (Z))


CHAPTER

TWO

ARITHMETIC SUBGROUPS DEFINED BY PERMUTATIONS OF


COSETS

A subgroup of finite index 𝐻 of a finitely generated group 𝐺 is completely described by the action of a set of generators
of 𝐺 on the right cosets 𝐻∖𝐺 = {𝐻𝑔}𝑔∈𝐺 . After some arbitrary choice of numbering one can identify the action of
generators as elements of a symmetric group acting transitively (and satisfying the relations of the relators in G). As
SL2 (Z) has a very simple presentation as a central extension of a free product of cyclic groups, one can easily design
algorithms from this point of view.
The generators of SL2 (Z) used in this module are named as follows 𝑠2 , 𝑠3 , 𝑙, 𝑟 which are defined by
(︂ )︂ (︂ )︂ (︂ )︂ (︂ )︂
0 −1 0 1 1 1 1 0
𝑠2 = , 𝑠3 = , 𝑙= , 𝑟= .
1 0 −1 1 0 1 1 1

Those generators satisfy the following relations

𝑠22 = 𝑠33 = −1, 𝑟 = 𝑠−1


2 𝑙
−1
𝑠2 .

In particular not all four are needed to generate the whole group SL2 (Z). Three couples which generate SL2 (Z) are
of particular interest:
• (𝑙, 𝑟) as they are also semigroup generators for the semigroup of matrices in SL2 (Z) with non-negative entries,
• (𝑙, 𝑠2 ) as they are closely related to the continued fraction algorithm,
• (𝑠2 , 𝑠3 ) as the group PSL2 (Z) is the free product of the finite cyclic groups generated by these two elements.
Part of these functions are based on Chris Kurth’s KFarey package [Kur2008]. For tests see the file sage.modular.
arithgroup.tests.
REFERENCES:
• [ASD1971]
• [Gor2009]
• [HL2014]
• [Hsu1996]
• [Hsu1997]
• [KSV2011]
• [Kul1991]
• [Kur2008]
• [KL2008]
• [Ver]

17
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

Todo:
• modular Farey symbols
• computation of generators of a modular subgroup with a standard surface group presentation. In other words,
compute a presentation of the form
∏︁ ∏︁ 𝜈
⟨𝑥𝑖 , 𝑦𝑖 , 𝑐𝑗 | [𝑥𝑖 , 𝑦𝑖 ] 𝑐𝑗 𝑗 = 1⟩
𝑖 𝑗

where the elements 𝑥𝑖 and 𝑦𝑖 are hyperbolic and 𝑐𝑗 are parabolic (𝜈𝑗 = ∞) or elliptic elements (𝜈𝑗 < ∞).
• computation of centralizer.
• generation of modular (even) subgroups of fixed index.

AUTHORS:
• Chris Kurth (2008): created KFarey package
• David Loeffler (2009): adapted functions from KFarey for inclusion into Sage
• Vincent Delecroix (2010): implementation for odd groups, new design, improvements, documentation
• David Loeffler (2011): congruence testing for odd subgroups, enumeration of liftings of projective subgroups
• David Loeffler & Thomas Hamilton (2012): generalised Hsu congruence test for odd subgroups
sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation(L=None,
R=None,
S2=None,
S3=None,
re-
la-
bel=False,
check=True)
Construct a subgroup of SL2 (Z) from the action of generators on its right cosets.
Return an arithmetic subgroup knowing the action, given by permutations, of at least two standard generators
on the its cosets. The generators considered are the following matrices:
(︂ )︂ (︂ )︂ (︂ )︂ (︂ )︂
0 −1 0 1 1 1 1 0
𝑠2 = , 𝑠3 = , 𝑙= , 𝑟= .
1 0 −1 1 0 1 1 1

An error will be raised if only one permutation is given. If no arguments are given at all, the full modular group
SL(2, Z) is returned.
INPUT:
• S2, S3, L, R - permutations - action of matrices on the right cosets (each coset is identified to an element
of {1, . . . , 𝑛} where 1 is reserved for the identity coset).
• relabel - boolean (default: False) - if True, renumber the cosets in a canonical way.
• check - boolean (default: True) - check that the input is valid (it may be time efficient but less safe to set
it to False)
EXAMPLES:

18 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)(3,4)",S3="(1,2,3)")
sage: G
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)
S3=(1,2,3)
L=(1,4,3)
R=(2,4,3)
sage: G.index()
4

sage: G = ArithmeticSubgroup_Permutation(); G
Arithmetic subgroup with permutations of right cosets
S2=()
S3=()
L=()
R=()
sage: G == SL2Z
True

Some invalid inputs:

sage: ArithmeticSubgroup_Permutation(S2="(1,2)")
Traceback (most recent call last):
...
ValueError: Need at least two generators
sage: ArithmeticSubgroup_Permutation(S2="(1,2)",S3="(3,4,5)")
Traceback (most recent call last):
...
ValueError: Permutations do not generate a transitive group
sage: ArithmeticSubgroup_Permutation(L="(1,2)",R="(1,2,3)")
Traceback (most recent call last):
...
ValueError: Wrong relations between generators
sage: ArithmeticSubgroup_Permutation(S2="(1,2,3,4)",S3="()")
Traceback (most recent call last):
...
ValueError: S2^2 does not equal to S3^3
sage: ArithmeticSubgroup_Permutation(S2="(1,4,2,5,3)", S3="(1,3,5,2,4)")
Traceback (most recent call last):
...
ValueError: S2^2 = S3^3 must have order 1 or 2

The input checks can be disabled for speed:

sage: ArithmeticSubgroup_Permutation(S2="(1,2)",S3="(3,4,5)", check=False) # don


˓→'t do this!

Arithmetic subgroup with permutations of right cosets


S2=(1,2)
S3=(3,4,5)
L=(1,2)(3,5,4)
R=(1,2)(3,4,5)

class sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
Bases: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup
A subgroup of SL2 (Z) defined by the action of generators on its coset graph.
The class stores the action of generators 𝑠2 , 𝑠3 , 𝑙, 𝑟 on right cosets 𝐻𝑔 of a finite index subgroup 𝐻 < SL2 (Z).

19
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

In particular the action of SL2 (Z) on the cosets is on right.


(︂ )︂ (︂ )︂ (︂ )︂ (︂ )︂
0 −1 0 1 1 1 1 0
𝑠2 = , 𝑠3 = , 𝑙= , 𝑟= .
1 0 −1 1 0 1 1 1

L()
Return the action of the matrix 𝑙 as a permutation of cosets.
(︂ )︂
1 1
𝑙=
0 1
EXAMPLES:
sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)",S3="(1,2,3)")
sage: G.L()
(1,3)

R()
Return the action of the matrix 𝑟 as a permutation of cosets.
(︂ )︂
1 0
𝑟=
1 1
EXAMPLES:
sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)",S3="(1,2,3)")
sage: G.R()
(2,3)

S2()
Return the action of the matrix 𝑠2 as a permutation of cosets.
(︂ )︂
0 −1
𝑠2 =
1 0
EXAMPLES:
sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)",S3="(1,2,3)")
sage: G.S2()
(1,2)

S3()
Return the action of the matrix 𝑠3 as a permutation of cosets.
(︂ )︂
0 1
𝑠3 = ,
−1 1
EXAMPLES:
sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)",S3="(1,2,3)")
sage: G.S3()
(1,2,3)

congruence_closure()
Returns the smallest congruence subgroup containing self. If self is congruence, this is just self, but
represented as a congruence subgroup data type. If self is not congruence, then it may be larger.
In practice, we use the following criterion: let 𝑚 be the generalised level of self. If this subgroup is even,
let 𝑛 = 𝑚, else let 𝑛 = 2𝑚. Then any congruence subgroup containing self contains Γ(𝑛) (a generalisation

20 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

of Wohlfahrt’s theorem due to Kiming, Verrill and Schuett). So we compute the image of self modulo 𝑛
and return the preimage of that.

Note: If you just want to know if the subgroup is congruence or not, it is much faster to use
is_congruence().

EXAMPLES:

sage: Gamma1(3).as_permutation_group().congruence_closure()
Congruence subgroup of SL(2,Z) of level 3, preimage of:
Matrix group over Ring of integers modulo 3 with 2 generators (
[1 1] [1 2]
[0 1], [0 1]
)
sage: sage.modular.arithgroup.arithgroup_perm.HsuExample10().congruence_
˓→closure() # long time (11s on sage.math, 2012)
Modular Group SL(2,Z)

coset_graph(right_cosets=False, s2_edges=True, s3_edges=True, l_edges=False, r_edges=False,


s2_label=’s2’, s3_label=’s3’, l_label=’l’, r_label=’r’)
Return the right (or left) coset graph.
INPUT:
• right_cosets - bool (default: False) - right or left coset graph
• s2_edges - bool (default: True) - put edges associated to s2
• s3_edges - bool (default: True) - put edges associated to s3
• l_edges - bool (default: False) - put edges associated to l
• r_edges - bool (default: False) - put edges associated to r
• s2_label, s3_label, l_label, r_label - the labels to put on the edges corresponding to the
generators action. Use None for no label.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)",S3="()")
sage: G
Arithmetic subgroup with permutations of right cosets
S2=(1,2)
S3=()
L=(1,2)
R=(1,2)
sage: G.index()
2
sage: G.coset_graph()
Looped multi-digraph on 2 vertices

generalised_level()
Return the generalised level of this subgroup.
The generalised level of a subgroup of the modular group is the least common multiple of the widths of the
cusps. It was proven by Wohlfart that for even congruence subgroups, the (conventional) level coincides
with the generalised level. For odd congruence subgroups the level is either the generalised level, or twice
the generalised level [KSV2011].
EXAMPLES:

21
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: G = Gamma(2).as_permutation_group()
sage: G.generalised_level()
2
sage: G = Gamma0(3).as_permutation_group()
sage: G.generalised_level()
3

index()
Returns the index of this modular subgroup in the full modular group.
EXAMPLES:
sage: G = Gamma(2)
sage: P = G.as_permutation_group()
sage: P.index()
6
sage: G.index() == P.index()
True

sage: G = Gamma0(8)
sage: P = G.as_permutation_group()
sage: P.index()
12
sage: G.index() == P.index()
True

sage: G = Gamma1(6)
sage: P = G.as_permutation_group()
sage: P.index()
24
sage: G.index() == P.index()
True

is_congruence()
Return True if this is a congruence subgroup, and False otherwise.
ALGORITHM:
Uses Hsu’s algorithm [Hsu1996]. Adapted from Chris Kurth’s implementation in KFarey [Kur2008].
For odd subgroups, Hsu’s algorithm still works with minor modifications, using the extension of Wohl-
farht’s theorem due to Kiming, Schuett and Verrill [KSV2011]. See [HL2014] for details.
The algorithm is as follows. Let 𝐺 be a finite-index
(︂ subgroup
)︂ of SL(2,
(︂ )︂ Z), and let 𝐿 and 𝑅 be the permu-
1 1 1 1
tations of the cosets of 𝐺 given by the elements and . Let 𝑁 be the generalized level of
0 1 0 1
𝐺 (if 𝐺 is even) or twice the generalized level (if 𝐺 is odd). Then:
• if 𝑁 is odd, 𝐺 is congruence if and only if the relation

(𝐿𝑅−1 𝐿)2 = (𝑅2 𝐿1/2 )3

holds, where 1/2 is understood as the multiplicative inverse of 2 modulo N.


• if 𝑁 is a power of 2, then 𝐺 is congruence if and only if the relations
(𝐿𝑅−1 𝐿)−1 𝑆(𝐿𝑅−1 𝐿)𝑆 = 1 (𝐴1)
𝑆 −1 𝑅𝑆 = 𝑅25 (𝐴2)
(𝐿𝑅 𝐿)2 = (𝑆𝑅5 𝐿𝑅−1 𝐿)3 (𝐴3)
−1

hold, where 𝑆 = 𝐿20 𝑅1/5 𝐿−4 𝑅−1 , 1/5 being the inverse of 5 modulo N.

22 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

• if 𝑁 is neither odd nor a power of 2, seven relations (B1-7) hold, for which see [HL2014], or the
source code of this function.
If the Sage verbosity flag is set (using set_verbose()), then extra output will be produced indicating
which of the relations (A1-3) or (B1-7) is not satisfied.
EXAMPLES:
Test if SL2 (Z) is congruence:

sage: a = ArithmeticSubgroup_Permutation(L='',R='')
sage: a.index()
1
sage: a.is_congruence()
True

This example is congruence – it is Γ0 (3) in disguise:

sage: S2 = SymmetricGroup(4)
sage: l = S2((2,3,4))
sage: r = S2((1,3,4))
sage: G = ArithmeticSubgroup_Permutation(L=l,R=r)
sage: G
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)
S3=(1,4,2)
L=(2,3,4)
R=(1,3,4)
sage: G.is_congruence()
True

This one is noncongruence:

sage: import sage.modular.arithgroup.arithgroup_perm as ap


sage: ap.HsuExample10().is_congruence()
False

The following example (taken from [KSV2011]) shows that a lifting of a congruence subgroup of
PSL(2, Z) to a subgroup of SL(2, Z) need not necessarily be congruence:

sage: S2 = "(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,
˓→23)"

sage: S3 = "(1,14,15,13,2,3)(4,5,6,16,17,18)(7,8,9,19,20,21)(10,11,12,22,23,
˓→24)"

sage: G = ArithmeticSubgroup_Permutation(S2=S2,S3=S3)
sage: G.is_congruence()
False
sage: G.to_even_subgroup().is_congruence()
True

In fact 𝐺 is a lifting to SL(2, Z) of the group Γ̄0 (6):

sage: G.to_even_subgroup() == Gamma0(6)


True

is_normal()
Test whether the group is normal
EXAMPLES:

23
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: G = Gamma(2).as_permutation_group()
sage: G.is_normal()
True

sage: G = Gamma1(2).as_permutation_group()
sage: G.is_normal()
False

perm_group()
Return the underlying permutation group.
The permutation group returned is isomorphic to the action of the generators 𝑠2 (element of order two), 𝑠3
(element of order 3), 𝑙 (parabolic element) and 𝑟 (parabolic element) on right cosets (the action is on the
right).
EXAMPLES:

sage: import sage.modular.arithgroup.arithgroup_perm as ap


sage: ap.HsuExample10().perm_group()
Permutation Group with generators [(1,2)(3,4)(5,6)(7,8)(9,10), (1,8,3)(2,4,
˓→6)(5,7,10), (1,4)(2,5,9,10,8)(3,7,6), (1,7,9,10,6)(2,3)(4,5,8)]

permutation_action(x)
Given an element x of SL2 (Z), compute the permutation of the cosets of self given by right multiplication
by x.
EXAMPLES:

sage: import sage.modular.arithgroup.arithgroup_perm as ap


sage: ap.HsuExample10().permutation_action(SL2Z([32, -21, -67, 44]))
(1,4,6,2,10,5,3,7,8,9)

random_element(initial_steps=30)
Returns a random element in this subgroup.
The algorithm uses a random walk on the Cayley graph of SL2 (Z) stopped at the first time it reaches the
subgroup after at least initial_steps steps.
INPUT:
• initial_steps - positive integer (default: 30)
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2='(1,3)(4,5)',S3='(1,2,5)(3,4,6)')
sage: all(G.random_element() in G for _ in range(10))
True

relabel(inplace=True)
Relabel the cosets of this modular subgroup in a canonical way.
The implementation of modular subgroup by action of generators on cosets depends on the choice of a
numbering. This function provides canonical labels in the sense that two equal subgroups with different
labels are relabeled the same way. The default implementation relabels the group itself. If you want to get
a relabeled copy of your modular subgroup, put to False the option inplace.
ALGORITHM:
We give an overview of how the canonical labels for the modular subgroup are built. The procedure
only uses the permutations 𝑆3 and 𝑆2 that define the modular subgroup and can be used to renumber any

24 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

transitive action of the symmetric group. In other words, the algorithm construct a canonical representative
of a transitive subgroup in its conjugacy class in the full symmetric group.
1. The identity is still numbered 0 and set the current vertex to be the identity.
2. Number the cycle of 𝑆3 the current vertex belongs to: if the current vertex is labeled 𝑛 then the
numbering in such way that the cycle becomes (𝑛, 𝑛 + 1, . . . , 𝑛 + 𝑘)).
3. Find a new current vertex using the permutation 𝑆2. If all vertices are relabeled then it’s done, otherwise
go to step 2.
EXAMPLES:

sage: S2 = "(1,2)(3,4)(5,6)"; S3 = "(1,2,3)(4,5,6)"


sage: G1 = ArithmeticSubgroup_Permutation(S2=S2,S3=S3); G1
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)(5,6)
S3=(1,2,3)(4,5,6)
L=(1,4,5,3)
R=(2,4,6,3)
sage: G1.relabel(); G1
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)(5,6)
S3=(1,2,3)(4,5,6)
L=(1,4,5,3)
R=(2,4,6,3)

sage: S2 = "(1,2)(3,5)(4,6)"; S3 = "(1,2,3)(4,5,6)"


sage: G2 = ArithmeticSubgroup_Permutation(S2=S2,S3=S3); G2
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,5)(4,6)
S3=(1,2,3)(4,5,6)
L=(1,5,6,3)
R=(2,5,4,3)
sage: G2.relabel(); G2
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)(5,6)
S3=(1,2,3)(4,5,6)
L=(1,4,5,3)
R=(2,4,6,3)

sage: S2 = "(1,2)(3,6)(4,5)"; S3 = "(1,2,3)(4,5,6)"


sage: G3 = ArithmeticSubgroup_Permutation(S2=S2,S3=S3); G3
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,6)(4,5)
S3=(1,2,3)(4,5,6)
L=(1,6,4,3)
R=(2,6,5,3)
sage: G4 = G3.relabel(inplace=False)
sage: G4
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)(5,6)
S3=(1,2,3)(4,5,6)
L=(1,4,5,3)
R=(2,4,6,3)
sage: G3 is G4
False

surgroups()
Return an iterator through the non-trivial intermediate groups between 𝑆𝐿(2, Z) and this finite index

25
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

group.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)(3,4)(5,6)", S3="(1,2,3)(4,


˓→5,6)")

sage: H = next(G.surgroups())
sage: H
Arithmetic subgroup with permutations of right cosets
S2=(1,2)
S3=(1,2,3)
L=(1,3)
R=(2,3)
sage: G.is_subgroup(H)
True

The principal congruence group Γ(3) has thirteen surgroups:

sage: G = Gamma(3).as_permutation_group()
sage: G.index()
24
sage: l = []
sage: for H in G.surgroups():
....: l.append(H.index())
....: assert G.is_subgroup(H) and H.is_congruence()
sage: l
[6, 3, 4, 8, 4, 8, 4, 12, 4, 6, 6, 8, 8]

class sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation(S2,
S3,
L,
R,
canon-
i-
cal_labels=Fa
Bases: sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
An arithmetic subgroup of SL(2, Z) containing −1, represented in terms of the right action of SL(2, Z) on its
cosets.
EXAMPLES:
Construct a noncongruence subgroup of index 7 (the smallest possible):

sage: a2 = SymmetricGroup(7)([(1,2),(3,4),(6,7)]); a3 = SymmetricGroup(7)([(1,2,


˓→3),(4,5,6)])

sage: G = ArithmeticSubgroup_Permutation(S2=a2, S3=a3); G


Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)(6,7)
S3=(1,2,3)(4,5,6)
L=(1,4,7,6,5,3)
R=(2,4,5,7,6,3)
sage: G.index()
7
sage: G.dimension_cusp_forms(4)
1
sage: G.is_congruence()
False

Convert some standard congruence subgroups into permutation form:

26 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: G = Gamma0(8).as_permutation_group()
sage: G.index()
12
sage: G.is_congruence()
True

sage: G = Gamma0(12).as_permutation_group()
sage: G
Arithmetic subgroup of index 24
sage: G.is_congruence()
True

The following is the unique index 2 even subgroup of SL2 (Z):

sage: w = SymmetricGroup(2)([2,1])
sage: G = ArithmeticSubgroup_Permutation(L=w, R=w)
sage: G.dimension_cusp_forms(6)
1
sage: G.genus()
0

coset_reps()
Return coset representatives.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)(3,4)",S3="(1,2,3)")
sage: c = G.coset_reps()
sage: len(c)
4
sage: [g in G for g in c]
[True, False, False, False]

cusp_widths(exp=False)
Return the list of cusp widths of the group.
EXAMPLES:

sage: G = Gamma(2).as_permutation_group()
sage: G.cusp_widths()
[2, 2, 2]
sage: G.cusp_widths(exp=True)
{2: 3}

sage: S2 = "(1,2)(3,4)(5,6)"
sage: S3 = "(1,2,3)(4,5,6)"
sage: G = ArithmeticSubgroup_Permutation(S2=S2,S3=S3)
sage: G.cusp_widths()
[1, 1, 4]
sage: G.cusp_widths(exp=True)
{1: 2, 4: 1}

sage: S2 = "(1,2)(3,4)(5,6)"
sage: S3 = "(1,3,5)(2,4,6)"
sage: G = ArithmeticSubgroup_Permutation(S2=S2,S3=S3)
sage: G.cusp_widths()
[6]
(continues on next page)

27
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: G.cusp_widths(exp=True)
{6: 1}

is_even()
Returns True if this subgroup contains the matrix −𝐼𝑑.
EXAMPLES:

sage: G = Gamma(2).as_permutation_group()
sage: G.is_even()
True

is_odd()
Returns True if this subgroup does not contain the matrix −𝐼𝑑.
EXAMPLES:

sage: G = Gamma(2).as_permutation_group()
sage: G.is_odd()
False

ncusps()
Return the number of cusps of this arithmetic subgroup.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2)(3,4)(5,6)",S3="(1,2,3)(4,5,
˓→6)")

sage: G.ncusps()
3

nu2()
Returns the number of orbits of elliptic points of order 2 for this arithmetic subgroup.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,4)(2)(3)",S3="(1,2,3)(4)")
sage: G.nu2()
2

nu3()
Returns the number of orbits of elliptic points of order 3 for this arithmetic subgroup.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,4)(2)(3)",S3="(1,2,3)(4)")
sage: G.nu3()
1

odd_subgroups()
Return a list of the odd subgroups of index 2 in Γ, where Γ is this subgroup. (Equivalently, return the
liftings of Γ̄ ≤ PSL(2, Z) to SL(2, Z).) This can take rather a long time if the index of this subgroup is
large.
See also:
one_odd_subgroup(), which returns just one of the odd subgroups (which is much quicker than
enumerating them all).

28 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

ALGORITHM:
• If Γ has an element of order 4, then there are no index 2 odd subgroups, so return the empty set.
• If Γ has no elements of order 4, then the permutation 𝑆2 is a combination of 2-cycles with no fixed
points on {1, . . . , 𝑁 }. We construct the permutation 𝑆˜2 of {1, . . . , 2𝑁 } which has a 4-cycle (𝑎, 𝑏, 𝑎 +
𝑁, 𝑏 + 𝑁 ) for each 2-cycle (𝑎, 𝑏) in S2. Similarly, we construct a permutation 𝑆˜3 which has a 6-cycle
(𝑎, 𝑏, 𝑐, 𝑎 + 𝑁, 𝑏 + 𝑁, 𝑐 + 𝑁 ) for each 3-cycle (𝑎, 𝑏, 𝑐) in 𝑆3 , and a 2-cycle (𝑎, 𝑎 + 𝑁 ) for each fixed
point 𝑎 of 𝑆3 .
Then the permutations 𝑆˜2 and 𝑆˜3 satisfy 𝑆˜22 = 𝑆˜33 = 𝜄 where 𝜄 is the order 2 permutation interchang-
ing 𝑎 and 𝑎 + 𝑁 for each 𝑎. So the subgroup corresponding to these permutations is an index 2 odd
subgroup of Γ.
• The other index 2 odd subgroups of Γ are obtained from the pairs 𝑆˜2 , 𝑆˜3𝜎 where 𝜎 is an element of the
group generated by the 2-cycles (𝑎, 𝑎 + 𝑁 ).
Studying the permutations in the first example below gives a good illustration of the algorithm.
EXAMPLES:

sage: G = sage.modular.arithgroup.arithgroup_perm.HsuExample10()
sage: [G.S2(), G.S3()]
[(1,2)(3,4)(5,6)(7,8)(9,10), (1,8,3)(2,4,6)(5,7,10)]
sage: X = G.odd_subgroups()
sage: for u in X: print([u.S2(), u.S3()])
[(1,2,11,12)(3,4,13,14)(5,6,15,16)(7,8,17,18)(9,10,19,20), (1,8,3,11,18,13)(2,
˓→4,6,12,14,16)(5,7,10,15,17,20)(9,19)]

[(1,2,11,12)(3,4,13,14)(5,6,15,16)(7,8,17,18)(9,10,19,20), (1,18,13,11,8,3)(2,
˓→4,6,12,14,16)(5,7,10,15,17,20)(9,19)]

[(1,2,11,12)(3,4,13,14)(5,6,15,16)(7,8,17,18)(9,10,19,20), (1,8,13,11,18,3)(2,
˓→4,6,12,14,16)(5,7,10,15,17,20)(9,19)]

[(1,2,11,12)(3,4,13,14)(5,6,15,16)(7,8,17,18)(9,10,19,20), (1,18,3,11,8,13)(2,
˓→4,6,12,14,16)(5,7,10,15,17,20)(9,19)]

A projective congruence subgroup may have noncongruence liftings, as the example of Γ̄0 (6) illustrates
(see [KSV2011]):

sage: X = Gamma0(6).as_permutation_group().odd_subgroups(); Sequence([[u.S2(),


˓→ u.S3()] for u in X],cr=True)

[
[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,2,
˓→3,13,14,15)(4,5,6,16,17,18)(7,8,9,19,20,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,14,
˓→15,13,2,3)(4,5,6,16,17,18)(7,8,9,19,20,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,2,
˓→3,13,14,15)(4,17,6,16,5,18)(7,8,9,19,20,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,14,
˓→15,13,2,3)(4,17,6,16,5,18)(7,8,9,19,20,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,2,
˓→3,13,14,15)(4,5,6,16,17,18)(7,20,9,19,8,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,14,
˓→15,13,2,3)(4,5,6,16,17,18)(7,20,9,19,8,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,2,
˓→3,13,14,15)(4,17,6,16,5,18)(7,20,9,19,8,21)(10,11,12,22,23,24)],

[(1,3,13,15)(2,4,14,16)(5,7,17,19)(6,10,18,22)(8,12,20,24)(9,11,21,23), (1,14,
˓→15,13,2,3)(4,17,6,16,5,18)(7,20,9,19,8,21)(10,11,12,22,23,24)]

]
sage: [u.is_congruence() for u in X]
[True, False, False, True, True, False, False, True]

29
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

one_odd_subgroup(random=False)
Return an odd subgroup of index 2 in Γ, where Γ is this subgroup. If the optional argument random is
False (the default), this returns an arbitrary but consistent choice from the set of index 2 odd subgroups. If
random is True, then it will choose one of these at random.
For details of the algorithm used, see the docstring for the related function odd_subgroups(), which
returns a list of all the index 2 odd subgroups.
EXAMPLES:
Starting from Γ(4) we get back Γ(4):

sage: G = Gamma(4).as_permutation_group()
sage: G.is_odd(), G.index()
(True, 48)
sage: Ge = G.to_even_subgroup()
sage: Go = Ge.one_odd_subgroup()
sage: Go.is_odd(), Go.index()
(True, 48)
sage: Go == G
True

Strating from Γ(6) we get a different group:

sage: G = Gamma(6).as_permutation_group()
sage: G.is_odd(), G.index()
(True, 144)
sage: Ge = G.to_even_subgroup()
sage: Go = Ge.one_odd_subgroup()
sage: Go.is_odd(), Go.index()
(True, 144)
sage: Go == G
False

An error will be raised if there are no such subgroups, which occurs if and only if the group contains an
element of order 4:

sage: Gamma0(10).as_permutation_group().one_odd_subgroup()
Traceback (most recent call last):
...
ValueError: Group contains an element of order 4, hence no index 2 odd
˓→subgroups

Testing randomness:

sage: G = Gamma(6).as_permutation_group().to_even_subgroup()
sage: G1 = G.one_odd_subgroup(random=True) # random
sage: G1.is_subgroup(G)
True

to_even_subgroup(relabel=True)
Return the subgroup generated by self and -Id. Since self is even, this is just self. Provided for compati-
bility.
EXAMPLES:

sage: G = Gamma0(4).as_permutation_group()
sage: H = G.to_even_subgroup()
(continues on next page)

30 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: H == G
True

todd_coxeter()
Returns a 4-tuple (coset_reps, gens, l, s2) where coset_reps is a list of coset represen-
tatives of the subgroup, gens a list of generators, l and s2 are list that corresponds to the action of the
matrix 𝑆2 and 𝐿 on the cosets.
EXAMPLES:
sage: G = ArithmeticSubgroup_Permutation(S2='(1,2)(3,4)',S3='(1,2,3)')
sage: reps,gens,l,s=G.todd_coxeter_l_s2()
sage: reps
[
[1 0] [ 0 -1] [1 2] [1 1]
[0 1], [ 1 0], [0 1], [0 1]
]
sage: gens
[
[1 3] [ 1 0] [ 2 -3]
[0 1], [-1 1], [ 1 -1]
]
sage: l
[3, 1, 0, 2]
sage: s
[1, 0, 3, 2]
sage: S2 = SL2Z([0,-1,1,0])
sage: L = SL2Z([1,1,0,1])
sage: reps[0] == SL2Z([1,0,0,1])
True
sage: all(reps[i]*S2*~reps[s[i]] in G for i in range(4))
True
sage: all(reps[i]*L*~reps[l[i]] in G for i in range(4))
True

todd_coxeter_l_s2()
Returns a 4-tuple (coset_reps, gens, l, s2) where coset_reps is a list of coset represen-
tatives of the subgroup, gens a list of generators, l and s2 are list that corresponds to the action of the
matrix 𝑆2 and 𝐿 on the cosets.
EXAMPLES:
sage: G = ArithmeticSubgroup_Permutation(S2='(1,2)(3,4)',S3='(1,2,3)')
sage: reps,gens,l,s=G.todd_coxeter_l_s2()
sage: reps
[
[1 0] [ 0 -1] [1 2] [1 1]
[0 1], [ 1 0], [0 1], [0 1]
]
sage: gens
[
[1 3] [ 1 0] [ 2 -3]
[0 1], [-1 1], [ 1 -1]
]
sage: l
[3, 1, 0, 2]
sage: s
(continues on next page)

31
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


[1, 0, 3, 2]
sage: S2 = SL2Z([0,-1,1,0])
sage: L = SL2Z([1,1,0,1])
sage: reps[0] == SL2Z([1,0,0,1])
True
sage: all(reps[i]*S2*~reps[s[i]] in G for i in range(4))
True
sage: all(reps[i]*L*~reps[l[i]] in G for i in range(4))
True

todd_coxeter_s2_s3()
Returns a 4-tuple (coset_reps, gens, s2, s3) where coset_reps are coset representatives
of the subgroup, gens is a list of generators, s2 and s3 are the action of the matrices 𝑆2 and 𝑆3 on the
list of cosets.
The so called Todd-Coxeter algorithm is a general method for coset enumeration for a subgroup of a group
given by generators and relations.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2='(1,2)(3,4)',S3='(1,2,3)')
sage: G.genus()
0
sage: reps,gens,s2,s3=G.todd_coxeter_s2_s3()
sage: g1,g2 = gens
sage: g1 in G and g2 in G
True
sage: g1
[-1 0]
[ 1 -1]
sage: g2
[-1 3]
[-1 2]
sage: S2 = SL2Z([0,-1,1,0])
sage: S3 = SL2Z([0,1,-1,1])
sage: reps[0] == SL2Z([1,0,0,1])
True
sage: all(reps[i]*S2*~reps[s2[i]] in G for i in range(4))
True
sage: all(reps[i]*S3*~reps[s3[i]] in G for i in range(4))
True

sage.modular.arithgroup.arithgroup_perm.HsuExample10()
An example of an index 10 arithmetic subgroup studied by Tim Hsu.
EXAMPLES:

sage: import sage.modular.arithgroup.arithgroup_perm as ap


sage: ap.HsuExample10()
Arithmetic subgroup with permutations of right cosets
S2=(1,2)(3,4)(5,6)(7,8)(9,10)
S3=(1,8,3)(2,4,6)(5,7,10)
L=(1,4)(2,5,9,10,8)(3,7,6)
R=(1,7,9,10,6)(2,3)(4,5,8)

sage.modular.arithgroup.arithgroup_perm.HsuExample18()
An example of an index 18 arithmetic subgroup studied by Tim Hsu.

32 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

EXAMPLES:

sage: import sage.modular.arithgroup.arithgroup_perm as ap


sage: ap.HsuExample18()
Arithmetic subgroup with permutations of right cosets
S2=(1,5)(2,11)(3,10)(4,15)(6,18)(7,12)(8,14)(9,16)(13,17)
S3=(1,7,11)(2,18,5)(3,9,15)(4,14,10)(6,17,12)(8,13,16)
L=(1,2)(3,4)(5,6,7)(8,9,10)(11,12,13,14,15,16,17,18)
R=(1,12,18)(2,6,13,9,4,8,17,7)(3,16,14)(5,11)(10,15)

class sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation(S2,
S3,
L,
R,
canon-
i-
cal_labels=Fals
Bases: sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
An arithmetic subgroup of SL(2, Z) not containing −1, represented in terms of the right action of SL(2, Z) on
its cosets.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2,3,4)",S3="(1,3)(2,4)")
sage: G
Arithmetic subgroup with permutations of right cosets
S2=(1,2,3,4)
S3=(1,3)(2,4)
L=(1,2,3,4)
R=(1,4,3,2)
sage: type(G)
<class 'sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation_
˓→with_category'>

cusp_widths(exp=False)
Return the list of cusp widths.
INPUT:
exp - boolean (default: False) - if True, return a dictionary with keys the possible widths and with values
the number of cusp with that width.
EXAMPLES:

sage: G = Gamma1(5).as_permutation_group()
sage: G.cusp_widths()
[1, 1, 5, 5]
sage: G.cusp_widths(exp=True)
{1: 2, 5: 2}

is_even()
Test whether the group is even.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,6,4,3)(2,7,5,8)",S3="(1,2,3,4,
˓→5,6)(7,8)")

sage: G.is_even()
False

33
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

is_odd()
Test whether the group is odd.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,6,4,3)(2,7,5,8)",S3="(1,2,3,4,
˓→5,6)(7,8)")

sage: G.is_odd()
True

ncusps()
Returns the number of cusps.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2,3,4)",S3="(1,3)(2,4)")
sage: G.ncusps()
1

sage: G = Gamma1(3).as_permutation_group()
sage: G.ncusps()
2

nirregcusps()
Return the number of irregular cusps.
The cusps are associated to cycles of the permutations 𝐿 or 𝑅. The irregular cusps are the one which are
stabilised by −𝐼𝑑.
EXAMPLES:

sage: S2 = "(1,3,2,4)(5,7,6,8)(9,11,10,12)"
sage: S3 = "(1,3,5,2,4,6)(7,9,11,8,10,12)"
sage: G = ArithmeticSubgroup_Permutation(S2=S2,S3=S3)
sage: G.nirregcusps()
3

nregcusps()
Return the number of regular cusps of the group.
The cusps are associated to cycles of 𝐿 or 𝑅. The irregular cusps correspond to the ones which are not
stabilised by −𝐼𝑑.
EXAMPLES:

sage: G = Gamma1(3).as_permutation_group()
sage: G.nregcusps()
2

nu2()
Return the number of elliptic points of order 2.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2,3,4)",S3="(1,3)(2,4)")
sage: G.nu2()
0

sage: G = Gamma1(2).as_permutation_group()
(continues on next page)

34 Chapter 2. Arithmetic subgroups defined by permutations of cosets


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: G.nu2()
1

nu3()
Return the number of elliptic points of order 3.
EXAMPLES:

sage: G = ArithmeticSubgroup_Permutation(S2="(1,2,3,4)",S3="(1,3)(2,4)")
sage: G.nu3()
2

sage: G = Gamma1(3).as_permutation_group()
sage: G.nu3()
1

to_even_subgroup(relabel=True)
Returns the group with −𝐼𝑑 added in it.
EXAMPLES:

sage: G = Gamma1(3).as_permutation_group()
sage: G.to_even_subgroup()
Arithmetic subgroup with permutations of right cosets
S2=(1,3)(2,4)
S3=(1,2,3)
L=(2,3,4)
R=(1,4,2)

sage: H = ArithmeticSubgroup_Permutation(S2 = '(1,4,11,14)(2,7,12,17)(3,5,13,


˓→15)(6,9,16,19)(8,10,18,20)', S3 = '(1,2,3,11,12,13)(4,5,6,14,15,16)(7,8,9,

˓→17,18,19)(10,20)')

sage: G = H.to_even_subgroup(relabel=False); G
Arithmetic subgroup with permutations of right cosets
S2=(1,4)(2,7)(3,5)(6,9)(8,10)
S3=(1,2,3)(4,5,6)(7,8,9)
L=(1,5)(2,4,9,10,8)(3,7,6)
R=(1,7,10,8,6)(2,5,9)(3,4)
sage: H.is_subgroup(G)
True

sage.modular.arithgroup.arithgroup_perm.eval_sl2z_word(w)
Given a word in the format output by sl2z_word_problem(), convert it back into an element of SL2 (Z).
EXAMPLES:

sage: from sage.modular.arithgroup.arithgroup_perm import eval_sl2z_word


sage: eval_sl2z_word([(0, 1), (1, -1), (0, 0), (1, 3), (0, 2), (1, 9), (0, -1)])
[ 66 -59]
[ 47 -42]

sage.modular.arithgroup.arithgroup_perm.sl2z_word_problem(A)
Given an element of SL2 (Z), express it as a word in the generators L = [1,1,0,1] and R = [1,0,1,1].
The return format is a list of pairs (a,b), where a = 0 or 1 denoting L or R respectively, and b is an integer
exponent.
See also the function eval_sl2z_word().

35
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

EXAMPLES:

sage: from sage.modular.arithgroup.arithgroup_perm import eval_sl2z_word, sl2z_


˓→word_problem

sage: m = SL2Z([1,0,0,1])
sage: eval_sl2z_word(sl2z_word_problem(m)) == m
True
sage: m = SL2Z([0,-1,1,0])
sage: eval_sl2z_word(sl2z_word_problem(m)) == m
True
sage: m = SL2Z([7,8,-50,-57])
sage: eval_sl2z_word(sl2z_word_problem(m)) == m
True

sage.modular.arithgroup.arithgroup_perm.word_of_perms(w, p1, p2)


Given a word 𝑤 as a list of 2-tuples (index,power) and permutations p1 and p2 return the product of p1
and p2 that corresponds to w.
EXAMPLES:

sage: import sage.modular.arithgroup.arithgroup_perm as ap


sage: S2 = SymmetricGroup(4)
sage: p1 = S2('(1,2)(3,4)')
sage: p2 = S2('(1,2,3,4)')
sage: ap.word_of_perms([(1,1),(0,1)], p1, p2) == p2 * p1
True
sage: ap.word_of_perms([(0,1),(1,1)], p1, p2) == p1 * p2
True

36 Chapter 2. Arithmetic subgroups defined by permutations of cosets


CHAPTER

THREE

ELEMENTS OF ARITHMETIC SUBGROUPS

class sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement
Bases: sage.structure.element.MultiplicativeGroupElement
An element of the group SL2 (Z), i.e. a 2x2 integer matrix of determinant 1.
a()
Return the upper left entry of self.
EXAMPLES:

sage: Gamma0(13)([7,1,13,2]).a()
7

acton(z)
Return the result of the action of self on z as a fractional linear transformation.
EXAMPLES:

sage: G = Gamma0(15)
sage: g = G([1, 2, 15, 31])

An example of g acting on a symbolic variable:

sage: z = var('z')
sage: g.acton(z)
(z + 2)/(15*z + 31)

An example involving the Gaussian numbers:

sage: K.<i> = NumberField(x^2 + 1)


sage: g.acton(i)
1/1186*i + 77/1186

An example with complex numbers:

sage: C.<i> = ComplexField()


sage: g.acton(i)
0.0649241146711636 + 0.000843170320404721*I

An example with the cusp infinity:

sage: g.acton(infinity)
1/15

An example which maps a finite cusp to infinity:

37
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: g.acton(-31/15)
+Infinity

Note that when acting on instances of cusps the return value is still a rational number or infinity (Note the
presence of ‘+’, which does not show up for cusp instances):

sage: g.acton(Cusp(-31/15))
+Infinity

b()
Return the upper right entry of self.
EXAMPLES:

sage: Gamma0(13)([7,1,13,2]).b()
1

c()
Return the lower left entry of self.
EXAMPLES:

sage: Gamma0(13)([7,1,13,2]).c()
13

d()
Return the lower right entry of self.
EXAMPLES:

sage: Gamma0(13)([7,1,13,2]).d()
2

det()
Return the determinant of self, which is always 1.
EXAMPLES:

sage: Gamma1(11)([12,11,-11,-10]).det()
1

determinant()
Return the determinant of self, which is always 1.
EXAMPLES:

sage: Gamma0(691)([1,0,691,1]).determinant()
1

matrix()
Return the matrix corresponding to self.
EXAMPLES:

sage: x = Gamma1(3)([4,5,3,4]) ; x
[4 5]
[3 4]
sage: x.matrix()
(continues on next page)

38 Chapter 3. Elements of Arithmetic Subgroups


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


[4 5]
[3 4]
sage: type(x.matrix())
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>

multiplicative_order()
Return the multiplicative order of this element.
EXAMPLES:

sage: SL2Z.one().multiplicative_order()
1
sage: SL2Z([-1,0,0,-1]).multiplicative_order()
2
sage: s,t = SL2Z.gens()
sage: ((t^3*s*t^2) * s * ~(t^3*s*t^2)).multiplicative_order()
4
sage: (t^3 * s * t * t^-3).multiplicative_order()
6
sage: (t^3 * s * t * s * t^-2).multiplicative_order()
3
sage: SL2Z([2,1,1,1]).multiplicative_order()
+Infinity
sage: SL2Z([-2,1,1,-1]).multiplicative_order()
+Infinity

39
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

40 Chapter 3. Elements of Arithmetic Subgroups


CHAPTER

FOUR

CONGRUENCE ARITHMETIC SUBGROUPS OF SL2 (Z)

Sage can compute extensively with the standard congruence subgroups Γ0 (𝑁 ), Γ1 (𝑁 ), and Γ𝐻 (𝑁 ).
AUTHORS:
• William Stein
• David Loeffler (2009, 10) – modifications to work with more general arithmetic subgroups
class sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(*args,
**kwds)
Bases: sage.modular.arithgroup.congroup_generic.CongruenceSubgroupFromGroup
One of the “standard” congruence subgroups Γ0 (𝑁 ), Γ1 (𝑁 ), Γ(𝑁 ), or Γ𝐻 (𝑁 ) (for some 𝐻).
This class is not intended to be instantiated directly. Derived subclasses must override _contains_sl2,
_repr_, and image_mod_n.
image_mod_n()
Raise an error: all derived subclasses should override this function.
EXAMPLES:

sage: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(5).image_
˓→mod_n()

Traceback (most recent call last):


...
NotImplementedError

modular_abelian_variety()
Return the modular abelian variety corresponding to the congruence subgroup self.
EXAMPLES:

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(sign=0, weight=2, base_ring=Rational Field)


Return the space of modular symbols of the specified weight and sign on the congruence subgroup self.
EXAMPLES:

sage: G = Gamma0(23)
sage: G.modular_symbols()
(continues on next page)

41
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


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

class sage.modular.arithgroup.congroup_generic.CongruenceSubgroupBase(level)
Bases: sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup
Create a congruence subgroup with given level.
EXAMPLES:

sage: Gamma0(500)
Congruence Subgroup Gamma0(500)

is_congruence()
Return True, since this is a congruence subgroup.
EXAMPLES:

sage: Gamma0(7).is_congruence()
True

level()
Return the level of this congruence subgroup.
EXAMPLES:

sage: SL2Z.level()
1
sage: Gamma0(20).level()
20
sage: Gamma1(11).level()
11
sage: GammaH(14, [5]).level()
14

class sage.modular.arithgroup.congroup_generic.CongruenceSubgroupFromGroup(G)
Bases: sage.modular.arithgroup.congroup_generic.CongruenceSubgroupBase
A congruence subgroup, defined by the data of an integer 𝑁 and a subgroup 𝐺 of the finite group 𝑆𝐿(2, Z/𝑁 Z);
the congruence subgroup consists of all the matrices in 𝑆𝐿(2, Z) whose reduction modulo 𝑁 lies in 𝐺.
This class should not be instantiated directly, but created using the factory function
CongruenceSubgroup_constructor(), which accepts much more flexible input, and checks the
input to make sure it is valid.
image_mod_n()
Return the subgroup of 𝑆𝐿(2, Z/𝑁 Z) of which this is the preimage, where 𝑁 is the level of self.
EXAMPLES:

42 Chapter 4. Congruence arithmetic subgroups of SL2 (Z)


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: G = MatrixGroup([matrix(Zmod(2), 2, [1,1,1,0])])


sage: H = sage.modular.arithgroup.congroup_generic.
˓→CongruenceSubgroupFromGroup(G); H.image_mod_n()

Matrix group over Ring of integers modulo 2 with 1 generators (


[1 1]
[1 0]
)
sage: H.image_mod_n() == G
True

index()
Return the index of self in the full modular group. This is equal to the index in 𝑆𝐿(2, Z/𝑁 Z) of the image
of this group modulo Γ(𝑁 ).
EXAMPLES:

sage: sage.modular.arithgroup.congroup_generic.
˓→CongruenceSubgroupFromGroup(MatrixGroup([matrix(Zmod(2), 2, [1,1,1,0])])).

˓→index()

to_even_subgroup()
Return the smallest even subgroup of 𝑆𝐿(2, Z) containing self.
EXAMPLES:

sage: G = Gamma(3)
sage: G.to_even_subgroup()
Congruence subgroup of SL(2,Z) of level 3, preimage of:
Matrix group over Ring of integers modulo 3 with 1 generators (
[2 0]
[0 2]
)

sage.modular.arithgroup.congroup_generic.CongruenceSubgroup_constructor(*args)
Attempt to create a congruence subgroup from the given data.
The allowed inputs are as follows:
• A MatrixGroup object. This must be a group of matrices over Z/𝑁 Z for some 𝑁 , with determinant 1,
in which case the function will return the group of matrices in 𝑆𝐿(2, Z) whose reduction mod 𝑁 is in the
given group.
• A list of matrices over Z/𝑁 Z for some 𝑁 . The function will then compute the subgroup of 𝑆𝐿(2, Z)
generated by these matrices, and proceed as above.
• An integer 𝑁 and a list of matrices (over any ring coercible to Z/𝑁 Z, e.g. over Z). The matrices will then
be coerced to Z/𝑁 Z.
The function checks that the input G is valid. It then tests to see if 𝐺 is the preimage mod 𝑁 of some group of
matrices modulo a proper divisor 𝑀 of 𝑁 , in which case it replaces 𝐺 with this group before continuing.
EXAMPLES:

sage: from sage.modular.arithgroup.congroup_generic import CongruenceSubgroup_


˓→constructor as CS

sage: CS(2, [[1,1,0,1]])


Congruence subgroup of SL(2,Z) of level 2, preimage of:
Matrix group over Ring of integers modulo 2 with 1 generators (
(continues on next page)

43
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


[1 1]
[0 1]
)
sage: CS([matrix(Zmod(2), 2, [1,1,0,1])])
Congruence subgroup of SL(2,Z) of level 2, preimage of:
Matrix group over Ring of integers modulo 2 with 1 generators (
[1 1]
[0 1]
)
sage: CS(MatrixGroup([matrix(Zmod(2), 2, [1,1,0,1])]))
Congruence subgroup of SL(2,Z) of level 2, preimage of:
Matrix group over Ring of integers modulo 2 with 1 generators (
[1 1]
[0 1]
)
sage: CS(SL(2, 2))
Modular Group SL(2,Z)

Some invalid inputs:

sage: CS(SU(2, 7))


Traceback (most recent call last):
...
TypeError: Ring of definition must be Z / NZ for some N

sage.modular.arithgroup.congroup_generic.is_CongruenceSubgroup(x)
Return True if x is of type CongruenceSubgroup.
Note that this may be False even if 𝑥 really is a congruence subgroup – it tests whether 𝑥 is “obviously”
congruence, i.e.~whether it has a congruence subgroup datatype. To test whether or not an arithmetic subgroup
of 𝑆𝐿(2, Z) is congruence, use the is_congruence() method instead.
EXAMPLES:

sage: from sage.modular.arithgroup.congroup_generic import is_CongruenceSubgroup


sage: is_CongruenceSubgroup(SL2Z)
True
sage: is_CongruenceSubgroup(Gamma0(13))
True
sage: is_CongruenceSubgroup(Gamma1(6))
True
sage: is_CongruenceSubgroup(GammaH(11, [3]))
True
sage: G = ArithmeticSubgroup_Permutation(L = "(1, 2)", R = "(1, 2)"); is_
˓→CongruenceSubgroup(G)

False
sage: G.is_congruence()
True
sage: is_CongruenceSubgroup(SymmetricGroup(3))
False

44 Chapter 4. Congruence arithmetic subgroups of SL2 (Z)


CHAPTER

FIVE

CONGRUENCE SUBGROUP Γ𝐻 (𝑁 )

AUTHORS:
• Jordi Quer
• David Loeffler
class sage.modular.arithgroup.congroup_gammaH.GammaH_class(level, H, Hlist=None)
Bases: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup
×
The congruence subgroup Γ𝐻 (𝑁 (︂ ) for)︂some subgroup 𝐻 E (Z/𝑁 Z) , which is the subgroup of SL2 (Z) con-
𝑎 𝑏
sisting of matrices of the form with 𝑁 | 𝑐 and 𝑎, 𝑏 ∈ 𝐻.
𝑐 𝑑
atkin_lehner_matrix(Q)
Return the matrix of the Atkin–Lehner–Li operator 𝑊𝑄 associated to an exact divisor 𝑄 of 𝑁 , where 𝑁
is the level of this group; that is, 𝑔𝑐𝑑(𝑄, 𝑁/𝑄) = 1.

Note: We follow
(︂ )︂ the conventions of [AL1978] here, so 𝑊𝑄 is given by the action of any matrix of the form
𝑄𝑥 𝑦
where 𝑥, 𝑦, 𝑧, 𝑤 are integers such that 𝑦 = 1 mod 𝑄, 𝑥 = 1 mod 𝑁/𝑄, and 𝑑𝑒𝑡(𝑊𝑄 ) = 𝑄.
𝑁 𝑧 𝑄𝑤
For convenience, we actually always choose 𝑥 = 𝑦 = 1.

INPUT:
• Q (integer): an integer dividing 𝑁 , where 𝑁 is the level of this group. If this divisor does not satisfy
𝑔𝑐𝑑(𝑄, 𝑁/𝑄) = 1, it will be replaced by the unique integer with this property having the same prime
factors as 𝑄.
EXAMPLES:

sage: Gamma1(994).atkin_lehner_matrix(71)
[ 71 1]
[4970 71]
sage: Gamma1(996).atkin_lehner_matrix(2)
[ 4 1]
[-996 -248]
sage: Gamma1(15).atkin_lehner_matrix(7)
Traceback (most recent call last):
...
ValueError: Q must divide the level

characters_mod_H(sign=None, galois_orbits=False)
Return the characters of (Z/𝑁 Z)* , of the specified sign, which are trivial on H.
INPUT:

45
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

• sign (default: None): if not None, return only characters of the given sign
• galois_orbits (default: False): if True, return only one character from each Galois orbit.
EXAMPLES:

sage: GammaH(5, [-1]).characters_mod_H()


[Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1,
Dirichlet character modulo 5 of conductor 1 mapping 2 |--> 1]
sage: Gamma1(31).characters_mod_H(galois_orbits=True,sign=-1)
[Dirichlet character modulo 31 of conductor 31 mapping 3 |--> zeta30,
Dirichlet character modulo 31 of conductor 31 mapping 3 |--> zeta30^3,
Dirichlet character modulo 31 of conductor 31 mapping 3 |--> zeta30^5,
Dirichlet character modulo 31 of conductor 31 mapping 3 |--> -1]
sage: GammaH(31, [-1]).characters_mod_H(sign=-1)
[]

coset_reps()
Return a set of coset representatives for self \ SL2Z.
EXAMPLES:

sage: list(Gamma1(3).coset_reps())
[
[1 0] [-1 -2] [ 0 -1] [-2 1] [1 0] [-3 -2] [ 0 -1] [-2 -3]
[0 1], [ 3 5], [ 1 0], [ 5 -3], [1 1], [ 8 5], [ 1 2], [ 5 7]
]
sage: len(list(Gamma1(31).coset_reps())) == 31**2 - 1
True

dimension_cusp_forms(k=2)
Return the dimension of the space of weight k cusp forms for this group. For 𝑘 ≥ 2, this is given by
a standard formula in terms of k and various invariants of the group; see Diamond + Shurman, “A First
Course in Modular Forms”, section 3.5 and 3.6. If k is not given, default to k = 2.
For dimensions of spaces of cusp forms with character for Gamma1, use the dimension_cusp_forms
method of the Gamma1 class, or the standalone function dimension_cusp_forms().
For weight 1 cusp forms, there is no simple formula for the dimensions, so we first try to rule out nonzero
cusp forms existing via Riemann-Roch, and if this fails, we trigger computation of the cusp form space
using Schaeffer’s algorithm; this can be quite expensive in large levels.
EXAMPLES:

sage: GammaH(31, [23]).dimension_cusp_forms(10)


69
sage: GammaH(31, [7]).dimension_cusp_forms(1)
1

dimension_new_cusp_forms(k=2, p=0)
Return the dimension of the space of new (or 𝑝-new) weight 𝑘 cusp forms for this congruence subgroup.
INPUT:
• k - an integer (default: 2), the weight. Not fully implemented for k = 1.
• p - integer (default: 0); if nonzero, compute the 𝑝-new subspace.
OUTPUT: Integer
EXAMPLES:

46 Chapter 5. Congruence Subgroup Γ𝐻 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: GammaH(33,[2]).dimension_new_cusp_forms()
3
sage: Gamma1(4*25).dimension_new_cusp_forms(2, p=5)
225
sage: Gamma1(33).dimension_new_cusp_forms(2)
19
sage: Gamma1(33).dimension_new_cusp_forms(2,p=11)
21

divisor_subgroups()
Given this congruence subgroup Γ𝐻 (𝑁 ), return all subgroups Γ𝐺 (𝑀 ) for 𝑀 a divisor of 𝑁 and such that
𝐺 is equal to the image of 𝐻 modulo 𝑀 .
EXAMPLES:

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()
[Modular Group SL(2,Z),
Congruence Subgroup Gamma0(3),
Congruence Subgroup Gamma0(11),
Congruence Subgroup Gamma_H(33) with H generated by [2]]

extend(M)
Return the subgroup of Γ0 (𝑀 ), for 𝑀 a multiple of 𝑁 , obtained by taking the preimage of this group
under the reduction map; in other words, the intersection of this group with Γ0 (𝑀 ).
EXAMPLES:

sage: G = GammaH(33, [2])


sage: G.extend(99)
Congruence Subgroup Gamma_H(99) with H generated by [2, 17, 68]
sage: G.extend(11)
Traceback (most recent call last):
...
ValueError: M (=11) must be a multiple of the level (33) of self

gamma0_coset_reps()
Return a set of coset representatives for self \ Gamma0(N), where N is the level of self.
EXAMPLES:

sage: GammaH(108, [1,-1]).gamma0_coset_reps()


[
[1 0] [-43 -45] [ 31 33] [-49 -54] [ 25 28] [-19 -22]
[0 1], [108 113], [108 115], [108 119], [108 121], [108 125],

[-17 -20] [ 47 57] [ 13 16] [ 41 52] [ 7 9] [-37 -49]


[108 127], [108 131], [108 133], [108 137], [108 139], [108 143],

[-35 -47] [ 29 40] [ -5 -7] [ 23 33] [-11 -16] [ 53 79]


[108 145], [108 149], [108 151], [108 155], [108 157], [108 161]
]

generators(algorithm=’farey’)
Return generators for this congruence subgroup. The result is cached.

47
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

INPUT:
• algorithm (string): either farey (default) or todd-coxeter.
If algorithm is set to "farey", then the generators will be calculated using Farey symbols, which will
always return a minimal generating set. See farey_symbol for more information.
If algorithm is set to "todd-coxeter", a simpler algorithm based on Todd-Coxeter enumeration
will be used. This tends to return far larger sets of generators.
EXAMPLES:

sage: GammaH(7, [2]).generators()


[
[1 1] [ 2 -1] [ 4 -3]
[0 1], [ 7 -3], [ 7 -5]
]
sage: GammaH(7, [2]).generators(algorithm="todd-coxeter")
[
[1 1] [-90 29] [ 15 4] [-10 -3] [ 1 -1] [1 0] [1 1] [-3 -1]
[0 1], [301 -97], [-49 -13], [ 7 2], [ 0 1], [7 1], [0 1], [ 7 2],

[-13 4] [-5 -1] [-5 -2] [-10 3] [ 1 0] [ 9 -1] [-20 7]


[ 42 -13], [21 4], [28 11], [ 63 -19], [-7 1], [28 -3], [-63 22],

[1 0] [-3 -1] [ 15 -4] [ 2 -1] [ 22 -7] [-5 1] [ 8 -3]


[7 1], [ 7 2], [ 49 -13], [ 7 -3], [ 63 -20], [14 -3], [-21 8],

[11 5] [-13 -4]


[35 16], [-42 -13]
]

image_mod_n()
Return the image of this group in 𝑆𝐿(2, Z/𝑁 Z).
EXAMPLES:

sage: Gamma0(3).image_mod_n()
Matrix group over Ring of integers modulo 3 with 2 generators (
[2 0] [1 1]
[0 2], [0 1]
)

index()
Return the index of self in SL2Z.
EXAMPLES:

sage: [G.index() for G in Gamma0(40).gamma_h_subgroups()]


[72, 144, 144, 144, 144, 288, 288, 288, 288, 144, 288, 288, 576, 576, 144,
˓→288, 288, 576, 576, 144, 288, 288, 576, 576, 288, 576, 1152]

is_even()
Return True precisely if this subgroup contains the matrix -1.
EXAMPLES:

sage: GammaH(10, [3]).is_even()


True
(continues on next page)

48 Chapter 5. Congruence Subgroup Γ𝐻 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: GammaH(14, [1]).is_even()
False

is_subgroup(other)
Return True if self is a subgroup of right, and False otherwise.
EXAMPLES:

sage: GammaH(24,[7]).is_subgroup(SL2Z)
True
sage: GammaH(24,[7]).is_subgroup(Gamma0(8))
True
sage: GammaH(24, []).is_subgroup(GammaH(24, [7]))
True
sage: GammaH(24, []).is_subgroup(Gamma1(24))
True
sage: GammaH(24, [17]).is_subgroup(GammaH(24, [7]))
False
sage: GammaH(1371, [169]).is_subgroup(GammaH(457, [169]))
True

ncusps()
Return the number of orbits of cusps (regular or otherwise) for this subgroup.
EXAMPLES:

sage: GammaH(33,[2]).ncusps()
8
sage: GammaH(32079, [21676]).ncusps()
28800

AUTHORS:
• Jordi Quer
nirregcusps()
Return the number of irregular cusps for this subgroup.
EXAMPLES:

sage: GammaH(3212, [2045, 2773]).nirregcusps()


720

nregcusps()
Return the number of orbits of regular cusps for this subgroup. A cusp is regular if we may find a parabolic
element generating the stabiliser of that cusp whose eigenvalues are both +1 rather than -1. If G contains
-1, all cusps are regular.
EXAMPLES:

sage: GammaH(20, [17]).nregcusps()


4
sage: GammaH(20, [17]).nirregcusps()
2
sage: GammaH(3212, [2045, 2773]).nregcusps()
1440
sage: GammaH(3212, [2045, 2773]).nirregcusps()
720

49
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

AUTHOR:
• Jordi Quer
nu2()
Return the number of orbits of elliptic points of order 2 for this group.
EXAMPLES:
sage: [H.nu2() for n in [1..10] for H in Gamma0(n).gamma_h_subgroups()]
[1, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0,
˓→ 0]

sage: GammaH(33,[2]).nu2()
0
sage: GammaH(5,[2]).nu2()
2

AUTHORS:
• Jordi Quer
nu3()
Return the number of orbits of elliptic points of order 3 for this group.
EXAMPLES:
sage: [H.nu3() for n in [1..10] for H in Gamma0(n).gamma_h_subgroups()]
[1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
˓→ 0]

sage: GammaH(33,[2]).nu3()
0
sage: GammaH(7,[2]).nu3()
2

AUTHORS:
• Jordi Quer
reduce_cusp(c)
Compute a minimal representative for the given cusp c. Returns a cusp c’ which is equivalent to the given
cusp, and is in lowest terms with minimal positive denominator, and minimal positive numerator for that
denominator.
Two cusps 𝑢1 /𝑣1 and 𝑢2 /𝑣2 are equivalent modulo Γ𝐻 (𝑁 ) if and only if

𝑣1 = ℎ𝑣2 mod 𝑁 and 𝑢1 = ℎ−1 𝑢2 mod gcd(𝑣1 , 𝑁 )

or

𝑣1 = −ℎ𝑣2 mod 𝑁 and 𝑢1 = −ℎ−1 𝑢2 mod gcd(𝑣1 , 𝑁 )

for some ℎ ∈ 𝐻.
EXAMPLES:
sage: GammaH(6,[5]).reduce_cusp(5/3)
1/3
sage: GammaH(12,[5]).reduce_cusp(Cusp(8,9))
1/3
sage: GammaH(12,[5]).reduce_cusp(5/12)
Infinity
(continues on next page)

50 Chapter 5. Congruence Subgroup Γ𝐻 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: GammaH(12,[]).reduce_cusp(Cusp(5,12))
5/12
sage: GammaH(21,[5]).reduce_cusp(Cusp(-9/14))
1/7
sage: Gamma1(5).reduce_cusp(oo)
Infinity
sage: Gamma1(5).reduce_cusp(0)
0

restrict(M)
Return the subgroup of Γ0 (𝑀 ), for 𝑀 a divisor of 𝑁 , obtained by taking the image of this group under
reduction modulo 𝑁 .
EXAMPLES:

sage: G = GammaH(33,[2])
sage: G.restrict(11)
Congruence Subgroup Gamma0(11)
sage: G.restrict(1)
Modular Group SL(2,Z)
sage: G.restrict(15)
Traceback (most recent call last):
...
ValueError: M (=15) must be a divisor of the level (33) of self

to_even_subgroup()
Return the smallest even subgroup of 𝑆𝐿(2, Z) containing self.
EXAMPLES:

sage: GammaH(11, [4]).to_even_subgroup()


Congruence Subgroup Gamma0(11)
sage: Gamma1(11).to_even_subgroup()
Congruence Subgroup Gamma_H(11) with H generated by [10]

sage.modular.arithgroup.congroup_gammaH.GammaH_constructor(level, H)
Return
(︂ the congruence subgroup Γ𝐻 (𝑁 ), which is the subgroup of 𝑆𝐿2 (Z) consisting of matrices of the form
)︂
𝑎 𝑏
with 𝑁 |𝑐 and 𝑎, 𝑏 ∈ 𝐻, for 𝐻 a specified subgroup of (Z/𝑁 Z)× .
𝑐 𝑑
INPUT:
• level – an integer
• H – either 0, 1, or a list
– If H is a list, return Γ𝐻 (𝑁 ), where 𝐻 is the subgroup of (Z/𝑁 Z)* generated by the elements of
the list.
– If H = 0, returns Γ0 (𝑁 ).
– If H = 1, returns Γ1 (𝑁 ).
EXAMPLES:

sage: GammaH(11,0) # indirect doctest


Congruence Subgroup Gamma0(11)
sage: GammaH(11,1)
Congruence Subgroup Gamma1(11)
(continues on next page)

51
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: GammaH(11,[10])
Congruence Subgroup Gamma_H(11) with H generated by [10]
sage: GammaH(11,[10,1])
Congruence Subgroup Gamma_H(11) with H generated by [10]
sage: GammaH(14,[10])
Traceback (most recent call last):
...
ArithmeticError: The generators [10] must be units modulo 14

sage.modular.arithgroup.congroup_gammaH.is_GammaH(x)
Return True if x is a congruence subgroup of type GammaH.
EXAMPLES:

sage: from sage.modular.arithgroup.all import is_GammaH


sage: is_GammaH(GammaH(13, [2]))
True
sage: is_GammaH(Gamma0(6))
True
sage: is_GammaH(Gamma1(6))
True
sage: is_GammaH(sage.modular.arithgroup.congroup_generic.CongruenceSubgroup(5))
False

sage.modular.arithgroup.congroup_gammaH.mumu(N)
Return 0 if any cube divides 𝑁 . Otherwise return (−2)𝑣 where 𝑣 is the number of primes that exactly divide 𝑁 .
This is similar to the Möbius function.
INPUT:
• N - an integer at least 1
OUTPUT: Integer
EXAMPLES:

sage: from sage.modular.arithgroup.congroup_gammaH import mumu


sage: mumu(27)
0
sage: mumu(6*25)
4
sage: mumu(7*9*25)
-2
sage: mumu(9*25)
1

52 Chapter 5. Congruence Subgroup Γ𝐻 (𝑁 )


CHAPTER

SIX

CONGRUENCE SUBGROUP Γ1 (𝑁 )

class sage.modular.arithgroup.congroup_gamma1.Gamma1_class(level)
Bases: sage.modular.arithgroup.congroup_gammaH.GammaH_class
The congruence subgroup Γ1 (𝑁 ).
dimension_cusp_forms(k=2, eps=None, algorithm=’CohenOesterle’)
Return the dimension of the space of cusp forms for self, or the dimension of the subspace corresponding
to the given character if one is supplied.
INPUT:
• k - an integer (default: 2), the weight.
• eps - either None or a Dirichlet character modulo N, where N is the level of this group. If this is
None, then the dimension of the whole space is returned; otherwise, the dimension of the subspace of
forms of character eps.
• algorithm – either “CohenOesterle” (the default) or “Quer”. This specifies the method to use in
the case of nontrivial character: either the Cohen–Oesterle formula as described in Stein’s book, or by
Möbius inversion using the subgroups GammaH (a method due to Jordi Quer). Ignored for weight 1.
EXAMPLES:
We compute the same dimension in two different ways

sage: K = CyclotomicField(3)
sage: eps = DirichletGroup(7*43,K).0^2
sage: G = Gamma1(7*43)

Via Cohen–Oesterle:

sage: Gamma1(7*43).dimension_cusp_forms(2, eps)


28

Via Quer’s method:

sage: Gamma1(7*43).dimension_cusp_forms(2, eps, algorithm="Quer")


28

Some more examples:

sage: G.<eps> = DirichletGroup(9)


sage: [Gamma1(9).dimension_cusp_forms(k, eps) for k in [1..10]]
[0, 0, 1, 0, 3, 0, 5, 0, 7, 0]
sage: [Gamma1(9).dimension_cusp_forms(k, eps^2) for k in [1..10]]
[0, 0, 0, 2, 0, 4, 0, 6, 0, 8]

53
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

In weight 1, we can sometimes rule out cusp forms existing via Riemann-Roch, but if this does not work,
we trigger computation of the cusp forms space via Schaeffer’s algorithm:
sage: chi = [u for u in DirichletGroup(40) if u(-1) == -1 and u(21) == 1][0]
sage: Gamma1(40).dimension_cusp_forms(1, chi)
0
sage: G = DirichletGroup(57); chi = (G.0) * (G.1)^6
sage: Gamma1(57).dimension_cusp_forms(1, chi)
1

dimension_eis(k=2, eps=None, algorithm=’CohenOesterle’)


Return the dimension of the space of Eisenstein series forms for self, or the dimension of the subspace
corresponding to the given character if one is supplied.
INPUT:
• k - an integer (default: 2), the weight.
• eps - either None or a Dirichlet character modulo N, where N is the level of this group. If this is
None, then the dimension of the whole space is returned; otherwise, the dimension of the subspace of
Eisenstein series of character eps.
• algorithm – either “CohenOesterle” (the default) or “Quer”. This specifies the method to use in
the case of nontrivial character: either the Cohen–Oesterle formula as described in Stein’s book, or by
Möbius inversion using the subgroups GammaH (a method due to Jordi Quer).
AUTHORS:
• William Stein - Cohen–Oesterle algorithm
• Jordi Quer - algorithm based on GammaH subgroups
• David Loeffler (2009) - code refactoring
EXAMPLES:
The following two computations use different algorithms:
sage: [Gamma1(36).dimension_eis(1,eps) for eps in DirichletGroup(36)]
[0, 4, 3, 0, 0, 2, 6, 0, 0, 2, 3, 0]
sage: [Gamma1(36).dimension_eis(1,eps,algorithm="Quer") for eps in
˓→DirichletGroup(36)]

[0, 4, 3, 0, 0, 2, 6, 0, 0, 2, 3, 0]

So do these:
sage: [Gamma1(48).dimension_eis(3,eps) for eps in DirichletGroup(48)]
[0, 12, 0, 4, 0, 8, 0, 4, 12, 0, 4, 0, 8, 0, 4, 0]
sage: [Gamma1(48).dimension_eis(3,eps,algorithm="Quer") for eps in
˓→DirichletGroup(48)]

[0, 12, 0, 4, 0, 8, 0, 4, 12, 0, 4, 0, 8, 0, 4, 0]

dimension_modular_forms(k=2, eps=None, algorithm=’CohenOesterle’)


Return the dimension of the space of modular forms for self, or the dimension of the subspace correspond-
ing to the given character if one is supplied.
INPUT:
• k - an integer (default: 2), the weight.
• eps - either None or a Dirichlet character modulo N, where N is the level of this group. If this is
None, then the dimension of the whole space is returned; otherwise, the dimension of the subspace of
forms of character eps.

54 Chapter 6. Congruence Subgroup Γ1 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

• algorithm – either “CohenOesterle” (the default) or “Quer”. This specifies the method to use in
the case of nontrivial character: either the Cohen–Oesterle formula as described in Stein’s book, or by
Möbius inversion using the subgroups GammaH (a method due to Jordi Quer).
EXAMPLES:

sage: K = CyclotomicField(3)
sage: eps = DirichletGroup(7*43,K).0^2
sage: G = Gamma1(7*43)

sage: G.dimension_modular_forms(2, eps)


32
sage: G.dimension_modular_forms(2, eps, algorithm="Quer")
32

dimension_new_cusp_forms(k=2, eps=None, p=0, algorithm=’CohenOesterle’)


Dimension of the new subspace (or 𝑝-new subspace) of cusp forms of weight 𝑘 and character 𝜀.
INPUT:
• k - an integer (default: 2)
• eps - a Dirichlet character
• p - a prime (default: 0); just the 𝑝-new subspace if given
• algorithm - either “CohenOesterle” (the default) or “Quer”. This specifies the method to use in
the case of nontrivial character: either the Cohen–Oesterle formula as described in Stein’s book, or by
Möbius inversion using the subgroups GammaH (a method due to Jordi Quer).
EXAMPLES:

sage: G = DirichletGroup(9)
sage: eps = G.0^3
sage: eps.conductor()
3
sage: [Gamma1(9).dimension_new_cusp_forms(k, eps) for k in [2..10]]
[0, 0, 0, 2, 0, 2, 0, 2, 0]
sage: [Gamma1(9).dimension_cusp_forms(k, eps) for k in [2..10]]
[0, 0, 0, 2, 0, 4, 0, 6, 0]
sage: [Gamma1(9).dimension_new_cusp_forms(k, eps, 3) for k in [2..10]]
[0, 0, 0, 2, 0, 2, 0, 2, 0]

Double check using modular symbols (independent calculation):

sage: [ModularSymbols(eps,k,sign=1).cuspidal_subspace().new_subspace().
˓→dimension() for k in [2..10]]
[0, 0, 0, 2, 0, 2, 0, 2, 0]
sage: [ModularSymbols(eps,k,sign=1).cuspidal_subspace().new_subspace(3).
˓→dimension() for k in [2..10]]
[0, 0, 0, 2, 0, 2, 0, 2, 0]

Another example at level 33:

sage: G = DirichletGroup(33)
sage: eps = G.1
sage: eps.conductor()
11
sage: [Gamma1(33).dimension_new_cusp_forms(k, G.1) for k in [2..4]]
[0, 4, 0]
(continues on next page)

55
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: [Gamma1(33).dimension_new_cusp_forms(k, G.1, algorithm="Quer") for k in
˓→[2..4]]

[0, 4, 0]
sage: [Gamma1(33).dimension_new_cusp_forms(k, G.1^2) for k in [2..4]]
[2, 0, 6]
sage: [Gamma1(33).dimension_new_cusp_forms(k, G.1^2, p=3) for k in [2..4]]
[2, 0, 6]

generators(algorithm=’farey’)
Return generators for this congruence subgroup. The result is cached.
INPUT:
• algorithm (string): either farey (default) or todd-coxeter.
If algorithm is set to "farey", then the generators will be calculated using Farey symbols, which will
always return a minimal generating set. See farey_symbol for more information.
If algorithm is set to "todd-coxeter", a simpler algorithm based on Todd-Coxeter enumeration
will be used. This tends to return far larger sets of generators.
EXAMPLES:

sage: Gamma1(3).generators()
[
[1 1] [ 1 -1]
[0 1], [ 3 -2]
]
sage: Gamma1(3).generators(algorithm="todd-coxeter")
[
[1 1] [-20 9] [ 4 1] [-5 -2] [ 1 -1] [1 0] [1 1] [-5 2]
[0 1], [ 51 -23], [-9 -2], [ 3 1], [ 0 1], [3 1], [0 1], [12 -5],

[ 1 0] [ 4 -1] [ -5 3] [ 1 -1] [ 7 -3] [ 4 -1] [ -5 3]


[-3 1], [ 9 -2], [-12 7], [ 3 -2], [12 -5], [ 9 -2], [-12 7]
]

index()
Return the index of self in the full modular group. This is given by the formula
∏︁ (︂ 1
)︂
𝑁2 1− 2 .
𝑝
𝑝|𝑁
𝑝 prime

EXAMPLES:

sage: Gamma1(180).index()
20736
sage: [Gamma1(n).projective_index() for n in [1..16]]
[1, 3, 4, 6, 12, 12, 24, 24, 36, 36, 60, 48, 84, 72, 96, 96]

is_even()
Return True precisely if this subgroup contains the matrix -1.
EXAMPLES:

sage: Gamma1(1).is_even()
True
(continues on next page)

56 Chapter 6. Congruence Subgroup Γ1 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: Gamma1(2).is_even()
True
sage: Gamma1(15).is_even()
False

is_subgroup(right)
Return True if self is a subgroup of right.
EXAMPLES:

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
sage: Gamma1(6).is_subgroup(Gamma0(2))
True
sage: Gamma1(80).is_subgroup(GammaH(40, []))
True
sage: Gamma1(80).is_subgroup(GammaH(40, [21]))
True

ncusps()
Return the number of cusps of this subgroup Γ1 (𝑁 ).
EXAMPLES:

sage: [Gamma1(n).ncusps() for n in [1..15]]


[1, 2, 2, 3, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 16]
sage: [Gamma1(n).ncusps() for n in prime_range(2, 100)]
[2, 2, 4, 6, 10, 12, 16, 18, 22, 28, 30, 36, 40, 42, 46, 52, 58, 60, 66, 70,
˓→72, 78, 82, 88, 96]

nu2()
Calculate the number of orbits of elliptic points of order 2 for this subgroup Γ1 (𝑁 ). This is known to be 0
if N > 2.
EXAMPLES:

sage: Gamma1(2).nu2()
1
sage: Gamma1(457).nu2()
0
sage: [Gamma1(n).nu2() for n in [1..16]]
[1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

nu3()
Calculate the number of orbits of elliptic points of order 3 for this subgroup Γ1 (𝑁 ). This is known to be 0
if N > 3.
EXAMPLES:

sage: Gamma1(2).nu3()
0
(continues on next page)

57
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: Gamma1(3).nu3()
1
sage: Gamma1(457).nu3()
0
sage: [Gamma1(n).nu3() for n in [1..10]]
[1, 0, 1, 0, 0, 0, 0, 0, 0, 0]

sage.modular.arithgroup.congroup_gamma1.Gamma1_constructor(N)
Return the congruence subgroup Γ1 (𝑁 ).
EXAMPLES:

sage: Gamma1(5) # indirect doctest


Congruence Subgroup Gamma1(5)
sage: G = Gamma1(23)
sage: G is Gamma1(23)
True
sage: G is GammaH(23, [1])
True
sage: TestSuite(G).run()
sage: G is loads(dumps(G))
True

sage.modular.arithgroup.congroup_gamma1.is_Gamma1(x)
Return True if x is a congruence subgroup of type Gamma1.
EXAMPLES:

sage: from sage.modular.arithgroup.all import is_Gamma1


sage: is_Gamma1(SL2Z)
False
sage: is_Gamma1(Gamma1(13))
True
sage: is_Gamma1(Gamma0(6))
False
sage: is_Gamma1(GammaH(12, [])) # trick question!
True
sage: is_Gamma1(GammaH(12, [5]))
False

58 Chapter 6. Congruence Subgroup Γ1 (𝑁 )


CHAPTER

SEVEN

CONGRUENCE SUBGROUP Γ0 (𝑁 )

class sage.modular.arithgroup.congroup_gamma0.Gamma0_class(level)
Bases: sage.modular.arithgroup.congroup_gammaH.GammaH_class
The congruence subgroup Γ0 (𝑁 ).
coset_reps()
Return representatives for the right cosets of this congruence subgroup in SL2 (Z) as a generator object.
Use list(self.coset_reps()) to obtain coset reps as a list.
EXAMPLES:

sage: list(Gamma0(5).coset_reps())
[
[1 0] [ 0 -1] [1 0] [ 0 -1] [ 0 -1] [ 0 -1]
[0 1], [ 1 0], [1 1], [ 1 2], [ 1 3], [ 1 4]
]
sage: list(Gamma0(4).coset_reps())
[
[1 0] [ 0 -1] [1 0] [ 0 -1] [ 0 -1] [1 0]
[0 1], [ 1 0], [1 1], [ 1 2], [ 1 3], [2 1]
]
sage: list(Gamma0(1).coset_reps())
[
[1 0]
[0 1]
]

dimension_new_cusp_forms(k=2, p=0)
Return the dimension of the space of new (or 𝑝-new) weight 𝑘 cusp forms for this congruence subgroup.
INPUT:
• 𝑘 – an integer (default: 2), the weight. Not fully implemented for 𝑘 = 1.
• 𝑝 – integer (default: 0); if nonzero, compute the 𝑝-new subspace.
OUTPUT: Integer
ALGORITHM:
This comes from the formula given in Theorem 1 of http://www.math.ubc.ca/~gerg/papers/downloads/
DSCFN.pdf
EXAMPLES:

59
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: Gamma0(11000).dimension_new_cusp_forms()
240
sage: Gamma0(11000).dimension_new_cusp_forms(k=1)
0
sage: Gamma0(22).dimension_new_cusp_forms(k=4)
3
sage: Gamma0(389).dimension_new_cusp_forms(k=2,p=17)
32

divisor_subgroups()
Return the subgroups of SL2Z of the form Gamma0(M) that contain this subgroup, i.e. those for M a
divisor of N.
EXAMPLES:

sage: Gamma0(24).divisor_subgroups()
[Modular Group SL(2,Z),
Congruence Subgroup Gamma0(2),
Congruence Subgroup Gamma0(3),
Congruence Subgroup Gamma0(4),
Congruence Subgroup Gamma0(6),
Congruence Subgroup Gamma0(8),
Congruence Subgroup Gamma0(12),
Congruence Subgroup Gamma0(24)]

gamma_h_subgroups()
Return the subgroups of the form Γ𝐻 (𝑁 ) contained in self, where 𝑁 is the level of self.
EXAMPLES:

sage: G = Gamma0(11)
sage: G.gamma_h_subgroups()
[Congruence Subgroup Gamma0(11), Congruence Subgroup Gamma_H(11) with H
˓→generated by [3], Congruence Subgroup Gamma_H(11) with H generated by [10],

˓→Congruence Subgroup Gamma1(11)]

sage: G = Gamma0(12)
sage: G.gamma_h_subgroups()
[Congruence Subgroup Gamma0(12), Congruence Subgroup Gamma_H(12) with H
˓→generated by [7], Congruence Subgroup Gamma_H(12) with H generated by [11],

˓→Congruence Subgroup Gamma_H(12) with H generated by [5], Congruence

˓→Subgroup Gamma1(12)]

generators(algorithm=’farey’)
Return generators for this congruence subgroup.
INPUT:
• algorithm (string): either farey (default) or todd-coxeter.
If algorithm is set to "farey", then the generators will be calculated using Farey symbols, which will
always return a minimal generating set. See farey_symbol for more information.
If algorithm is set to "todd-coxeter", a simpler algorithm based on Todd-Coxeter enumeration
will be used. This tends to return far larger sets of generators.
EXAMPLES:

sage: Gamma0(3).generators()
[
(continues on next page)

60 Chapter 7. Congruence Subgroup Γ0 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


[1 1] [-1 1]
[0 1], [-3 2]
]
sage: Gamma0(3).generators(algorithm="todd-coxeter")
[
[1 1] [-1 0] [ 1 -1] [1 0] [1 1] [-1 0] [ 1 0]
[0 1], [ 0 -1], [ 0 1], [3 1], [0 1], [ 3 -1], [-3 1]
]
sage: SL2Z.gens()
(
[ 0 -1] [1 1]
[ 1 0], [0 1]
)

index()
Return the index of self in the full modular group.
This is given by
∏︁ (︂ 1
)︂
𝑁 1+ .
𝑝
𝑝|𝑁
𝑝 prime

EXAMPLES:
sage: [Gamma0(n).index() for n in [1..19]]
[1, 3, 4, 6, 6, 12, 8, 12, 12, 18, 12, 24, 14, 24, 24, 24, 18, 36, 20]
sage: Gamma0(32041).index()
32220

is_even()
Return True precisely if this subgroup contains the matrix -1.
Since Γ0(𝑁 ) always contains the matrix -1, this always returns True.
EXAMPLES:
sage: Gamma0(12).is_even()
True
sage: SL2Z.is_even()
True

is_subgroup(right)
Return True if self is a subgroup of right.
EXAMPLES:
sage: G = Gamma0(20)
sage: G.is_subgroup(SL2Z)
True
sage: G.is_subgroup(Gamma0(4))
True
sage: G.is_subgroup(Gamma0(20))
True
sage: G.is_subgroup(Gamma0(7))
False
sage: G.is_subgroup(Gamma1(20))
False
(continues on next page)

61
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: G.is_subgroup(GammaH(40, []))
False
sage: Gamma0(80).is_subgroup(GammaH(40, [31, 21, 17]))
True
sage: Gamma0(2).is_subgroup(Gamma1(2))
True

ncusps()
Return the number of cusps of this subgroup Γ0 (𝑁 ).
EXAMPLES:

sage: [Gamma0(n).ncusps() for n in [1..19]]


[1, 2, 2, 3, 2, 4, 2, 4, 4, 4, 2, 6, 2, 4, 4, 6, 2, 8, 2]
sage: [Gamma0(n).ncusps() for n in prime_range(2,100)]
[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]

nu2()
Return the number of elliptic points of order 2 for this congruence subgroup Γ0 (𝑁 ). The number of these
is given by a standard formula: 0 if 𝑁 is divisible by 4 or any prime congruent to -1 mod 4, and otherwise
2𝑑 where d is the number of odd primes dividing 𝑁 .
EXAMPLES:

sage: Gamma0(2).nu2()
1
sage: Gamma0(4).nu2()
0
sage: Gamma0(21).nu2()
0
sage: Gamma0(1105).nu2()
8
sage: [Gamma0(n).nu2() for n in [1..19]]
[1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 2, 0, 0]

nu3()
Return the number of elliptic points of order 3 for this congruence subgroup Γ0 (𝑁 ). The number of these
is given by a standard formula: 0 if 𝑁 is divisible by 9 or any prime congruent to -1 mod 3, and otherwise
2𝑑 where d is the number of primes other than 3 dividing 𝑁 .
EXAMPLES:

sage: Gamma0(2).nu3()
0
sage: Gamma0(3).nu3()
1
sage: Gamma0(9).nu3()
0
sage: Gamma0(7).nu3()
2
sage: Gamma0(21).nu3()
2
sage: Gamma0(1729).nu3()
8

sage.modular.arithgroup.congroup_gamma0.Gamma0_constructor(N)
Return the congruence subgroup Gamma0(N).

62 Chapter 7. Congruence Subgroup Γ0 (𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

EXAMPLES:

sage: G = Gamma0(51) ; G # indirect doctest


Congruence Subgroup Gamma0(51)
sage: G == Gamma0(51)
True
sage: G is Gamma0(51)
True

sage.modular.arithgroup.congroup_gamma0.is_Gamma0(x)
Return True if x is a congruence subgroup of type Gamma0.
EXAMPLES:

sage: from sage.modular.arithgroup.all import is_Gamma0


sage: is_Gamma0(SL2Z)
True
sage: is_Gamma0(Gamma0(13))
True
sage: is_Gamma0(Gamma1(6))
False

63
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

64 Chapter 7. Congruence Subgroup Γ0 (𝑁 )


CHAPTER

EIGHT

CONGRUENCE SUBGROUP Γ(𝑁 )

class sage.modular.arithgroup.congroup_gamma.Gamma_class(*args, **kwds)


Bases: sage.modular.arithgroup.congroup_generic.CongruenceSubgroup
The principal congruence subgroup Γ(𝑁 ).
are_equivalent(x, y, trans=False)
Check if the cusps 𝑥 and 𝑦 are equivalent under the action of this group.
ALGORITHM: The cusps 𝑢1 /𝑣1 and 𝑢2 /𝑣2 are equivalent modulo Γ(𝑁 ) if and only if (𝑢1 , 𝑣1 ) =
±(𝑢2 , 𝑣2 ) mod 𝑁 .
EXAMPLES:

sage: Gamma(7).are_equivalent(Cusp(2/3), Cusp(5/4))


True

image_mod_n()
Return the image of this group modulo 𝑁 , as a subgroup of 𝑆𝐿(2, Z/𝑁 Z). This is just the trivial subgroup.
EXAMPLES:

sage: Gamma(3).image_mod_n()
Matrix group over Ring of integers modulo 3 with 1 generators (
[1 0]
[0 1]
)

index()
Return the index of self in the full modular group. This is given by
∏︁ (︀
𝑝3𝑒 − 𝑝3𝑒−2 .
)︀

𝑝|𝑁
𝑝 prime

EXAMPLES:

sage: [Gamma(n).index() for n in [1..19]]


[1, 6, 24, 48, 120, 144, 336, 384, 648, 720, 1320, 1152, 2184, 2016, 2880,
˓→3072, 4896, 3888, 6840]

sage: Gamma(32041).index()
32893086819240

ncusps()
Return the number of cusps of this subgroup Γ(𝑁 ).
EXAMPLES:

65
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: [Gamma(n).ncusps() for n in [1..19]]


[1, 3, 4, 6, 12, 12, 24, 24, 36, 36, 60, 48, 84, 72, 96, 96, 144, 108, 180]
sage: Gamma(30030).ncusps()
278691840
sage: Gamma(2^30).ncusps()
432345564227567616

nirregcusps()
Return the number of irregular cusps of self. For principal congruence subgroups this is always 0.
EXAMPLES:
sage: Gamma(17).nirregcusps()
0

nu3()
Return the number of elliptic points of order 3 for this arithmetic subgroup. Since this subgroup is Γ(𝑁 )
for 𝑁 ≥ 2, there are no such points, so we return 0.
EXAMPLES:
sage: Gamma(89).nu3()
0

reduce_cusp(c)
Calculate the unique reduced representative of the equivalence of the cusp 𝑐 modulo this group. The
reduced representative of an equivalence class is the unique cusp in the class of the form 𝑢/𝑣 with 𝑢, 𝑣 ≥ 0
coprime, 𝑣 minimal, and 𝑢 minimal for that 𝑣.
EXAMPLES:
sage: Gamma(5).reduce_cusp(1/5)
Infinity
sage: Gamma(5).reduce_cusp(7/8)
3/2
sage: Gamma(6).reduce_cusp(4/3)
2/3

sage.modular.arithgroup.congroup_gamma.Gamma_constructor(N)
Return the congruence subgroup Γ(𝑁 ).
EXAMPLES:
sage: Gamma(5) # indirect doctest
Congruence Subgroup Gamma(5)
sage: G = Gamma(23)
sage: G is Gamma(23)
True
sage: TestSuite(G).run()

Test global uniqueness:


sage: G = Gamma(17)
sage: G is loads(dumps(G))
True
sage: G2 = sage.modular.arithgroup.congroup_gamma.Gamma_class(17)
sage: G == G2
True
(continues on next page)

66 Chapter 8. Congruence Subgroup Γ(𝑁 )


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: G is G2
False

sage.modular.arithgroup.congroup_gamma.is_Gamma(x)
Return True if x is a congruence subgroup of type Gamma.
EXAMPLES:

sage: from sage.modular.arithgroup.all import is_Gamma


sage: is_Gamma(Gamma0(13))
False
sage: is_Gamma(Gamma(4))
True

67
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

68 Chapter 8. Congruence Subgroup Γ(𝑁 )


CHAPTER

NINE

THE MODULAR GROUP SL2 (Z)

AUTHORS:
• Niles Johnson (2010-08): trac ticket #3893: random_element() should pass on *args and **kwds.
class sage.modular.arithgroup.congroup_sl2z.SL2Z_class
Bases: sage.modular.arithgroup.congroup_gamma0.Gamma0_class
The full modular group SL2 (Z), regarded as a congruence subgroup of itself.
is_subgroup(right)
Return True if self is a subgroup of right.
EXAMPLES:

sage: SL2Z.is_subgroup(SL2Z)
True
sage: SL2Z.is_subgroup(Gamma1(1))
True
sage: SL2Z.is_subgroup(Gamma0(6))
False

random_element(bound=100, *args, **kwds)


Return a random element of SL2 (Z) with entries whose absolute value is strictly less than bound (default
100). Additional arguments and keywords are passed to the random_element method of ZZ.
(Algorithm: Generate a random pair of integers at most bound. If they are not coprime, throw them away
and start)︂ again. If they are, find an element of SL2 (Z) whose bottom row is that, and left-multiply it by
(︂
1 𝑤
for an integer 𝑤 randomly chosen from a small enough range that the answer still has entries at
0 1
most bound.)
It is, unfortunately, not true that all elements of SL2Z with entries < bound appear with equal probability;
those with larger bottom rows are favoured, because there are fewer valid possibilities for w.
EXAMPLES:

sage: SL2Z.random_element()
[60 13]
[83 18]
sage: SL2Z.random_element(5)
[-1 3]
[ 1 -4]

Passes extra positional or keyword arguments through:

69
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sage: SL2Z.random_element(5, distribution='1/n')


[ 1 -4]
[ 0 1]

reduce_cusp(c)
Return the unique reduced cusp equivalent to c under the action of self. Always returns Infinity, since there
is only one equivalence class of cusps for 𝑆𝐿2 (𝑍).
EXAMPLES:

sage: SL2Z.reduce_cusp(Cusps(-1/4))
Infinity

sage.modular.arithgroup.congroup_sl2z.is_SL2Z(x)
Return True if x is the modular group SL2 (Z).
EXAMPLES:

sage: from sage.modular.arithgroup.all import is_SL2Z


sage: is_SL2Z(SL2Z)
True
sage: is_SL2Z(Gamma0(6))
False

70 Chapter 9. The modular group SL2 (Z)


CHAPTER

TEN

FAREY SYMBOL FOR ARITHMETIC SUBGROUPS OF PSL2 (Z)

AUTHORS:
• Hartmut Monien (08 - 2011)
based on the KFarey package by Chris Kurth. Implemented as C++ module for speed.
class sage.modular.arithgroup.farey_symbol.Farey
Bases: object
A class for calculating Farey symbols of arithmetics subgroups of PSL2 (Z).
The arithmetic subgroup can be either any of the congruence subgroups implemented in Sage, i.e. Gamma,
Gamma0, Gamma1 and GammaH or a subgroup of PSL2 (Z) which is given by a user written helper class
defining membership in that group.
REFERENCES:
• Ravi S. Kulkarni, ‘’An arithmetic-geometric method in the study of the subgroups of the modular group’‘,
Amer. J. Math., 113(6):1053–1133, 1991.
INPUT:
• 𝐺 - an arithmetic subgroup of PSL2 (Z)
EXAMPLES:
Create a Farey symbol for the group Γ0 (11):

sage: f = FareySymbol(Gamma0(11)); f
FareySymbol(Congruence Subgroup Gamma0(11))

Calculate the generators:

sage: f.generators()
[
[1 1] [ 7 -2] [ 8 -3] [-1 0]
[0 1], [11 -3], [11 -4], [ 0 -1]
]

Pickling the FareySymbol and recovering it:

sage: f == loads(dumps(f))
True

Calculate the index of Γ𝐻 (33, [2, 5]) in PSL2 (Z) via FareySymbol:

sage: FareySymbol(GammaH(33, [2, 5])).index()


48

71
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

Calculate the generators of Γ1 (4):

sage: FareySymbol(Gamma1(4)).generators()
[
[1 1] [-3 1]
[0 1], [-4 1]
]

Calculate the generators of the example of an index 10 arithmetic subgroup given by Tim Hsu:

sage: from sage.modular.arithgroup.arithgroup_perm import HsuExample10


sage: FareySymbol(HsuExample10()).generators()
[
[1 2] [-2 1] [ 4 -3]
[0 1], [-7 3], [ 3 -2]
]

Calculate the generators of the group Γ′ = Γ0 (8) ∩ Γ1 (4) using a helper class to define group membership:

sage: class GPrime:


....: def __contains__(self, M):
....: return M in Gamma0(8) and M in Gamma1(4)
....:

sage: FareySymbol(GPrime()).generators()
[
[1 1] [ 5 -1] [ 5 -2]
[0 1], [16 -3], [ 8 -3]
]

Calculate cusps of arithmetic subgroup defined via permutation group:

sage: L = SymmetricGroup(4)('(1, 2, 3)')

sage: R = SymmetricGroup(4)('(1, 2, 4)')

sage: FareySymbol(ArithmeticSubgroup_Permutation(L, R)).cusps()


[-1, Infinity]

Calculate the left coset representation of Γ𝐻 (8, [3]):

sage: FareySymbol(GammaH(8, [3])).coset_reps()


[
[1 0] [ 4 -1] [ 3 -1] [ 2 -1] [ 1 -1] [ 3 -1] [ 2 -1] [-1 0]
[0 1], [ 1 0], [ 1 0], [ 1 0], [ 1 0], [ 4 -1], [ 3 -1], [ 3 -1],
[ 1 -1] [-1 0] [ 0 -1] [-1 0]
[ 2 -1], [ 2 -1], [ 1 -1], [ 1 -1]
]

coset_reps()
Left coset of the arithmetic group of the FareySymbol.
EXAMPLES:
Calculate the left coset of Γ0 (6):

sage: FareySymbol(Gamma0(6)).coset_reps()
[
(continues on next page)

72 Chapter 10. Farey Symbol for arithmetic subgroups of PSL2 (Z)


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


[1 0] [ 3 -1] [ 2 -1] [ 1 -1] [ 2 -1] [ 3 -2] [ 1 -1] [-1 0]
[0 1], [ 1 0], [ 1 0], [ 1 0], [ 3 -1], [ 2 -1], [ 2 -1], [ 2 -1],
[ 1 -1] [ 0 -1] [-1 0] [-2 1]
[ 3 -2], [ 1 -1], [ 1 -1], [ 1 -1]
]

cusp_class(c)
Cusp class of a cusp in the FareySymbol.
INPUT:
c – a cusp
EXAMPLES:

sage: FareySymbol(Gamma0(12)).cusp_class(Cusp(1, 12))


5

cusp_widths()
Cusps widths of the FareySymbol.
EXAMPLES:

sage: FareySymbol(Gamma0(6)).cusp_widths()
[6, 2, 3, 1]

cusps()
Cusps of the FareySymbol.
EXAMPLES:

sage: FareySymbol(Gamma0(6)).cusps()
[0, 1/3, 1/2, Infinity]

fractions()
Fractions of the FareySymbol.
EXAMPLES:

sage: FareySymbol(Gamma(4)).fractions()
[0, 1/2, 1, 3/2, 2, 5/2, 3, 7/2, 4]

fundamental_domain(alpha=1, fill=True, thickness=1, color=’lightgray’, color_even=’white’,


zorder=2, linestyle=’solid’, show_pairing=True, tesselation=’Dedekind’,
ymax=1, **options)
Plot a fundamental domain of an arithmetic subgroup of PSL2 (Z) corresponding to the Farey symbol.
OPTIONS:
• fill – boolean (default True) fill the fundamental domain
• linestyle – string (default: ‘solid’) The style of the line, which is one of ‘dashed’, ‘dotted’, ‘solid’,
‘dashdot’, or ‘–’, ‘:’, ‘-‘, ‘-.’, respectively
• color – (default: ‘lightgray’) fill color; fill color for odd part of Dedekind tesselation.
• show_pairing – boolean (default: True) flag for pairing
• tesselation – (default: ‘Dedekind’) The type of hyperbolic tesselation which is one of ‘coset’,
‘Dedekind’ or None respectively

73
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

• color_even – fill color for even parts of Dedekind tesselation (default ‘white’); ignored for other
tesselations
• thickness – float (default: 1) the thickness of the line
• ymax – float (default: 1) maximal height
EXAMPLES:
For example, to plot the fundamental domain of Γ0 (11) with pairings use the following command:

sage: FareySymbol(Gamma0(11)).fundamental_domain()
Graphics object consisting of 54 graphics primitives

indicating that side 1 is paired with side 3 and side 2 is paired with side 4, see also paired_sides().
To plot the fundamental domain of Γ(3) without pairings use the following command:

sage: FareySymbol(Gamma(3)).fundamental_domain(show_pairing=False)
Graphics object consisting of 48 graphics primitives

Plot the fundamental domain of Γ0 (23) showing the left coset representatives:

sage: FareySymbol(Gamma0(23)).fundamental_domain(tesselation='coset')
Graphics object consisting of 58 graphics primitives

The same as above but with a custom linestyle:

sage: FareySymbol(Gamma0(23)).fundamental_domain(tesselation='coset',
˓→linestyle=':', thickness='2')

Graphics object consisting of 58 graphics primitives

generators()
Minimal set of generators of the group of the FareySymbol.
EXAMPLES:
Calculate the generators of Γ0 (6):

sage: FareySymbol(Gamma0(6)).generators()
[
[1 1] [ 5 -1] [ 7 -3] [-1 0]
[0 1], [ 6 -1], [12 -5], [ 0 -1]
]

Calculate the generators of SL2 (Z):

sage: FareySymbol(SL2Z).generators()
[
[ 0 -1] [ 0 -1]
[ 1 0], [ 1 -1]
]

The unique index 2 even subgroup and index 4 odd subgroup each get handled correctly:

sage: FareySymbol(ArithmeticSubgroup_Permutation(S2="(1,2)", S3="()")).


˓→generators()

[
[ 0 1] [-1 1]
[-1 -1], [-1 0]
(continues on next page)

74 Chapter 10. Farey Symbol for arithmetic subgroups of PSL2 (Z)


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


]
sage: FareySymbol(ArithmeticSubgroup_Permutation(S2="(1,2, 3, 4)", S3="(1,
˓→3)(2,4)")).generators()

[
[ 0 1] [-1 1]
[-1 -1], [-1 0]
]

genus()
Return the genus of the arithmetic group of the FareySymbol.
EXAMPLES:

sage: [FareySymbol(Gamma0(n)).genus() for n in range(16, 32)]


[0, 1, 0, 1, 1, 1, 2, 2, 1, 0, 2, 1, 2, 2, 3, 2]

index()
Return the index of the arithmetic group of the FareySymbol in PSL2 (Z).
EXAMPLES:

sage: [FareySymbol(Gamma0(n)).index() for n in range(1, 16)]


[1, 3, 4, 6, 6, 12, 8, 12, 12, 18, 12, 24, 14, 24, 24]

level()
Return the level of the arithmetic group of the FareySymbol.
EXAMPLES:

sage: [FareySymbol(Gamma0(n)).level() for n in range(1, 16)]


[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]

nu2()
Return the number of elliptic points of order two.
EXAMPLES:

sage: [FareySymbol(Gamma0(n)).nu2() for n in range(1, 16)]


[1, 1, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0]

nu3()
Return the number of elliptic points of order three.
EXAMPLES:

sage: [FareySymbol(Gamma0(n)).nu3() for n in range(1, 16)]


[1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0]

paired_sides()
Pairs of index of the sides of the fundamental domain of the Farey symbol of the arithmetic group. The
sides of the hyperbolic polygon are numbered 0, 1, . . . from left to right.

75
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

EXAMPLES:

sage: FareySymbol(Gamma0(11)).paired_sides()
[(0, 5), (1, 3), (2, 4)]

indicating that the side 0 is paired with 5, 1 with 3 and 2 with 4.


pairing_matrices()
Pairing matrices of the sides of the fundamental domain. The sides of the hyperbolic polygon are numbered
0, 1, . . . from left to right.
EXAMPLES:

sage: FareySymbol(Gamma0(6)).pairing_matrices()
[
[1 1] [ 5 -1] [ 7 -3] [ 5 -3] [ 1 -1] [-1 1]
[0 1], [ 6 -1], [12 -5], [12 -7], [ 6 -5], [ 0 -1]
]

pairing_matrices_to_tietze_index()
Obtain the translation table from pairing matrices to generators.
The result is cached.
OUTPUT:
a list where the 𝑖-th entry is a nonzero integer 𝑘, such that if 𝑘 > 0 then the 𝑖-th pairing matrix is (up to
sign) the (𝑘 − 1)-th generator and, if 𝑘 < 0, then the 𝑖-th pairing matrix is (up to sign) the inverse of the
(−𝑘 − 1)-th generator.
EXAMPLES:

sage: F = Gamma0(40).farey_symbol()
sage: table = F.pairing_matrices_to_tietze_index()
sage: table[12]
(-2, -1)
sage: F.pairing_matrices()[12]
[ 3 -1]
[ 40 -13]
(continues on next page)

76 Chapter 10. Farey Symbol for arithmetic subgroups of PSL2 (Z)


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(continued from previous page)


sage: F.generators()[1]**-1
[ -3 1]
[-40 13]

pairings()
Pairings of the sides of the fundamental domain of the Farey symbol of the arithmetic group.
The sides of the hyperbolic polygon are numbered 0, 1, . . . from left to right. Conventions: even pairings
are denoted by -2, odd pairings by -3 while free pairings are denoted by an integer number greater than
zero.
EXAMPLES:
Odd pairings:

sage: FareySymbol(Gamma0(7)).pairings()
[1, -3, -3, 1]

Even and odd pairings:

FareySymbol(Gamma0(13)).pairings()
[1, -3, -2, -2, -3, 1]

Only free pairings:

sage: FareySymbol(Gamma0(23)).pairings()
[1, 2, 3, 5, 3, 4, 2, 4, 5, 1]

reduce_to_cusp(r)
Transformation of a rational number to cusp representative.
INPUT:
r – a rational number
EXAMPLES:

sage: FareySymbol(Gamma0(12)).reduce_to_cusp(5/8)
[ 5 -3]
[12 -7]

Reduce 11/17 to a cusp of for HsuExample10():

sage: from sage.modular.arithgroup.arithgroup_perm import HsuExample10


sage: f = FareySymbol(HsuExample10())
sage: f.reduce_to_cusp(11/17)
[14 -9]
[-3 2]
sage: _.acton(11/17)
1
sage: f.cusps()[f.cusp_class(11/17)]
1

word_problem(M, output=’standard’, check=True)


Solve the word problem (up to sign) using this Farey symbol.
INPUT:
• M – An element 𝑀 of SL2 (Z).

77
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

• output – (default: 'standard') Should be one of 'standard', 'syllables', 'gens'.


• check – (default: True) Whether to check for correct input and output.
OUTPUT:
A solution to the word problem for the matrix 𝑀 . The format depends on the output parameter, as
follows.
• standard returns the so called the Tietze representation, consists of a tuple of nonzero integers 𝑖,
where if 𝑖 > 0 then it indicates the 𝑖 would correspond to 𝑖 = 1), and if 𝑖 < 0 then it indicates the inverse
of the 𝑖-th generator.
• syllables returns a tuple of tuples of the form (𝑖, 𝑛), where (𝑖, 𝑛) represents self.
generators()[i] ^ n, whose product equals 𝑀 up to sign.
• gens returns tuple of tuples of the form (𝑔, 𝑛), (𝑔, 𝑛) such that the product of the matrices 𝑔 𝑛 equals
𝑀 up to sign.
EXAMPLES:

sage: F = Gamma0(30).farey_symbol()
sage: gens = F.generators()
sage: g = gens[3] * gens[10] * gens[8]^-1 * gens[5]
sage: g
[-628597 73008]
[-692130 80387]
sage: F.word_problem(g)
(4, 11, -9, 6)
sage: g = gens[3] * gens[10]^2 * gens[8]^-1 * gens[5]
sage: g
[-5048053 586303]
[-5558280 645563]
sage: F.word_problem(g, output = 'gens')
((
[109 -10]
[120 -11], 1
),
(
[ 19 -7]
[ 30 -11], 2
),
(
[ 49 -9]
[ 60 -11], -1
),
(
[17 -2]
[60 -7], 1
))
sage: F.word_problem(g, output = 'syllables')
((3, 1), (10, 2), (8, -1), (5, 1))

78 Chapter 10. Farey Symbol for arithmetic subgroups of PSL2 (Z)


CHAPTER

ELEVEN

CYTHON HELPER FUNCTIONS FOR CONGRUENCE SUBGROUPS

This file contains optimized Cython implementations of a few functions related to the standard congruence subgroups
Γ0 , Γ1 , Γ𝐻 . These functions are for internal use by routines elsewhere in the Sage library.
sage.modular.arithgroup.congroup.degeneracy_coset_representatives_gamma0(N,
M,
t)
Let 𝑁 be a positive integer and 𝑀 a divisor of 𝑁 . Let 𝑡 be a divisor of 𝑁/𝑀 , and let 𝑇 be the 2 × 2 matrix
(1, 0; 0, 𝑡). This function returns representatives for the orbit set Γ0 (𝑁 )∖𝑇 Γ0 (𝑀 ), where Γ0 (𝑁 ) acts on the left
on 𝑇 Γ0 (𝑀 ).
INPUT:
• N – int
• M – int (divisor of 𝑁 )
• t – int (divisor of 𝑁/𝑀 )
OUTPUT:
list – list of lists [a,b,c,d], where [a,b,c,d] should be viewed as a 2x2 matrix.
This function is used for computation of degeneracy maps between spaces of modular symbols, hence its name.
We use that 𝑇 −1 · (𝑎, 𝑏; 𝑐, 𝑑) · 𝑇 = (𝑎, 𝑏𝑡; 𝑐/𝑡, 𝑑), that the group 𝑇 −1 Γ0 (𝑁 )𝑇 is contained in Γ0 (𝑀 ), and that
Γ0 (𝑁 )𝑇 is contained in 𝑇 Γ0 (𝑀 ).
ALGORITHM:
1. Compute representatives for Γ0 (𝑁/𝑡, 𝑡) inside of Γ0 (𝑀 ):

• COSET EQUIVALENCE: Two right cosets represented by [𝑎, 𝑏; 𝑐, 𝑑] and [𝑎′ , 𝑏′ ; 𝑐′ , 𝑑′ ] of Γ0 (𝑁/𝑡, 𝑡) in
SL2 (Z) are equivalent if and only if (𝑎, 𝑏) = (𝑎′ , 𝑏′ ) as points of P1 (Z/𝑡Z), i.e., 𝑎𝑏′ ∼
= 𝑏𝑎′ (mod 𝑡), and
′ ′ 1
(𝑐, 𝑑) = (𝑐 , 𝑑 ) as points of P (Z/(𝑁/𝑡)Z).
• ALGORITHM to list all cosets:
a) Compute the number of cosets.
b) Compute a random element 𝑥 of Γ0 (𝑀 ).
c) Check if x is equivalent to anything generated so far; if not, add x to the list.
d) Continue until the list is as long as the bound computed in step (a).

2. There is a bijection between Γ0 (𝑁 )∖𝑇 Γ0 (𝑀 ) and Γ0 (𝑁/𝑡, 𝑡)∖Γ0 (𝑀 ) given by 𝑇 𝑟 ↔ 𝑟. Consequently


we obtain coset representatives for Γ0 (𝑁 )∖𝑇 Γ0 (𝑀 ) by left multiplying by 𝑇 each coset representative of
Γ0 (𝑁/𝑡, 𝑡)∖Γ0 (𝑀 ) found in step 1.

79
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

EXAMPLES:

sage: from sage.modular.arithgroup.all import degeneracy_coset_representatives_


˓→gamma0

sage: len(degeneracy_coset_representatives_gamma0(13, 1, 1))


14
sage: len(degeneracy_coset_representatives_gamma0(13, 13, 1))
1
sage: len(degeneracy_coset_representatives_gamma0(13, 1, 13))
14

sage.modular.arithgroup.congroup.degeneracy_coset_representatives_gamma1(N,
M,
t)
Let 𝑁 be a positive integer and 𝑀 a divisor of 𝑁 . Let 𝑡 be a divisor of 𝑁/𝑀 , and let 𝑇 be the 2 × 2 matrix
(1, 0; 0, 𝑡). This function returns representatives for the orbit set Γ1 (𝑁 )∖𝑇 Γ1 (𝑀 ), where Γ1 (𝑁 ) acts on the left
on 𝑇 Γ1 (𝑀 ).
INPUT:
• N – int
• M – int (divisor of 𝑁 )
• t – int (divisor of 𝑁/𝑀 )
OUTPUT:
list – list of lists [a,b,c,d], where [a,b,c,d] should be viewed as a 2x2 matrix.
This function is used for computation of degeneracy maps between spaces of modular symbols, hence its name.
ALGORITHM:
Everything is the same as for degeneracy_coset_representatives_gamma0(), except for coset
equivalence. Here Γ1 (𝑁/𝑡, 𝑡) consists of matrices that are of the form (1, *; 0, 1) mod 𝑁/𝑡 and (1, 0; *, 1) mod
𝑡.
COSET EQUIVALENCE: Two right cosets represented by [𝑎, 𝑏; 𝑐, 𝑑] and [𝑎′ , 𝑏′ ; 𝑐′ , 𝑑′ ] of Γ1 (𝑁/𝑡, 𝑡) in SL2 (Z)
are equivalent if and only if

𝑎∼
= 𝑎′ (mod 𝑡), 𝑏 ∼
= 𝑏′ (mod 𝑡), 𝑐 ∼
= 𝑐′ (mod 𝑁/𝑡), 𝑑 ∼
= 𝑑′ (mod 𝑁/𝑡).

EXAMPLES:

sage: from sage.modular.arithgroup.all import degeneracy_coset_representatives_


˓→gamma1

sage: len(degeneracy_coset_representatives_gamma1(13, 1, 1))


168
sage: len(degeneracy_coset_representatives_gamma1(13, 13, 1))
1
sage: len(degeneracy_coset_representatives_gamma1(13, 1, 13))
168

sage.modular.arithgroup.congroup.generators_helper(coset_reps, level)
Helper function for generators of Gamma0, Gamma1 and GammaH.
These are computed using coset representatives, via an “inverse Todd-Coxeter” algorithm, and generators for
SL2 (Z).
ALGORITHM: Given coset representatives for a finite index subgroup 𝐺 of SL2 (Z) we compute generators for
𝐺 as follows. Let 𝑅 be a set of coset representatives for 𝐺. Let 𝑆, 𝑇 ∈ SL2 (Z) be defined by (0, −1; 1, 0) and

80 Chapter 11. Cython helper functions for congruence subgroups


Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

(1, 1, 0, 1), respectively. Define maps 𝑠, 𝑡 : 𝑅 → 𝐺 as follows. If 𝑟 ∈ 𝑅, then there exists a unique 𝑟′ ∈ 𝑅
such that 𝐺𝑟𝑆 = 𝐺𝑟′ . Let 𝑠(𝑟) = 𝑟𝑆𝑟′−1 . Likewise, there is a unique 𝑟′ such that 𝐺𝑟𝑇 = 𝐺𝑟′ and we let
𝑡(𝑟) = 𝑟𝑇 𝑟′−1 . Note that 𝑠(𝑟) and 𝑡(𝑟) are in 𝐺 for all 𝑟. Then 𝐺 is generated by 𝑠(𝑅) ∪ 𝑡(𝑅).
There are more sophisticated algorithms using group actions on trees (and Farey symbols) that give smaller
generating sets – this code is now deprecated in favour of the newer implementation based on Farey symbols.
EXAMPLES:

sage: Gamma0(7).generators(algorithm="todd-coxeter") # indirect doctest


[
[1 1] [-1 0] [ 1 -1] [1 0] [1 1] [-3 -1] [-2 -1] [-5 -1]
[0 1], [ 0 -1], [ 0 1], [7 1], [0 1], [ 7 2], [ 7 3], [21 4],

[-4 -1] [-1 0] [ 1 0]


[21 5], [ 7 -1], [-7 1]
]

81
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

82 Chapter 11. Cython helper functions for congruence subgroups


CHAPTER

TWELVE

INDICES AND TABLES

• Index
• Module Index
• Search Page

83
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

84 Chapter 12. Indices and Tables


PYTHON MODULE INDEX

m
sage.modular.arithgroup.arithgroup_element, 37
sage.modular.arithgroup.arithgroup_generic, 3
sage.modular.arithgroup.arithgroup_perm, 17
sage.modular.arithgroup.congroup, 79
sage.modular.arithgroup.congroup_gamma, 65
sage.modular.arithgroup.congroup_gamma0, 59
sage.modular.arithgroup.congroup_gamma1, 53
sage.modular.arithgroup.congroup_gammaH, 45
sage.modular.arithgroup.congroup_generic, 41
sage.modular.arithgroup.congroup_sl2z, 69
sage.modular.arithgroup.farey_symbol, 71

85
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

86 Python Module Index


INDEX

A
a() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 37
acton() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 37
are_equivalent() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 3
are_equivalent() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 65
ArithmeticSubgroup (class in sage.modular.arithgroup.arithgroup_generic), 3
ArithmeticSubgroup_Permutation() (in module sage.modular.arithgroup.arithgroup_perm), 18
ArithmeticSubgroup_Permutation_class (class in sage.modular.arithgroup.arithgroup_perm), 19
ArithmeticSubgroupElement (class in sage.modular.arithgroup.arithgroup_element), 37
as_permutation_group() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 3
atkin_lehner_matrix() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 45

B
b() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 38

C
c() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 38
characters_mod_H() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 45
congruence_closure() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
method), 20
CongruenceSubgroup (class in sage.modular.arithgroup.congroup_generic), 41
CongruenceSubgroup_constructor() (in module sage.modular.arithgroup.congroup_generic), 43
CongruenceSubgroupBase (class in sage.modular.arithgroup.congroup_generic), 42
CongruenceSubgroupFromGroup (class in sage.modular.arithgroup.congroup_generic), 42
coset_graph() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 21
coset_reps() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 4
coset_reps() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 27
coset_reps() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 59
coset_reps() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 46
coset_reps() (sage.modular.arithgroup.farey_symbol.Farey method), 72
cusp_class() (sage.modular.arithgroup.farey_symbol.Farey method), 73
cusp_data() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 4
cusp_width() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 4
cusp_widths() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 27
cusp_widths() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 33
cusp_widths() (sage.modular.arithgroup.farey_symbol.Farey method), 73
cusps() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 4

87
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

cusps() (sage.modular.arithgroup.farey_symbol.Farey method), 73

D
d() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 38
degeneracy_coset_representatives_gamma0() (in module sage.modular.arithgroup.congroup), 79
degeneracy_coset_representatives_gamma1() (in module sage.modular.arithgroup.congroup), 80
det() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 38
determinant() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 38
dimension_cusp_forms() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 5
dimension_cusp_forms() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 53
dimension_cusp_forms() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 46
dimension_eis() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 5
dimension_eis() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 54
dimension_modular_forms() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 5
dimension_modular_forms() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 54
dimension_new_cusp_forms() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 59
dimension_new_cusp_forms() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 55
dimension_new_cusp_forms() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 46
divisor_subgroups() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 60
divisor_subgroups() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 47

E
Element (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup attribute), 3
eval_sl2z_word() (in module sage.modular.arithgroup.arithgroup_perm), 35
EvenArithmeticSubgroup_Permutation (class in sage.modular.arithgroup.arithgroup_perm), 26
extend() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 47

F
Farey (class in sage.modular.arithgroup.farey_symbol), 71
farey_symbol() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 6
fractions() (sage.modular.arithgroup.farey_symbol.Farey method), 73
fundamental_domain() (sage.modular.arithgroup.farey_symbol.Farey method), 73

G
Gamma0_class (class in sage.modular.arithgroup.congroup_gamma0), 59
Gamma0_constructor() (in module sage.modular.arithgroup.congroup_gamma0), 62
gamma0_coset_reps() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 47
Gamma1_class (class in sage.modular.arithgroup.congroup_gamma1), 53
Gamma1_constructor() (in module sage.modular.arithgroup.congroup_gamma1), 58
Gamma_class (class in sage.modular.arithgroup.congroup_gamma), 65
Gamma_constructor() (in module sage.modular.arithgroup.congroup_gamma), 66
gamma_h_subgroups() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 60
GammaH_class (class in sage.modular.arithgroup.congroup_gammaH), 45
GammaH_constructor() (in module sage.modular.arithgroup.congroup_gammaH), 51
gen() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 6
generalised_level() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 6
generalised_level() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
method), 21
generators() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 7
generators() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 60

88 Index
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

generators() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 56


generators() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 47
generators() (sage.modular.arithgroup.farey_symbol.Farey method), 74
generators_helper() (in module sage.modular.arithgroup.congroup), 80
gens() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 7
genus() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 7
genus() (sage.modular.arithgroup.farey_symbol.Farey method), 75

H
HsuExample10() (in module sage.modular.arithgroup.arithgroup_perm), 32
HsuExample18() (in module sage.modular.arithgroup.arithgroup_perm), 32

I
image_mod_n() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 65
image_mod_n() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 48
image_mod_n() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroup method), 41
image_mod_n() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroupFromGroup method), 42
index() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 8
index() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 22
index() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 65
index() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 61
index() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 56
index() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 48
index() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroupFromGroup method), 43
index() (sage.modular.arithgroup.farey_symbol.Farey method), 75
is_abelian() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 8
is_ArithmeticSubgroup() (in module sage.modular.arithgroup.arithgroup_generic), 14
is_congruence() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 8
is_congruence() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method),
22
is_congruence() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroupBase method), 42
is_CongruenceSubgroup() (in module sage.modular.arithgroup.congroup_generic), 44
is_even() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 8
is_even() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 28
is_even() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 33
is_even() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 61
is_even() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 56
is_even() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 48
is_finite() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 8
is_Gamma() (in module sage.modular.arithgroup.congroup_gamma), 67
is_Gamma0() (in module sage.modular.arithgroup.congroup_gamma0), 63
is_Gamma1() (in module sage.modular.arithgroup.congroup_gamma1), 58
is_GammaH() (in module sage.modular.arithgroup.congroup_gammaH), 52
is_normal() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 9
is_normal() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 23
is_odd() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 9
is_odd() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 28
is_odd() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 33
is_parent_of() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 9
is_regular_cusp() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 9

Index 89
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

is_SL2Z() (in module sage.modular.arithgroup.congroup_sl2z), 70


is_subgroup() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 10
is_subgroup() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 61
is_subgroup() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 57
is_subgroup() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 49
is_subgroup() (sage.modular.arithgroup.congroup_sl2z.SL2Z_class method), 69

L
L() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 20
level() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroupBase method), 42
level() (sage.modular.arithgroup.farey_symbol.Farey method), 75

M
matrix() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement method), 38
matrix_space() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 10
modular_abelian_variety() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroup method), 41
modular_symbols() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroup method), 41
multiplicative_order() (sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement
method), 39
mumu() (in module sage.modular.arithgroup.congroup_gammaH), 52

N
ncusps() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 10
ncusps() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 28
ncusps() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 34
ncusps() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 65
ncusps() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 62
ncusps() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 57
ncusps() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 49
ngens() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 10
nirregcusps() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 10
nirregcusps() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 34
nirregcusps() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 66
nirregcusps() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 49
nregcusps() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 11
nregcusps() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 34
nregcusps() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 49
nu2() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 11
nu2() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 28
nu2() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 34
nu2() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 62
nu2() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 57
nu2() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 50
nu2() (sage.modular.arithgroup.farey_symbol.Farey method), 75
nu3() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 11
nu3() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 28
nu3() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation method), 35
nu3() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 66
nu3() (sage.modular.arithgroup.congroup_gamma0.Gamma0_class method), 62
nu3() (sage.modular.arithgroup.congroup_gamma1.Gamma1_class method), 57

90 Index
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

nu3() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 50


nu3() (sage.modular.arithgroup.farey_symbol.Farey method), 75

O
odd_subgroups() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method),
28
OddArithmeticSubgroup_Permutation (class in sage.modular.arithgroup.arithgroup_perm), 33
one_odd_subgroup() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation
method), 29
order() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 11

P
paired_sides() (sage.modular.arithgroup.farey_symbol.Farey method), 75
pairing_matrices() (sage.modular.arithgroup.farey_symbol.Farey method), 76
pairing_matrices_to_tietze_index() (sage.modular.arithgroup.farey_symbol.Farey method), 76
pairings() (sage.modular.arithgroup.farey_symbol.Farey method), 77
perm_group() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 24
permutation_action() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
method), 24
projective_index() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 12

R
R() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 20
random_element() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class
method), 24
random_element() (sage.modular.arithgroup.congroup_sl2z.SL2Z_class method), 69
reduce_cusp() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 12
reduce_cusp() (sage.modular.arithgroup.congroup_gamma.Gamma_class method), 66
reduce_cusp() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 50
reduce_cusp() (sage.modular.arithgroup.congroup_sl2z.SL2Z_class method), 70
reduce_to_cusp() (sage.modular.arithgroup.farey_symbol.Farey method), 77
relabel() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 24
restrict() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 51

S
S2() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 20
S3() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 20
sage.modular.arithgroup.arithgroup_element (module), 37
sage.modular.arithgroup.arithgroup_generic (module), 3
sage.modular.arithgroup.arithgroup_perm (module), 17
sage.modular.arithgroup.congroup (module), 79
sage.modular.arithgroup.congroup_gamma (module), 65
sage.modular.arithgroup.congroup_gamma0 (module), 59
sage.modular.arithgroup.congroup_gamma1 (module), 53
sage.modular.arithgroup.congroup_gammaH (module), 45
sage.modular.arithgroup.congroup_generic (module), 41
sage.modular.arithgroup.congroup_sl2z (module), 69
sage.modular.arithgroup.farey_symbol (module), 71
SL2Z_class (class in sage.modular.arithgroup.congroup_sl2z), 69
sl2z_word_problem() (in module sage.modular.arithgroup.arithgroup_perm), 35

Index 91
Sage 9.1 Reference Manual: Arithmetic Subgroups of SL2 (Z), Release 9.1

sturm_bound() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 12


surgroups() (sage.modular.arithgroup.arithgroup_perm.ArithmeticSubgroup_Permutation_class method), 25

T
to_even_subgroup() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 13
to_even_subgroup() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation
method), 30
to_even_subgroup() (sage.modular.arithgroup.arithgroup_perm.OddArithmeticSubgroup_Permutation
method), 35
to_even_subgroup() (sage.modular.arithgroup.congroup_gammaH.GammaH_class method), 51
to_even_subgroup() (sage.modular.arithgroup.congroup_generic.CongruenceSubgroupFromGroup method),
43
todd_coxeter() (sage.modular.arithgroup.arithgroup_generic.ArithmeticSubgroup method), 13
todd_coxeter() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation method), 31
todd_coxeter_l_s2() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation
method), 31
todd_coxeter_s2_s3() (sage.modular.arithgroup.arithgroup_perm.EvenArithmeticSubgroup_Permutation
method), 32

W
word_of_perms() (in module sage.modular.arithgroup.arithgroup_perm), 36
word_problem() (sage.modular.arithgroup.farey_symbol.Farey method), 77

92 Index

You might also like