Modular Symbols
Release 10.4

The Sage Development TeamJul 23, 2024

CONTENTS

1

Creation of modular symbols spaces

1

2

Base class of the space of modular symbols

11

3

Ambient spaces of modular symbols

51

4

Subspace of ambient spaces of modular symbols

83

5

A single element of an ambient space of modular symbols

91

6

Modular symbols {𝛼, 𝛽}95

7Manin symbols

101

8

Manin symbol lists

107

9Space of boundary modular symbols

129

10 Heilbronn matrix computation
11 Lists of Manin symbols over139
, elements of P1 ( /𝑁 )145

12 List of coset representatives for Γ1 (𝑁 ) in SL2 ( )159

13 List of coset representatives for Γ𝐻 (𝑁 ) in SL2 ( )161

14 Relation matrices for ambient modular symbols spaces

163

15 Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )171

16 Monomial expansion of (𝑎𝑋 + 𝑏𝑌 )𝑖 (𝑐𝑋 + 𝑑𝑌 )𝑗−𝑖

191

17 Sparse action of Hecke operators

193

18 Optimized computing of relation matrices in certain cases

195

19 Overconvergent modular symbols

197

20 Indices and Tables

345

Python Module Index

347

Index

349

i

ii

CHAPTERONECREATION OF MODULAR SYMBOLS SPACES

EXAMPLES: We create a space and output its category.
sage: C = HeckeModules(RationalField()); C
Category of Hecke modules over Rational Field
sage: M = ModularSymbols(11)sage: M.category()
Category of Hecke modules over Rational Field
sage: M in C
True>>> from sage.all import *>>> C = HeckeModules(RationalField()); C
Category of Hecke modules over Rational Field>>> M = ModularSymbols(Integer(11))>>> M.category()
Category of Hecke modules over Rational Field>>> M in C
True

We create a space compute the charpoly, then compute the same but over a bigger field. In each case we also decompose
the space using 𝑇2 .
sage: M = ModularSymbols(23,2, base_ring=QQ)
sage: M.T(2).charpoly( x ).factor()(x - 3) * (x^2 + x - 1)^2
sage: M.decomposition(2)[Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Rational Field]>>> from sage.all import *>>> M = ModularSymbols(Integer(23),Integer(2), base_ring=QQ)>>> M.T(Integer(2)).charpoly( x ).factor()(x - 3) * (x^2 + x - 1)^2>>> M.decomposition(Integer(2))[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5(continues on next page)1

Modular Symbols, Release 10.4

(continued from previous page)for Gamma_0(23) of weight 2 with sign 0 over Rational Field]
sage: # needs sage.rings.number_fieldsage: M = ModularSymbols(23,2, base_ring=QuadraticField(5, sqrt5 ))sage: M.T(2).charpoly( x ).factor()(x - 3) * (x - 1/2*sqrt5 + 1/2)^2 * (x + 1/2*sqrt5 + 1/2)^2
sage: M.decomposition(2)[Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5
with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?,
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5
with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?,
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5
with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
]>>> from sage.all import *>>> # needs sage.rings.number_field>>> M = ModularSymbols(Integer(23),Integer(2), base_ring=QuadraticField(Integer(5),˓→ sqrt5 ))>>> M.T(Integer(2)).charpoly( x ).factor()(x - 3) * (x - 1/2*sqrt5 + 1/2)^2 * (x + 1/2*sqrt5 + 1/2)^2>>> M.decomposition(Integer(2))[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5
with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?,
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5
with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?,
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5
for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5
with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?
]

We compute some Hecke operators and do a consistency check:sage: m = ModularSymbols(39, 2)
sage: t2 = m.T(2); t5 = m.T(5)sage: t2*t5 - t5*t2 == 0
True>>> from sage.all import *>>> m = ModularSymbols(Integer(39), Integer(2))>>> t2 = m.T(Integer(2)); t5 = m.T(Integer(5))>>> t2*t5 - t5*t2 == Integer(0)TrueThis tests the bug reported in Issue #1220:
sage: G = GammaH(36, [13, 19])sage: G.modular_symbols()

2(continues on next page)

Chapter 1. Creation of modular symbols spaces

Modular Symbols, Release 10.4

(continued from previous page)

Modular Symbols space of dimension 13 for Congruence Subgroup Gamma_H(36)with H generated by [13, 19] of weight 2 with sign 0 over Rational Field
sage: G.modular_symbols().cuspidal_subspace()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 13 forCongruence Subgroup Gamma_H(36) with H generated by [13, 19] of weight 2 with sign 0
over Rational Field>>> from sage.all import *>>> G = GammaH(Integer(36), [Integer(13), Integer(19)])>>> G.modular_symbols()
Modular Symbols space of dimension 13 for Congruence Subgroup Gamma_H(36)with H generated by [13, 19] of weight 2 with sign 0 over Rational Field>>> G.modular_symbols().cuspidal_subspace()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 13 forCongruence Subgroup Gamma_H(36) with H generated by [13, 19] of weight 2 with sign 0
over Rational Field

This test catches a tricky corner case for spaces with character:sage: ModularSymbols(DirichletGroup(20).1**3, weight=3, sign=1).cuspidal_subspace()
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 6
and level 20, weight 3, character [1, -zeta4], sign 1,
over Cyclotomic Field of order 4 and degree 2>>> from sage.all import *>>> ModularSymbols(DirichletGroup(Integer(20)).gen(1)**Integer(3), weight=Integer(3),␣
˓→sign=Integer(1)).cuspidal_subspace()
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 6
and level 20, weight 3, character [1, -zeta4], sign 1,
over Cyclotomic Field of order 4 and degree 2This tests the bugs reported in Issue #20932:
sage: chi = kronecker_character(3*34603)
sage: ModularSymbols(chi, 2, sign=1, base_ring=GF(3)) # not tested # long time (600␣
˓→seconds)
Modular Symbols space of dimension 11535 and level 103809, weight 2,character [2, 2], sign 1, over Finite Field of size 3
sage: chi = kronecker_character(3*61379)
sage: ModularSymbols(chi, 2, sign=1, base_ring=GF(3)) # not tested # long time␣˓→(1800 seconds)
Modular Symbols space of dimension 20460 and level 184137, weight 2,character [2, 2], sign 1, over Finite Field of size 3>>> from sage.all import *>>> chi = kronecker_character(Integer(3)*Integer(34603))>>> ModularSymbols(chi, Integer(2), sign=Integer(1), base_ring=GF(Integer(3)))˓→tested# long time (600 seconds)
Modular Symbols space of dimension 11535 and level 103809, weight 2,character [2, 2], sign 1, over Finite Field of size 3>>> chi = kronecker_character(Integer(3)*Integer(61379))>>> ModularSymbols(chi, Integer(2), sign=Integer(1), base_ring=GF(Integer(3)))˓→tested# long time (1800 seconds)
Modular Symbols space of dimension 20460 and level 184137, weight 2,character [2, 2], sign 1, over Finite Field of size 3# not␣

# not␣

3

Modular Symbols, Release 10.4

sage.modular.modsym.modsym.ModularSymbols(group=1, weight=2, sign=0, base_ring=None,
use_cache=True, custom_init=None)
Create an ambient space of modular symbols.
INPUT:• group – A congruence subgroup or a Dirichlet character eps.
• weight – int, the weight, which must be >= 2.
• sign – int, The sign of the involution on modular symbols induced by complex conjugation. The default is
0, which means “no sign”, i.e., take the whole space.
• base_ring – the base ring. Defaults tocontaining the values of the character.

if no character is given, or to the minimal extension of• custom_init – a function that is called with self as input before any computations are done using
self; this could be used to set a custom modular symbols presentation. If self is already in the cache anduse_cache=True, then this function is not called.
EXAMPLES: First we create some spaces with trivial character:sage: ModularSymbols(Gamma0(11),2).dimension()3
sage: ModularSymbols(Gamma0(1),12).dimension()3>>> from sage.all import *>>> ModularSymbols(Gamma0(Integer(11)),Integer(2)).dimension()3>>> ModularSymbols(Gamma0(Integer(1)),Integer(12)).dimension()3

If we give an integer N for the congruence subgroup, it defaults to Γ0 (𝑁 ):sage: ModularSymbols(1,12,-1).dimension()1
sage: ModularSymbols(11,4, sign=1)
Modular Symbols space of dimension 4 for Gamma_0(11) of weight 4
with sign 1 over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(1),Integer(12),-Integer(1)).dimension()1>>> ModularSymbols(Integer(11),Integer(4), sign=Integer(1))
Modular Symbols space of dimension 4 for Gamma_0(11) of weight 4
with sign 1 over Rational Field

We create some spaces for Γ1 (𝑁 ).
sage: ModularSymbols(Gamma1(13),2)
Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2
with sign 0 over Rational Field
sage: ModularSymbols(Gamma1(13),2, sign=1).dimension()13
sage: ModularSymbols(Gamma1(13),2, sign=-1).dimension()2
sage: [ModularSymbols(Gamma1(7),k).dimension() for k in [2,3,4,5]][5, 8, 12, 16](continues on next page)

4

Chapter 1. Creation of modular symbols spaces

Modular Symbols, Release 10.4

(continued from previous page)

sage: ModularSymbols(Gamma1(5),11).dimension()20>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(13)),Integer(2))
Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2
with sign 0 over Rational Field>>> ModularSymbols(Gamma1(Integer(13)),Integer(2), sign=Integer(1)).dimension()13>>> ModularSymbols(Gamma1(Integer(13)),Integer(2), sign=-Integer(1)).dimension()2>>> [ModularSymbols(Gamma1(Integer(7)),k).dimension() for k in [Integer(2),˓→Integer(3),Integer(4),Integer(5)]][5, 8, 12, 16]>>> ModularSymbols(Gamma1(Integer(5)),Integer(11)).dimension()20

We create a space for Γ𝐻 (𝑁 ):sage: G = GammaH(15,[4,13])
sage: M = ModularSymbols(G,2)
sage: M.decomposition()[
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5
for Congruence Subgroup Gamma_H(15) with H generated by [4, 7]
of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 5
for Congruence Subgroup Gamma_H(15) with H generated by [4, 7]
of weight 2 with sign 0 over Rational Field]>>> from sage.all import *>>> G = GammaH(Integer(15),[Integer(4),Integer(13)])>>> M = ModularSymbols(G,Integer(2))>>> M.decomposition()[
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5
for Congruence Subgroup Gamma_H(15) with H generated by [4, 7]
of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 5
for Congruence Subgroup Gamma_H(15) with H generated by [4, 7]
of weight 2 with sign 0 over Rational Field]

We create a space with character:sage: e = (DirichletGroup(13).0)^2
sage: e.order()6sage: M = ModularSymbols(e, 2); M
Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6],
sign 0, over Cyclotomic Field of order 6 and degree 2
sage: f = M.T(2).charpoly( x ); fx^4 + (-zeta6 - 1)*x^3 - 8*zeta6*x^2 + (10*zeta6 - 5)*x + 21*zeta6 - 21sage: f.factor()(x - zeta6 - 2) * (x - 2*zeta6 - 1) * (x + zeta6 + 1)^2

5Modular Symbols, Release 10.4>>> from sage.all import *>>> e = (DirichletGroup(Integer(13)).gen(0))**Integer(2)>>> e.order()6>>> M = ModularSymbols(e, Integer(2)); M
Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6],
sign 0, over Cyclotomic Field of order 6 and degree 2>>> f = M.T(Integer(2)).charpoly( x ); fx^4 + (-zeta6 - 1)*x^3 - 8*zeta6*x^2 + (10*zeta6 - 5)*x + 21*zeta6 - 21>>> f.factor()(x - zeta6 - 2) * (x - 2*zeta6 - 1) * (x + zeta6 + 1)^2

We create a space with character over a larger base ring than the values of the character:sage: # needs sage.rings.number_fieldsage: ModularSymbols(e, 2, base_ring=CyclotomicField(24))
Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta24^4],sign 0, over Cyclotomic Field of order 24 and degree 8>>> from sage.all import *>>> # needs sage.rings.number_field>>> ModularSymbols(e, Integer(2), base_ring=CyclotomicField(Integer(24)))
Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta24^4],sign 0, over Cyclotomic Field of order 24 and degree 8More examples of spaces with character:sage: e = DirichletGroup(5, RationalField()).gen(); eDirichlet character modulo 5 of conductor 5 mapping 2 |--> -1
sage: m = ModularSymbols(e, 2); m
Modular Symbols space of dimension 2 and level 5, weight 2, character [-1],sign 0, over Rational Field>>> from sage.all import *>>> e = DirichletGroup(Integer(5), RationalField()).gen(); eDirichlet character modulo 5 of conductor 5 mapping 2 |--> -1>>> m = ModularSymbols(e, Integer(2)); m
Modular Symbols space of dimension 2 and level 5, weight 2, character [-1],sign 0, over Rational Field
sage: m.T(2).charpoly( x )x^2 - 1
sage: m = ModularSymbols(e, 6); m.dimension()6
sage: m.T(2).charpoly( x )x^6 - 873*x^4 - 82632*x^2 - 1860496>>> from sage.all import *>>> m.T(Integer(2)).charpoly( x )x^2 - 1>>> m = ModularSymbols(e, Integer(6)); m.dimension()
6>>> m.T(Integer(2)).charpoly( x )x^6 - 873*x^4 - 82632*x^2 - 1860496

6

Chapter 1. Creation of modular symbols spaces

Modular Symbols, Release 10.4

We create a space of modular symbols with nontrivial character in characteristic 2.
sage: # needs sage.rings.finite_rings
sage: G = DirichletGroup(13, GF(4, a )); GGroup of Dirichlet characters modulo 13
with values in Finite Field in a of size 2^2
sage: e = G.list()[2]; eDirichlet character modulo 13 of conductor 13 mapping 2 |--> a + 1
sage: M = ModularSymbols(e,4); M
Modular Symbols space of dimension 8 and level 13, weight 4,character [a + 1], sign 0, over Finite Field in a of size 2^2
sage: M.basis()([X*Y,(1,0)], [X*Y,(1,5)], [X*Y,(1,10)], [X*Y,(1,11)],[X^2,(0,1)], [X^2,(1,10)], [X^2,(1,11)], [X^2,(1,12)])sage: M.T(2).matrix()
[
0
0
0
0
0
0
1
1]
[
0
0
0
0
0
0
0
0]
[
0
0
0
0
0 a + 1
1
a]
[
0
0
0
0
0
1 a + 1a][0
0
0
0 a + 1
0
1
1]
[
0
0
0
0
0
a
1
a]
[
0
0
0
0
0
0 a + 1
a]
[
0
0
0
0
0
0
1
0]
>>> from sage.all import *>>> # needs sage.rings.finite_rings>>> G = DirichletGroup(Integer(13), GF(Integer(4), a )); GGroup of Dirichlet characters modulo 13
with values in Finite Field in a of size 2^2>>> e = G.list()[Integer(2)]; e
Dirichlet character modulo 13 of conductor 13 mapping 2 |--> a + 1>>> M = ModularSymbols(e,Integer(4)); M
Modular Symbols space of dimension 8 and level 13, weight 4,character [a + 1], sign 0, over Finite Field in a of size 2^2>>> M.basis()([X*Y,(1,0)], [X*Y,(1,5)], [X*Y,(1,10)], [X*Y,(1,11)],[X^2,(0,1)], [X^2,(1,10)], [X^2,(1,11)], [X^2,(1,12)])>>> M.T(Integer(2)).matrix()
[
0
0
0
0
0
0
1
1]
[
0
0
0
0
0
0
0
0]
[
0
0
0
0
0 a + 1
1
a]
[
0
0
0
0
0
1 a + 1a][0
0
0
0 a + 1
0
1
1]
[
0
0
0
0
0
a
1
a]
[
0
0
0
0
0
0 a + 1
a]
[
0
0
0
0
0
0
1
0]

We illustrate the custom_init function, which can be used to make arbitrary changes to the modular symbols object
before its presentation is computed:
sage: ModularSymbols_clear_cache()sage: def custom_init(M):....:M.customize= hi
sage: M = ModularSymbols(1,12, custom_init=custom_init)
sage: M.customizehi7Modular Symbols, Release 10.4>>> from sage.all import *>>> ModularSymbols_clear_cache()>>> def custom_init(M):...
M.customize= hi>>> M = ModularSymbols(Integer(1),Integer(12), custom_init=custom_init)>>> M.customizehi

We illustrate the relation between custom_init and use_cache:sage: def custom_init(M):....:M.customize= hi2
sage: M = ModularSymbols(1,12, custom_init=custom_init)
sage: M.customizehisage: M = ModularSymbols(1,12, custom_init=custom_init, use_cache=False)
sage: M.customize
hi2>>> from sage.all import *>>> def custom_init(M):...
M.customize= hi2>>> M = ModularSymbols(Integer(1),Integer(12), custom_init=custom_init)>>> M.customizehi>>> M = ModularSymbols(Integer(1),Integer(12), custom_init=custom_init, use_
˓→cache=False)>>> M.customize
hi2

sage.modular.modsym.modsym.ModularSymbols_clear_cache()
Clear the global cache of modular symbols spaces.
EXAMPLES:
sage: sage.modular.modsym.modsym.ModularSymbols_clear_cache()sage: sorted(sage.modular.modsym.modsym._cache)[]sage: M = ModularSymbols(6,2)
sage: sorted(sage.modular.modsym.modsym._cache)[(Congruence Subgroup Gamma0(6), 2, 0, Rational Field)]sage: sage.modular.modsym.modsym.ModularSymbols_clear_cache()sage: sorted(sage.modular.modsym.modsym._cache)[]>>> from sage.all import *>>> sage.modular.modsym.modsym.ModularSymbols_clear_cache()>>> sorted(sage.modular.modsym.modsym._cache)[]>>> M = ModularSymbols(Integer(6),Integer(2))>>> sorted(sage.modular.modsym.modsym._cache)[(Congruence Subgroup Gamma0(6), 2, 0, Rational Field)]>>> sage.modular.modsym.modsym.ModularSymbols_clear_cache()>>> sorted(sage.modular.modsym.modsym._cache)[]sage.modular.modsym.modsym.canonical_parameters(group, weight, sign, base_ring)
8

Chapter 1. Creation of modular symbols spaces

Modular Symbols, Release 10.4

Return the canonically normalized parameters associated to a choice of group, weight, sign, and base_ring. Thatis, normalize each of these to be of the correct type, perform all appropriate type checking, etc.
EXAMPLES:
sage: p1 = sage.modular.modsym.modsym.canonical_parameters(5,int(2),1,QQ) ; p1
(Congruence Subgroup Gamma0(5), 2, 1, Rational Field)
sage: p2 = sage.modular.modsym.modsym.canonical_parameters(Gamma0(5),2,1,QQ) ; p2
(Congruence Subgroup Gamma0(5), 2, 1, Rational Field)
sage: p1 == p2
True
sage: type(p1[1])<class sage.rings.integer.Integer >>>> from sage.all import *>>> p1 = sage.modular.modsym.modsym.canonical_parameters(Integer(5),˓→int(Integer(2)),Integer(1),QQ) ; p1
(Congruence Subgroup Gamma0(5), 2, 1, Rational Field)>>> p2 = sage.modular.modsym.modsym.canonical_parameters(Gamma0(Integer(5)),
˓→Integer(2),Integer(1),QQ) ; p2
(Congruence Subgroup Gamma0(5), 2, 1, Rational Field)>>> p1 == p2
True>>> type(p1[Integer(1)])<class sage.rings.integer.Integer >9Modular Symbols, Release 10.4

10Chapter 1. Creation of modular symbols spaces

CHAPTERTWOBASE CLASS OF THE SPACE OF MODULAR SYMBOLS

All the spaces of modular symbols derive from this class. This class is an abstract base class.
class sage.modular.modsym.space.IntegralPeriodMapping(modsym, A)
Bases: PeriodMappingclass sage.modular.modsym.space.ModularSymbolsSpace(group, weight, character, sign,
base_ring, category=None)
Bases: HeckeModule_free_module
Base class for spaces of modular symbols.
Element
alias of ModularSymbolsElement
abelian_variety()
Return the corresponding abelian variety.
INPUT:• self – modular symbols space of weight 2 for a congruence subgroup such as Gamma0, Gamma1 orGammaH.
EXAMPLES:
sage: ModularSymbols(Gamma0(11)).cuspidal_submodule().abelian_variety()
Abelian variety J0(11) of dimension 1
sage: ModularSymbols(Gamma1(11)).cuspidal_submodule().abelian_variety()
Abelian variety J1(11) of dimension 1
sage: ModularSymbols(GammaH(11,[3])).cuspidal_submodule().abelian_variety()
Abelian variety JH(11,[3]) of dimension 1>>> from sage.all import *>>> ModularSymbols(Gamma0(Integer(11))).cuspidal_submodule().abelian_variety()
Abelian variety J0(11) of dimension 1>>> ModularSymbols(Gamma1(Integer(11))).cuspidal_submodule().abelian_variety()
Abelian variety J1(11) of dimension 1>>> ModularSymbols(GammaH(Integer(11),[Integer(3)])).cuspidal_submodule().
˓→abelian_variety()
Abelian variety JH(11,[3]) of dimension 1

The abelian variety command only works on cuspidal modular symbols spaces:sage: M = ModularSymbols(37)sage: M[0].abelian_variety()
Traceback (most recent call last):(continues on next page)11

Modular Symbols, Release 10.4

(continued from previous page)...
ValueError: self must be cuspidal
sage: M[1].abelian_variety()
Abelian subvariety of dimension 1 of J0(37)sage: M[2].abelian_variety()
Abelian subvariety of dimension 1 of J0(37)>>> from sage.all import *>>> M = ModularSymbols(Integer(37))>>> M[Integer(0)].abelian_variety()
Traceback (most recent call last):...
ValueError: self must be cuspidal>>> M[Integer(1)].abelian_variety()
Abelian subvariety of dimension 1 of J0(37)>>> M[Integer(2)].abelian_variety()
Abelian subvariety of dimension 1 of J0(37)abvarquo_cuspidal_subgroup()
Compute the rational subgroup of the cuspidal subgroup (as an abstract abelian group) of the abelian variety
quotient A of the relevant modular Jacobian attached to this modular symbols space.
We assume that self is defined over QQ and has weight 2. If the sign of self is not 0, then the power of
2 may be wrong.
EXAMPLES:
sage: D = ModularSymbols(66,2,sign=0).cuspidal_subspace().new_subspace().
˓→decomposition()sage: D[0].abvarquo_cuspidal_subgroup()
Finitely generated module V/W over Integer Ring with invariants (3)sage: [A.abvarquo_cuspidal_subgroup().invariants() for A in D][(3,), (2,), ()]sage: D = ModularSymbols(66,2,sign=1).cuspidal_subspace().new_subspace().
˓→decomposition()sage: [A.abvarquo_cuspidal_subgroup().invariants() for A in D][(3,), (2,), ()]sage: D = ModularSymbols(66,2,sign=-1).cuspidal_subspace().new_subspace().
˓→decomposition()sage: [A.abvarquo_cuspidal_subgroup().invariants() for A in D][(), (), ()]>>> from sage.all import *>>> D = ModularSymbols(Integer(66),Integer(2),sign=Integer(0)).cuspidal_
˓→subspace().new_subspace().decomposition()>>> D[Integer(0)].abvarquo_cuspidal_subgroup()
Finitely generated module V/W over Integer Ring with invariants (3)>>> [A.abvarquo_cuspidal_subgroup().invariants() for A in D][(3,), (2,), ()]>>> D = ModularSymbols(Integer(66),Integer(2),sign=Integer(1)).cuspidal_
˓→subspace().new_subspace().decomposition()>>> [A.abvarquo_cuspidal_subgroup().invariants() for A in D][(3,), (2,), ()]>>> D = ModularSymbols(Integer(66),Integer(2),sign=-Integer(1)).cuspidal_
˓→subspace().new_subspace().decomposition()>>> [A.abvarquo_cuspidal_subgroup().invariants() for A in D](continues on next page)

12

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[(), (), ()]abvarquo_rational_cuspidal_subgroup()
Compute the rational subgroup of the cuspidal subgroup (as an abstract abelian group) of the abelian variety
quotient A of the relevant modular Jacobian attached to this modular symbols space.
If C is the subgroup of A generated by differences of cusps, then C is equipped with an action of Gal(Qbar/Q),
and this function computes the fixed subgroup, i.e., C(Q).
We assume that self is defined over QQ and has weight 2. If the sign of self is not 0, then the power of
2 may be wrong.
EXAMPLES:First we consider the fairly straightforward level 37 case, where the torsion subgroup of the optimal quotients(which are all elliptic curves) are all cuspidal:
sage: M = ModularSymbols(37).cuspidal_subspace().new_subspace()sage: D = M.decomposition()sage: [(A.abvarquo_rational_cuspidal_subgroup().invariants(), A.T(19)[0,0])␣
˓→for A in D][((), 0), ((3,), 2)]
sage: [(E.torsion_subgroup().invariants(),E.ap(19)) for E in cremona_optimal_
˓→curves([37])][((), 0), ((3,), 2)]>>> from sage.all import *>>> M = ModularSymbols(Integer(37)).cuspidal_subspace().new_subspace()>>> D = M.decomposition()>>> [(A.abvarquo_rational_cuspidal_subgroup().invariants(), A.
˓→T(Integer(19))[Integer(0),Integer(0)]) for A in D][((), 0), ((3,), 2)]>>> [(E.torsion_subgroup().invariants(),E.ap(Integer(19))) for E in cremona_
˓→optimal_curves([Integer(37)])][((), 0), ((3,), 2)]

Next we consider level 54, where the rational cuspidal subgroups of the quotients are also cuspidal:
sage: M = ModularSymbols(54).cuspidal_subspace().new_subspace()sage: D = M.decomposition()sage: [A.abvarquo_rational_cuspidal_subgroup().invariants() for A in D][(3,), (3,)]
sage: [E.torsion_subgroup().invariants() for E in cremona_optimal_
˓→curves([54])][(3,), (3,)]>>> from sage.all import *>>> M = ModularSymbols(Integer(54)).cuspidal_subspace().new_subspace()>>> D = M.decomposition()>>> [A.abvarquo_rational_cuspidal_subgroup().invariants() for A in D][(3,), (3,)]>>> [E.torsion_subgroup().invariants() for E in cremona_optimal_
˓→curves([Integer(54)])][(3,), (3,)]

Level 66 is interesting, since not all torsion of the quotient is rational. In fact, for each elliptic curve quotient,the -rational subgroup of the image of the cuspidal subgroup in the quotient is a nontrivial subgroup of13

Modular Symbols, Release 10.4

𝐸( )𝑡𝑜𝑟 . Thus not all torsion in the quotient is cuspidal!:sage: M = ModularSymbols(66).cuspidal_subspace().new_subspace()sage: D = M.decomposition()sage: [(A.abvarquo_rational_cuspidal_subgroup().invariants(), A.T(19)[0,0])␣
˓→for A in D][((3,), -4), ((2,), 4), ((), 0)]
sage: [(E.torsion_subgroup().invariants(),E.ap(19)) for E in cremona_optimal_
˓→curves([66])][((6,), -4), ((4,), 4), ((10,), 0)]
sage: [A.abelian_variety().rational_cuspidal_subgroup().invariants() for A in␣˓→D][[6], [4], [10]]>>> from sage.all import *>>> M = ModularSymbols(Integer(66)).cuspidal_subspace().new_subspace()>>> D = M.decomposition()>>> [(A.abvarquo_rational_cuspidal_subgroup().invariants(), A.
˓→T(Integer(19))[Integer(0),Integer(0)]) for A in D][((3,), -4), ((2,), 4), ((), 0)]>>> [(E.torsion_subgroup().invariants(),E.ap(Integer(19))) for E in cremona_
˓→optimal_curves([Integer(66)])][((6,), -4), ((4,), 4), ((10,), 0)]>>> [A.abelian_variety().rational_cuspidal_subgroup().invariants() for A in D][[6], [4], [10]]In this example, the abelian varieties involved all having dimension bigger than 1 (unlike above). We find that
all torsion in the quotient in each of these cases is cuspidal:
sage: M = ModularSymbols(125).cuspidal_subspace().new_subspace()sage: D = M.decomposition()sage: [A.abvarquo_rational_cuspidal_subgroup().invariants() for A in D][(), (5,), (5,)]
sage: [A.abelian_variety().rational_torsion_subgroup().multiple_of_order()␣
˓→for A in D][1, 5, 5]>>> from sage.all import *>>> M = ModularSymbols(Integer(125)).cuspidal_subspace().new_subspace()>>> D = M.decomposition()>>> [A.abvarquo_rational_cuspidal_subgroup().invariants() for A in D][(), (5,), (5,)]>>> [A.abelian_variety().rational_torsion_subgroup().multiple_of_order() for␣
˓→A in D][1, 5, 5]character()
Return the character associated to self.
EXAMPLES:
sage: ModularSymbols(12,8).character()
Dirichlet character modulo 12 of conductor 1 mapping 7 |--> 1, 5 |--> 1
sage: ModularSymbols(DirichletGroup(25).0, 4).character()
Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20

14

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> ModularSymbols(Integer(12),Integer(8)).character()
Dirichlet character modulo 12 of conductor 1 mapping 7 |--> 1, 5 |--> 1>>> ModularSymbols(DirichletGroup(Integer(25)).gen(0), Integer(4)).character()
Dirichlet character modulo 25 of conductor 25 mapping 2 |--> zeta20

compact_system_of_eigenvalues(v, names='alpha', nz=None)
Return a compact system of eigenvalues 𝑎𝑛 for 𝑛 ∈ 𝑣.
This should only be called on simple factors of modular symbols spaces.
INPUT:• v – a list of positive integers• nz – (default: None); if given specifies a column index such that the dual module has that column
nonzero.
OUTPUT:• E – matrix such that E*v is a vector with components the eigenvalues 𝑎𝑛 for 𝑛 ∈ 𝑣.
• v – a vector over a number field
EXAMPLES:
sage: M = ModularSymbols(43,2,1)[2]; M
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 for Gamma_0(43) of weight 2 with sign 1 over Rational Field
sage: E, v = M.compact_system_of_eigenvalues(prime_range(10))
sage: E[ 2/3 -4/3][-2/3 4/3]
[ 4/3 4/3][-4/3 -4/3]
sage: v
(1, -3/4*alpha + 1/2)
sage: E*v(alpha, -alpha, -alpha + 2, alpha - 2)>>> from sage.all import *>>> M = ModularSymbols(Integer(43),Integer(2),Integer(1))[Integer(2)]; M
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 for Gamma_0(43) of weight 2 with sign 1 over Rational Field>>> E, v = M.compact_system_of_eigenvalues(prime_range(Integer(10)))>>> E[ 2/3 -4/3][-2/3 4/3]
[ 4/3 4/3][-4/3 -4/3]>>> v(1, -3/4*alpha + 1/2)>>> E*v(alpha, -alpha, -alpha + 2, alpha - 2)congruence_number(other, prec=None)
Given two cuspidal spaces of modular symbols, compute the congruence number, using prec terms of the
𝑞-expansions.

15Modular Symbols, Release 10.4

The congruence number is defined as follows. If 𝑉 is the submodule of integral cusp forms corresponding
to self (saturated in [[𝑞]], by definition) and 𝑊 is the submodule corresponding to other, each computed toprecision prec, the congruence number is the index of 𝑉 + 𝑊 in its saturation in [[𝑞]].
If prec is not given it is set equal to the max of the hecke_bound function called on each space.
EXAMPLES:
sage: A, B = ModularSymbols(48, 2).cuspidal_submodule().decomposition()sage: A.congruence_number(B)2>>> from sage.all import *>>> A, B = ModularSymbols(Integer(48), Integer(2)).cuspidal_submodule().
˓→decomposition()>>> A.congruence_number(B)2cuspidal_submodule()
Return the cuspidal submodule of self.
Note: This should be overridden by all derived classes.
EXAMPLES:
sage: sage.modular.modsym.space.ModularSymbolsSpace(Gamma0(11),2,
˓→DirichletGroup(11).gens()[0]**10,0,QQ).cuspidal_submodule()
Traceback (most recent call last):...
NotImplementedError: computation of cuspidal submodule not yet implemented␣
˓→for this classsage: ModularSymbols(Gamma0(11),2).cuspidal_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> sage.modular.modsym.space.ModularSymbolsSpace(Gamma0(Integer(11)),
˓→Integer(2),DirichletGroup(Integer(11)).gens()[Integer(0)]**Integer(10),
˓→Integer(0),QQ).cuspidal_submodule()
Traceback (most recent call last):...
NotImplementedError: computation of cuspidal submodule not yet implemented␣
˓→for this class>>> ModularSymbols(Gamma0(Integer(11)),Integer(2)).cuspidal_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field

cuspidal_subspace()
Synonym for cuspidal_submodule.
EXAMPLES:
sage: m = ModularSymbols(Gamma1(3),12); m.dimension()8
sage: m.cuspidal_subspace().new_subspace().dimension()
2

16

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> m = ModularSymbols(Gamma1(Integer(3)),Integer(12)); m.dimension()
8>>> m.cuspidal_subspace().new_subspace().dimension()2

default_prec()Get the default precision for computation of 𝑞-expansion associated to the ambient space of this space ofmodular symbols (and all subspaces). Use set_default_prec to change the default precision.
EXAMPLES:
sage: M = ModularSymbols(15)sage: M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^3 - q^4 + q^5 + q^6 + O(q^8)]
sage: M.set_default_prec(20)>>> from sage.all import *>>> M = ModularSymbols(Integer(15))>>> M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^3 - q^4 + q^5 + q^6 + O(q^8)]>>> M.set_default_prec(Integer(20))

Notice that setting the default precision of the ambient space affects the subspaces.
sage: M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^3 - q^4 + q^5 + q^6 + 3*q^8 + q^9 - q^10 - 4*q^11 + q^12 - 2*q^13␣
˓→- q^15 - q^16 + 2*q^17 - q^18 + 4*q^19 + O(q^20)]
sage: M.cuspidal_submodule().default_prec()20>>> from sage.all import *>>> M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^3 - q^4 + q^5 + q^6 + 3*q^8 + q^9 - q^10 - 4*q^11 + q^12 - 2*q^13␣
˓→- q^15 - q^16 + 2*q^17 - q^18 + 4*q^19 + O(q^20)]>>> M.cuspidal_submodule().default_prec()20

dimension_of_associated_cuspform_space()
Return the dimension of the corresponding space of cusp forms.
The input space must be cuspidal, otherwise there is no corresponding space of cusp forms.
EXAMPLES:
sage: m = ModularSymbols(Gamma0(389),2).cuspidal_subspace(); m.dimension()64
sage: m.dimension_of_associated_cuspform_space()
32(continues on next page)17

Modular Symbols, Release 10.4

(continued from previous page)

sage: m = ModularSymbols(Gamma0(389),2,sign=1).cuspidal_subspace(); m.
˓→dimension()32
sage: m.dimension_of_associated_cuspform_space()
32>>> from sage.all import *>>> m = ModularSymbols(Gamma0(Integer(389)),Integer(2)).cuspidal_subspace();␣
˓→m.dimension()64>>> m.dimension_of_associated_cuspform_space()32>>> m = ModularSymbols(Gamma0(Integer(389)),Integer(2),sign=Integer(1)).
˓→cuspidal_subspace(); m.dimension()32>>> m.dimension_of_associated_cuspform_space()32

dual_star_involution_matrix()
Return the matrix of the dual star involution, which is induced by complex conjugation on the linear dual ofmodular symbols.
Note: This should be overridden in all derived classes.
EXAMPLES:
sage: sage.modular.modsym.space.ModularSymbolsSpace(Gamma0(11),2,
˓→DirichletGroup(11).gens()[0]**10,0,QQ).dual_star_involution_matrix()
Traceback (most recent call last):...
NotImplementedError: computation of dual star involution matrix not yet␣˓→implemented for this classsage: ModularSymbols(Gamma0(11),2).dual_star_involution_matrix()[ 1 0 0][ 0 -1 0][ 0 1 1]>>> from sage.all import *>>> sage.modular.modsym.space.ModularSymbolsSpace(Gamma0(Integer(11)),
˓→Integer(2),DirichletGroup(Integer(11)).gens()[Integer(0)]**Integer(10),
˓→Integer(0),QQ).dual_star_involution_matrix()
Traceback (most recent call last):...
NotImplementedError: computation of dual star involution matrix not yet␣˓→implemented for this class>>> ModularSymbols(Gamma0(Integer(11)),Integer(2)).dual_star_involution_
˓→matrix()[ 1 0 0][ 0 -1 0][ 0 1 1]eisenstein_subspace()
Synonym for eisenstein_submodule.
EXAMPLES:
18

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

sage: m = ModularSymbols(Gamma1(3),12); m.dimension()8
sage: m.eisenstein_subspace().dimension()2
sage: m.cuspidal_subspace().dimension()6>>> from sage.all import *>>> m = ModularSymbols(Gamma1(Integer(3)),Integer(12)); m.dimension()
8>>> m.eisenstein_subspace().dimension()2>>> m.cuspidal_subspace().dimension()
6group()
Return the group of this modular symbols space.
INPUT:• ModularSymbols self – an arbitrary space of modular symbols
OUTPUT:• CongruenceSubgroup – the congruence subgroup that this is a space of modular symbols for.
ALGORITHM: The group is recorded when this space is created.
EXAMPLES:
sage: m = ModularSymbols(20)sage: m.group()
Congruence Subgroup Gamma0(20)>>> from sage.all import *>>> m = ModularSymbols(Integer(20))>>> m.group()
Congruence Subgroup Gamma0(20)hecke_module_of_level(level)
Alias for self.modular_symbols_of_level(level).
EXAMPLES:
sage: ModularSymbols(11, 2).hecke_module_of_level(22)Modular Symbols space of dimension 7 for Gamma_0(22) of weight 2 with sign 0␣˓→over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(11), Integer(2)).hecke_module_of_level(Integer(22))
Modular Symbols space of dimension 7 for Gamma_0(22) of weight 2 with sign 0␣˓→over Rational Field

integral_basis()
Return a basis for the -submodule of this modular symbols space spanned by the generators.
Modular symbols spaces for congruence subgroups have a -structure. Computing this -structure is expensive, so by default modular symbols spaces for congruence subgroups in Sage are defined over . This

19

Modular Symbols, Release 10.4

function returns a tuple of independent elements in this modular symbols space whose -span is the corresponding space of modular symbols over .
EXAMPLES:
sage: M = ModularSymbols(11)sage: M.basis()((1,0), (1,8), (1,9))
sage: M.integral_basis()((1,0), (1,8), (1,9))
sage: S = M.cuspidal_submodule()
sage: S.basis()((1,8), (1,9))
sage: S.integral_basis()((1,8), (1,9))>>> from sage.all import *>>> M = ModularSymbols(Integer(11))>>> M.basis()((1,0), (1,8), (1,9))>>> M.integral_basis()((1,0), (1,8), (1,9))>>> S = M.cuspidal_submodule()>>> S.basis()((1,8), (1,9))>>> S.integral_basis()((1,8), (1,9))
sage: M = ModularSymbols(13,4)
sage: M.basis()([X^2,(0,1)], [X^2,(1,4)], [X^2,(1,5)], [X^2,(1,7)], [X^2,(1,9)], [X^2,(1,˓→10)], [X^2,(1,11)], [X^2,(1,12)])sage: M.integral_basis()([X^2,(0,1)], 1/28*[X^2,(1,4)] + 2/7*[X^2,(1,5)] + 3/28*[X^2,(1,7)] + 11/
˓→14*[X^2,(1,9)] + 2/7*[X^2,(1,10)] + 11/28*[X^2,(1,11)] + 3/28*[X^2,(1,12)],␣
˓→[X^2,(1,5)], 1/2*[X^2,(1,7)] + 1/2*[X^2,(1,9)], [X^2,(1,9)], [X^2,(1,10)],␣
˓→[X^2,(1,11)], [X^2,(1,12)])sage: S = M.cuspidal_submodule()
sage: S.basis()([X^2,(1,4)] - [X^2,(1,12)], [X^2,(1,5)] - [X^2,(1,12)], [X^2,(1,7)] - [X^2,
˓→(1,12)], [X^2,(1,9)] - [X^2,(1,12)], [X^2,(1,10)] - [X^2,(1,12)], [X^2,(1,
˓→11)] - [X^2,(1,12)])sage: S.integral_basis()(1/28*[X^2,(1,4)] + 2/7*[X^2,(1,5)] + 3/28*[X^2,(1,7)] + 11/14*[X^2,(1,9)] +␣˓→2/7*[X^2,(1,10)] + 11/28*[X^2,(1,11)] - 53/28*[X^2,(1,12)], [X^2,(1,5)] -␣˓→[X^2,(1,12)], 1/2*[X^2,(1,7)] + 1/2*[X^2,(1,9)] - [X^2,(1,12)], [X^2,(1,9)]␣
˓→- [X^2,(1,12)], [X^2,(1,10)] - [X^2,(1,12)], [X^2,(1,11)] - [X^2,(1,12)])>>> from sage.all import *>>> M = ModularSymbols(Integer(13),Integer(4))>>> M.basis()([X^2,(0,1)], [X^2,(1,4)], [X^2,(1,5)], [X^2,(1,7)], [X^2,(1,9)], [X^2,(1,˓→10)], [X^2,(1,11)], [X^2,(1,12)])>>> M.integral_basis()([X^2,(0,1)], 1/28*[X^2,(1,4)] + 2/7*[X^2,(1,5)] + 3/28*[X^2,(1,7)] + 11/
˓→14*[X^2,(1,9)] + 2/7*[X^2,(1,10)] + 11/28*[X^2,(1,11)] + 3/28*[X^2,(1,12)],␣
˓→[X^2,(1,5)], 1/2*[X^2,(1,7)] + 1/2*[X^2,(1,9)], [X^2,(1,9)], [X^2,(1,10)],␣
(continues on next page)

20

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[X^2,(1,11)], [X^2,(1,12)])>>> S = M.cuspidal_submodule()>>> S.basis()([X^2,(1,4)] - [X^2,(1,12)], [X^2,(1,5)] - [X^2,(1,12)], [X^2,(1,7)] - [X^2,
˓→(1,12)], [X^2,(1,9)] - [X^2,(1,12)], [X^2,(1,10)] - [X^2,(1,12)], [X^2,(1,
˓→11)] - [X^2,(1,12)])>>> S.integral_basis()(1/28*[X^2,(1,4)] + 2/7*[X^2,(1,5)] + 3/28*[X^2,(1,7)] + 11/14*[X^2,(1,9)] +␣˓→2/7*[X^2,(1,10)] + 11/28*[X^2,(1,11)] - 53/28*[X^2,(1,12)], [X^2,(1,5)] -␣˓→[X^2,(1,12)], 1/2*[X^2,(1,7)] + 1/2*[X^2,(1,9)] - [X^2,(1,12)], [X^2,(1,9)]␣
˓→- [X^2,(1,12)], [X^2,(1,10)] - [X^2,(1,12)], [X^2,(1,11)] - [X^2,(1,12)])˓→This function currently raises a NotImplementedError on modular symbols spaces with character of orderbigger than 2:
EXAMPLES:
sage: M = ModularSymbols(DirichletGroup(13).0^2, 2); M
Modular Symbols space of dimension 4 and level 13, weight 2, character␣˓→[zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2
sage: M.basis()((1,0), (1,5), (1,10), (1,11))
sage: M.integral_basis()
Traceback (most recent call last):...
NotImplementedError>>> from sage.all import *>>> M = ModularSymbols(DirichletGroup(Integer(13)).gen(0)**Integer(2),␣
˓→Integer(2)); M
Modular Symbols space of dimension 4 and level 13, weight 2, character␣˓→[zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2>>> M.basis()((1,0), (1,5), (1,10), (1,11))>>> M.integral_basis()
Traceback (most recent call last):...
NotImplementedError

integral_hecke_matrix(n)Return the matrix of the 𝑛`𝑡ℎ𝐻𝑒𝑐𝑘𝑒𝑜𝑝𝑒𝑟𝑎𝑡𝑜𝑟𝑎𝑐𝑡𝑖𝑛𝑔𝑜𝑛𝑡ℎ𝑒𝑖𝑛𝑡𝑒𝑔𝑟𝑎𝑙𝑠𝑡𝑟𝑢𝑐𝑡𝑢𝑟𝑒𝑜𝑛``𝑠𝑒𝑙𝑓 ` (as returned by
self.integral_structure()).
This is often (but not always) different from the matrix returned by self.hecke_matrix, even if thelatter has integral entries.
EXAMPLES:
sage: M = ModularSymbols(6,4)
sage: M.hecke_matrix(3)[27 0 0 0 6 -6][ 0 1 -4 4 8 10][18 0 1 0 6 -6][18 0 4 -3 6 -6][ 0 0 0 0 9 18][ 0 0 0 0 12 15]
sage: M.integral_hecke_matrix(3)(continues on next page)21

Modular Symbols, Release 10.4

(continued from previous page)

[ 27
[ 0
[ 18
[ 18
[ 0
[ 0

0
1
0
0
0
0

0
-8
5
8
0
0

0
8
-4
-7
0
0

6 -6]
12 14]
148]
2 -10]
9 18]
12 15]>>> from sage.all import *>>> M = ModularSymbols(Integer(6),Integer(4))>>> M.hecke_matrix(Integer(3))[27 0 0 0 6 -6][ 0 1 -4 4 8 10][18 0 1 0 6 -6][18 0 4 -3 6 -6][ 0 0 0 0 9 18][ 0 0 0 0 12 15]>>> M.integral_hecke_matrix(Integer(3))
[ 27
0
0
0
6 -6]
[ 0
1 -8
8 12 14][ 18
0
5 -4 14
8]
[ 18
0
8 -7
2 -10]
[ 0
0
0
0
9 18]
[ 0
0
0
0 12 15]integral_period_mapping()
Return the integral period mapping associated to self.
This is a homomorphism to a vector space whose kernel is the same as the kernel of the period mapping
associated to self, normalized so the image of integral modular symbols is exactly 𝑛 .
EXAMPLES:
sage: m = ModularSymbols(23).cuspidal_submodule()
sage: i = m.integral_period_mapping()sage: iIntegral period mapping associated to Modular Symbols subspace of dimension 4␣˓→of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with␣
˓→sign 0 over Rational Field
sage: i.matrix()[-1/11 1/11
0 3/11]
[
1
0
0
0]
[
0
1
0
0]
[
0
0
1
0]
[
0
0
0
1]
sage: [i(b) for b in m.integral_structure().basis()][(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)]
sage: [i(b) for b in m.ambient_module().basis()][(-1/11, 1/11, 0, 3/11),(1, 0, 0, 0),(0, 1, 0, 0),(0, 0, 1, 0),(0, 0, 0, 1)]>>> from sage.all import *>>> m = ModularSymbols(Integer(23)).cuspidal_submodule()>>> i = m.integral_period_mapping()(continues on next page)

22

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> iIntegral period mapping associated to Modular Symbols subspace of dimension 4␣˓→of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with␣
˓→sign 0 over Rational Field>>> i.matrix()[-1/11 1/11
0 3/11]
[
1
0
0
0]
[
0
1
0
0]
[
0
0
1
0]
[
0
0
0
1]
>>> [i(b) for b in m.integral_structure().basis()][(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)]>>> [i(b) for b in m.ambient_module().basis()][(-1/11, 1/11, 0, 3/11),(1, 0, 0, 0),(0, 1, 0, 0),(0, 0, 1, 0),(0, 0, 0, 1)]

We compute the image of the winding element:
sage: m = ModularSymbols(37,sign=1)
sage: a = m[1]sage: f = a.integral_period_mapping()sage: e = m([0,oo])
sage: f(e)(-2/3)>>> from sage.all import *>>> m = ModularSymbols(Integer(37),sign=Integer(1))>>> a = m[Integer(1)]>>> f = a.integral_period_mapping()>>> e = m([Integer(0),oo])>>> f(e)(-2/3)The input space must be cuspidal:
sage: m = ModularSymbols(37,2,sign=1)
sage: m.integral_period_mapping()
Traceback (most recent call last):...
ValueError: integral mapping only defined for cuspidal spaces>>> from sage.all import *>>> m = ModularSymbols(Integer(37),Integer(2),sign=Integer(1))>>> m.integral_period_mapping()
Traceback (most recent call last):...
ValueError: integral mapping only defined for cuspidal spaces

integral_structure()
Return the -structure of this modular symbols spaces generated by all integral modular symbols.
EXAMPLES:

23

Modular Symbols, Release 10.4

sage: M = ModularSymbols(11,4)
sage: M.integral_structure()
Free module of degree 6 and rank 6 over Integer Ring
Echelon basis matrix:
[
1
0
0
0
0
0]
[
0 1/14
1/7 5/14
1/2 13/14]
[
0
0
1/2
0
0
1/2]
[
0
0
0
1
0
0]
[
0
0
0
0
1
0]
[
0
0
0
0
0
1]
sage: M.cuspidal_submodule().integral_structure()
Free module of degree 6 and rank 4 over Integer Ring
Echelon basis matrix:
[
0
1/14
1/7
5/14
1/2 -15/14]
[
0
0
1/2
0
0
-1/2]
[
0
0
0
1
0
-1]
[
0
0
0
0
1
-1]
>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(4))>>> M.integral_structure()
Free module of degree 6 and rank 6 over Integer Ring
Echelon basis matrix:
[
1
0
0
0
0
0]
[
0 1/14
1/7 5/14
1/2 13/14]
[
0
0
1/2
0
0
1/2]
[
0
0
0
1
0
0]
[
0
0
0
0
1
0]
[
0
0
0
0
0
1]
>>> M.cuspidal_submodule().integral_structure()
Free module of degree 6 and rank 4 over Integer Ring
Echelon basis matrix:
[
0
1/14
1/7
5/14
1/2 -15/14]
[
0
0
1/2
0
0
-1/2]
[
0
0
0
1
0
-1]
[
0
0
0
0
1
-1]

intersection_number(M)Given modular symbols spaces self and M in some common ambient space, returns the intersection numberof these two spaces.
This is the index in their saturation of the sum of their underlying integral structures.
If self and M are of weight two and defined over QQ, and correspond to newforms f and g, then this number
equals the order of the intersection of the modular abelian varieties attached to f and g.
EXAMPLES:
sage: m = ModularSymbols(389,2)
sage: d = m.decomposition(2)sage: eis = d[0]sage: ell = d[1]sage: af = d[-1]sage: af.intersection_number(eis)97sage: af.intersection_number(ell)400

24Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> m = ModularSymbols(Integer(389),Integer(2))>>> d = m.decomposition(Integer(2))>>> eis = d[Integer(0)]>>> ell = d[Integer(1)]>>> af = d[-Integer(1)]>>> af.intersection_number(eis)97>>> af.intersection_number(ell)400

is_ambient()
Return True if self is an ambient space of modular symbols.
EXAMPLES:
sage: ModularSymbols(21,4).is_ambient()
True
sage: ModularSymbols(21,4).cuspidal_submodule().is_ambient()
False>>> from sage.all import *>>> ModularSymbols(Integer(21),Integer(4)).is_ambient()
True>>> ModularSymbols(Integer(21),Integer(4)).cuspidal_submodule().is_ambient()
False

is_cuspidal()
Return True if self is a cuspidal space of modular symbols.
Note: This should be overridden in all derived classes.
EXAMPLES:
sage: sage.modular.modsym.space.ModularSymbolsSpace(Gamma0(11),2,
˓→DirichletGroup(11).gens()[0]**10,0,QQ).is_cuspidal()Traceback (most recent call last):...
NotImplementedError: computation of cuspidal subspace not yet implemented for␣
˓→this classsage: ModularSymbols(Gamma0(11),2).is_cuspidal()False>>> from sage.all import *>>> sage.modular.modsym.space.ModularSymbolsSpace(Gamma0(Integer(11)),
˓→Integer(2),DirichletGroup(Integer(11)).gens()[Integer(0)]**Integer(10),
˓→Integer(0),QQ).is_cuspidal()Traceback (most recent call last):...
NotImplementedError: computation of cuspidal subspace not yet implemented for␣
˓→this class>>> ModularSymbols(Gamma0(Integer(11)),Integer(2)).is_cuspidal()False

is_simple()

25

Modular Symbols, Release 10.4

Return whether this modular symbols space is simple as a module over the anemic Hecke algebra adjoin *.
EXAMPLES:
sage: m = ModularSymbols(Gamma0(33),2,sign=1)
sage: m.is_simple()False
sage: o = m.old_subspace()sage: o.decomposition()[
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field,
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field]
sage: C = ModularSymbols(1,14,0,GF(5)).cuspidal_submodule(); C
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→2 for Gamma_0(1) of weight 14 with sign 0 over Finite Field of size 5
sage: C.is_simple()True>>> from sage.all import *>>> m = ModularSymbols(Gamma0(Integer(33)),Integer(2),sign=Integer(1))>>> m.is_simple()
False>>> o = m.old_subspace()>>> o.decomposition()[
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field,
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→6 for Gamma_0(33) of weight 2 with sign 1 over Rational Field]>>> C = ModularSymbols(Integer(1),Integer(14),Integer(0),GF(Integer(5))).
˓→cuspidal_submodule(); C
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→2 for Gamma_0(1) of weight 14 with sign 0 over Finite Field of size 5>>> C.is_simple()Trueminus_submodule(compute_dual=True)
Return the subspace of self on which the star involution acts as -1.
INPUT:• compute_dual – bool (default: True) also compute dual subspace. This are useful for many algorithms.
OUTPUT: subspace of modular symbols
EXAMPLES:
sage: ModularSymbols(14,4)
Modular Symbols space of dimension 12 for Gamma_0(14) of weight 4 with sign 0␣˓→over Rational Field
sage: ModularSymbols(14,4).minus_submodule()
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣˓→12 for Gamma_0(14) of weight 4 with sign 0 over Rational Field

26

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> ModularSymbols(Integer(14),Integer(4))
Modular Symbols space of dimension 12 for Gamma_0(14) of weight 4 with sign 0␣˓→over Rational Field>>> ModularSymbols(Integer(14),Integer(4)).minus_submodule()
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣˓→12 for Gamma_0(14) of weight 4 with sign 0 over Rational Field

modular_symbols_of_sign(sign, bound=None)
Return a space of modular symbols with the same defining properties (weight, level, etc.) and Hecke eigenvalues as this space except with given sign.
INPUT:• self – a cuspidal space of modular symbols• sign – an integer, one of -1, 0, or 1
• bound – integer (default: None); if specified only use Hecke operators up to the given bound.
EXAMPLES:
sage: S = ModularSymbols(Gamma0(11),2,sign=0).cuspidal_subspace()sage: S
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field
sage: S.modular_symbols_of_sign(-1)
Modular Symbols space of dimension 1 for Gamma_0(11) of weight 2 with sign -1␣
˓→over Rational Field>>> from sage.all import *>>> S = ModularSymbols(Gamma0(Integer(11)),Integer(2),sign=Integer(0)).
˓→cuspidal_subspace()>>> S
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field>>> S.modular_symbols_of_sign(-Integer(1))
Modular Symbols space of dimension 1 for Gamma_0(11) of weight 2 with sign -1␣
˓→over Rational Field
sage: S = ModularSymbols(43,2,sign=1)[2]; S
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 for Gamma_0(43) of weight 2 with sign 1 over Rational Field
sage: S.modular_symbols_of_sign(-1)
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(43) of weight 2 with sign -1 over Rational Field>>> from sage.all import *>>> S = ModularSymbols(Integer(43),Integer(2),sign=Integer(1))[Integer(2)]; S
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 for Gamma_0(43) of weight 2 with sign 1 over Rational Field>>> S.modular_symbols_of_sign(-Integer(1))
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(43) of weight 2 with sign -1 over Rational Field
sage: S.modular_symbols_of_sign(0)Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(43) of weight 2 with sign 0 over Rational Field

27

Modular Symbols, Release 10.4>>> from sage.all import *>>> S.modular_symbols_of_sign(Integer(0))
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(43) of weight 2 with sign 0 over Rational Field
sage: S = ModularSymbols(389,sign=1)[3]; S
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field
sage: S.modular_symbols_of_sign(-1)
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣˓→32 for Gamma_0(389) of weight 2 with sign -1 over Rational Field
sage: S.modular_symbols_of_sign(0)Modular Symbols subspace of dimension 6 of Modular Symbols space of dimension␣
˓→65 for Gamma_0(389) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> S = ModularSymbols(Integer(389),sign=Integer(1))[Integer(3)]; S
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→33 for Gamma_0(389) of weight 2 with sign 1 over Rational Field>>> S.modular_symbols_of_sign(-Integer(1))
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣˓→32 for Gamma_0(389) of weight 2 with sign -1 over Rational Field>>> S.modular_symbols_of_sign(Integer(0))
Modular Symbols subspace of dimension 6 of Modular Symbols space of dimension␣
˓→65 for Gamma_0(389) of weight 2 with sign 0 over Rational Field
sage: S = ModularSymbols(23,sign=1,weight=4)[2]; S
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(23) of weight 4 with sign 1 over Rational Field
sage: S.modular_symbols_of_sign(1) is S
True
sage: S.modular_symbols_of_sign(0)Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension␣˓→12 for Gamma_0(23) of weight 4 with sign 0 over Rational Field
sage: S.modular_symbols_of_sign(-1)
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(23) of weight 4 with sign -1 over Rational Field>>> from sage.all import *>>> S = ModularSymbols(Integer(23),sign=Integer(1),˓→weight=Integer(4))[Integer(2)]; S
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(23) of weight 4 with sign 1 over Rational Field>>> S.modular_symbols_of_sign(Integer(1)) is S
True>>> S.modular_symbols_of_sign(Integer(0))
Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension␣˓→12 for Gamma_0(23) of weight 4 with sign 0 over Rational Field>>> S.modular_symbols_of_sign(-Integer(1))
Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(23) of weight 4 with sign -1 over Rational Field

multiplicity(S, check_simple=True)
Return the multiplicity of the simple modular symbols space S in self. S must be a simple anemic Hecke
module.
ASSUMPTION: self is an anemic Hecke module with the same weight and group as S, and S is simple.
28

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

EXAMPLES:
sage: M = ModularSymbols(11,2,sign=1)
sage: N1, N2 = M.decomposition()sage: N1.multiplicity(N2)0sage: M.multiplicity(N1)1sage: M.multiplicity(ModularSymbols(14,2))0>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(2),sign=Integer(1))>>> N1, N2 = M.decomposition()>>> N1.multiplicity(N2)0>>> M.multiplicity(N1)1>>> M.multiplicity(ModularSymbols(Integer(14),Integer(2)))
0new_subspace(p=None)
Synonym for new_submodule.
EXAMPLES:
sage: m = ModularSymbols(Gamma0(5),12); m.dimension()12
sage: m.new_subspace().dimension()6
sage: m = ModularSymbols(Gamma1(3),12); m.dimension()8
sage: m.new_subspace().dimension()2>>> from sage.all import *>>> m = ModularSymbols(Gamma0(Integer(5)),Integer(12)); m.dimension()
12>>> m.new_subspace().dimension()
6>>> m = ModularSymbols(Gamma1(Integer(3)),Integer(12)); m.dimension()
8>>> m.new_subspace().dimension()2

ngens()
Return the number of generators of self.
INPUT:• ModularSymbols self – arbitrary space of modular symbols.
OUTPUT:• int – the number of generators, which is the same as the dimension of self.
ALGORITHM: Call the dimension function.
EXAMPLES:

29

Modular Symbols, Release 10.4

sage: m = ModularSymbols(33)sage: m.ngens()
9sage: m.rank()
9sage: ModularSymbols(100, weight=2, sign=1).ngens()
18>>> from sage.all import *>>> m = ModularSymbols(Integer(33))>>> m.ngens()
9>>> m.rank()
9>>> ModularSymbols(Integer(100), weight=Integer(2), sign=Integer(1)).ngens()
18

old_subspace(p=None)
Synonym for old_submodule.
EXAMPLES:
sage: m = ModularSymbols(Gamma1(3),12); m.dimension()8
sage: m.old_subspace().dimension()6>>> from sage.all import *>>> m = ModularSymbols(Gamma1(Integer(3)),Integer(12)); m.dimension()
8>>> m.old_subspace().dimension()
6plus_submodule(compute_dual=True)
Return the subspace of self on which the star involution acts as +1.
INPUT:• compute_dual – bool (default: True) also compute dual subspace. This are useful for many algorithms.
OUTPUT: subspace of modular symbols
EXAMPLES:
sage: ModularSymbols(17,2)
Modular Symbols space of dimension 3 for Gamma_0(17) of weight 2 with sign 0␣˓→over Rational Field
sage: ModularSymbols(17,2).plus_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(17) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(17),Integer(2))
Modular Symbols space of dimension 3 for Gamma_0(17) of weight 2 with sign 0␣˓→over Rational Field>>> ModularSymbols(Integer(17),Integer(2)).plus_submodule()(continues on next page)

30

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(17) of weight 2 with sign 0 over Rational Field

q_eigenform(prec, names=None)
Return the q-expansion to precision prec of a new eigenform associated to self.
Here self must be new, cuspidal, and simple.
EXAMPLES:
sage: ModularSymbols(2, 8)[1].q_eigenform(5, a )q - 8*q^2 + 12*q^3 + 64*q^4 + O(q^5)
sage: ModularSymbols(2, 8)[0].q_eigenform(5, a )Traceback (most recent call last):...
ArithmeticError: self must be cuspidal.
>>> from sage.all import *>>> ModularSymbols(Integer(2), Integer(8))[Integer(1)].q_eigenform(Integer(5),˓→a )q - 8*q^2 + 12*q^3 + 64*q^4 + O(q^5)>>> ModularSymbols(Integer(2), Integer(8))[Integer(0)].q_eigenform(Integer(5),˓→ a )
Traceback (most recent call last):...
ArithmeticError: self must be cuspidal.

q_eigenform_character(names=None)
Return the Dirichlet character associated to the specific choice of 𝑞-eigenform attached to this simple cuspidal
modular symbols space.
INPUT:• names – string, name of the variable.
OUTPUT:• a Dirichlet character taking values in the Hecke eigenvalue field, where the indeterminate of that field isdetermined by the given variable name.
EXAMPLES:
sage: f = ModularSymbols(Gamma1(13),2,sign=1).cuspidal_subspace().
˓→decomposition()[0]sage: eps = f.q_eigenform_character( a ); eps
Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -a - 1
sage: parent(eps)Group of Dirichlet characters modulo 13 with values in Number Field in a with␣
˓→defining polynomial x^2 + 3*x + 3
sage: eps(3)a + 1>>> from sage.all import *>>> f = ModularSymbols(Gamma1(Integer(13)),Integer(2),sign=Integer(1)).
˓→cuspidal_subspace().decomposition()[Integer(0)]>>> eps = f.q_eigenform_character( a ); eps
Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -a - 1(continues on next page)31

Modular Symbols, Release 10.4

(continued from previous page)>>> parent(eps)Group of Dirichlet characters modulo 13 with values in Number Field in a with␣
˓→defining polynomial x^2 + 3*x + 3>>> eps(Integer(3))
a + 1

The modular symbols space must be simple.:sage: ModularSymbols(Gamma1(17),2,sign=1).cuspidal_submodule().q_eigenform_
˓→character( a )Traceback (most recent call last):...
ArithmeticError: self must be simple>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(17)),Integer(2),sign=Integer(1)).cuspidal_
˓→submodule().q_eigenform_character( a )Traceback (most recent call last):...
ArithmeticError: self must be simple

If the character is specified when making the modular symbols space, then names need not be given and thereturned character is just the character of the space.:sage: f = ModularSymbols(kronecker_character(19),2,sign=1).cuspidal_
˓→subspace().decomposition()[0]sage: fModular Symbols subspace of dimension 8 of Modular Symbols space of dimension␣˓→10 and level 76, weight 2, character [-1, -1], sign 1, over Rational Field
sage: f.q_eigenform_character()
Dirichlet character modulo 76 of conductor 76 mapping 39 |--> -1, 21 |--> -1
sage: f.q_eigenform_character() is f.character()True>>> from sage.all import *>>> f = ModularSymbols(kronecker_character(Integer(19)),Integer(2),˓→sign=Integer(1)).cuspidal_subspace().decomposition()[Integer(0)]>>> fModular Symbols subspace of dimension 8 of Modular Symbols space of dimension␣˓→10 and level 76, weight 2, character [-1, -1], sign 1, over Rational Field>>> f.q_eigenform_character()
Dirichlet character modulo 76 of conductor 76 mapping 39 |--> -1, 21 |--> -1>>> f.q_eigenform_character() is f.character()True

The input space need not be cuspidal:
sage: M = ModularSymbols(Gamma1(13),2,sign=1).eisenstein_submodule()[0]sage: M.q_eigenform_character( a )Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(13)),Integer(2),sign=Integer(1)).
˓→eisenstein_submodule()[Integer(0)]>>> M.q_eigenform_character( a )Dirichlet character modulo 13 of conductor 13 mapping 2 |--> -1

32

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

The modular symbols space does not have to come from a decomposition:
sage: ModularSymbols(Gamma1(16),2,sign=1).cuspidal_submodule().q_eigenform_
˓→character( a )Dirichlet character modulo 16 of conductor 16 mapping 15 |--> 1, 5 |--> -a - 1>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(16)),Integer(2),sign=Integer(1)).cuspidal_
˓→submodule().q_eigenform_character( a )Dirichlet character modulo 16 of conductor 16 mapping 15 |--> 1, 5 |--> -a - 1

q_expansion_basis(prec=None, algorithm='default')
Return a basis of q-expansions (as power series) to precision prec of the space of modular forms associatedto self.
The q-expansions are defined over the same base ring as self, and a put in echelon form.
INPUT:• self – a space of CUSPIDAL modular symbols• prec – an integer• algorithm – string:•default(default) – decide which algorithm to use based on heuristics•

hecke – compute basis by computing homomorphisms T - K, where T is the Hecke algebra•

eigen – compute basis using eigenvectors for the Hecke action and Atkin-Lehner-Li theory to patchthem together•

all – compute using hecke_dual and eigen algorithms and verify that the results are the same.

The computed basis is not cached, though of course Hecke operators used in computing the basis are cached.
EXAMPLES:
sage: M = ModularSymbols(1, 12).cuspidal_submodule()
sage: M.q_expansion_basis(8)[q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + O(q^8)]>>> from sage.all import *>>> M = ModularSymbols(Integer(1), Integer(12)).cuspidal_submodule()>>> M.q_expansion_basis(Integer(8))[
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + O(q^8)]
sage: M.q_expansion_basis(8, algorithm= eigen )[q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + O(q^8)]>>> from sage.all import *>>> M.q_expansion_basis(Integer(8), algorithm= eigen )[(continues on next page)33

Modular Symbols, Release 10.4

(continued from previous page)q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + O(q^8)]
sage: M = ModularSymbols(1, 24).cuspidal_submodule()
sage: M.q_expansion_basis(8, algorithm= eigen )[q + 195660*q^3 + 12080128*q^4 + 44656110*q^5 - 982499328*q^6 - 147247240*q^7␣
˓→+ O(q^8),
q^2 - 48*q^3 + 1080*q^4 - 15040*q^5 + 143820*q^6 - 985824*q^7 + O(q^8)]>>> from sage.all import *>>> M = ModularSymbols(Integer(1), Integer(24)).cuspidal_submodule()>>> M.q_expansion_basis(Integer(8), algorithm= eigen )[q + 195660*q^3 + 12080128*q^4 + 44656110*q^5 - 982499328*q^6 - 147247240*q^7␣
˓→+ O(q^8),
q^2 - 48*q^3 + 1080*q^4 - 15040*q^5 + 143820*q^6 - 985824*q^7 + O(q^8)]
sage: M = ModularSymbols(11, 2, sign=-1).cuspidal_submodule()
sage: M.q_expansion_basis(8, algorithm= eigen )[q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 + O(q^8)]>>> from sage.all import *>>> M = ModularSymbols(Integer(11), Integer(2), sign=-Integer(1)).cuspidal_
˓→submodule()>>> M.q_expansion_basis(Integer(8), algorithm= eigen )[q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 + O(q^8)]
sage: M = ModularSymbols(Gamma1(13), 2, sign=1).cuspidal_submodule()
sage: M.q_expansion_basis(8, algorithm= eigen )[q - 4*q^3 - q^4 + 3*q^5 + 6*q^6 + O(q^8),
q^2 - 2*q^3 - q^4 + 2*q^5 + 2*q^6 + O(q^8)]>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(13)), Integer(2), sign=Integer(1)).
˓→cuspidal_submodule()>>> M.q_expansion_basis(Integer(8), algorithm= eigen )[q - 4*q^3 - q^4 + 3*q^5 + 6*q^6 + O(q^8),
q^2 - 2*q^3 - q^4 + 2*q^5 + 2*q^6 + O(q^8)]
sage: M = ModularSymbols(Gamma1(5), 3, sign=-1).cuspidal_submodule()
sage: M.q_expansion_basis(8, algorithm= eigen )# dimension is 0[]34

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(5)), Integer(3), sign=-Integer(1)).
˓→cuspidal_submodule()>>> M.q_expansion_basis(Integer(8), algorithm= eigen )# dimension is 0[]
sage: M = ModularSymbols(Gamma1(7), 3, sign=-1).cuspidal_submodule()
sage: M.q_expansion_basis(8)[q - 3*q^2 + 5*q^4 - 7*q^7 + O(q^8)]>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(7)), Integer(3), sign=-Integer(1)).
˓→cuspidal_submodule()>>> M.q_expansion_basis(Integer(8))[
q - 3*q^2 + 5*q^4 - 7*q^7 + O(q^8)]
sage: M = ModularSymbols(43, 2, sign=0).cuspidal_submodule()
sage: M[0]Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(43) of weight 2 with sign 0 over Rational Field
sage: M[0].q_expansion_basis()[q - 2*q^2 - 2*q^3 + 2*q^4 - 4*q^5 + 4*q^6 + O(q^8)]
sage: M[1]Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(43) of weight 2 with sign 0 over Rational Field
sage: M[1].q_expansion_basis()[q + 2*q^5 - 2*q^6 - 2*q^7 + O(q^8),
q^2 - q^3 - q^5 + q^7 + O(q^8)]>>> from sage.all import *>>> M = ModularSymbols(Integer(43), Integer(2), sign=Integer(0)).cuspidal_
˓→submodule()>>> M[Integer(0)]Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(43) of weight 2 with sign 0 over Rational Field>>> M[Integer(0)].q_expansion_basis()[q - 2*q^2 - 2*q^3 + 2*q^4 - 4*q^5 + 4*q^6 + O(q^8)]>>> M[Integer(1)]Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(43) of weight 2 with sign 0 over Rational Field>>> M[Integer(1)].q_expansion_basis()[q + 2*q^5 - 2*q^6 - 2*q^7 + O(q^8),
q^2 - q^3 - q^5 + q^7 + O(q^8)]

q_expansion_cuspforms(prec=None)35

Modular Symbols, Release 10.4

Return a function f(i,j) such that each value f(i,j) is the q-expansion, to the given precision, of an element of
the corresponding space 𝑆 of cusp forms.
Together these functions span 𝑆. Here 𝑖, 𝑗 are integers with 0 ≤ 𝑖, 𝑗 < 𝑑, where 𝑑 is the dimension of self.
For a reduced echelon basis, use the function q_expansion_basis instead.
More precisely, this function returns the 𝑞-expansions obtained by taking the 𝑖𝑗 entry of the matrices of the
Hecke operators 𝑇𝑛 acting on the subspace of the linear dual of modular symbols corresponding to self.
EXAMPLES:
sage: S = ModularSymbols(11,2, sign=1).cuspidal_submodule()
sage: f = S.q_expansion_cuspforms(8)sage: f(0,0)
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 + O(q^8)>>> from sage.all import *>>> S = ModularSymbols(Integer(11),Integer(2), sign=Integer(1)).cuspidal_
˓→submodule()>>> f = S.q_expansion_cuspforms(Integer(8))>>> f(Integer(0),Integer(0))
q - 2*q^2 - q^3 + 2*q^4 + q^5 + 2*q^6 - 2*q^7 + O(q^8)
sage: S = ModularSymbols(37,2).cuspidal_submodule()
sage: f = S.q_expansion_cuspforms(8)sage: f(0,0)
q + q^3 - 2*q^4 - q^7 + O(q^8)
sage: f(3,3)
q - 2*q^2 - 3*q^3 + 2*q^4 - 2*q^5 + 6*q^6 - q^7 + O(q^8)
sage: f(1,2)
q^2 + 2*q^3 - 2*q^4 + q^5 - 3*q^6 + O(q^8)>>> from sage.all import *>>> S = ModularSymbols(Integer(37),Integer(2)).cuspidal_submodule()>>> f = S.q_expansion_cuspforms(Integer(8))>>> f(Integer(0),Integer(0))
q + q^3 - 2*q^4 - q^7 + O(q^8)>>> f(Integer(3),Integer(3))
q - 2*q^2 - 3*q^3 + 2*q^4 - 2*q^5 + 6*q^6 - q^7 + O(q^8)>>> f(Integer(1),Integer(2))
q^2 + 2*q^3 - 2*q^4 + q^5 - 3*q^6 + O(q^8)
sage: S = ModularSymbols(Gamma1(13),2,sign=-1).cuspidal_submodule()
sage: f = S.q_expansion_cuspforms(8)sage: f(0,0)
q - 2*q^2 + q^4 - q^5 + 2*q^6 + O(q^8)
sage: f(0,1)-q^2 + 2*q^3 + q^4 - 2*q^5 - 2*q^6 + O(q^8)>>> from sage.all import *>>> S = ModularSymbols(Gamma1(Integer(13)),Integer(2),sign=-Integer(1)).
˓→cuspidal_submodule()>>> f = S.q_expansion_cuspforms(Integer(8))>>> f(Integer(0),Integer(0))
q - 2*q^2 + q^4 - q^5 + 2*q^6 + O(q^8)(continues on next page)

36

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> f(Integer(0),Integer(1))-q^2 + 2*q^3 + q^4 - 2*q^5 - 2*q^6 + O(q^8)
sage: S = ModularSymbols(1,12,sign=-1).cuspidal_submodule()
sage: f = S.q_expansion_cuspforms(8)sage: f(0,0)
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + O(q^8)>>> from sage.all import *>>> S = ModularSymbols(Integer(1),Integer(12),sign=-Integer(1)).cuspidal_
˓→submodule()>>> f = S.q_expansion_cuspforms(Integer(8))>>> f(Integer(0),Integer(0))
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + O(q^8)

q_expansion_module(prec=None, R=None)
Return a basis over R for the space spanned by the coefficient vectors of the 𝑞-expansions corresponding to
self.
If R is not the base ring of self, this returns the restriction of scalars down to R (for this, self must havebase ring or a number field).
INPUT:• self – must be cuspidal• prec – an integer (default: self.default_prec())• R – either ZZ, QQ, or the base_ring of self (which is the default)
OUTPUT: A free module over R.
Todo: extend to more general R (though that is fairly easy for the user to get by just doing base_extend orchange_ring on the output of this function).
Note that the prec needed to distinguish elements of the restricted-down-to-R basis may be bigger than self.
hecke_bound(), since one must use the Sturm bound for modular forms on Γ𝐻 (𝑁 ).
EXAMPLES WITH SIGN 1 and R=QQ:
Basic example with sign 1:
sage: M = ModularSymbols(11, sign=1).cuspidal_submodule()
sage: M.q_expansion_module(5, QQ)
Vector space of degree 5 and dimension 1 over Rational Field
Basis matrix:[ 0 1 -2 -1 2]>>> from sage.all import *>>> M = ModularSymbols(Integer(11), sign=Integer(1)).cuspidal_submodule()>>> M.q_expansion_module(Integer(5), QQ)
Vector space of degree 5 and dimension 1 over Rational Field
Basis matrix:[ 0 1 -2 -1 2]Same example with sign -1:

37

Modular Symbols, Release 10.4

sage: M = ModularSymbols(11, sign=-1).cuspidal_submodule()
sage: M.q_expansion_module(5, QQ)
Vector space of degree 5 and dimension 1 over Rational Field
Basis matrix:[ 0 1 -2 -1 2]>>> from sage.all import *>>> M = ModularSymbols(Integer(11), sign=-Integer(1)).cuspidal_submodule()>>> M.q_expansion_module(Integer(5), QQ)
Vector space of degree 5 and dimension 1 over Rational Field
Basis matrix:[ 0 1 -2 -1 2]

An example involving old forms:
sage: M = ModularSymbols(22, sign=1).cuspidal_submodule()
sage: M.q_expansion_module(5, QQ)
Vector space of degree 5 and dimension 2 over Rational Field
Basis matrix:[ 0 1 0 -1 -2][ 0 0 1 0 -2]>>> from sage.all import *>>> M = ModularSymbols(Integer(22), sign=Integer(1)).cuspidal_submodule()>>> M.q_expansion_module(Integer(5), QQ)
Vector space of degree 5 and dimension 2 over Rational Field
Basis matrix:[ 0 1 0 -1 -2][ 0 0 1 0 -2]

An example that (somewhat spuriously) is over a number field:
sage: x = polygen(QQ)
sage: k = NumberField(x^2+1, a )sage: M = ModularSymbols(11, base_ring=k, sign=1).cuspidal_submodule()
sage: M.q_expansion_module(5, QQ)
Vector space of degree 5 and dimension 1 over Rational Field
Basis matrix:[ 0 1 -2 -1 2]>>> from sage.all import *>>> x = polygen(QQ)>>> k = NumberField(x**Integer(2)+Integer(1), a )>>> M = ModularSymbols(Integer(11), base_ring=k, sign=Integer(1)).cuspidal_
˓→submodule()>>> M.q_expansion_module(Integer(5), QQ)
Vector space of degree 5 and dimension 1 over Rational Field
Basis matrix:[ 0 1 -2 -1 2]

An example that involves an eigenform with coefficients in a number field:
sage: M = ModularSymbols(23, sign=1).cuspidal_submodule()
sage: M.q_eigenform(4, gamma )q + gamma*q^2 + (-2*gamma - 1)*q^3 + O(q^4)
sage: M.q_expansion_module(11, QQ)(continues on next page)

38

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

Vector space of degree 11 and dimension 2 over Rational Field
Basis matrix:[ 0 1 0 -1 -1 0 -2 2 -1 2 2]
[ 0 0 1 -2 -1 2 1 2 -2 0 -2]>>> from sage.all import *>>> M = ModularSymbols(Integer(23), sign=Integer(1)).cuspidal_submodule()>>> M.q_eigenform(Integer(4), gamma )q + gamma*q^2 + (-2*gamma - 1)*q^3 + O(q^4)>>> M.q_expansion_module(Integer(11), QQ)
Vector space of degree 11 and dimension 2 over Rational Field
Basis matrix:[ 0 1 0 -1 -1 0 -2 2 -1 2 2]
[ 0 0 1 -2 -1 2 1 2 -2 0 -2]

An example that is genuinely over a base field besides QQ.
sage: eps = DirichletGroup(11).0
sage: M = ModularSymbols(eps,3,sign=1).cuspidal_submodule(); M
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→2 and level 11, weight 3, character [zeta10], sign 1, over Cyclotomic Field␣
˓→of order 10 and degree 4
sage: M.q_eigenform(4, beta )q + (-zeta10^3 + 2*zeta10^2 - 2*zeta10)*q^2 + (2*zeta10^3 - 3*zeta10^2 +␣
˓→3*zeta10 - 2)*q^3 + O(q^4)
sage: M.q_expansion_module(7, QQ)
Vector space of degree 7 and dimension 4 over Rational Field
Basis matrix:
[ 0
1
0
0
0 -40 64][ 001
0
0 -24 41][ 000
1
0 -12 21]
[ 0
0
0
0
1 -4
4]
>>> from sage.all import *>>> eps = DirichletGroup(Integer(11)).gen(0)>>> M = ModularSymbols(eps,Integer(3),sign=Integer(1)).cuspidal_submodule(); M
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→2 and level 11, weight 3, character [zeta10], sign 1, over Cyclotomic Field␣
˓→of order 10 and degree 4>>> M.q_eigenform(Integer(4), beta )q + (-zeta10^3 + 2*zeta10^2 - 2*zeta10)*q^2 + (2*zeta10^3 - 3*zeta10^2 +␣
˓→3*zeta10 - 2)*q^3 + O(q^4)>>> M.q_expansion_module(Integer(7), QQ)
Vector space of degree 7 and dimension 4 over Rational Field
Basis matrix:
[ 0
1
0
0
0 -40 64][ 001
0
0 -24 41][ 000
1
0 -12 21]
[ 0
0
0
0
1 -4
4]

An example involving an eigenform rational over the base, but the base is not QQ.
sage: k.<a> = NumberField(x^2-5)
sage: M = ModularSymbols(23, base_ring=k, sign=1).cuspidal_submodule()
sage: D = M.decomposition(); D[(continues on next page)39

Modular Symbols, Release 10.4

(continued from previous page)

Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(23) of weight 2 with sign 1 over Number Field in a with␣
˓→defining polynomial x^2 - 5,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(23) of weight 2 with sign 1 over Number Field in a with␣
˓→defining polynomial x^2 - 5]sage: M.q_expansion_module(8, QQ)
Vector space of degree 8 and dimension 2 over Rational Field
Basis matrix:[ 0 1 0 -1 -1 0 -2 2][ 0 0 1 -2 -1 2 1 2]>>> from sage.all import *>>> k = NumberField(x**Integer(2)-Integer(5), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> M = ModularSymbols(Integer(23), base_ring=k, sign=Integer(1)).cuspidal_
˓→submodule()>>> D = M.decomposition(); D[
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(23) of weight 2 with sign 1 over Number Field in a with␣
˓→defining polynomial x^2 - 5,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(23) of weight 2 with sign 1 over Number Field in a with␣
˓→defining polynomial x^2 - 5]>>> M.q_expansion_module(Integer(8), QQ)
Vector space of degree 8 and dimension 2 over Rational Field
Basis matrix:[ 0 1 0 -1 -1 0 -2 2][ 0 0 1 -2 -1 2 1 2]

An example involving an eigenform not rational over the base and for which the base is not QQ.
sage: eps = DirichletGroup(25).0^2
sage: M = ModularSymbols(eps,2,sign=1).cuspidal_submodule(); M
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 and level 25, weight 2, character [zeta10], sign 1, over Cyclotomic Field␣
˓→of order 10 and degree 4
sage: D = M.decomposition(); D[
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 and level 25, weight 2, character [zeta10], sign 1, over Cyclotomic Field␣
˓→of order 10 and degree 4]
sage: D[0].q_eigenform(4, mu )q + mu*q^2 + ((zeta10^3 + zeta10 - 1)*mu + zeta10^2 - 1)*q^3 + O(q^4)
sage: D[0].q_expansion_module(11, QQ)
Vector space of degree 11 and dimension 8 over Rational Field
Basis matrix:
[ 0
1
0
0
0
0
0
0 -20 -3
0]
[ 0
0
1
0
0
0
0
0 -16 -1
0]
[ 0
0
0
1
0
0
0
0 -11 -2
0]
[ 0
0
0
0
1
0
0
0 -8 -1
0]
[ 0
0
0
0
0
1
0
0 -5 -1
0](continues on next page)

40

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

[ 0
0
0
0
0
0
1
0 -3 -1
0]
[ 0
0
0
0
0
0
0
1 -2
0
0]
[ 0
0
0
0
0
0
0
0
0
0
1]
sage: D[0].q_expansion_module(11)Vector space of degree 11 and dimension 2 over Cyclotomic Field of order 10␣
˓→and degree 4
Basis matrix:
[
0
1
␣
˓→
0
zeta10^2 - 1␣˓→-zeta10^2 - 1-zeta10^3 - zeta10^2␣˓→
zeta10^2 - zeta10
2*zeta10^3 + 2*zeta10 - 1
zeta10^3 -␣
˓→zeta10^2 - zeta10 + 1
zeta10^3 - zeta10^2 + zeta10-2*zeta10^3 +␣
˓→2*zeta10^2 - zeta10]
[
0
0
␣
˓→
1
zeta10^3 + zeta10 - 1␣˓→-zeta10 - 1-zeta10^3 - zeta10^2 -2*zeta10^3␣˓→+ zeta10^2 - zeta10 + 1
zeta10^2
␣˓→
0zeta10^3 + 1 2*zeta10^3 -␣
˓→zeta10^2 + zeta10 - 1]>>> from sage.all import *>>> eps = DirichletGroup(Integer(25)).gen(0)**Integer(2)>>> M = ModularSymbols(eps,Integer(2),sign=Integer(1)).cuspidal_submodule(); M
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 and level 25, weight 2, character [zeta10], sign 1, over Cyclotomic Field␣
˓→of order 10 and degree 4>>> D = M.decomposition(); D[
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→4 and level 25, weight 2, character [zeta10], sign 1, over Cyclotomic Field␣
˓→of order 10 and degree 4]>>> D[Integer(0)].q_eigenform(Integer(4), mu )q + mu*q^2 + ((zeta10^3 + zeta10 - 1)*mu + zeta10^2 - 1)*q^3 + O(q^4)>>> D[Integer(0)].q_expansion_module(Integer(11), QQ)
Vector space of degree 11 and dimension 8 over Rational Field
Basis matrix:
[ 0
1
0
0
0
0
0
0 -20 -3
0]
[ 0
0
1
0
0
0
0
0 -16 -1
0]
[ 0
0
0
1
0
0
0
0 -11 -2
0]
[ 0
0
0
0
1
0
0
0 -8 -1
0]
[ 0
0
0
0
0
1
0
0 -5 -1
0]
[ 0
0
0
0
0
0
1
0 -3 -1
0]
[ 0
0
0
0
0
0
0
1 -2
0
0]
[ 0
0
0
0
0
0
0
0
0
0
1]
>>> D[Integer(0)].q_expansion_module(Integer(11))
Vector space of degree 11 and dimension 2 over Cyclotomic Field of order 10␣
˓→and degree 4
Basis matrix:
[
0
1
␣
˓→
0
zeta10^2 - 1␣˓→-zeta10^2 - 1-zeta10^3 - zeta10^2␣˓→
zeta10^2 - zeta10
2*zeta10^3 + 2*zeta10 - 1
zeta10^3 -␣
˓→zeta10^2 - zeta10 + 1
zeta10^3 - zeta10^2 + zeta10-2*zeta10^3 +␣
˓→2*zeta10^2 - zeta10][00␣(continues on next page)41

Modular Symbols, Release 10.4

(continued from previous page)1

˓→-zeta10 - 1+ zeta10^2 - zeta10 + 1˓→0˓→zeta10^2 + zeta10 - 1]˓→˓→

zeta10^3 + zeta10 - 1␣-zeta10^3 - zeta10^2 -2*zeta10^3␣
zeta10^2
␣zeta10^3 + 1 2*zeta10^3 -␣

EXAMPLES WITH SIGN 0 and R=QQ:
Todo: This doesn’t work yet as it’s not implemented!!
sage: M = ModularSymbols(11,2).cuspidal_submodule() #not tested
sage: M.q_expansion_module() #not tested... boom ...
>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(2)).cuspidal_submodule() #not␣
˓→tested>>> M.q_expansion_module() #not tested... boom ...

EXAMPLES WITH SIGN 1 and R=ZZ (computes saturation):sage: M = ModularSymbols(43,2, sign=1).cuspidal_submodule()
sage: M.q_expansion_module(8, QQ)
Vector space of degree 8 and dimension 3 over Rational Field
Basis matrix:
[
0
1
0
0
0
2
-2
-2]
[
0
0
1
0 -1/2
1 -3/20][0
00
1 -1/2
2 -3/2-1]
sage: M.q_expansion_module(8, ZZ)
Free module of degree 8 and rank 3 over Integer Ring
Echelon basis matrix:[ 0 1 0 0 0 2 -2 -2][ 0 0 1 1 -1 3 -3 -1][ 0 0 0 2 -1 4 -3 -2]>>> from sage.all import *>>> M = ModularSymbols(Integer(43),Integer(2), sign=Integer(1)).cuspidal_
˓→submodule()>>> M.q_expansion_module(Integer(8), QQ)
Vector space of degree 8 and dimension 3 over Rational Field
Basis matrix:
[
0
1
0
0
0
2
-2
-2]
[
0
0
1
0 -1/2
1 -3/20][0
00
1 -1/2
2 -3/2-1]>>> M.q_expansion_module(Integer(8), ZZ)
Free module of degree 8 and rank 3 over Integer Ring
Echelon basis matrix:[ 0 1 0 0 0 2 -2 -2][ 0 0 1 1 -1 3 -3 -1][ 0 0 0 2 -1 4 -3 -2]

rational_period_mapping()
Return the rational period mapping associated to self.

42

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

This is a homomorphism to a vector space whose kernel is the same as the kernel of the period mapping
associated to self. For this to exist, self must be Hecke equivariant.
Use integral_period_mapping() to obtain a homomorphism to a
image of integral modular symbols is exactly 𝑛 .

-module, normalized so the

EXAMPLES:
sage: M = ModularSymbols(37)sage: A = M[1]; A
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(37) of weight 2 with sign 0 over Rational Field
sage: r = A.rational_period_mapping(); rRational period mapping associated to Modular Symbols subspace of dimension 2␣˓→of Modular Symbols space of dimension 5 for Gamma_0(37) of weight 2 with␣
˓→sign 0 over Rational Field
sage: r(M.0)(0, 0)
sage: r(M.1)(1, 0)
sage: r.matrix()[ 0 0][ 1 0][ 0 1][-1 -1][ 0 0]
sage: r.domain()
Modular Symbols space of dimension 5 for Gamma_0(37) of weight 2 with sign 0␣˓→over Rational Field
sage: r.codomain()
Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]
>>> from sage.all import *>>> M = ModularSymbols(Integer(37))>>> A = M[Integer(1)]; A
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(37) of weight 2 with sign 0 over Rational Field>>> r = A.rational_period_mapping(); rRational period mapping associated to Modular Symbols subspace of dimension 2␣˓→of Modular Symbols space of dimension 5 for Gamma_0(37) of weight 2 with␣
˓→sign 0 over Rational Field>>> r(M.gen(0))(0, 0)>>> r(M.gen(1))(1, 0)>>> r.matrix()[ 0 0][ 1 0][ 0 1][-1 -1][ 0 0]>>> r.domain()
Modular Symbols space of dimension 5 for Gamma_0(37) of weight 2 with sign 0␣˓→over Rational Field>>> r.codomain()(continues on next page)43

Modular Symbols, Release 10.4

(continued from previous page)

Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]

set_default_prec(prec)
Set the default precision for computation of 𝑞-expansion associated to the ambient space of this space ofmodular symbols (and all subspaces).
EXAMPLES:
sage: M = ModularSymbols(Gamma1(13),2)
sage: M.set_default_prec(5)sage: M.cuspidal_submodule().q_expansion_basis()[q - 4*q^3 - q^4 + O(q^5),
q^2 - 2*q^3 - q^4 + O(q^5)]>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(13)),Integer(2))>>> M.set_default_prec(Integer(5))>>> M.cuspidal_submodule().q_expansion_basis()[q - 4*q^3 - q^4 + O(q^5),
q^2 - 2*q^3 - q^4 + O(q^5)]

set_precision(prec)
Same as self.set_default_prec(prec).
EXAMPLES:
sage: M = ModularSymbols(17,2)
sage: M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^4 - 2*q^5 + 4*q^7 + O(q^8)]
sage: M.set_precision(10)sage: M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^4 - 2*q^5 + 4*q^7 + 3*q^8 - 3*q^9 + O(q^10)]>>> from sage.all import *>>> M = ModularSymbols(Integer(17),Integer(2))>>> M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^4 - 2*q^5 + 4*q^7 + O(q^8)]>>> M.set_precision(Integer(10))>>> M.cuspidal_submodule().q_expansion_basis()[q - q^2 - q^4 - 2*q^5 + 4*q^7 + 3*q^8 - 3*q^9 + O(q^10)]44Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

sign()
Return the sign of self.
For efficiency reasons, it is often useful to compute in the (largest) quotient of modular symbols where the *involution acts as +1, or where it acts as -1.
INPUT:• ModularSymbols self – arbitrary space of modular symbols.
OUTPUT:• int – the sign of self, either -1, 0, or 1.
• -1 – if this is factor of quotient where * acts as -1,• +1 – if this is factor of quotient where * acts as +1,• 0 – if this is full space of modular symbols (no quotient).
EXAMPLES:
sage: m = ModularSymbols(33)sage: m.rank()
9sage: m.sign()
0sage: m = ModularSymbols(33, sign=0)
sage: m.sign()
0sage: m.rank()
9sage: m = ModularSymbols(33, sign=-1)
sage: m.sign()-1
sage: m.rank()
3>>> from sage.all import *>>> m = ModularSymbols(Integer(33))>>> m.rank()
9>>> m.sign()
0>>> m = ModularSymbols(Integer(33), sign=Integer(0))>>> m.sign()
0>>> m.rank()
9>>> m = ModularSymbols(Integer(33), sign=-Integer(1))>>> m.sign()-1>>> m.rank()3

sign_submodule(sign, compute_dual=True)
Return the subspace of self that is fixed under the star involution.
INPUT:• sign – int (either -1, 0 or +1)

45

Modular Symbols, Release 10.4

• compute_dual – bool (default: True) also compute dual subspace. This are useful for many algorithms.
OUTPUT: subspace of modular symbols
EXAMPLES:
sage: M = ModularSymbols(29,2)
sage: M.sign_submodule(1)Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(29) of weight 2 with sign 0 over Rational Field
sage: M.sign_submodule(-1)
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(29) of weight 2 with sign 0 over Rational Field
sage: M.sign_submodule(-1).sign()-1>>> from sage.all import *>>> M = ModularSymbols(Integer(29),Integer(2))>>> M.sign_submodule(Integer(1))
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(29) of weight 2 with sign 0 over Rational Field>>> M.sign_submodule(-Integer(1))
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(29) of weight 2 with sign 0 over Rational Field>>> M.sign_submodule(-Integer(1)).sign()-1

simple_factors()
Return a list modular symbols spaces 𝑆 where 𝑆 is simple spaces of modular symbols (for the anemic Hecke
algebra) and self is isomorphic to the direct sum of the 𝑆 with some multiplicities, as a module over theanemic Hecke algebra.
For the multiplicities use factorization() instead.
ASSUMPTION: self is a module over the anemic Hecke algebra.
EXAMPLES:
sage: ModularSymbols(1,100,sign=-1).simple_factors()[Modular Symbols subspace of dimension 8 of Modular Symbols space of␣˓→dimension 8 for Gamma_0(1) of weight 100 with sign -1 over Rational Field]
sage: ModularSymbols(1,16,0,GF(5)).simple_factors()[Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(1) of weight 16 with sign 0 over Finite Field of␣˓→size 5,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(1) of weight 16 with sign 0 over Finite Field of size 5,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(1) of weight 16 with sign 0 over Finite Field of size 5]>>> from sage.all import *>>> ModularSymbols(Integer(1),Integer(100),sign=-Integer(1)).simple_factors()[Modular Symbols subspace of dimension 8 of Modular Symbols space of␣˓→dimension 8 for Gamma_0(1) of weight 100 with sign -1 over Rational Field]>>> ModularSymbols(Integer(1),Integer(16),Integer(0),GF(Integer(5))).simple_
˓→factors()[Modular Symbols subspace of dimension 1 of Modular Symbols space of␣(continues on next page)46

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

dimension 3 for Gamma_0(1) of weight 16 with sign 0 over Finite Field of␣˓→size 5,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(1) of weight 16 with sign 0 over Finite Field of size 5,
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(1) of weight 16 with sign 0 over Finite Field of size 5]˓→star_decomposition()
Decompose self into subspaces which are eigenspaces for the star involution.
EXAMPLES:
sage: ModularSymbols(Gamma1(19), 2).cuspidal_submodule().star_decomposition()[
Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension␣˓→31 for Gamma_1(19) of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension␣˓→31 for Gamma_1(19) of weight 2 with sign 0 over Rational Field]>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(19)), Integer(2)).cuspidal_submodule().star_˓→decomposition()[
Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension␣˓→31 for Gamma_1(19) of weight 2 with sign 0 over Rational Field,
Modular Symbols subspace of dimension 7 of Modular Symbols space of dimension␣˓→31 for Gamma_1(19) of weight 2 with sign 0 over Rational Field]

star_eigenvalues()
Return the eigenvalues of the star involution acting on self.
EXAMPLES:
sage: M = ModularSymbols(11)sage: D = M.decomposition()sage: M.star_eigenvalues()[1, -1]
sage: D[0].star_eigenvalues()[1]
sage: D[1].star_eigenvalues()[1, -1]
sage: D[1].plus_submodule().star_eigenvalues()[1]
sage: D[1].minus_submodule().star_eigenvalues()[-1]>>> from sage.all import *>>> M = ModularSymbols(Integer(11))>>> D = M.decomposition()>>> M.star_eigenvalues()[1, -1]>>> D[Integer(0)].star_eigenvalues()[1]>>> D[Integer(1)].star_eigenvalues()(continues on next page)47

Modular Symbols, Release 10.4

(continued from previous page)[1, -1]>>> D[Integer(1)].plus_submodule().star_eigenvalues()[1]>>> D[Integer(1)].minus_submodule().star_eigenvalues()[-1]

star_involution()
Return the star involution on self, which is induced by complex conjugation on modular symbols.
Not implemented in this abstract base class.
EXAMPLES:
sage: M = ModularSymbols(11, 2); sage.modular.modsym.space.
˓→ModularSymbolsSpace.star_involution(M)Traceback (most recent call last):...
NotImplementedError>>> from sage.all import *>>> M = ModularSymbols(Integer(11), Integer(2)); sage.modular.modsym.space.
˓→ModularSymbolsSpace.star_involution(M)Traceback (most recent call last):...
NotImplementedError

sturm_bound()Return the Sturm bound for this space of modular symbols.
Type sturm_bound? for more details.
EXAMPLES:
sage: ModularSymbols(11,2).sturm_bound()2
sage: ModularSymbols(389,2).sturm_bound()65
sage: ModularSymbols(1,12).sturm_bound()1
sage: ModularSymbols(1,36).sturm_bound()3
sage: ModularSymbols(DirichletGroup(31).0^2).sturm_bound()6
sage: ModularSymbols(Gamma1(31)).sturm_bound()160>>> from sage.all import *>>> ModularSymbols(Integer(11),Integer(2)).sturm_bound()2>>> ModularSymbols(Integer(389),Integer(2)).sturm_bound()65>>> ModularSymbols(Integer(1),Integer(12)).sturm_bound()1>>> ModularSymbols(Integer(1),Integer(36)).sturm_bound()3>>> ModularSymbols(DirichletGroup(Integer(31)).gen(0)**Integer(2)).sturm_
˓→bound()(continues on next page)48

Chapter 2. Base class of the space of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

6>>> ModularSymbols(Gamma1(Integer(31))).sturm_bound()160

class sage.modular.modsym.space.PeriodMapping(modsym, A)
Bases: SageObject
Base class for representing a period mapping attached to a space of modular symbols.
To be used via the derived classes RationalPeriodMapping and IntegralPeriodMapping.
codomain()
Return the codomain of this mapping.
EXAMPLES:
Note that this presently returns the wrong answer, as a consequence of various bugs in the free module routines:
sage: ModularSymbols(11, 2).cuspidal_submodule().integral_period_mapping().
˓→codomain()
Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]
>>> from sage.all import *>>> ModularSymbols(Integer(11), Integer(2)).cuspidal_submodule().integral_
˓→period_mapping().codomain()
Vector space of degree 2 and dimension 2 over Rational Field
Basis matrix:
[1 0]
[0 1]

domain()Return the domain of this mapping (which is the ambient space of the corresponding modular symbols space).
EXAMPLES:
sage: ModularSymbols(17, 2).cuspidal_submodule().integral_period_mapping().
˓→domain()
Modular Symbols space of dimension 3 for Gamma_0(17) of weight 2 with sign 0␣˓→over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(17), Integer(2)).cuspidal_submodule().integral_
˓→period_mapping().domain()
Modular Symbols space of dimension 3 for Gamma_0(17) of weight 2 with sign 0␣˓→over Rational Field

matrix()Return the matrix of this period mapping.
EXAMPLES:
sage: ModularSymbols(11, 2).cuspidal_submodule().integral_period_mapping().
˓→matrix()[ 0 1/5](continues on next page)49

Modular Symbols, Release 10.4

(continued from previous page)

[
[

1
0

0]
1]

>>> from sage.all import *>>> ModularSymbols(Integer(11), Integer(2)).cuspidal_submodule().integral_
˓→period_mapping().matrix()[ 0 1/5]
[ 1
0]
[ 0
1]

modular_symbols_space()
Return the space of modular symbols to which this period mapping corresponds.
EXAMPLES:
sage: ModularSymbols(17, 2).rational_period_mapping().modular_symbols_space()
Modular Symbols space of dimension 3 for Gamma_0(17) of weight 2 with sign 0␣˓→over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(17), Integer(2)).rational_period_mapping().modular_
˓→symbols_space()
Modular Symbols space of dimension 3 for Gamma_0(17) of weight 2 with sign 0␣˓→over Rational Field

class sage.modular.modsym.space.RationalPeriodMapping(modsym, A)
Bases: PeriodMapping
sage.modular.modsym.space.is_ModularSymbolsSpace(x)Return True if x is a space of modular symbols.
EXAMPLES:
sage: M = ModularForms(3, 2)
sage: sage.modular.modsym.space.is_ModularSymbolsSpace(M)doctest:warning...
DeprecationWarning: The function is_ModularSymbolsSpace is deprecated; use
˓→ isinstance(..., ModularForms)
instead.
See https://github.com/sagemath/sage/issues/38035 for details.
False
sage: sage.modular.modsym.space.is_ModularSymbolsSpace(M.modular_symbols(sign=1))
True>>> from sage.all import *>>> M = ModularForms(Integer(3), Integer(2))>>> sage.modular.modsym.space.is_ModularSymbolsSpace(M)doctest:warning...
DeprecationWarning: The function is_ModularSymbolsSpace is deprecated; use
˓→ isinstance(..., ModularForms)
instead.
See https://github.com/sagemath/sage/issues/38035 for details.
False>>> sage.modular.modsym.space.is_ModularSymbolsSpace(M.modular_
˓→symbols(sign=Integer(1)))
True

50

Chapter 2. Base class of the space of modular symbols

CHAPTER

THREE

AMBIENT SPACES OF MODULAR SYMBOLSThis module defines the following classes. There is an abstract base class ModularSymbolsAmbient, derived fromspace.ModularSymbolsSpace and hecke.AmbientHeckeModule. As this is an abstract base class, only
derived classes should be instantiated. There are five derived classes:• ModularSymbolsAmbient_wtk_g0, for modular symbols of general weight 𝑘 for Γ0 (𝑁 );• ModularSymbolsAmbient_wt2_g0 (derived from ModularSymbolsAmbient_wtk_g0), for modular symbols of weight 2 for Γ0 (𝑁 );• ModularSymbolsAmbient_wtk_g1, for modular symbols of general weight 𝑘 for Γ1 (𝑁 );• ModularSymbolsAmbient_wtk_gamma_h, for modular symbols of general weight 𝑘 for Γ𝐻 , where 𝐻 isa subgroup of /𝑁 ;• ModularSymbolsAmbient_wtk_eps, for modular symbols of general weight 𝑘 and character 𝜖.
EXAMPLES:
We compute a space of modular symbols modulo 2. The dimension is different from that of the corresponding space incharacteristic 0:
sage: M = ModularSymbols(11,4,base_ring=GF(2)); M
Modular Symbols space of dimension 7 for Gamma_0(11) of weight 4
with sign 0 over Finite Field of size 2
sage: M.basis()([X*Y,(1,0)], [X*Y,(1,8)], [X*Y,(1,9)], [X^2,(0,1)], [X^2,(1,8)], [X^2,(1,9)], [X^2,
˓→(1,10)])sage: M0 = ModularSymbols(11,4,base_ring=QQ); M0
Modular Symbols space of dimension 6 for Gamma_0(11) of weight 4
with sign 0 over Rational Field
sage: M0.basis()([X^2,(0,1)], [X^2,(1,6)], [X^2,(1,7)], [X^2,(1,8)], [X^2,(1,9)], [X^2,(1,10)])>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(4),base_ring=GF(Integer(2))); M
Modular Symbols space of dimension 7 for Gamma_0(11) of weight 4
with sign 0 over Finite Field of size 2>>> M.basis()([X*Y,(1,0)], [X*Y,(1,8)], [X*Y,(1,9)], [X^2,(0,1)], [X^2,(1,8)], [X^2,(1,9)], [X^2,
˓→(1,10)])>>> M0 = ModularSymbols(Integer(11),Integer(4),base_ring=QQ); M0
Modular Symbols space of dimension 6 for Gamma_0(11) of weight 4
with sign 0 over Rational Field>>> M0.basis()([X^2,(0,1)], [X^2,(1,6)], [X^2,(1,7)], [X^2,(1,8)], [X^2,(1,9)], [X^2,(1,10)])51

Modular Symbols, Release 10.4

The characteristic polynomial of the Hecke operator 𝑇2 has an extra factor 𝑥.
sage: M.T(2).matrix().fcp( x )(x + 1)^2 * x^5sage: M0.T(2).matrix().fcp( x )(x - 9)^2 * (x^2 - 2*x - 2)^2>>> from sage.all import *>>> M.T(Integer(2)).matrix().fcp( x )(x + 1)^2 * x^5>>> M0.T(Integer(2)).matrix().fcp( x )(x - 9)^2 * (x^2 - 2*x - 2)^2

class sage.modular.modsym.ambient.ModularSymbolsAmbient(group, weight, sign, base_ring,
character=None,custom_init=None,
category=None)
Bases: ModularSymbolsSpace, AmbientHeckeModule
An ambient space of modular symbols for a congruence subgroup of 𝑆𝐿2 ( ).
This class is an abstract base class, so only derived classes should be instantiated.
INPUT:• weight – an integer• group – a congruence subgroup.
• sign – an integer, either -1, 0, or 1
• base_ring – a commutative ring• custom_init – a function that is called with self as input before any computations are done using self;
this could be used to set a custom modular symbols presentation.
boundary_map()
Return the boundary map to the corresponding space of boundary modular symbols.
EXAMPLES:
sage: ModularSymbols(20,2).boundary_map()
Hecke module morphism boundary map defined by the matrix[ 1 -1 0 0 0 0]
[ 0 1 -1 0 0 0]
[ 0 1 0 -1 0 0]
[ 0 0 0 -1 1 0]
[ 0 1 0 -1 0 0]
[ 0 0 1 -1 0 0]
[ 0 1 0 0 0 -1]
Domain: Modular Symbols space of dimension 7 for Gamma_0(20) of weight ...
Codomain: Space of Boundary Modular Symbols for Congruence Subgroup␣˓→Gamma0(20) ...
sage: type(ModularSymbols(20,2).boundary_map())<class sage.modular.hecke.morphism.HeckeModuleMorphism_matrix >>>> from sage.all import *>>> ModularSymbols(Integer(20),Integer(2)).boundary_map()
Hecke module morphism boundary map defined by the matrix[ 1 -1 0 0 0 0](continues on next page)

52

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[ 0 1 -1 0 0 0]
[ 0 1 0 -1 0 0]
[ 0 0 0 -1 1 0]
[ 0 1 0 -1 0 0]
[ 0 0 1 -1 0 0]
[ 0 1 0 0 0 -1]
Domain: Modular Symbols space of dimension 7 for Gamma_0(20) of weight ...
Codomain: Space of Boundary Modular Symbols for Congruence Subgroup␣˓→Gamma0(20) ...
>>> type(ModularSymbols(Integer(20),Integer(2)).boundary_map())<class sage.modular.hecke.morphism.HeckeModuleMorphism_matrix >boundary_space()
Return the subspace of boundary modular symbols of this modular symbols ambient space.
EXAMPLES:
sage: M = ModularSymbols(20, 2)
sage: B = M.boundary_space(); BSpace of Boundary Modular Symbols for Congruence Subgroup Gamma0(20) of␣
˓→weight 2 over Rational Field
sage: M.cusps()[Infinity, 0, -1/4, 1/5, -1/2, 1/10]
sage: M.dimension()7
sage: B.dimension()6>>> from sage.all import *>>> M = ModularSymbols(Integer(20), Integer(2))>>> B = M.boundary_space(); BSpace of Boundary Modular Symbols for Congruence Subgroup Gamma0(20) of␣
˓→weight 2 over Rational Field>>> M.cusps()[Infinity, 0, -1/4, 1/5, -1/2, 1/10]>>> M.dimension()7>>> B.dimension()
6change_ring(R)Change the base ring to R.
EXAMPLES:
sage: ModularSymbols(Gamma1(13), 2).change_ring(GF(17))
Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2 with sign 0␣˓→over Finite Field of size 17
sage: M = ModularSymbols(DirichletGroup(5).0, 7); MM=M.change_
˓→ring(CyclotomicField(8)); MM
Modular Symbols space of dimension 6 and level 5, weight 7, character [zeta8^
˓→2], sign 0, over Cyclotomic Field of order 8 and degree 4
sage: MM.change_ring(CyclotomicField(4)) == M
True
sage: M.change_ring(QQ)
Traceback (most recent call last):(continues on next page)53

Modular Symbols, Release 10.4

(continued from previous page)...
TypeError: Unable to coerce zeta4 to a rational>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(13)), Integer(2)).change_
˓→ring(GF(Integer(17)))
Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2 with sign 0␣˓→over Finite Field of size 17>>> M = ModularSymbols(DirichletGroup(Integer(5)).gen(0), Integer(7)); MM=M.
˓→change_ring(CyclotomicField(Integer(8))); MM
Modular Symbols space of dimension 6 and level 5, weight 7, character [zeta8^
˓→2], sign 0, over Cyclotomic Field of order 8 and degree 4>>> MM.change_ring(CyclotomicField(Integer(4))) == M
True>>> M.change_ring(QQ)
Traceback (most recent call last):...
TypeError: Unable to coerce zeta4 to a rational

Similarly with base_extend():sage: M = ModularSymbols(DirichletGroup(5).0, 7); MM = M.base_
˓→extend(CyclotomicField(8)); MM
Modular Symbols space of dimension 6 and level 5, weight 7, character [zeta8^
˓→2], sign 0, over Cyclotomic Field of order 8 and degree 4
sage: MM.base_extend(CyclotomicField(4))
Traceback (most recent call last):...
TypeError: Base extension of self (over Cyclotomic Field of order 8 and␣
˓→degree 4 ) to ring
Cyclotomic Field of order 4 and degree 2 not defined.
>>> from sage.all import *>>> M = ModularSymbols(DirichletGroup(Integer(5)).gen(0), Integer(7)); MM = M.
˓→base_extend(CyclotomicField(Integer(8))); MM
Modular Symbols space of dimension 6 and level 5, weight 7, character [zeta8^
˓→2], sign 0, over Cyclotomic Field of order 8 and degree 4>>> MM.base_extend(CyclotomicField(Integer(4)))
Traceback (most recent call last):...
TypeError: Base extension of self (over Cyclotomic Field of order 8 and␣
˓→degree 4 ) to ring
Cyclotomic Field of order 4 and degree 2 not defined.

compact_newform_eigenvalues(v, names='alpha')
Return compact systems of eigenvalues for each Galois conjugacy class of cuspidal newforms in this ambient
space.
INPUT:• v – list of positive integers
OUTPUT:• list – of pairs (E, x), where E*x is a vector with entries the eigenvalues 𝑎𝑛 for 𝑛 ∈ 𝑣.
EXAMPLES:

54

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

sage: M = ModularSymbols(43,2,1)
sage: X = M.compact_newform_eigenvalues(prime_range(10))
sage: X[0][0] * X[0][1](-2, -2, -4, 0)
sage: X[1][0] * X[1][1](alpha1, -alpha1, -alpha1 + 2, alpha1 - 2)>>> from sage.all import *>>> M = ModularSymbols(Integer(43),Integer(2),Integer(1))>>> X = M.compact_newform_eigenvalues(prime_range(Integer(10)))>>> X[Integer(0)][Integer(0)] * X[Integer(0)][Integer(1)](-2, -2, -4, 0)>>> X[Integer(1)][Integer(0)] * X[Integer(1)][Integer(1)](alpha1, -alpha1, -alpha1 + 2, alpha1 - 2)sage: M = ModularSymbols(DirichletGroup(24,QQ).1,2,sign=1)
sage: M.compact_newform_eigenvalues(prime_range(10), a )[([-1/2 -1/2][ 1/2 -1/2]
[ -1
1]
[ -2
0], (1, -2*a0 - 1))]sage: a = M.compact_newform_eigenvalues([1..10], a )[0]sage: a[0]*a[1](1, a0, a0 + 1, -2*a0 - 2, -2*a0 - 2, -a0 - 2, -2, 2*a0 + 4, -1, 2*a0 + 4)
sage: M = ModularSymbols(DirichletGroup(13).0^2,2,sign=1)
sage: M.compact_newform_eigenvalues(prime_range(10), a )[([ -zeta6 - 1]
[ 2*zeta6 - 2][-2*zeta6 + 1][0], (1))]
sage: a = M.compact_newform_eigenvalues([1..10], a )[0]sage: a[0]*a[1](1, -zeta6 - 1, 2*zeta6 - 2, zeta6, -2*zeta6 + 1, -2*zeta6 + 4, 0, 2*zeta6 -␣
˓→1, -zeta6, 3*zeta6 - 3)>>> from sage.all import *>>> M = ModularSymbols(DirichletGroup(Integer(24),QQ).gen(1),Integer(2),˓→sign=Integer(1))>>> M.compact_newform_eigenvalues(prime_range(Integer(10)), a )[([-1/2 -1/2][ 1/2 -1/2]
[ -1
1]
[ -2
0], (1, -2*a0 - 1))]>>> a = M.compact_newform_eigenvalues((ellipsis_range(Integer(1),Ellipsis,
˓→Integer(10))), a )[Integer(0)]>>> a[Integer(0)]*a[Integer(1)](1, a0, a0 + 1, -2*a0 - 2, -2*a0 - 2, -a0 - 2, -2, 2*a0 + 4, -1, 2*a0 + 4)>>> M = ModularSymbols(DirichletGroup(Integer(13)).gen(0)**Integer(2),˓→Integer(2),sign=Integer(1))>>> M.compact_newform_eigenvalues(prime_range(Integer(10)), a )(continues on next page)55

Modular Symbols, Release 10.4

(continued from previous page)[([ -zeta6 - 1]
[ 2*zeta6 - 2][-2*zeta6 + 1][0], (1))]>>> a = M.compact_newform_eigenvalues((ellipsis_range(Integer(1),Ellipsis,
˓→Integer(10))), a )[Integer(0)]>>> a[Integer(0)]*a[Integer(1)](1, -zeta6 - 1, 2*zeta6 - 2, zeta6, -2*zeta6 + 1, -2*zeta6 + 4, 0, 2*zeta6 -␣
˓→1, -zeta6, 3*zeta6 - 3)compute_presentation()
Compute and cache the presentation of this space.
EXAMPLES:
sage: ModularSymbols(11,2).compute_presentation() # no output>>> from sage.all import *>>> ModularSymbols(Integer(11),Integer(2)).compute_presentation() # no output

cuspidal_submodule()
The cuspidal submodule of this modular symbols ambient space.
EXAMPLES:
sage: M = ModularSymbols(12,2,0,GF(5)) ; M
Modular Symbols space of dimension 5 for Gamma_0(12) of weight 2 with sign 0␣˓→over Finite Field of size 5
sage: M.cuspidal_submodule()
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(12) of weight 2 with sign 0 over Finite Field of size 5
sage: ModularSymbols(1,24,-1).cuspidal_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→2 for Gamma_0(1) of weight 24 with sign -1 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(12),Integer(2),Integer(0),GF(Integer(5))) ; M
Modular Symbols space of dimension 5 for Gamma_0(12) of weight 2 with sign 0␣˓→over Finite Field of size 5>>> M.cuspidal_submodule()
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension␣
˓→5 for Gamma_0(12) of weight 2 with sign 0 over Finite Field of size 5>>> ModularSymbols(Integer(1),Integer(24),-Integer(1)).cuspidal_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣
˓→2 for Gamma_0(1) of weight 24 with sign -1 over Rational Field

The cuspidal submodule of the cuspidal submodule is itself:
sage: M = ModularSymbols(389)sage: S = M.cuspidal_submodule()
sage: S.cuspidal_submodule() is S
True

56

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> M = ModularSymbols(Integer(389))>>> S = M.cuspidal_submodule()>>> S.cuspidal_submodule() is S
Truecusps()
Return the set of cusps for this modular symbols space.
EXAMPLES:
sage: ModularSymbols(20,2).cusps()[Infinity, 0, -1/4, 1/5, -1/2, 1/10]>>> from sage.all import *>>> ModularSymbols(Integer(20),Integer(2)).cusps()[Infinity, 0, -1/4, 1/5, -1/2, 1/10]

dual_star_involution_matrix()
Return the matrix of the dual star involution, which is induced by complex conjugation on the linear dual ofmodular symbols.
EXAMPLES:
sage: ModularSymbols(20,2).dual_star_involution_matrix()[1 0 0 0 0 0 0]
[0 1 0 0 0 0 0]
[0 0 0 0 1 0 0]
[0 0 0 1 0 0 0]
[0 0 1 0 0 0 0]
[0 0 0 0 0 1 0]
[0 0 0 0 0 0 1]>>> from sage.all import *>>> ModularSymbols(Integer(20),Integer(2)).dual_star_involution_matrix()[1 0 0 0 0 0 0]
[0 1 0 0 0 0 0]
[0 0 0 0 1 0 0]
[0 0 0 1 0 0 0]
[0 0 1 0 0 0 0]
[0 0 0 0 0 1 0]
[0 0 0 0 0 0 1]

eisenstein_submodule()
Return the Eisenstein submodule of this space of modular symbols.
EXAMPLES:
sage: ModularSymbols(20,2).eisenstein_submodule()
Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(20) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(20),Integer(2)).eisenstein_submodule()
Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension␣
˓→7 for Gamma_0(20) of weight 2 with sign 0 over Rational Field

57

Modular Symbols, Release 10.4

element(x)Creates and returns an element of self from a modular symbol, if possible.
INPUT:• x – an object of one of the following types: ModularSymbol, ManinSymbol.
OUTPUT:
ModularSymbol - a modular symbol with parent self.
EXAMPLES:
sage: M = ModularSymbols(11,4,1)
sage: M.T(3)Hecke operator T_3 on Modular Symbols space of dimension 4 for Gamma_0(11) of␣
˓→weight 4 with sign 1 over Rational Field
sage: M.T(3)(M.0)
28*[X^2,(0,1)] + 2*[X^2,(1,4)] + 2/3*[X^2,(1,6)] - 8/3*[X^2,(1,9)]
sage: M.T(3)(M.0).element()(28, 2, 2/3, -8/3)>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(4),Integer(1))>>> M.T(Integer(3))
Hecke operator T_3 on Modular Symbols space of dimension 4 for Gamma_0(11) of␣
˓→weight 4 with sign 1 over Rational Field>>> M.T(Integer(3))(M.gen(0))
28*[X^2,(0,1)] + 2*[X^2,(1,4)] + 2/3*[X^2,(1,6)] - 8/3*[X^2,(1,9)]>>> M.T(Integer(3))(M.gen(0)).element()(28, 2, 2/3, -8/3)

factor()Return a list of pairs (𝑆, 𝑒) where 𝑆 is spaces of modular symbols and self is isomorphic to the direct sum of
the 𝑆 𝑒 as a module over the anemic Hecke algebra adjoin the star involution. The cuspidal 𝑆 are all simple,
but the Eisenstein factors need not be simple.
EXAMPLES:
sage: ModularSymbols(Gamma0(22), 2).factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 3 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(22) of weight 2 with sign 0 over Rational Field)>>> from sage.all import *>>> ModularSymbols(Gamma0(Integer(22)), Integer(2)).factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 3 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(22) of weight 2 with sign 0 over Rational Field)
sage: ModularSymbols(1,6,0,GF(2)).factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣(continues on next page)

58

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2)˓→>>> from sage.all import *>>> ModularSymbols(Integer(1),Integer(6),Integer(0),GF(Integer(2))).
˓→factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2)
sage: ModularSymbols(18,2).factorization()(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 5 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field)>>> from sage.all import *>>> ModularSymbols(Integer(18),Integer(2)).factorization()(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 5 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field)
sage: M = ModularSymbols(DirichletGroup(38,CyclotomicField(3)).0^2, 2, +1); M
Modular Symbols space of dimension 7 and level 38, weight 2, character␣˓→[zeta3], sign 1, over Cyclotomic Field of order 3 and degree 2
sage: M.factorization()# long time (about 8 seconds)(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2)>>> from sage.all import *>>> M = ModularSymbols(DirichletGroup(Integer(38),
˓→CyclotomicField(Integer(3))).gen(0)**Integer(2),Integer(2), +Integer(1));␣
˓→M
Modular Symbols space of dimension 7 and level 38, weight 2, character␣˓→[zeta3], sign 1, over Cyclotomic Field of order 3 and degree 2>>> M.factorization()# long time (about 8 seconds)(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣(continues on next page)59

Modular Symbols, Release 10.4

(continued from previous page)

Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2)
˓→factorization()
Return a list of pairs (𝑆, 𝑒) where 𝑆 is spaces of modular symbols and self is isomorphic to the direct sum of
the 𝑆 𝑒 as a module over the anemic Hecke algebra adjoin the star involution. The cuspidal 𝑆 are all simple,
but the Eisenstein factors need not be simple.
EXAMPLES:
sage: ModularSymbols(Gamma0(22), 2).factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 3 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(22) of weight 2 with sign 0 over Rational Field)>>> from sage.all import *>>> ModularSymbols(Gamma0(Integer(22)), Integer(2)).factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field)^2 *(Modular Symbols subspace of dimension 3 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(22) of weight 2 with sign 0 over Rational Field)
sage: ModularSymbols(1,6,0,GF(2)).factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2)>>> from sage.all import *>>> ModularSymbols(Integer(1),Integer(6),Integer(0),GF(Integer(2))).
˓→factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2 for Gamma_0(1) of weight 6 with sign 0 over Finite Field of␣˓→size 2)
sage: ModularSymbols(18,2).factorization()(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣(continues on next page)

60

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 5 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field)˓→>>> from sage.all import *>>> ModularSymbols(Integer(18),Integer(2)).factorization()(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 5 of Modular Symbols space of␣˓→dimension 7 for Gamma_0(18) of weight 2 with sign 0 over Rational Field)
sage: M = ModularSymbols(DirichletGroup(38,CyclotomicField(3)).0^2, 2, +1); M
Modular Symbols space of dimension 7 and level 38, weight 2, character␣˓→[zeta3], sign 1, over Cyclotomic Field of order 3 and degree 2
sage: M.factorization()# long time (about 8 seconds)(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2)>>> from sage.all import *>>> M = ModularSymbols(DirichletGroup(Integer(38),
˓→CyclotomicField(Integer(3))).gen(0)**Integer(2),Integer(2), +Integer(1));␣
˓→M
Modular Symbols space of dimension 7 and level 38, weight 2, character␣˓→[zeta3], sign 1, over Cyclotomic Field of order 3 and degree 2>>> M.factorization()# long time (about 8 seconds)(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2) *(Modular Symbols subspace of dimension 2 of Modular Symbols space of␣˓→dimension 7 and level 38, weight 2, character [zeta3], sign 1, over␣
˓→Cyclotomic Field of order 3 and degree 2)

integral_structure(algorithm='default')
Return the -structure of this modular symbols space, generated by all integral modular symbols.
INPUT:• algorithm – string (default: ‘default’, choose heuristically)–pari – use pari for the HNF computation

61

Modular Symbols, Release 10.4–

padic – use p-adic algorithm (only good for dense case)

ALGORITHM: It suffices to consider lattice generated by the free generating symbols 𝑋 𝑖 𝑌 𝑘−2−𝑖 .(𝑢, 𝑣) after
quotienting out by the 𝑆 (and 𝐼) relations, since the quotient by these relations is the same over any ring.
EXAMPLES: In weight 2 the rational basis is often integral.
sage: M = ModularSymbols(11,2)
sage: M.integral_structure()
Free module of degree 3 and rank 3 over Integer Ring
Echelon basis matrix:[1 0 0][0 1 0][0 0 1]>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(2))>>> M.integral_structure()
Free module of degree 3 and rank 3 over Integer Ring
Echelon basis matrix:[1 0 0][0 1 0][0 0 1]This is rarely the case in higher weight:
sage: M = ModularSymbols(6,4)
sage: M.integral_structure()
Free module of degree 6 and rank 6 over Integer Ring
Echelon basis matrix:
[ 1
0
0
0
0
0]
[ 0
1
0
0
0
0]
[ 0
0 1/2 1/2 1/2 1/2]
[ 0
0
0
1
0
0]
[ 0
0
0
0
1
0]
[ 0
0
0
0
0
1]
>>> from sage.all import *>>> M = ModularSymbols(Integer(6),Integer(4))>>> M.integral_structure()
Free module of degree 6 and rank 6 over Integer Ring
Echelon basis matrix:
[ 1
0
0
0
0
0]
[ 0
1
0
0
0
0]
[ 0
0 1/2 1/2 1/2 1/2]
[ 0
0
0
1
0
0]
[ 0
0
0
0
1
0]
[ 0
0
0
0
0
1]

Here is an example involving Γ1 (𝑁 ).
sage: M = ModularSymbols(Gamma1(5),6)
sage: M.integral_structure()
Free module of degree 10 and rank 10 over Integer Ring
Echelon basis matrix:
[
1
0
0
0
0
0
0
0
0
0]
[
0
1
0
0
0
0
0
0
0
0]
[
0
0 1/96 1/32 23/24
0 1/96
0 7/24 67/96](continues on next page)

62

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

[
[
[
[
[
[
[

0
0
0
0
0
0
0

0
0
0
0
0
0
0

0
0
0
0
0
0
0

1/24 23/24
0
1
0
0
0
0
0
0
0
0
0
0

0
0
1/6
0
0
0
0

0
0
0
1/24
0
0
0

1/24
1/4 17/24]
000]1/48 23/48
1/3]
1/24 11/24 11/24]
1/16 7/16
1/2]
0
1/2
1/2]
0
0
1]

>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(5)),Integer(6))>>> M.integral_structure()
Free module of degree 10 and rank 10 over Integer Ring
Echelon basis matrix:
[
1
0
0
0
0
0
0
0
0
0]
[
0
1
0
0
0
0
0
0
0
0]
[
0
0 1/96 1/32 23/24
0 1/96
0 7/24 67/96][
00
0 1/24 23/24
0
0 1/241/4 17/24]
[
0
0
0
0
1
0
0
0
0
0]
[
0
0
0
0
0
1/6
0 1/48 23/48
1/3]
[
0
0
0
0
0
0 1/24 1/24 11/24 11/24]
[
0
0
0
0
0
0
0 1/16 7/16
1/2]
[
0
0
0
0
0
0
0
0
1/2
1/2]
[
0
0
0
0
0
0
0
0
0
1]

is_cuspidal()
Return True if this space is cuspidal, else False.
EXAMPLES:
sage: M = ModularSymbols(20,2)
sage: M.is_cuspidal()False
sage: S = M.cuspidal_subspace()sage: S.is_cuspidal()Truesage: S = M.eisenstein_subspace()sage: S.is_cuspidal()False>>> from sage.all import *>>> M = ModularSymbols(Integer(20),Integer(2))>>> M.is_cuspidal()False>>> S = M.cuspidal_subspace()>>> S.is_cuspidal()
True>>> S = M.eisenstein_subspace()>>> S.is_cuspidal()False

is_eisenstein()
Return True if this space is Eisenstein, else False.
EXAMPLES:

63

Modular Symbols, Release 10.4

sage: M = ModularSymbols(20,2)
sage: M.is_eisenstein()
False
sage: S = M.eisenstein_submodule()
sage: S.is_eisenstein()True
sage: S = M.cuspidal_subspace()sage: S.is_eisenstein()
False>>> from sage.all import *>>> M = ModularSymbols(Integer(20),Integer(2))>>> M.is_eisenstein()
False>>> S = M.eisenstein_submodule()>>> S.is_eisenstein()
True>>> S = M.cuspidal_subspace()>>> S.is_eisenstein()
False

manin_basis()
Return a list of indices into the list of Manin generators (see self.manin_generators()) such thatthose symbols form a basis for the quotient of the -vector space spanned by Manin symbols modulo therelations.
EXAMPLES:
sage: M = ModularSymbols(2,2)
sage: M.manin_basis()[1]
sage: [M.manin_generators()[i] for i in M.manin_basis()][(1,0)]
sage: M = ModularSymbols(6,2)
sage: M.manin_basis()[1, 10, 11]
sage: [M.manin_generators()[i] for i in M.manin_basis()][(1,0), (3,1), (3,2)]>>> from sage.all import *>>> M = ModularSymbols(Integer(2),Integer(2))>>> M.manin_basis()[1]>>> [M.manin_generators()[i] for i in M.manin_basis()][(1,0)]>>> M = ModularSymbols(Integer(6),Integer(2))>>> M.manin_basis()[1, 10, 11]>>> [M.manin_generators()[i] for i in M.manin_basis()][(1,0), (3,1), (3,2)]

manin_generators()
Return list of all Manin symbols for this space. These are the generators in the presentation of this space byManin symbols.
EXAMPLES:

64

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

sage: M = ModularSymbols(2,2)
sage: M.manin_generators()[(0,1), (1,0), (1,1)]>>> from sage.all import *>>> M = ModularSymbols(Integer(2),Integer(2))>>> M.manin_generators()[(0,1), (1,0), (1,1)]
sage: M = ModularSymbols(1,6)
sage: M.manin_generators()[[Y^4,(0,0)], [X*Y^3,(0,0)], [X^2*Y^2,(0,0)], [X^3*Y,(0,0)], [X^4,(0,0)]]>>> from sage.all import *>>> M = ModularSymbols(Integer(1),Integer(6))>>> M.manin_generators()[[Y^4,(0,0)], [X*Y^3,(0,0)], [X^2*Y^2,(0,0)], [X^3*Y,(0,0)], [X^4,(0,0)]]manin_gens_to_basis()
Return the matrix expressing the manin symbol generators in terms of the basis.
EXAMPLES:
sage: ModularSymbols(11,2).manin_gens_to_basis()[-1 0 0]
[ 1 0 0][ 0 0 0][ 0 0 1][ 0 -1 1][ 0 -1 0][ 0 0 -1]
[ 0 0 -1]
[ 0 1 -1]
[ 0 1 0][ 0 0 1][ 0 0 0]>>> from sage.all import *>>> ModularSymbols(Integer(11),Integer(2)).manin_gens_to_basis()[-1 0 0]
[ 1 0 0][ 0 0 0][ 0 0 1][ 0 -1 1][ 0 -1 0][ 0 0 -1]
[ 0 0 -1]
[ 0 1 -1]
[ 0 1 0][ 0 0 1][ 0 0 0]manin_symbol(x, check=True)
Construct a Manin Symbol from the given data.
INPUT:

65

Modular Symbols, Release 10.4

• x (list) – either [𝑢, 𝑣] or [𝑖, 𝑢, 𝑣], where 0 ≤ 𝑖 ≤ 𝑘 − 2 where 𝑘 is the weight, and 𝑢,`v` are integers
defining a valid element of P1 (𝑁 ), where 𝑁 is the level.
OUTPUT:(ManinSymbol) the Manin Symbol associated to [𝑖; (𝑢, 𝑣)], with 𝑖 = 0 if not supplied, corresponding to themonomial symbol [𝑋 𝑖 * 𝑌 𝑘−2−𝑖 , (𝑢, 𝑣)].
EXAMPLES:
sage: M = ModularSymbols(11,4,1)
sage: M.manin_symbol([2,5,6])-2/3*[X^2,(1,6)] + 5/3*[X^2,(1,9)]>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(4),Integer(1))>>> M.manin_symbol([Integer(2),Integer(5),Integer(6)])-2/3*[X^2,(1,6)] + 5/3*[X^2,(1,9)]

manin_symbols()
Return the list of Manin symbols for this modular symbols ambient space.
EXAMPLES:
sage: ModularSymbols(11,2).manin_symbols()
Manin Symbol List of weight 2 for Gamma0(11)>>> from sage.all import *>>> ModularSymbols(Integer(11),Integer(2)).manin_symbols()
Manin Symbol List of weight 2 for Gamma0(11)manin_symbols_basis()
A list of Manin symbols that form a basis for the ambient space self.
OUTPUT:• list – a list of 2-tuples (if the weight is 2) or 3-tuples, which represent the Manin symbols basis for
self.
EXAMPLES:
sage: m = ModularSymbols(23)sage: m.manin_symbols_basis()[(1,0), (1,17), (1,19), (1,20), (1,21)]
sage: m = ModularSymbols(6, weight=4, sign=-1)
sage: m.manin_symbols_basis()[[X^2,(2,1)]]>>> from sage.all import *>>> m = ModularSymbols(Integer(23))>>> m.manin_symbols_basis()[(1,0), (1,17), (1,19), (1,20), (1,21)]>>> m = ModularSymbols(Integer(6), weight=Integer(4), sign=-Integer(1))>>> m.manin_symbols_basis()[[X^2,(2,1)]]

modular_symbol(x, check=True)
Create a modular symbol in this space.

66

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

INPUT:• x (list) – a list of either 2 or 3 entries:– 2 entries: [𝛼, 𝛽] where 𝛼 and 𝛽 are cusps;– 3 entries: [𝑖, 𝛼, 𝛽] where 0 ≤ 𝑖 ≤ 𝑘 − 2 and 𝛼 and 𝛽 are cusps;• check (bool, default: True) – flag that determines whether the input x needs processing: usecheck=False for efficiency if the input x is a list of length 3 whose first entry is an Integer, and whose
second and third entries are Cusps (see examples).
OUTPUT:(Modular Symbol) The modular symbol 𝑌 𝑘−2 {𝛼, 𝛽}. or 𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}.
EXAMPLES:
sage: set_modsym_print_mode( modular )sage: M = ModularSymbols(11)sage: M.modular_symbol([2/11, oo])-{-1/9, 0}
sage: M.1{-1/8, 0}
sage: M.modular_symbol([-1/8, 0]){-1/8, 0}
sage: M.modular_symbol([0, -1/8, 0]){-1/8, 0}
sage: M.modular_symbol([10, -1/8, 0])Traceback (most recent call last):...
ValueError: The first entry of the tuple (=[10, -1/8, 0]) must be an integer␣
˓→between 0 and k-2 (=0).
>>> from sage.all import *>>> set_modsym_print_mode( modular )>>> M = ModularSymbols(Integer(11))>>> M.modular_symbol([Integer(2)/Integer(11), oo])-{-1/9, 0}>>> M.gen(1){-1/8, 0}>>> M.modular_symbol([-Integer(1)/Integer(8), Integer(0)]){-1/8, 0}>>> M.modular_symbol([Integer(0), -Integer(1)/Integer(8), Integer(0)]){-1/8, 0}>>> M.modular_symbol([Integer(10), -Integer(1)/Integer(8), Integer(0)])
Traceback (most recent call last):...
ValueError: The first entry of the tuple (=[10, -1/8, 0]) must be an integer␣
˓→between 0 and k-2 (=0).
sage: N = ModularSymbols(6,4)
sage: set_modsym_print_mode( manin )sage: N([1,Cusp(-1/4),Cusp(0)])
17/2*[X^2,(2,3)] - 9/2*[X^2,(2,5)] + 15/2*[X^2,(3,1)] - 15/2*[X^2,(3,2)]
sage: N([1,Cusp(-1/2),Cusp(0)])
1/2*[X^2,(2,3)] + 3/2*[X^2,(2,5)] + 3/2*[X^2,(3,1)] - 3/2*[X^2,(3,2)]

67

Modular Symbols, Release 10.4>>> from sage.all import *>>> N = ModularSymbols(Integer(6),Integer(4))>>> set_modsym_print_mode( manin )>>> N([Integer(1),Cusp(-Integer(1)/Integer(4)),Cusp(Integer(0))])17/2*[X^2,(2,3)] - 9/2*[X^2,(2,5)] + 15/2*[X^2,(3,1)] - 15/2*[X^2,(3,2)]>>> N([Integer(1),Cusp(-Integer(1)/Integer(2)),Cusp(Integer(0))])1/2*[X^2,(2,3)] + 3/2*[X^2,(2,5)] + 3/2*[X^2,(3,1)] - 3/2*[X^2,(3,2)]

Use check=False for efficiency if the input x is a list of length 3 whose first entry is an Integer, and whose
second and third entries are cusps:
sage: M.modular_symbol([0, Cusp(2/11), Cusp(oo)], check=False)-(1,9)>>> from sage.all import *>>> M.modular_symbol([Integer(0), Cusp(Integer(2)/Integer(11)), Cusp(oo)],␣
˓→check=False)-(1,9)
sage: set_modsym_print_mode()>>> from sage.all import *>>> set_modsym_print_mode()# return to default.

# return to default.

modular_symbol_sum(x, check=True)
Construct a modular symbol sum.
INPUT:• x (list) – [𝑓, 𝛼, 𝛽] where 𝑓 =𝛼 and 𝛽 are cusps.

∑︀𝑘−2

𝑖 𝑘−2−𝑖is a homogeneous polynomial over𝑖=0 𝑎𝑖 𝑋 𝑌of degree 𝑘 and• check (bool, default: True) – if True check the validity of the input tuple x
OUTPUT:∑︀𝑘−2
The sum 𝑖=0 𝑎𝑖 [𝑖, 𝛼, 𝛽] as an element of this modular symbol space.
EXAMPLES:
sage: M = ModularSymbols(11,4)
sage: R.<X,Y>=QQ[]
sage: M.modular_symbol_sum([X*Y,Cusp(0),Cusp(Infinity)])-3/14*[X^2,(1,6)] + 1/14*[X^2,(1,7)] - 1/14*[X^2,(1,8)] + 1/2*[X^2,(1,9)] - 2/
˓→7*[X^2,(1,10)]>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(4))>>> R = QQ[ X, Y ]; (X, Y,) = R._first_ngens(2)>>> M.modular_symbol_sum([X*Y,Cusp(Integer(0)),Cusp(Infinity)])-3/14*[X^2,(1,6)] + 1/14*[X^2,(1,7)] - 1/14*[X^2,(1,8)] + 1/2*[X^2,(1,9)] - 2/
˓→7*[X^2,(1,10)]

modular_symbols_of_level(G)Return a space of modular symbols with the same parameters as this space, except the congruence subgroupis changed to 𝐺.
INPUT:
68

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

• G – either a congruence subgroup or an integer to use as the level of such a group. The given group must
either contain or be contained in the group defining self.
modular_symbols_of_sign(sign)
Return a space of modular symbols with the same defining properties (weight, level, etc.) as this space except
with given sign.
INPUT:• sign (int) – A sign (+1, −1 or 0).
OUTPUT:(ModularSymbolsAmbient) A space of modular symbols with the same defining properties (weight, level,etc.) as this space except with given sign.
EXAMPLES:
sage: M = ModularSymbols(Gamma0(11),2,sign=0)
sage: M
Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0␣˓→over Rational Field
sage: M.modular_symbols_of_sign(-1)
Modular Symbols space of dimension 1 for Gamma_0(11) of weight 2 with sign -1␣
˓→over Rational Field
sage: M = ModularSymbols(Gamma1(11),2,sign=0)
sage: M.modular_symbols_of_sign(-1)
Modular Symbols space of dimension 1 for Gamma_1(11) of weight 2 with sign -1␣
˓→over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Gamma0(Integer(11)),Integer(2),sign=Integer(0))>>> M
Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0␣˓→over Rational Field>>> M.modular_symbols_of_sign(-Integer(1))
Modular Symbols space of dimension 1 for Gamma_0(11) of weight 2 with sign -1␣
˓→over Rational Field>>> M = ModularSymbols(Gamma1(Integer(11)),Integer(2),sign=Integer(0))>>> M.modular_symbols_of_sign(-Integer(1))
Modular Symbols space of dimension 1 for Gamma_1(11) of weight 2 with sign -1␣
˓→over Rational Field

modular_symbols_of_weight(k)Return a space of modular symbols with the same defining properties (weight, sign, etc.) as this space except
with weight 𝑘.
INPUT:• k (int) – A positive integer.
OUTPUT:(ModularSymbolsAmbient) A space of modular symbols with the same defining properties (level, sign) as
this space except with given weight.
EXAMPLES:
sage: M = ModularSymbols(Gamma1(6),2,sign=0)
sage: M.modular_symbols_of_weight(3)(continues on next page)69

Modular Symbols, Release 10.4

(continued from previous page)

Modular Symbols space of dimension 4 for Gamma_1(6) of weight 3 with sign 0␣˓→over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(6)),Integer(2),sign=Integer(0))>>> M.modular_symbols_of_weight(Integer(3))
Modular Symbols space of dimension 4 for Gamma_1(6) of weight 3 with sign 0␣˓→over Rational Field

new_submodule(p=None)
Return the new or 𝑝-new submodule of this modular symbols ambient space.
INPUT:• p – (default: None); if not None, return only the 𝑝-new submodule.
OUTPUT:
The new or 𝑝-new submodule of this modular symbols ambient space.
EXAMPLES:
sage: ModularSymbols(100).new_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣˓→31 for Gamma_0(100) of weight 2 with sign 0 over Rational Field
sage: ModularSymbols(389).new_submodule()
Modular Symbols space of dimension 65 for Gamma_0(389) of weight 2 with sign␣
˓→0 over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(100)).new_submodule()
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension␣˓→31 for Gamma_0(100) of weight 2 with sign 0 over Rational Field>>> ModularSymbols(Integer(389)).new_submodule()
Modular Symbols space of dimension 65 for Gamma_0(389) of weight 2 with sign␣
˓→0 over Rational Field

p1list()Return a P1list of the level of this modular symbol space.
EXAMPLES:
sage: ModularSymbols(11,2).p1list()
The projective line over the integers modulo 11>>> from sage.all import *>>> ModularSymbols(Integer(11),Integer(2)).p1list()
The projective line over the integers modulo 11

rank()
Return the rank of this modular symbols ambient space.
OUTPUT:(int) The rank of this space of modular symbols.
EXAMPLES:

70

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

sage: M = ModularSymbols(389)sage: M.rank()
65>>> from sage.all import *>>> M = ModularSymbols(Integer(389))>>> M.rank()
65
sage: ModularSymbols(11,sign=0).rank()
3sage: ModularSymbols(100,sign=0).rank()
31
sage: ModularSymbols(22,sign=1).rank()
5sage: ModularSymbols(1,12).rank()
3sage: ModularSymbols(3,4).rank()
2sage: ModularSymbols(8,6,sign=-1).rank()
3>>> from sage.all import *>>> ModularSymbols(Integer(11),sign=Integer(0)).rank()
3>>> ModularSymbols(Integer(100),sign=Integer(0)).rank()
31>>> ModularSymbols(Integer(22),sign=Integer(1)).rank()
5>>> ModularSymbols(Integer(1),Integer(12)).rank()
3>>> ModularSymbols(Integer(3),Integer(4)).rank()
2>>> ModularSymbols(Integer(8),Integer(6),sign=-Integer(1)).rank()3

star_involution()
Return the star involution on this modular symbols space.
OUTPUT:(matrix) The matrix of the star involution on this space, which is induced by complex conjugation on modular
symbols, with respect to the standard basis.
EXAMPLES:
sage: ModularSymbols(20,2).star_involution()
Hecke module morphism Star involution on Modular Symbols space of dimension 7␣˓→for Gamma_0(20) of weight 2 with sign 0 over Rational Field defined by the␣˓→matrix[1 0 0 0 0 0 0]
[0 1 0 0 0 0 0]
[0 0 0 0 1 0 0]
[0 0 0 1 0 0 0]
[0 0 1 0 0 0 0]
[0 0 0 0 0 1 0]
[0 0 0 0 0 0 1]
(continues on next page)71

Modular Symbols, Release 10.4

(continued from previous page)

Domain: Modular Symbols space of dimension 7 for Gamma_0(20) of weight ...
Codomain: Modular Symbols space of dimension 7 for Gamma_0(20) of weight ...
>>> from sage.all import *>>> ModularSymbols(Integer(20),Integer(2)).star_involution()
Hecke module morphism Star involution on Modular Symbols space of dimension 7␣˓→for Gamma_0(20) of weight 2 with sign 0 over Rational Field defined by the␣˓→matrix[1 0 0 0 0 0 0]
[0 1 0 0 0 0 0]
[0 0 0 0 1 0 0]
[0 0 0 1 0 0 0]
[0 0 1 0 0 0 0]
[0 0 0 0 0 1 0]
[0 0 0 0 0 0 1]
Domain: Modular Symbols space of dimension 7 for Gamma_0(20) of weight ...
Codomain: Modular Symbols space of dimension 7 for Gamma_0(20) of weight ...

submodule(M, dual_free_module=None, check=True)
Return the submodule with given generators or free module 𝑀 .
INPUT:• M – either a submodule of this ambient free module, or generators for a submodule;• dual_free_module (bool, default None) – this may be
useful to speed up certain calculations; it is the corresponding submodule of the ambient dual module;• check (bool, default: True) – if True, check that 𝑀 isa submodule, i.e. is invariant under all Hecke operators.
OUTPUT:
A subspace of this modular symbol space.
EXAMPLES:
sage: M = ModularSymbols(11)sage: M.submodule([M.0])
Traceback (most recent call last):...
ValueError: The submodule must be invariant under all Hecke operators.
sage: M.eisenstein_submodule().basis()((1,0) - 1/5*(1,9),)sage: M.basis()((1,0), (1,8), (1,9))
sage: M.submodule([M.0 - 1/5*M.2])
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(11))>>> M.submodule([M.gen(0)])
Traceback (most recent call last):...
ValueError: The submodule must be invariant under all Hecke operators.
>>> M.eisenstein_submodule().basis()((1,0) - 1/5*(1,9),)(continues on next page)

72

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> M.basis()((1,0), (1,8), (1,9))>>> M.submodule([M.gen(0) - Integer(1)/Integer(5)*M.gen(2)])
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field

Note: It would make more sense to only check that 𝑀 is invariant under the Hecke operators with index
coprime to the level. Unfortunately, I do not know a reasonable algorithm for determining whether a module
is invariant under just the anemic Hecke algebra, since I do not know an analogue of the Sturm bound for theanemic Hecke algebra. - William Stein, 2007-07-27
twisted_winding_element(i, eps)
Return the twisted winding element of given degree and character.
INPUT:• i (int) – an integer, 0 ≤ 𝑖 ≤ 𝑘 − 2 where 𝑘 is the weight.
• eps (character) – a Dirichlet character
OUTPUT:(modular symbol) The so-called ‘twisted winding element’:∑︁𝜀(𝑎) * [𝑖, 0, 𝑎/𝑚].
𝑎∈( /𝑚 )×

Note: This will only work if the base ring of the modular symbol space contains the character values.
EXAMPLES:
sage: eps = DirichletGroup(5)[2]sage: K = eps.base_ring()sage: M = ModularSymbols(37,2,0,K)
sage: M.twisted_winding_element(0,eps)
2*(1,23) - 2*(1,32) + 2*(1,34)>>> from sage.all import *>>> eps = DirichletGroup(Integer(5))[Integer(2)]>>> K = eps.base_ring()>>> M = ModularSymbols(Integer(37),Integer(2),Integer(0),K)>>> M.twisted_winding_element(Integer(0),eps)
2*(1,23) - 2*(1,32) + 2*(1,34)

class sage.modular.modsym.ambient.ModularSymbolsAmbient_wt2_g0(N, sign, F,
custom_init=None,
category=None)
Bases: ModularSymbolsAmbient_wtk_g0
Modular symbols for Γ0 (𝑁 ) of integer weight 2 over the field 𝐹 .
INPUT:• N – int, the level73

Modular Symbols, Release 10.4

• sign – int, either -1, 0, or 1
OUTPUT:
The space of modular symbols of weight 2, trivial character, level 𝑁 and given sign.
EXAMPLES:
sage: ModularSymbols(Gamma0(12),2)
Modular Symbols space of dimension 5 for Gamma_0(12) of weight 2 with sign 0 over␣˓→Rational Field>>> from sage.all import *>>> ModularSymbols(Gamma0(Integer(12)),Integer(2))
Modular Symbols space of dimension 5 for Gamma_0(12) of weight 2 with sign 0 over␣˓→Rational Field

boundary_space()
Return the space of boundary modular symbols for this space.
EXAMPLES:
sage: M = ModularSymbols(100,2)
sage: M.boundary_space()
Space of Boundary Modular Symbols for Congruence Subgroup Gamma0(100) of␣
˓→weight 2 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(100),Integer(2))>>> M.boundary_space()
Space of Boundary Modular Symbols for Congruence Subgroup Gamma0(100) of␣
˓→weight 2 over Rational Field

class sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_eps(eps, weight, sign,
base_ring,custom_init=None,
category=None)
Bases: ModularSymbolsAmbient
Space of modular symbols with given weight, character, base ring and sign.
INPUT:• eps – dirichlet.DirichletCharacter, the “Nebentypus” character.
• weight – int, the weight = 2• sign – int, either -1, 0, or 1
• base_ring – the base ring. It must be possible to change the ring of the character to this base ring (notalways canonically).
EXAMPLES:
sage: eps = DirichletGroup(4).gen(0)sage: eps.order()2sage: ModularSymbols(eps, 2)
Modular Symbols space of dimension 0 and level 4, weight 2, character [-1], sign␣
˓→0, over Rational Field(continues on next page)

74

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: ModularSymbols(eps, 3)
Modular Symbols space of dimension 2 and level 4, weight 3, character [-1], sign␣
˓→0, over Rational Field>>> from sage.all import *>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> eps.order()2>>> ModularSymbols(eps, Integer(2))
Modular Symbols space of dimension 0 and level 4, weight 2, character [-1], sign␣
˓→0, over Rational Field>>> ModularSymbols(eps, Integer(3))
Modular Symbols space of dimension 2 and level 4, weight 3, character [-1], sign␣
˓→0, over Rational Field

We next create a space with character of order bigger than 2.
sage: eps = DirichletGroup(5).gen(0)sage: eps# has order 4
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4
sage: ModularSymbols(eps, 2).dimension()0
sage: ModularSymbols(eps, 3).dimension()2>>> from sage.all import *>>> eps = DirichletGroup(Integer(5)).gen(Integer(0))>>> eps# has order 4
Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4>>> ModularSymbols(eps, Integer(2)).dimension()0>>> ModularSymbols(eps, Integer(3)).dimension()
2

Here is another example:
sage: G.<e> = DirichletGroup(5)sage: M = ModularSymbols(e,3)
sage: loads(M.dumps()) == M
True>>> from sage.all import *>>> G = DirichletGroup(Integer(5), names=( e ,)); (e,) = G._first_ngens(1)>>> M = ModularSymbols(e,Integer(3))>>> loads(M.dumps()) == M
Trueboundary_space()
Return the space of boundary modular symbols for this space.
EXAMPLES:
sage: eps = DirichletGroup(5).gen(0)sage: M = ModularSymbols(eps, 2)
sage: M.boundary_space()(continues on next page)75

Modular Symbols, Release 10.4

(continued from previous page)

Boundary Modular Symbols space of level 5, weight 2, character [zeta4] and␣
˓→dimension 0 over Cyclotomic Field of order 4 and degree 2>>> from sage.all import *>>> eps = DirichletGroup(Integer(5)).gen(Integer(0))>>> M = ModularSymbols(eps, Integer(2))>>> M.boundary_space()
Boundary Modular Symbols space of level 5, weight 2, character [zeta4] and␣
˓→dimension 0 over Cyclotomic Field of order 4 and degree 2manin_symbols()
Return the Manin symbol list of this modular symbol space.
EXAMPLES:
sage: eps = DirichletGroup(5).gen(0)sage: M = ModularSymbols(eps, 2)
sage: M.manin_symbols()
Manin Symbol List of weight 2 for Gamma1(5) with character [zeta4]
sage: len(M.manin_symbols())
6>>> from sage.all import *>>> eps = DirichletGroup(Integer(5)).gen(Integer(0))>>> M = ModularSymbols(eps, Integer(2))>>> M.manin_symbols()
Manin Symbol List of weight 2 for Gamma1(5) with character [zeta4]>>> len(M.manin_symbols())
6

modular_symbols_of_level(N)Return a space of modular symbols with the same parameters as this space except with level 𝑁 .
INPUT:• N (int) – a positive integer.
OUTPUT:(Modular Symbol space) A space of modular symbols with the same defining properties (weight, sign, etc.)
as this space except with level 𝑁 .
EXAMPLES:
sage: eps = DirichletGroup(5).gen(0)sage: M = ModularSymbols(eps, 2); M
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2
sage: M.modular_symbols_of_level(15)Modular Symbols space of dimension 0 and level 15, weight 2, character [1,␣˓→zeta4], sign 0, over Cyclotomic Field of order 4 and degree 2>>> from sage.all import *>>> eps = DirichletGroup(Integer(5)).gen(Integer(0))>>> M = ModularSymbols(eps, Integer(2)); M
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2(continues on next page)

76

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> M.modular_symbols_of_level(Integer(15))
Modular Symbols space of dimension 0 and level 15, weight 2, character [1,␣˓→zeta4], sign 0, over Cyclotomic Field of order 4 and degree 2

modular_symbols_of_sign(sign)
Return a space of modular symbols with the same defining properties (weight, level, etc.) as this space except
with given sign.
INPUT:• sign (int) – A sign (+1, −1 or 0).
OUTPUT:(ModularSymbolsAmbient) A space of modular symbols with the same defining properties (weight, level,etc.) as this space except with given sign.
EXAMPLES:
sage: eps = DirichletGroup(5).gen(0)sage: M = ModularSymbols(eps, 2); M
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2
sage: M.modular_symbols_of_sign(0) == M
True
sage: M.modular_symbols_of_sign(+1)
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 1, over Cyclotomic Field of order 4 and degree 2
sage: M.modular_symbols_of_sign(-1)
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign -1, over Cyclotomic Field of order 4 and degree 2>>> from sage.all import *>>> eps = DirichletGroup(Integer(5)).gen(Integer(0))>>> M = ModularSymbols(eps, Integer(2)); M
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2>>> M.modular_symbols_of_sign(Integer(0)) == M
True>>> M.modular_symbols_of_sign(+Integer(1))
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 1, over Cyclotomic Field of order 4 and degree 2>>> M.modular_symbols_of_sign(-Integer(1))
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign -1, over Cyclotomic Field of order 4 and degree 2

modular_symbols_of_weight(k)Return a space of modular symbols with the same defining properties (weight, sign, etc.) as this space except
with weight 𝑘.
INPUT:• k (int) – A positive integer.
OUTPUT:(ModularSymbolsAmbient) A space of modular symbols with the same defining properties (level, sign) as
this space except with given weight.
EXAMPLES:77

Modular Symbols, Release 10.4

sage: eps = DirichletGroup(5).gen(0)sage: M = ModularSymbols(eps, 2); M
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2
sage: M.modular_symbols_of_weight(3)Modular Symbols space of dimension 2 and level 5, weight 3, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2
sage: M.modular_symbols_of_weight(2) == M
True>>> from sage.all import *>>> eps = DirichletGroup(Integer(5)).gen(Integer(0))>>> M = ModularSymbols(eps, Integer(2)); M
Modular Symbols space of dimension 0 and level 5, weight 2, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2>>> M.modular_symbols_of_weight(Integer(3))
Modular Symbols space of dimension 2 and level 5, weight 3, character [zeta4],
˓→ sign 0, over Cyclotomic Field of order 4 and degree 2>>> M.modular_symbols_of_weight(Integer(2)) == M
Trueclass sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g0(N, k, sign, F,
custom_init=None,
category=None)
Bases: ModularSymbolsAmbient
Modular symbols for Γ0 (𝑁 ) of integer weight 𝑘 > 2 over the field 𝐹 .
For weight 2, it is faster to use ModularSymbols_wt2_g0.
INPUT:• N – int, the level• k – integer weight = 2.
• sign – int, either -1, 0, or 1
• F – field
EXAMPLES:
sage: ModularSymbols(1,12)
Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over␣˓→Rational Field
sage: ModularSymbols(1,12, sign=1).dimension()2
sage: ModularSymbols(15,4, sign=-1).dimension()4
sage: ModularSymbols(6,6).dimension()10
sage: ModularSymbols(36,4).dimension()36>>> from sage.all import *>>> ModularSymbols(Integer(1),Integer(12))
Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over␣˓→Rational Field>>> ModularSymbols(Integer(1),Integer(12), sign=Integer(1)).dimension()(continues on next page)

78

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)2>>> ModularSymbols(Integer(15),Integer(4), sign=-Integer(1)).dimension()4>>> ModularSymbols(Integer(6),Integer(6)).dimension()10>>> ModularSymbols(Integer(36),Integer(4)).dimension()36

boundary_space()
Return the space of boundary modular symbols for this space.
EXAMPLES:
sage: M = ModularSymbols(100,2)
sage: M.boundary_space()
Space of Boundary Modular Symbols for Congruence Subgroup Gamma0(100) of␣
˓→weight 2 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(100),Integer(2))>>> M.boundary_space()
Space of Boundary Modular Symbols for Congruence Subgroup Gamma0(100) of␣
˓→weight 2 over Rational Fieldmanin_symbols()
Return the Manin symbol list of this modular symbol space.
EXAMPLES:
sage: M = ModularSymbols(100,4)
sage: M.manin_symbols()
Manin Symbol List of weight 4 for Gamma0(100)sage: len(M.manin_symbols())
540>>> from sage.all import *>>> M = ModularSymbols(Integer(100),Integer(4))>>> M.manin_symbols()
Manin Symbol List of weight 4 for Gamma0(100)>>> len(M.manin_symbols())
540

class sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1(level, weight, sign, F,
custom_init=None,
category=None)
Bases: ModularSymbolsAmbient
INPUT:• level – int, the level• weight – int, the weight = 2• sign – int, either -1, 0, or 1
• F – field
EXAMPLES:79

Modular Symbols, Release 10.4

sage: ModularSymbols(Gamma1(17),2)
Modular Symbols space of dimension 25 for Gamma_1(17) of weight 2 with sign 0␣˓→over Rational Field
sage: [ModularSymbols(Gamma1(7),k).dimension() for k in [2,3,4,5]][5, 8, 12, 16]>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(17)),Integer(2))
Modular Symbols space of dimension 25 for Gamma_1(17) of weight 2 with sign 0␣˓→over Rational Field>>> [ModularSymbols(Gamma1(Integer(7)),k).dimension() for k in [Integer(2),˓→Integer(3),Integer(4),Integer(5)]][5, 8, 12, 16]
sage: ModularSymbols(Gamma1(7),3)
Modular Symbols space of dimension 8 for Gamma_1(7) of weight 3 with sign 0 over␣˓→Rational Field>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(7)),Integer(3))
Modular Symbols space of dimension 8 for Gamma_1(7) of weight 3 with sign 0 over␣˓→Rational Field

boundary_space()
Return the space of boundary modular symbols for this space.
EXAMPLES:
sage: M = ModularSymbols(100,2)
sage: M.boundary_space()
Space of Boundary Modular Symbols for Congruence Subgroup Gamma0(100) of␣
˓→weight 2 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(100),Integer(2))>>> M.boundary_space()
Space of Boundary Modular Symbols for Congruence Subgroup Gamma0(100) of␣
˓→weight 2 over Rational Fieldmanin_symbols()
Return the Manin symbol list of this modular symbol space.
EXAMPLES:
sage: M = ModularSymbols(Gamma1(30),4)
sage: M.manin_symbols()
Manin Symbol List of weight 4 for Gamma1(30)sage: len(M.manin_symbols())
1728>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(30)),Integer(4))>>> M.manin_symbols()
Manin Symbol List of weight 4 for Gamma1(30)>>> len(M.manin_symbols())
1728

80

Chapter 3. Ambient spaces of modular symbols

Modular Symbols, Release 10.4class sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_gamma_h(group, weight,
sign, F, custom_init=None,
category=None)
Bases: ModularSymbolsAmbient
Initialize a space of modular symbols for Γ𝐻 (𝑁 ).
INPUT:• group – a congruence subgroup Γ𝐻 (𝑁 ).
• weight – int, the weight = 2• sign – int, either -1, 0, or 1
• F – field
EXAMPLES:
sage: ModularSymbols(GammaH(15,[4]),2)
Modular Symbols space of dimension 9 for Congruence Subgroup Gamma_H(15) with H␣
˓→generated by [4] of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> ModularSymbols(GammaH(Integer(15),[Integer(4)]),Integer(2))
Modular Symbols space of dimension 9 for Congruence Subgroup Gamma_H(15) with H␣
˓→generated by [4] of weight 2 with sign 0 over Rational Field

boundary_space()
Return the space of boundary modular symbols for this space.
EXAMPLES:
sage: M = ModularSymbols(GammaH(15,[4]),2)
sage: M.boundary_space()
Boundary Modular Symbols space for Congruence Subgroup Gamma_H(15) with H␣
˓→generated by [4] of weight 2 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(GammaH(Integer(15),[Integer(4)]),Integer(2))>>> M.boundary_space()
Boundary Modular Symbols space for Congruence Subgroup Gamma_H(15) with H␣
˓→generated by [4] of weight 2 over Rational Fieldmanin_symbols()
Return the Manin symbol list of this modular symbol space.
EXAMPLES:
sage: M = ModularSymbols(GammaH(15,[4]),2)
sage: M.manin_symbols()
Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(15) with H␣
˓→generated by [4]sage: len(M.manin_symbols())
96

81Modular Symbols, Release 10.4>>> from sage.all import *>>> M = ModularSymbols(GammaH(Integer(15),[Integer(4)]),Integer(2))>>> M.manin_symbols()
Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(15) with H␣
˓→generated by [4]>>> len(M.manin_symbols())
96

82

Chapter 3. Ambient spaces of modular symbols

CHAPTERFOUR

SUBSPACE OF AMBIENT SPACES OF MODULAR SYMBOLS

class sage.modular.modsym.subspace.ModularSymbolsSubspace(ambient_hecke_module,
submodule,
dual_free_module=None,check=False)
Bases: ModularSymbolsSpace, HeckeSubmodule
Subspace of ambient space of modular symbols
boundary_map()
The boundary map to the corresponding space of boundary modular symbols. (This is the restriction of themap on the ambient space.)
EXAMPLES:
sage: M = ModularSymbols(1, 24, sign=1) ; M
Modular Symbols space of dimension 3 for Gamma_0(1) of weight 24with sign 1 over Rational Field
sage: M.basis()([X^18*Y^4,(0,0)], [X^20*Y^2,(0,0)], [X^22,(0,0)])
sage: M.cuspidal_submodule().basis()([X^18*Y^4,(0,0)], [X^20*Y^2,(0,0)])
sage: M.eisenstein_submodule().basis()([X^18*Y^4,(0,0)] + 166747/324330*[X^20*Y^2,(0,0)] + 236364091/6742820700*[X^˓→22,(0,0)],)sage: M.boundary_map()
Hecke module morphism boundary map defined by the matrix
[ 0]
[ 0]
[-1]
Domain: Modular Symbols space of dimension 3 for Gamma_0(1) of weight ...
Codomain: Space of Boundary Modular Symbols for Modular Group SL(2,Z) ...
sage: M.cuspidal_subspace().boundary_map()
Hecke module morphism defined by the matrix[0][0]Domain: Modular Symbols subspace of dimension 2 of Modular Symbols space ...
Codomain: Space of Boundary Modular Symbols for Modular Group SL(2,Z) ...
sage: M.eisenstein_submodule().boundary_map()
Hecke module morphism defined by the matrix[-236364091/6742820700]
Domain: Modular Symbols subspace of dimension 1 of Modular Symbols space ...
Codomain: Space of Boundary Modular Symbols for Modular Group SL(2,Z) ...

83

Modular Symbols, Release 10.4>>> from sage.all import *>>> M = ModularSymbols(Integer(1), Integer(24), sign=Integer(1)) ; M
Modular Symbols space of dimension 3 for Gamma_0(1) of weight 24with sign 1 over Rational Field>>> M.basis()([X^18*Y^4,(0,0)], [X^20*Y^2,(0,0)], [X^22,(0,0)])>>> M.cuspidal_submodule().basis()([X^18*Y^4,(0,0)], [X^20*Y^2,(0,0)])>>> M.eisenstein_submodule().basis()([X^18*Y^4,(0,0)] + 166747/324330*[X^20*Y^2,(0,0)] + 236364091/6742820700*[X^˓→22,(0,0)],)>>> M.boundary_map()
Hecke module morphism boundary map defined by the matrix
[ 0]
[ 0]
[-1]
Domain: Modular Symbols space of dimension 3 for Gamma_0(1) of weight ...
Codomain: Space of Boundary Modular Symbols for Modular Group SL(2,Z) ...
>>> M.cuspidal_subspace().boundary_map()
Hecke module morphism defined by the matrix[0][0]Domain: Modular Symbols subspace of dimension 2 of Modular Symbols space ...
Codomain: Space of Boundary Modular Symbols for Modular Group SL(2,Z) ...
>>> M.eisenstein_submodule().boundary_map()
Hecke module morphism defined by the matrix[-236364091/6742820700]
Domain: Modular Symbols subspace of dimension 1 of Modular Symbols space ...
Codomain: Space of Boundary Modular Symbols for Modular Group SL(2,Z) ...

cuspidal_submodule()
Return the cuspidal subspace of this subspace of modular symbols.
EXAMPLES:
sage: S = ModularSymbols(42,4).cuspidal_submodule() ; S
Modular Symbols subspace of dimension 40 of Modular Symbols space of␣˓→dimension 48
for Gamma_0(42) of weight 4 with sign 0 over Rational Field
sage: S.is_cuspidal()Truesage: S.cuspidal_submodule()
Modular Symbols subspace of dimension 40 of Modular Symbols space of␣˓→dimension 48
for Gamma_0(42) of weight 4 with sign 0 over Rational Field>>> from sage.all import *>>> S = ModularSymbols(Integer(42),Integer(4)).cuspidal_submodule() ; S
Modular Symbols subspace of dimension 40 of Modular Symbols space of␣˓→dimension 48
for Gamma_0(42) of weight 4 with sign 0 over Rational Field>>> S.is_cuspidal()
True>>> S.cuspidal_submodule()
Modular Symbols subspace of dimension 40 of Modular Symbols space of␣˓→dimension 48
for Gamma_0(42) of weight 4 with sign 0 over Rational Field

84

Chapter 4. Subspace of ambient spaces of modular symbols

Modular Symbols, Release 10.4

The cuspidal submodule of the cuspidal submodule is just itself:
sage: S.cuspidal_submodule() is S
True
sage: S.cuspidal_submodule() == S
True>>> from sage.all import *>>> S.cuspidal_submodule() is S
True>>> S.cuspidal_submodule() == STrue

An example where we abuse the _set_is_cuspidal function:
sage: M = ModularSymbols(389)sage: S = M.eisenstein_submodule()
sage: S._set_is_cuspidal(True)
sage: S.cuspidal_submodule()
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→65
for Gamma_0(389) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(389))>>> S = M.eisenstein_submodule()>>> S._set_is_cuspidal(True)>>> S.cuspidal_submodule()
Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension␣
˓→65
for Gamma_0(389) of weight 2 with sign 0 over Rational Field

dual_star_involution_matrix()
Return the matrix of the dual star involution.
This involution is induced by complex conjugation on the linear dual of modular symbols.
EXAMPLES:
sage: S = ModularSymbols(6,4) ; S.dual_star_involution_matrix()[ 1 0 0 0 0 0]
[ 0 1 0 0 0 0]
[ 0 -2 1 2 0 0]
[ 0 2 0 -1 0 0]
[ 0 -2 0 2 1 0]
[ 0 2 0 -2 0 1]
sage: S.star_involution().matrix().transpose() == S.dual_star_involution_
˓→matrix()True>>> from sage.all import *>>> S = ModularSymbols(Integer(6),Integer(4)) ; S.dual_star_involution_
˓→matrix()[ 1 0 0 0 0 0]
[ 0 1 0 0 0 0]
[ 0 -2 1 2 0 0]
[ 0 2 0 -1 0 0](continues on next page)85

Modular Symbols, Release 10.4

(continued from previous page)[ 0 -2 0 2 1 0]
[ 0 2 0 -2 0 1]>>> S.star_involution().matrix().transpose() == S.dual_star_involution_
˓→matrix()Trueeisenstein_subspace()
Return the Eisenstein subspace of this space of modular symbols.
EXAMPLES:
sage: ModularSymbols(24,4).eisenstein_subspace()
Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension␣
˓→24
for Gamma_0(24) of weight 4 with sign 0 over Rational Field
sage: ModularSymbols(20,2).cuspidal_subspace().eisenstein_subspace()
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension␣
˓→7
for Gamma_0(20) of weight 2 with sign 0 over Rational Field>>> from sage.all import *>>> ModularSymbols(Integer(24),Integer(4)).eisenstein_subspace()
Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension␣
˓→24
for Gamma_0(24) of weight 4 with sign 0 over Rational Field>>> ModularSymbols(Integer(20),Integer(2)).cuspidal_subspace().eisenstein_
˓→subspace()
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension␣
˓→7
for Gamma_0(20) of weight 2 with sign 0 over Rational Field

factorization()
Return a list of pairs (𝑆, 𝑒) where 𝑆 is simple spaces of modular symbols and self is isomorphic to the direct
sum of the 𝑆 𝑒 as a module over the anemic Hecke algebra adjoin the star involution.
The cuspidal 𝑆 are all simple, but the Eisenstein factors need not be simple.
The factors are sorted by dimension - don’t depend on much more for now.
ASSUMPTION: self is a module over the anemic Hecke algebra.
EXAMPLES: Note that if the sign is 1 then the cuspidal factors occur twice, one with each star eigenvalue.
sage: M = ModularSymbols(11)sage: D = M.factorization(); D(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3
for Gamma_0(11) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3
for Gamma_0(11) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3
for Gamma_0(11) of weight 2 with sign 0 over Rational Field)
sage: [A.T(2).matrix() for A, _ in D][[-2], [3], [-2]]sage: [A.star_eigenvalues() for A, _ in D][[-1], [1], [1]]86Chapter 4. Subspace of ambient spaces of modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> M = ModularSymbols(Integer(11))>>> D = M.factorization(); D(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3
for Gamma_0(11) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3
for Gamma_0(11) of weight 2 with sign 0 over Rational Field) *(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 3
for Gamma_0(11) of weight 2 with sign 0 over Rational Field)>>> [A.T(Integer(2)).matrix() for A, _ in D][[-2], [3], [-2]]>>> [A.star_eigenvalues() for A, _ in D][[-1], [1], [1]]In this example there is one old factor squared.
sage: M = ModularSymbols(22,sign=1)
sage: S = M.cuspidal_submodule()
sage: S.factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2
for Gamma_0(11) of weight 2 with sign 1 over Rational Field)^2>>> from sage.all import *>>> M = ModularSymbols(Integer(22),sign=Integer(1))>>> S = M.cuspidal_submodule()>>> S.factorization()(Modular Symbols subspace of dimension 1 of Modular Symbols space of␣˓→dimension 2
for Gamma_0(11) of weight 2 with sign 1 over Rational Field)^2
sage: M = ModularSymbols(Gamma0(22), 2, sign=1)
sage: M1 = M.decomposition()[1]sage: M1.factorization()
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→5for Gamma_0(22) of weight 2 with sign 1 over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Gamma0(Integer(22)), Integer(2), sign=Integer(1))>>> M1 = M.decomposition()[Integer(1)]>>> M1.factorization()
Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension␣
˓→5for Gamma_0(22) of weight 2 with sign 1 over Rational Field

is_cuspidal()
Return True if self is cuspidal.
EXAMPLES:
sage: ModularSymbols(42,4).cuspidal_submodule().is_cuspidal()True(continues on next page)87

Modular Symbols, Release 10.4

(continued from previous page)

sage: ModularSymbols(12,6).eisenstein_submodule().is_cuspidal()False>>> from sage.all import *>>> ModularSymbols(Integer(42),Integer(4)).cuspidal_submodule().is_cuspidal()True>>> ModularSymbols(Integer(12),Integer(6)).eisenstein_submodule().is_˓→cuspidal()False

is_eisenstein()
Return True if self is an Eisenstein subspace.
EXAMPLES:
sage: ModularSymbols(22,6).cuspidal_submodule().is_eisenstein()
False
sage: ModularSymbols(22,6).eisenstein_submodule().is_eisenstein()True>>> from sage.all import *>>> ModularSymbols(Integer(22),Integer(6)).cuspidal_submodule().is_˓→eisenstein()
False>>> ModularSymbols(Integer(22),Integer(6)).eisenstein_submodule().is_˓→eisenstein()Truestar_involution()
Return the star involution on self, which is induced by complex conjugation on modular symbols.
EXAMPLES:
sage: M = ModularSymbols(1,24)
sage: M.star_involution()
Hecke module morphism Star involution on Modular Symbols space of dimension 5
for Gamma_0(1) of weight 24 with sign 0 over Rational Field defined by the␣˓→matrix[ 1 0 0 0 0]
[ 0 -1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 -1 0][ 0 0 0 0 1]
Domain: Modular Symbols space of dimension 5 for Gamma_0(1) of weight ...
Codomain: Modular Symbols space of dimension 5 for Gamma_0(1) of weight ...
sage: M.cuspidal_subspace().star_involution()
Hecke module morphism defined by the matrix[ 1 0 0 0]
[ 0 -1 0 0]
[ 0 0 1 0]
[ 0 0 0 -1]
Domain: Modular Symbols subspace of dimension 4 of Modular Symbols space ...
Codomain: Modular Symbols subspace of dimension 4 of Modular Symbols space ...
sage: M.plus_submodule().star_involution()
Hecke module morphism defined by the matrix[1 0 0](continues on next page)

88

Chapter 4. Subspace of ambient spaces of modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[0 1 0][0 0 1]
Domain: Modular Symbols subspace of dimension 3 of Modular Symbols space ...
Codomain: Modular Symbols subspace of dimension 3 of Modular Symbols space ...
sage: M.minus_submodule().star_involution()
Hecke module morphism defined by the matrix[-1 0][ 0 -1]
Domain: Modular Symbols subspace of dimension 2 of Modular Symbols space ...
Codomain: Modular Symbols subspace of dimension 2 of Modular Symbols space ...
>>> from sage.all import *>>> M = ModularSymbols(Integer(1),Integer(24))>>> M.star_involution()
Hecke module morphism Star involution on Modular Symbols space of dimension 5
for Gamma_0(1) of weight 24 with sign 0 over Rational Field defined by the␣˓→matrix[ 1 0 0 0 0]
[ 0 -1 0 0 0]
[ 0 0 1 0 0]
[ 0 0 0 -1 0][ 0 0 0 0 1]
Domain: Modular Symbols space of dimension 5 for Gamma_0(1) of weight ...
Codomain: Modular Symbols space of dimension 5 for Gamma_0(1) of weight ...
>>> M.cuspidal_subspace().star_involution()
Hecke module morphism defined by the matrix[ 1 0 0 0]
[ 0 -1 0 0]
[ 0 0 1 0]
[ 0 0 0 -1]
Domain: Modular Symbols subspace of dimension 4 of Modular Symbols space ...
Codomain: Modular Symbols subspace of dimension 4 of Modular Symbols space ...
>>> M.plus_submodule().star_involution()
Hecke module morphism defined by the matrix[1 0 0][0 1 0][0 0 1]
Domain: Modular Symbols subspace of dimension 3 of Modular Symbols space ...
Codomain: Modular Symbols subspace of dimension 3 of Modular Symbols space ...
>>> M.minus_submodule().star_involution()
Hecke module morphism defined by the matrix[-1 0][ 0 -1]
Domain: Modular Symbols subspace of dimension 2 of Modular Symbols space ...
Codomain: Modular Symbols subspace of dimension 2 of Modular Symbols space ...

89Modular Symbols, Release 10.4

90

Chapter 4. Subspace of ambient spaces of modular symbols

CHAPTERFIVE

A SINGLE ELEMENT OF AN AMBIENT SPACE OF MODULAR
SYMBOLS

class sage.modular.modsym.element.ModularSymbolsElement(parent, x, check=True)
Bases: HeckeModuleElement
An element of a space of modular symbols.
list()
Return a list of the coordinates of self in terms of a basis for the ambient space.
EXAMPLES:
sage: ModularSymbols(37, 2).0.list()[1, 0, 0, 0, 0]>>> from sage.all import *>>> ModularSymbols(Integer(37), Integer(2)).gen(0).list()[1, 0, 0, 0, 0]

manin_symbol_rep()
Return a representation of self as a formal sum of Manin symbols.
EXAMPLES:
sage: x = ModularSymbols(37, 4).0
sage: x.manin_symbol_rep()[X^2,(0,1)]>>> from sage.all import *>>> x = ModularSymbols(Integer(37), Integer(4)).gen(0)>>> x.manin_symbol_rep()[X^2,(0,1)]

The result is cached:sage: x.manin_symbol_rep() is x.manin_symbol_rep()True>>> from sage.all import *>>> x.manin_symbol_rep() is x.manin_symbol_rep()
True

91

Modular Symbols, Release 10.4

modular_symbol_rep()
Return a representation of self as a formal sum of modular symbols.
EXAMPLES:
sage: x = ModularSymbols(37, 4).0
sage: x.modular_symbol_rep()X^2*{0, Infinity}>>> from sage.all import *>>> x = ModularSymbols(Integer(37), Integer(4)).gen(0)>>> x.modular_symbol_rep()X^2*{0, Infinity}

The result is cached:sage: x.modular_symbol_rep() is x.modular_symbol_rep()True>>> from sage.all import *>>> x.modular_symbol_rep() is x.modular_symbol_rep()True

sage.modular.modsym.element.is_ModularSymbolsElement(x)Return True if x is an element of a modular symbols space.
EXAMPLES:
sage: sage.modular.modsym.element.is_ModularSymbolsElement(ModularSymbols(11, 2).
˓→0)doctest:warning...
DeprecationWarning: The function is_ModularSymbolsElement is deprecated;
use isinstance(..., ModularSymbolsElement) instead.
See https://github.com/sagemath/sage/issues/38184 for details.
Truesage: sage.modular.modsym.element.is_ModularSymbolsElement(13)False>>> from sage.all import *>>> sage.modular.modsym.element.is_
˓→ModularSymbolsElement(ModularSymbols(Integer(11), Integer(2)).gen(0))
doctest:warning...
DeprecationWarning: The function is_ModularSymbolsElement is deprecated;
use isinstance(..., ModularSymbolsElement) instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True>>> sage.modular.modsym.element.is_ModularSymbolsElement(Integer(13))
False

sage.modular.modsym.element.set_modsym_print_mode(mode='manin')
Set the mode for printing of elements of modular symbols spaces.
INPUT:• mode – a string. The possibilities are as follows:92•

manin – (the default) formal sums of Manin symbols [P(X,Y),(u,v)]•

modular – formal sums of Modular symbols P(X,Y)*alpha,beta, where alpha and beta are cusps
Chapter 5. A single element of an ambient space of modular symbols

Modular Symbols, Release 10.4•

vector – as vectors on the basis for the ambient space

OUTPUT: none
EXAMPLES:
sage: M = ModularSymbols(13, 8)
sage: x = M.0 + M.1 + M.14
sage: set_modsym_print_mode( manin ); x[X^5*Y,(1,11)] + [X^5*Y,(1,12)] + [X^6,(1,11)]
sage: set_modsym_print_mode( modular ); x
1610510*X^6*{-1/11, 0} + 893101*X^5*Y*{-1/11, 0} + 206305*X^4*Y^2*{-1/11, 0} +␣˓→25410*X^3*Y^3*{-1/11, 0} + 1760*X^2*Y^4*{-1/11, 0} + 65*X*Y^5*{-1/11, 0} -␣˓→248832*X^6*{-1/12, 0} - 103680*X^5*Y*{-1/12, 0} - 17280*X^4*Y^2*{-1/12, 0} -␣
˓→1440*X^3*Y^3*{-1/12, 0} - 60*X^2*Y^4*{-1/12, 0} - X*Y^5*{-1/12, 0} + Y^6*{-1/11,
˓→ 0}
sage: set_modsym_print_mode( vector ); x
(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)
sage: set_modsym_print_mode()>>> from sage.all import *>>> M = ModularSymbols(Integer(13), Integer(8))>>> x = M.gen(0) + M.gen(1) + M.gen(14)>>> set_modsym_print_mode( manin ); x[X^5*Y,(1,11)] + [X^5*Y,(1,12)] + [X^6,(1,11)]>>> set_modsym_print_mode( modular ); x
1610510*X^6*{-1/11, 0} + 893101*X^5*Y*{-1/11, 0} + 206305*X^4*Y^2*{-1/11, 0} +␣˓→25410*X^3*Y^3*{-1/11, 0} + 1760*X^2*Y^4*{-1/11, 0} + 65*X*Y^5*{-1/11, 0} -␣˓→248832*X^6*{-1/12, 0} - 103680*X^5*Y*{-1/12, 0} - 17280*X^4*Y^2*{-1/12, 0} -␣
˓→1440*X^3*Y^3*{-1/12, 0} - 60*X^2*Y^4*{-1/12, 0} - X*Y^5*{-1/12, 0} + Y^6*{-1/11,
˓→ 0}>>> set_modsym_print_mode( vector ); x
(1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0)>>> set_modsym_print_mode()93Modular Symbols, Release 10.4

94

Chapter 5. A single element of an ambient space of modular symbols

CHAPTER

SIXMODULAR SYMBOLS {𝛼, 𝛽}The ModularSymbol class represents a single modular symbol 𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}.
AUTHOR:• William Stein (2005, 2009)class sage.modular.modsym.modular_symbols.ModularSymbol(space, i, alpha, beta)
Bases: SageObject
The modular symbol 𝑋 𝑖 · 𝑌 𝑘−2−𝑖 · {𝛼, 𝛽}.
alpha()For a symbol of the form 𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}, return 𝛼.
EXAMPLES:
sage: s = ModularSymbols(11,4).1.modular_symbol_rep()[0][1]; sX^2*{-1/6, 0}
sage: s.alpha()-1/6
sage: type(s.alpha())<class sage.modular.cusps.Cusp >>>> from sage.all import *>>> s = ModularSymbols(Integer(11),Integer(4)).gen(1).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]; sX^2*{-1/6, 0}>>> s.alpha()-1/6>>> type(s.alpha())<class sage.modular.cusps.Cusp >apply(g)Act on this symbol by the element 𝑔 ∈ GL2 ( ).
INPUT:(︂𝑎 𝑏• g – a list [a,b,c,d], corresponding to the 2x2 matrix𝑐 𝑑)︂

∈ GL2 ( ).

OUTPUT:∑︀• FormalSum∑︀ – a formal sum 𝑖 𝑐𝑖 𝑥𝑖 , where 𝑐𝑖 are scalars and 𝑥𝑖 are ModularSymbol objects, such thatthe sum 𝑖 𝑐𝑖 𝑥𝑖 is the image of this symbol under the action of g. No reduction is performed modulo
the relations that hold in self.space().

95Modular Symbols, Release 10.4

The action of 𝑔 on symbols is by
𝑃 (𝑋, 𝑌 ){𝛼, 𝛽} ↦→ 𝑃 (𝑑𝑋 − 𝑏𝑌, −𝑐𝑥 + 𝑎𝑌 ){𝑔(𝛼), 𝑔(𝛽)}.
Note that for us we have 𝑃 = 𝑋 𝑖 𝑌 𝑘−2−𝑖 , which simplifies computation of the polynomial part slightly.
EXAMPLES:
sage: s = ModularSymbols(11,2).1.modular_symbol_rep()[0][1]; s{-1/8, 0}
sage: a = 1; b = 2; c = 3; d = 4; s.apply([a,b,c,d]){15/29, 1/2}
sage: x = -1/8; (a*x+b)/(c*x+d)
15/29
sage: x = 0; (a*x+b)/(c*x+d)
1/2
sage: s = ModularSymbols(11,4).1.modular_symbol_rep()[0][1]; sX^2*{-1/6, 0}
sage: s.apply([a,b,c,d])
16*X^2*{11/21, 1/2} - 16*X*Y*{11/21, 1/2} + 4*Y^2*{11/21, 1/2}
sage: P = s.polynomial_part()sage: X, Y = P.parent().gens()
sage: P(d*X-b*Y, -c*X+a*Y)
16*X^2 - 16*X*Y + 4*Y^2
sage: x = -1/6; (a*x+b)/(c*x+d)
11/21
sage: x = 0; (a*x+b)/(c*x+d)
1/2
sage: type(s.apply([a,b,c,d]))<class sage.structure.formal_sum.FormalSum >>>> from sage.all import *>>> s = ModularSymbols(Integer(11),Integer(2)).gen(1).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]; s{-1/8, 0}>>> a = Integer(1); b = Integer(2); c = Integer(3); d = Integer(4); s.
˓→apply([a,b,c,d]){15/29, 1/2}>>> x = -Integer(1)/Integer(8); (a*x+b)/(c*x+d)
15/29>>> x = Integer(0); (a*x+b)/(c*x+d)
1/2>>> s = ModularSymbols(Integer(11),Integer(4)).gen(1).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]; sX^2*{-1/6, 0}>>> s.apply([a,b,c,d])
16*X^2*{11/21, 1/2} - 16*X*Y*{11/21, 1/2} + 4*Y^2*{11/21, 1/2}>>> P = s.polynomial_part()>>> X, Y = P.parent().gens()>>> P(d*X-b*Y, -c*X+a*Y)
16*X^2 - 16*X*Y + 4*Y^2>>> x = -Integer(1)/Integer(6); (a*x+b)/(c*x+d)
11/21>>> x = Integer(0); (a*x+b)/(c*x+d)
1/2>>> type(s.apply([a,b,c,d]))<class sage.structure.formal_sum.FormalSum >beta()
96

Chapter 6. Modular symbols {𝛼, 𝛽}Modular Symbols, Release 10.4

For a symbol of the form 𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}, return 𝛽.
EXAMPLES:
sage: s = ModularSymbols(11,4).1.modular_symbol_rep()[0][1]; sX^2*{-1/6, 0}
sage: s.beta()0sage: type(s.beta())<class sage.modular.cusps.Cusp >>>> from sage.all import *>>> s = ModularSymbols(Integer(11),Integer(4)).gen(1).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]; sX^2*{-1/6, 0}>>> s.beta()
0>>> type(s.beta())<class sage.modular.cusps.Cusp >i()
For a symbol of the form 𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}, return 𝑖.
EXAMPLES:
sage: s = ModularSymbols(11).2.modular_symbol_rep()[0][1]sage: s.i()0
sage: s = ModularSymbols(1,28).0.modular_symbol_rep()[0][1]; sX^22*Y^4*{0, Infinity}
sage: s.i()22>>> from sage.all import *>>> s = ModularSymbols(Integer(11)).gen(2).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]>>> s.i()0>>> s = ModularSymbols(Integer(1),Integer(28)).gen(0).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]; sX^22*Y^4*{0, Infinity}>>> s.i()22

manin_symbol_rep()
Return a representation of self as a formal sum of Manin symbols.
The result is not cached.
EXAMPLES:
sage: M = ModularSymbols(11,4)
sage: s = M.1.modular_symbol_rep()[0][1]; sX^2*{-1/6, 0}
sage: s.manin_symbol_rep()-2*[X*Y,(-1,0)] - [X^2,(-1,0)] - [Y^2,(1,1)] - [X^2,(-6,1)](continues on next page)97

Modular Symbols, Release 10.4

(continued from previous page)

sage: M(s.manin_symbol_rep()) == M([2,-1/6,0])
True>>> from sage.all import *>>> M = ModularSymbols(Integer(11),Integer(4))>>> s = M.gen(1).modular_symbol_rep()[Integer(0)][Integer(1)]; sX^2*{-1/6, 0}>>> s.manin_symbol_rep()-2*[X*Y,(-1,0)] - [X^2,(-1,0)] - [Y^2,(1,1)] - [X^2,(-6,1)]>>> M(s.manin_symbol_rep()) == M([Integer(2),-Integer(1)/Integer(6),˓→Integer(0)])
Truepolynomial_part()
Return the polynomial part of this symbol, i.e. for a symbol of the form 𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}, return 𝑋 𝑖 𝑌 𝑘−2−𝑖 .
EXAMPLES:
sage: s = ModularSymbols(11).2.modular_symbol_rep()[0][1]sage: s.polynomial_part()1
sage: s = ModularSymbols(1,28).0.modular_symbol_rep()[0][1]; sX^22*Y^4*{0, Infinity}
sage: s.polynomial_part()
X^22*Y^4>>> from sage.all import *>>> s = ModularSymbols(Integer(11)).gen(2).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]>>> s.polynomial_part()1>>> s = ModularSymbols(Integer(1),Integer(28)).gen(0).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]; sX^22*Y^4*{0, Infinity}>>> s.polynomial_part()
X^22*Y^4

space()The list of Manin symbols to which this symbol belongs.
EXAMPLES:
sage: s = ModularSymbols(11).2.modular_symbol_rep()[0][1]sage: s.space()
Manin Symbol List of weight 2 for Gamma0(11)>>> from sage.all import *>>> s = ModularSymbols(Integer(11)).gen(2).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]>>> s.space()
Manin Symbol List of weight 2 for Gamma0(11)weight()Return the weight of the modular symbols space to which this symbol belongs; i.e. for a symbol of the form
𝑋 𝑖 𝑌 𝑘−2−𝑖 {𝛼, 𝛽}, return 𝑘.

98

Chapter 6. Modular symbols {𝛼, 𝛽}Modular Symbols, Release 10.4

EXAMPLES:
sage: s = ModularSymbols(1,28).0.modular_symbol_rep()[0][1]sage: s.weight()
28>>> from sage.all import *>>> s = ModularSymbols(Integer(1),Integer(28)).gen(0).modular_symbol_
˓→rep()[Integer(0)][Integer(1)]>>> s.weight()
28

99Modular Symbols, Release 10.4

100

Chapter 6. Modular symbols {𝛼, 𝛽}CHAPTERSEVENMANIN SYMBOLSThis module defines the class ManinSymbol. A Manin symbol of weight 𝑘, level 𝑁 has the form [𝑃 (𝑋, 𝑌 ), (𝑢 : 𝑣)]
where 𝑃 (𝑋, 𝑌 ) ∈ [𝑋, 𝑌 ] is homogeneous of weight 𝑘 − 2 and (𝑢 : 𝑣) ∈ P1 ( /𝑁 ). The ManinSymbol class holds
a “monomial Manin symbol” of the simpler form [𝑋 𝑖 𝑌 𝑘−2−𝑖 , (𝑢 : 𝑣)], which is stored as a triple (𝑖, 𝑢, 𝑣); the weight
and level are obtained from the parent structure, which is a sage.modular.modsym.manin_symbol_list.
ManinSymbolList.
Integer matrices [𝑎, 𝑏; 𝑐, 𝑑] act on Manin symbols on the right, sending [𝑃 (𝑋, 𝑌 ), (𝑢, 𝑣)] to [𝑃 (𝑎𝑋 + 𝑏𝑌, 𝑐𝑋 +𝑑𝑌 ), (𝑢, 𝑣)𝑔]. Diagonal matrices (with 𝑏 = 𝑐 = 0, such as 𝐼 = [−1, 0; 0, 1] and 𝐽 = [−1, 0; 0, −1]) and anti-diagonal
matrices (with 𝑎 = 𝑑 = 0, such as 𝑆 = [0, −1; 1, 0]) map monomial Manin symbols to monomial Manin symbols, up
to a scalar factor. For general matrices (such as 𝑇 = [0, 1, −1, −1] and 𝑇 2 = [−1, −1; 0, 1]) the image of a monomial
Manin symbol is expressed as a formal sum of monomial Manin symbols, with integer coefficients.
class sage.modular.modsym.manin_symbol.ManinSymbol
Bases: Element
A Manin symbol [𝑋 𝑖 𝑌 𝑘−2−𝑖 , (𝑢, 𝑣)].
INPUT:• parent – ManinSymbolList• t – a triple (𝑖, 𝑢, 𝑣) of integers
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,2)
sage: s = ManinSymbol(m,(2,2,3)); s(2,3)
sage: s == loads(dumps(s))
True>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(2))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3))); s(2,3)>>> s == loads(dumps(s))
Truesage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3)); s[X^2*Y^4,(2,3)]101

Modular Symbols, Release 10.4>>> from sage.all import *>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3))); s[X^2*Y^4,(2,3)]
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3))
sage: s.parent()
Manin Symbol List of weight 8 for Gamma0(5)>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3)))>>> s.parent()
Manin Symbol List of weight 8 for Gamma0(5)apply(a, b, c, d)Return the image of self under the matrix [𝑎, 𝑏; 𝑐, 𝑑].
Not implemented for raw ManinSymbol objects, only for members of ManinSymbolLists.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,2)
sage: m.apply(10,[1,0,0,1]) # not implemented for base class>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(2))>>> m.apply(Integer(10),[Integer(1),Integer(0),Integer(0),Integer(1)]) # not␣
˓→implemented for base class

endpoints(N=None)
Return cusps 𝑎𝑙𝑝ℎ𝑎, 𝑏𝑒𝑡𝑎 such that this Manin symbol, viewed as a symbol for level 𝑁 , is 𝑋 𝑖 *𝑌 𝑘−2−𝑖 {𝑎𝑙𝑝ℎ𝑎, 𝑏𝑒𝑡𝑎}.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3)); s[X^2*Y^4,(2,3)]
sage: s.endpoints()(1/3, 1/2)>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0(continues on next page)

102

Chapter 7. Manin symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3))); s[X^2*Y^4,(2,3)]>>> s.endpoints()(1/3, 1/2)ilevel()
Return the level of this Manin symbol.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3))
sage: s.level()
5>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3)))>>> s.level()5

lift_to_sl2z(N=None)
Return a lift of this Manin symbol to 𝑆𝐿2 ( ).
If this Manin symbol is (𝑐, 𝑑) and 𝑁 is its level, this function returns a list [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that defines a 2x2
matrix with determinant 1 and integer entries, such that 𝑐 = 𝑐′ (mod 𝑁 ) and 𝑑 = 𝑑′ (mod 𝑁 ).
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3))
sage: s[X^2*Y^4,(2,3)]
sage: s.lift_to_sl2z()[1, 1, 2, 3]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3)))>>> s[X^2*Y^4,(2,3)]>>> s.lift_to_sl2z()[1, 1, 2, 3]

modular_symbol_rep()
Return a representation of self as a formal sum of modular symbols.
103Modular Symbols, Release 10.4

The result is not cached.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3))
sage: s.modular_symbol_rep()
144*X^6*{1/3, 1/2} - 384*X^5*Y*{1/3, 1/2} + 424*X^4*Y^2*{1/3, 1/2} - 248*X^
˓→3*Y^3*{1/3, 1/2} + 81*X^2*Y^4*{1/3, 1/2} - 14*X*Y^5*{1/3, 1/2} + Y^6*{1/3,␣
˓→1/2}>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3)))>>> s.modular_symbol_rep()
144*X^6*{1/3, 1/2} - 384*X^5*Y*{1/3, 1/2} + 424*X^4*Y^2*{1/3, 1/2} - 248*X^
˓→3*Y^3*{1/3, 1/2} + 81*X^2*Y^4*{1/3, 1/2} - 14*X*Y^5*{1/3, 1/2} + Y^6*{1/3,␣
˓→1/2}

tuple()
Return the 3-tuple (𝑖, 𝑢, 𝑣) of this Manin symbol.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3))
sage: s.tuple()(2, 2, 3)>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3)))>>> s.tuple()(2, 2, 3)uvweight()Return the weight of this Manin symbol.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: s = ManinSymbol(m,(2,2,3))
sage: s.weight()
8104

Chapter 7. Manin symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> s = ManinSymbol(m,(Integer(2),Integer(2),Integer(3)))>>> s.weight()
8sage.modular.modsym.manin_symbol.is_ManinSymbol(x)Return True if x is a ManinSymbol.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol import ManinSymbol, is_ManinSymbol
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(6, 4)
sage: s = ManinSymbol(m, m.symbol_list()[3])sage: s[Y^2,(1,2)]
sage: is_ManinSymbol(s)doctest:warning...
DeprecationWarning: The function is_ManinSymbol is deprecated;
use isinstance(..., ManinSymbol) instead.
See https://github.com/sagemath/sage/issues/38184 for details.
Truesage: is_ManinSymbol(m[3])True>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol import ManinSymbol, is_ManinSymbol>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(6), Integer(4))>>> s = ManinSymbol(m, m.symbol_list()[Integer(3)])>>> s[Y^2,(1,2)]>>> is_ManinSymbol(s)doctest:warning...
DeprecationWarning: The function is_ManinSymbol is deprecated;
use isinstance(..., ManinSymbol) instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True>>> is_ManinSymbol(m[Integer(3)])
True

105

Modular Symbols, Release 10.4

106

Chapter 7. Manin symbols

CHAPTEREIGHTMANIN SYMBOL LISTS

There are various different classes holding lists of Manin symbols of different types. The hierarchy is as follows:• ManinSymbolList– ManinSymbolList_group∗ ManinSymbolList_gamma0∗ ManinSymbolList_gamma1∗ ManinSymbolList_gamma_h– ManinSymbolList_characterclass sage.modular.modsym.manin_symbol_list.ManinSymbolList(weight, lst)
Bases: Parent
Base class for lists of all Manin symbols for a given weight, group or character.
Element
alias of ManinSymbol
apply(j, X)
Apply the matrix 𝑋 = [𝑎, 𝑏; 𝑐, 𝑑] to the 𝑗-th Manin symbol.
Implemented in derived classes.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.apply(10, [1,2,0,1])
Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.apply(Integer(10), [Integer(1),Integer(2),Integer(0),Integer(1)])
Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes

apply_I(j)Apply the matrix 𝐼 = [−1, 0; 0, 1] to the 𝑗-th Manin symbol.
Implemented in derived classes.
107Modular Symbols, Release 10.4

EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.apply_I(10)Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.apply_I(Integer(10))
Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes

apply_S(j)Apply the matrix 𝑆 = [0, −1; 1, 0] to the 𝑗-th Manin symbol.
Implemented in derived classes.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.apply_S(10)Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.apply_S(Integer(10))
Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes

apply_T(j)Apply the matrix 𝑇 = [0, 1; −1, −1] to the 𝑗-th Manin symbol.
Implemented in derived classes.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.apply_T(10)Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.apply_T(Integer(10))(continues on next page)

108

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

(continued from previous page)

Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes

apply_TT(j)Apply the matrix 𝑇 𝑇 = 𝑇 2 = [−1, −1; 0, 1] to the 𝑗-th Manin symbol.
Implemented in derived classes.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.apply_TT(10)Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.apply_TT(Integer(10))
Traceback (most recent call last):...
NotImplementedError: Only implemented in derived classes

index(x)Return the index of x in the list of Manin symbols.
INPUT:• x – a triple of integers (𝑖, 𝑢, 𝑣) defining a valid Manin symbol, which need not be normalized
OUTPUT:
integer – the index of the normalized Manin symbol equivalent to (𝑖, 𝑢, 𝑣). If x is not in self, -1 is returned.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.index(m.symbol_list()[2])2sage: S = m.symbol_list()
sage: all(i == m.index(S[i]) for i in range(len(S)))
True>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.index(m.symbol_list()[Integer(2)])
2>>> S = m.symbol_list()>>> all(i == m.index(S[i]) for i in range(len(S)))
True

list()
Return all the Manin symbols in self as a list.
109

Modular Symbols, Release 10.4

Cached for subsequent calls.
OUTPUT:
A list of ManinSymbol objects, which is a copy of the complete list of Manin symbols.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.manin_symbol_list() # not implemented for the base class>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.manin_symbol_list() # not implemented for the base classsage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(6, 4)
sage: m.manin_symbol_list()[[Y^2,(0,1)],[Y^2,(1,0)],[Y^2,(1,1)],...
[X^2,(3,1)],[X^2,(3,2)]]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(6), Integer(4))>>> m.manin_symbol_list()[[Y^2,(0,1)],[Y^2,(1,0)],[Y^2,(1,1)],...
[X^2,(3,1)],[X^2,(3,2)]]

manin_symbol(i)Return the i-th Manin symbol in this ManinSymbolList.
INPUT:• i – integer, a valid index of a symbol in this list
OUTPUT:
ManinSymbol – the 𝑖’th Manin symbol in the list.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.manin_symbol(3) # not implemented for base class>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.manin_symbol(Integer(3)) # not implemented for base class110

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(6, 4)
sage: s = m.manin_symbol(3); s[Y^2,(1,2)]
sage: type(s)<class sage.modular.modsym.manin_symbol.ManinSymbol >>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(6), Integer(4))>>> s = m.manin_symbol(Integer(3)); s[Y^2,(1,2)]>>> type(s)<class sage.modular.modsym.manin_symbol.ManinSymbol >manin_symbol_list()
Return all the Manin symbols in self as a list.
Cached for subsequent calls.
OUTPUT:
A list of ManinSymbol objects, which is a copy of the complete list of Manin symbols.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.manin_symbol_list() # not implemented for the base class>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.manin_symbol_list() # not implemented for the base classsage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(6, 4)
sage: m.manin_symbol_list()[[Y^2,(0,1)],[Y^2,(1,0)],[Y^2,(1,1)],...
[X^2,(3,1)],[X^2,(3,2)]]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(6), Integer(4))>>> m.manin_symbol_list()[[Y^2,(0,1)],[Y^2,(1,0)],[Y^2,(1,1)],...
[X^2,(3,1)],[X^2,(3,2)]]

normalize(x)111Modular Symbols, Release 10.4

Return a normalized Manin symbol from x.
To be implemented in derived classes.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6,P1List(11))
sage: m.normalize((0,6,7)) # not implemented in base class>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6),P1List(Integer(11)))>>> m.normalize((Integer(0),Integer(6),Integer(7))) # not implemented in base␣˓→class

symbol_list()
Return the list of symbols of self.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList
sage: m = ManinSymbolList(6, P1List(11))>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList>>> m = ManinSymbolList(Integer(6), P1List(Integer(11)))weight()Return the weight of the Manin symbols in this ManinSymbolList.
OUTPUT:
integer – the weight of the Manin symbols in the list.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(6, 4)
sage: m.weight()
4>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(6), Integer(4))>>> m.weight()
4class sage.modular.modsym.manin_symbol_list.ManinSymbolList_character(character,weight)Bases: ManinSymbolList
List of Manin symbols with character.
INPUT:• character – (DirichletCharacter) the Dirichlet character• weight – (integer) the weight
112

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_charactersage: m = ManinSymbolList_character(eps,2); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]sage: m.manin_symbol_list()[(0,1), (1,0), (1,1), (1,2), (1,3), (2,1)]
sage: m == loads(dumps(m))
True>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character>>> m = ManinSymbolList_character(eps,Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]>>> m.manin_symbol_list()[(0,1), (1,0), (1,1), (1,2), (1,3), (2,1)]>>> m == loads(dumps(m))
Trueapply(j, m)Apply the integer matrix 𝑚 = [𝑎, 𝑏; 𝑐, 𝑑] to the 𝑗-th Manin symbol.
INPUT:• j (integer): the index of the symbol to act on.
• m (list of ints): [𝑎, 𝑏, 𝑐, 𝑑] where 𝑚 = [𝑎, 𝑏; 𝑐, 𝑑] is the matrix to be applied.
OUTPUT:
A list of pairs (𝑗, 𝑐𝑖 ), where each 𝑐𝑖 is an integer, 𝑗 is an integer (the 𝑗-th Manin symbol), and the sum 𝑐𝑖 * 𝑥𝑖
is the image of self under the right action of the matrix [𝑎, 𝑏; 𝑐, 𝑑]. Here the right action of 𝑔 = [𝑎, 𝑏; 𝑐, 𝑑] on
a Manin symbol [𝑃 (𝑋, 𝑌 ), (𝑢, 𝑣)] is by definition [𝑃 (𝑎𝑋 + 𝑏𝑌, 𝑐𝑋 + 𝑑𝑌 ), (𝑢, 𝑣) * 𝑔].
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,4)
sage: m[6][X*Y,(0,1)]
sage: m.apply(4, [1,0,0,1])[(4, 1)]
sage: m.apply(1, [-1,0,0,1])[(1, -1)]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(4))>>> m[Integer(6)](continues on next page)113

Modular Symbols, Release 10.4

(continued from previous page)[X*Y,(0,1)]>>> m.apply(Integer(4), [Integer(1),Integer(0),Integer(0),Integer(1)])[(4, 1)]>>> m.apply(Integer(1), [-Integer(1),Integer(0),Integer(0),Integer(1)])[(1, -1)]

apply_I(j)Apply the matrix 𝐼 = [−1, 0, 0, 1] to the 𝑗-th Manin symbol.
INPUT:• j – (integer) a symbol index
OUTPUT:(k, s) where 𝑘 is the index of the symbol obtained by acting on the 𝑗’th symbol with 𝐼, and 𝑠 is the parityof the 𝑗’th symbol.
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,2); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]sage: m.apply_I(4)(2, -1)
sage: [m.apply_I(i) for i in range(len(m))][(0, 1), (1, -1), (4, -1), (3, -1), (2, -1), (5, 1)]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]>>> m.apply_I(Integer(4))(2, -1)>>> [m.apply_I(i) for i in range(len(m))][(0, 1), (1, -1), (4, -1), (3, -1), (2, -1), (5, 1)]apply_S(j)Apply the matrix 𝑆 = [0, 1; −1, 0] to the 𝑗-th Manin symbol.
INPUT:• j – (integer) a symbol index.
OUTPUT:(k, s) where 𝑘 is the index of the symbol obtained by acting on the 𝑗’th symbol with 𝑆, and 𝑠 is the parityof the 𝑗’th symbol.
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)(continues on next page)

114

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

(continued from previous page)

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,2); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]sage: m.apply_S(4)(2, -1)
sage: [m.apply_S(i) for i in range(len(m))][(1, 1), (0, -1), (4, 1), (5, -1), (2, -1), (3, 1)]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]>>> m.apply_S(Integer(4))(2, -1)>>> [m.apply_S(i) for i in range(len(m))][(1, 1), (0, -1), (4, 1), (5, -1), (2, -1), (3, 1)]apply_T(j)Apply the matrix 𝑇 = [0, 1, −1, −1] to the j-th Manin symbol.
INPUT:• j – (integer) a symbol index.
OUTPUT:
A list of pairs (𝑗, 𝑐𝑖 ), where each 𝑐𝑖 is an integer, 𝑗 is an integer (the 𝑗-th Manin symbol), and the sum 𝑐𝑖 * 𝑥𝑖
is the image of self under the right action of the matrix 𝑇 .
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,2); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]sage: m.apply_T(4)[(1, -1)]
sage: [m.apply_T(i) for i in range(len(m))][[(4, 1)], [(0, -1)], [(3, 1)], [(5, 1)], [(1, -1)], [(2, 1)]]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]>>> m.apply_T(Integer(4))[(1, -1)]>>> [m.apply_T(i) for i in range(len(m))][[(4, 1)], [(0, -1)], [(3, 1)], [(5, 1)], [(1, -1)], [(2, 1)]]115

Modular Symbols, Release 10.4

apply_TT(j)Apply the matrix 𝑇 𝑇 = [−1, −1, 0, 1] to the 𝑗-th Manin symbol.
INPUT:• j – (integer) a symbol index
OUTPUT:
A list of pairs (𝑗, 𝑐𝑖 ), where each 𝑐𝑖 is an integer, 𝑗 is an integer (the 𝑗-th Manin symbol), and the sum 𝑐𝑖 * 𝑥𝑖
is the image of self under the right action of the matrix 𝑇 2 .
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,2); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]sage: m.apply_TT(4)[(0, 1)]
sage: [m.apply_TT(i) for i in range(len(m))][[(1, -1)], [(4, -1)], [(5, 1)], [(2, 1)], [(0, 1)], [(3, 1)]]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]>>> m.apply_TT(Integer(4))[(0, 1)]>>> [m.apply_TT(i) for i in range(len(m))][[(1, -1)], [(4, -1)], [(5, 1)], [(2, 1)], [(0, 1)], [(3, 1)]]character()
Return the character of this ManinSymbolList_character object.
OUTPUT:The Dirichlet character of this Manin symbol list.
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,2); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]sage: m.character()
Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_(continues on next page)

116

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

(continued from previous page)

character>>> m = ManinSymbolList_character(eps,Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(4) with character [-1]>>> m.character()
Dirichlet character modulo 4 of conductor 4 mapping 3 |--> -1
˓→index(x)Return the index of a standard Manin symbol equivalent to x, together with a scaling factor.
INPUT:• x – 3-tuple of integers defining an element of this list of Manin symbols, which need not be normalized
OUTPUT:
A pair (i, s) where i is the index of the Manin symbol equivalent to x and s is the scalar (an element of
the base field). If there is no Manin symbol equivalent to x in the list, then (-1, 0) is returned.
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,4); m
Manin Symbol List of weight 4 for Gamma1(4) with character [-1]sage: [m.index(s.tuple()) for s in m.manin_symbol_list()][(0, 1),(1, 1),(2, 1),(3, 1),...
(16, 1),(17, 1)]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(4)); m
Manin Symbol List of weight 4 for Gamma1(4) with character [-1]>>> [m.index(s.tuple()) for s in m.manin_symbol_list()][(0, 1),(1, 1),(2, 1),(3, 1),...
(16, 1),(17, 1)]level()
Return the level of this ManinSymbolList.
OUTPUT:
integer – the level of the symbols in this list.
EXAMPLES:
117

Modular Symbols, Release 10.4

sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: ManinSymbolList_character(eps,4).level()4>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> ManinSymbolList_character(eps,Integer(4)).level()4

normalize(x)Return the normalization of the Manin Symbol x with respect to this list, together with the normalizing scalar.
INPUT:• x – 3-tuple of integers (i,u,v), defining an element of this list of Manin symbols, which need not be
normalized.
OUTPUT:((i,u,v),s), where (i,u,v) is the normalized Manin symbol equivalent to x, and s is the normalizing
scalar.
EXAMPLES:
sage: # needs sage.rings.number_fieldsage: eps = DirichletGroup(4).gen(0)sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→charactersage: m = ManinSymbolList_character(eps,4); m
Manin Symbol List of weight 4 for Gamma1(4) with character [-1]sage: [m.normalize(s.tuple()) for s in m.manin_symbol_list()][((0, 0, 1), 1),((0, 1, 0), 1),((0, 1, 1), 1),...
((2, 1, 3), 1),((2, 2, 1), 1)]>>> from sage.all import *>>> # needs sage.rings.number_field>>> eps = DirichletGroup(Integer(4)).gen(Integer(0))>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_
˓→character>>> m = ManinSymbolList_character(eps,Integer(4)); m
Manin Symbol List of weight 4 for Gamma1(4) with character [-1]>>> [m.normalize(s.tuple()) for s in m.manin_symbol_list()][((0, 0, 1), 1),((0, 1, 0), 1),((0, 1, 1), 1),...
((2, 1, 3), 1),((2, 2, 1), 1)]118

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4class sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma0(level, weight)
Bases: ManinSymbolList_groupClass for Manin symbols for Γ0 (𝑁 ).
INPUT:• level – (integer): the level.
• weight – (integer): the weight.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,2); m
Manin Symbol List of weight 2 for Gamma0(5)sage: m.manin_symbol_list()[(0,1), (1,0), (1,1), (1,2), (1,3), (1,4)]
sage: m = ManinSymbolList_gamma0(6,4); m
Manin Symbol List of weight 4 for Gamma0(6)sage: len(m)36>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(2)); m
Manin Symbol List of weight 2 for Gamma0(5)>>> m.manin_symbol_list()[(0,1), (1,0), (1,1), (1,2), (1,3), (1,4)]>>> m = ManinSymbolList_gamma0(Integer(6),Integer(4)); m
Manin Symbol List of weight 4 for Gamma0(6)>>> len(m)36class sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma1(level, weight)
Bases: ManinSymbolList_groupClass for Manin symbols for Γ1 (𝑁 ).
INPUT:• level – (integer): the level.
• weight – (integer): the weight.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1
sage: m = ManinSymbolList_gamma1(5,2); m
Manin Symbol List of weight 2 for Gamma1(5)sage: m.manin_symbol_list()[(0,1),(0,2),(0,3),...
(4,3),(4,4)]
sage: m = ManinSymbolList_gamma1(6,4); m
Manin Symbol List of weight 4 for Gamma1(6)sage: len(m)(continues on next page)

119

Modular Symbols, Release 10.4

(continued from previous page)72
sage: m == loads(dumps(m))
True>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1>>> m = ManinSymbolList_gamma1(Integer(5),Integer(2)); m
Manin Symbol List of weight 2 for Gamma1(5)>>> m.manin_symbol_list()[(0,1),(0,2),(0,3),...
(4,3),(4,4)]>>> m = ManinSymbolList_gamma1(Integer(6),Integer(4)); m
Manin Symbol List of weight 4 for Gamma1(6)>>> len(m)72>>> m == loads(dumps(m))
Trueclass sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma_h(group, weight)
Bases: ManinSymbolList_groupClass for Manin symbols for Γ𝐻 (𝑁 ).
INPUT:• group – (integer): the congruence subgroup.
• weight – (integer): the weight.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_h
sage: G = GammaH(117, [4])sage: m = ManinSymbolList_gamma_h(G,2); m
Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(117) with H␣
˓→generated by [4]sage: m.manin_symbol_list()[100:110][(1,88),(1,89),(1,90),(1,91),(1,92),(1,93),(1,94),(1,95),(1,96),(1,97)]
sage: len(m.manin_symbol_list())
2016
sage: m == loads(dumps(m))
True

120

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_h>>> G = GammaH(Integer(117), [Integer(4)])>>> m = ManinSymbolList_gamma_h(G,Integer(2)); m
Manin Symbol List of weight 2 for Congruence Subgroup Gamma_H(117) with H␣
˓→generated by [4]>>> m.manin_symbol_list()[Integer(100):Integer(110)][(1,88),(1,89),(1,90),(1,91),(1,92),(1,93),(1,94),(1,95),(1,96),(1,97)]>>> len(m.manin_symbol_list())
2016>>> m == loads(dumps(m))
Truegroup()
Return the group associated to self.
EXAMPLES:
sage: ModularSymbols(GammaH(12, [5]), 2).manin_symbols().group()
Congruence Subgroup Gamma_H(12) with H generated by [5]>>> from sage.all import *>>> ModularSymbols(GammaH(Integer(12), [Integer(5)]), Integer(2)).manin_
˓→symbols().group()
Congruence Subgroup Gamma_H(12) with H generated by [5]class sage.modular.modsym.manin_symbol_list.ManinSymbolList_group(level, weight,
syms)
Bases: ManinSymbolList
Base class for Manin symbol lists for a given group.
INPUT:• level – integer level• weight – integer weight• syms – something with normalize and list methods,
e.g. P1List.
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_group
sage: ManinSymbolList_group(11, 2, P1List(11))<sage.modular.modsym.manin_symbol_list.ManinSymbolList_group_with_category object␣˓→at ...>

121

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_group>>> ManinSymbolList_group(Integer(11), Integer(2), P1List(Integer(11)))<sage.modular.modsym.manin_symbol_list.ManinSymbolList_group_with_category object␣˓→at ...>

apply(j, m)Apply the matrix 𝑚 = [𝑎, 𝑏; 𝑐, 𝑑] to the 𝑗-th Manin symbol.
INPUT:• j – (int) a symbol index• m = [a, b, c, d] a list of 4 integers, which defines a 2x2 matrix
OUTPUT:a list∑︀of pairs (𝑗𝑖 , 𝛼𝑖 ), where each 𝛼𝑖 is a nonzero integer, 𝑗𝑖 is an integer (index of the 𝑗𝑖 -th Manin symbol),and 𝑖 𝛼𝑖 𝑥𝑗𝑖 is the image of the j-th Manin symbol under the right action of the matrix [a,b;c,d]. Here theright action of 𝑔 = [𝑎, 𝑏; 𝑐, 𝑑] on a Manin symbol [𝑃 (𝑋, 𝑌 ), (𝑢, 𝑣)] is [𝑃 (𝑎𝑋 + 𝑏𝑌, 𝑐𝑋 + 𝑑𝑌 ), (𝑢, 𝑣)𝑔].
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply(40, [2,3,1,1])[(0, 729), (6, 2916), (12, 4860), (18, 4320),(24, 2160), (30, 576), (36, 64)]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> m.apply(Integer(40), [Integer(2),Integer(3),Integer(1),Integer(1)])[(0, 729), (6, 2916), (12, 4860), (18, 4320),(24, 2160), (30, 576), (36, 64)]

apply_I(j)Apply the matrix 𝐼 = [−1, 0, 0, 1] to the 𝑗-th Manin symbol.
INPUT:• j – (int) a symbol index
OUTPUT:(k, s) where k is the index of the symbol obtained by acting on the 𝑗’th symbol with 𝐼, and 𝑠 is the parityof the 𝑗’th symbol (a Python int, either 1 or -1)
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply_I(4)(3, 1)
sage: [m.apply_I(i) for i in range(10)][(0, 1),(1, 1),(5, 1),(4, 1),(3, 1),(continues on next page)

122

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

(continued from previous page)(2, 1),(6, -1),(7, -1),(11, -1),(10, -1)]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> m.apply_I(Integer(4))(3, 1)>>> [m.apply_I(i) for i in range(Integer(10))][(0, 1),(1, 1),(5, 1),(4, 1),(3, 1),(2, 1),(6, -1),(7, -1),(11, -1),(10, -1)]

apply_S(j)Apply the matrix 𝑆 = [0, −1; 1, 0] to the 𝑗-th Manin symbol.
INPUT:• j – (int) a symbol index
OUTPUT:(k, s) where k is the index of the symbol obtained by acting on the 𝑗’th symbol with 𝑆, and 𝑠 is the parityof the 𝑗’th symbol (a Python int, either 1 or -1).
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply_S(4)(40, 1)
sage: [m.apply_S(i) for i in range(len(m))][(37, 1),(36, 1),(41, 1),(39, 1),(40, 1),(38, 1),(31, -1),(30, -1),(35, -1),(33, -1),(34, -1),(32, -1),...
(4, 1),(2, 1)]

123

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> m.apply_S(Integer(4))(40, 1)>>> [m.apply_S(i) for i in range(len(m))][(37, 1),(36, 1),(41, 1),(39, 1),(40, 1),(38, 1),(31, -1),(30, -1),(35, -1),(33, -1),(34, -1),(32, -1),...
(4, 1),(2, 1)]

apply_T(j)Apply the matrix 𝑇 = [0, 1, −1, −1] to the 𝑗-th Manin symbol.
INPUT:• j – (int) a symbol index
OUTPUT: see documentation for apply()
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply_T(4)[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)]
sage: [m.apply_T(i) for i in range(10)][[(5, 1), (11, -6), (17, 15), (23, -20), (29, 15), (35, -6), (41, 1)],[(0, 1), (6, -6), (12, 15), (18, -20), (24, 15), (30, -6), (36, 1)],[(4, 1), (10, -6), (16, 15), (22, -20), (28, 15), (34, -6), (40, 1)],[(2, 1), (8, -6), (14, 15), (20, -20), (26, 15), (32, -6), (38, 1)],[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)],[(1, 1), (7, -6), (13, 15), (19, -20), (25, 15), (31, -6), (37, 1)],[(5, 1), (11, -5), (17, 10), (23, -10), (29, 5), (35, -1)],[(0, 1), (6, -5), (12, 10), (18, -10), (24, 5), (30, -1)],[(4, 1), (10, -5), (16, 10), (22, -10), (28, 5), (34, -1)],[(2, 1), (8, -5), (14, 10), (20, -10), (26, 5), (32, -1)]]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> m.apply_T(Integer(4))[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)]>>> [m.apply_T(i) for i in range(Integer(10))][[(5, 1), (11, -6), (17, 15), (23, -20), (29, 15), (35, -6), (41, 1)],[(0, 1), (6, -6), (12, 15), (18, -20), (24, 15), (30, -6), (36, 1)],[(4, 1), (10, -6), (16, 15), (22, -20), (28, 15), (34, -6), (40, 1)],
(continues on next page)

124

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4

(continued from previous page)[(2, 1), (8, -6), (14, 15), (20, -20), (26, 15), (32, -6), (38, 1)],[(3, 1), (9, -6), (15, 15), (21, -20), (27, 15), (33, -6), (39, 1)],[(1, 1), (7, -6), (13, 15), (19, -20), (25, 15), (31, -6), (37, 1)],[(5, 1), (11, -5), (17, 10), (23, -10), (29, 5), (35, -1)],[(0, 1), (6, -5), (12, 10), (18, -10), (24, 5), (30, -1)],[(4, 1), (10, -5), (16, 10), (22, -10), (28, 5), (34, -1)],[(2, 1), (8, -5), (14, 10), (20, -10), (26, 5), (32, -1)]]

apply_TT(j)Apply the matrix 𝑇 𝑇 = [−1, −1, 0, 1] to the 𝑗-th Manin symbol.
INPUT:• j – (int) a symbol index
OUTPUT: see documentation for apply()
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: m.apply_TT(4)[(38, 1)]
sage: [m.apply_TT(i) for i in range(10)][[(37, 1)],[(41, 1)],[(39, 1)],[(40, 1)],[(38, 1)],[(36, 1)],[(31, -1), (37, 1)],[(35, -1), (41, 1)],[(33, -1), (39, 1)],[(34, -1), (40, 1)]]>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> m.apply_TT(Integer(4))[(38, 1)]>>> [m.apply_TT(i) for i in range(Integer(10))][[(37, 1)],[(41, 1)],[(39, 1)],[(40, 1)],[(38, 1)],[(36, 1)],[(31, -1), (37, 1)],[(35, -1), (41, 1)],[(33, -1), (39, 1)],[(34, -1), (40, 1)]]level()
Return the level of this ManinSymbolList.
EXAMPLES:

125

Modular Symbols, Release 10.4

sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: ManinSymbolList_gamma0(5,2).level()
5>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> ManinSymbolList_gamma0(Integer(5),Integer(2)).level()5
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1
sage: ManinSymbolList_gamma1(51,2).level()
51>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1>>> ManinSymbolList_gamma1(Integer(51),Integer(2)).level()51
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_
˓→hsage: ManinSymbolList_gamma_h(GammaH(117, [4]),2).level()
117>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma_h>>> ManinSymbolList_gamma_h(GammaH(Integer(117), [Integer(4)]),Integer(2)).
˓→level()117

normalize(x)Return the normalization of the Manin symbol x with respect to this list.
INPUT:• x – (3-tuple of ints) a tuple defining a ManinSymbol
OUTPUT:(i,u,v) – (3-tuple of ints) another tuple defining the associated normalized ManinSymbol
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: m = ManinSymbolList_gamma0(5,8)
sage: [m.normalize(s.tuple()) for s in m.manin_symbol_list()][:10][(0, 0, 1),(0, 1, 0),(0, 1, 1),(0, 1, 2),(0, 1, 3),(0, 1, 4),(1, 0, 1),(1, 1, 0),(1, 1, 1),(1, 1, 2)]126

Chapter 8. Manin symbol lists

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> m = ManinSymbolList_gamma0(Integer(5),Integer(8))>>> [m.normalize(s.tuple()) for s in m.manin_symbol_list()][:Integer(10)][(0, 0, 1),(0, 1, 0),(0, 1, 1),(0, 1, 2),(0, 1, 3),(0, 1, 4),(1, 0, 1),(1, 1, 0),(1, 1, 1),(1, 1, 2)]127Modular Symbols, Release 10.4

128

Chapter 8. Manin symbol lists

CHAPTERNINESPACE OF BOUNDARY MODULAR SYMBOLS

Used mainly for computing the cuspidal subspace of modular symbols. The space of boundary symbols of sign 0 is
isomorphic as a Hecke module to the dual of the space of Eisenstein series, but this does not give a useful method ofcomputing Eisenstein series, since there is no easy way to extract the constant terms.
We represent boundary modular symbols as a sum of Manin symbols of the form [𝑃, 𝑢/𝑣], where 𝑢/𝑣 is a cusp for ourgroup 𝐺. The group of boundary modular symbols naturally embeds into a vector space 𝐵𝑘 (𝐺) (see Stein, section 8.4, orMerel, section 1.4, where this space is called C[Γ∖ ]𝑘 , for a definition), which is a finite dimensional vector space, ofdimension equal to the number of cusps for 𝐺 (if 𝑘 is even), or the number of regular cusps (if 𝑘 is odd). The embedding
takes [𝑃, 𝑢/𝑣] to 𝑃 (𝑢, 𝑣) · [(𝑢, 𝑣)]. We represent the basis vectors by pairs [(𝑢, 𝑣)] with u, v coprime. On 𝐵𝑘 (𝐺), we
have the relations[𝛾 · (𝑢, 𝑣)] = [(𝑢, 𝑣)]
for all 𝛾 ∈ 𝐺 and[(𝜆𝑢, 𝜆𝑣)] = sign(𝜆)𝑘 [(𝑢, 𝑣)]
for all 𝜆 ∈×.

It’s possible for these relations to kill a class, i.e., for a pair [(𝑢, 𝑣)] to be 0. For example, when 𝑁 = 4 and 𝑘 = 3 then(−1, −2) is equivalent mod Γ1 (4) to (1, 2) since 2 = −2 mod 4 and 1 = −1 mod 2. But since 𝑘 is odd, [(−1, −2)] is
also equivalent to −[(1, 2)]. Thus this symbol is equivalent to its negative, hence 0 (notice that this wouldn’t be the casein characteristic 2). This happens for any irregular cusp when the weight is odd; there are no irregular cusps on Γ1 (𝑁 )except when 𝑁 = 4, but there can be more on Γ𝐻 groups. See also prop 2.30 of Stein’s Ph.D. thesis.
In addition, in the case that our space is of sign 𝜎 = 1 or −1, we also have the relation [(−𝑢, 𝑣)] = 𝜎 · [(𝑢, 𝑣)]. This
relation can also combine with the above to kill a cusp class - for instance, take (u,v) = (1,3) for Γ1 (5). Then since thecusp 13 is Γ1 (5)-equivalent to the cusp − 13 , we have that [(1, 3)] = [(−1, 3)]. Now, on the minus subspace, we also havethat [(−1, 3)] = −[(1, 3)], which means this class must vanish. Notice that this cannot be used to show that [(1, 0)] or[(0, 1)] is 0.
Note: Special care must be taken when working with the images of the cusps 0 and ∞ in 𝐵𝑘 (𝐺). For all cusps except
0 and ∞, multiplying the cusp by -1 corresponds to taking [(𝑢, 𝑣)] to [(−𝑢, 𝑣)] in 𝐵𝑘 (𝐺). This means that [(𝑢, 𝑣)] is
equivalent to [(−𝑢, 𝑣)] whenever 𝑢𝑣 is equivalent to − 𝑢𝑣 , except in the case of 0 and ∞. We have the following conditions
for [(1, 0)] and [(0, 1)]:
• [(0, 1)] = 𝜎 · [(0, 1)], so [(0, 1)] is 0 exactly when 𝜎 = −1.
• [(1, 0)] = 𝜎 · [(−1, 0)] and [(1, 0)] = (−1)𝑘 [(−1, 0)], so [(1, 0)] = 0 whenever 𝜎 ̸= (−1)𝑘 .

Note: For all the spaces of boundary symbols below, no work is done to determine the cusps for G at creation time.
Instead, cusps are added as they are discovered in the course of computation. As a result, the rank of a space can change
129Modular Symbols, Release 10.4

as a computation proceeds.
REFERENCES:• Merel, “Universal Fourier expansions of modular forms.” Springer LNM 1585 (1994), pg. 59-95.
• Stein, “Modular Forms, a computational approach.” AMS (2007).
class sage.modular.modsym.boundary.BoundarySpace(group=Modular Group SL(2, Z), weight=2,
sign=0, base_ring=Rational Field,
character=None)
Bases: HeckeModule_genericSpace of boundary symbols for a congruence subgroup of SL_2(Z).
This class is an abstract base class, so only derived classes should be instantiated.
INPUT:• weight – int, the weight• group – arithgroup.congroup_generic.CongruenceSubgroup, a congruence subgroup.
• sign – int, either -1, 0, or 1
• base_ring – rings.Ring (defaults to the rational numbers)
EXAMPLES:
sage: B = ModularSymbols(Gamma0(11),2).boundary_space()sage: isinstance(B, sage.modular.modsym.boundary.BoundarySpace)True
sage: B == loads(dumps(B))
True>>> from sage.all import *>>> B = ModularSymbols(Gamma0(Integer(11)),Integer(2)).boundary_space()>>> isinstance(B, sage.modular.modsym.boundary.BoundarySpace)
True>>> B == loads(dumps(B))
Truecharacter()
Return the Dirichlet character associated to this space of boundary modular symbols.
EXAMPLES:
sage: ModularSymbols(DirichletGroup(7).0, 6).boundary_space().character()
Dirichlet character modulo 7 of conductor 7 mapping 3 |--> zeta6>>> from sage.all import *>>> ModularSymbols(DirichletGroup(Integer(7)).gen(0), Integer(6)).boundary_
˓→space().character()
Dirichlet character modulo 7 of conductor 7 mapping 3 |--> zeta6

free_module()
Return the underlying free module for self.
EXAMPLES:

130

Chapter 9. Space of boundary modular symbols

Modular Symbols, Release 10.4

sage: B = ModularSymbols(Gamma1(7), 5, sign=-1).boundary_space()sage: B.free_module()
Sparse vector space of dimension 0 over Rational Field
sage: x = B(Cusp(0)) ; y = B(Cusp(1/7)) ; B.free_module()
Sparse vector space of dimension 1 over Rational Field>>> from sage.all import *>>> B = ModularSymbols(Gamma1(Integer(7)), Integer(5), sign=-Integer(1)).
˓→boundary_space()>>> B.free_module()
Sparse vector space of dimension 0 over Rational Field>>> x = B(Cusp(Integer(0))) ; y = B(Cusp(Integer(1)/Integer(7))) ; B.free_˓→module()
Sparse vector space of dimension 1 over Rational Fieldgen(i=0)
Return the i-th generator of this space.
EXAMPLES:
sage: B = ModularSymbols(Gamma0(24), 4).boundary_space()sage: B.gen(0)Traceback (most recent call last):...
ValueError: only 0 generators known for Space of Boundary Modular Symbols for␣
˓→Congruence Subgroup Gamma0(24) of weight 4 over Rational Field
sage: B(Cusp(1/3))[1/3]
sage: B.gen(0)[1/3]>>> from sage.all import *>>> B = ModularSymbols(Gamma0(Integer(24)), Integer(4)).boundary_space()>>> B.gen(Integer(0))
Traceback (most recent call last):...
ValueError: only 0 generators known for Space of Boundary Modular Symbols for␣
˓→Congruence Subgroup Gamma0(24) of weight 4 over Rational Field>>> B(Cusp(Integer(1)/Integer(3)))[1/3]>>> B.gen(Integer(0))[1/3]group()
Return the congruence subgroup associated to this space of boundary modular symbols.
EXAMPLES:
sage: ModularSymbols(GammaH(14,[9]), 2).boundary_space().group()
Congruence Subgroup Gamma_H(14) with H generated by [9]>>> from sage.all import *>>> ModularSymbols(GammaH(Integer(14),[Integer(9)]), Integer(2)).boundary_
˓→space().group()
Congruence Subgroup Gamma_H(14) with H generated by [9]131Modular Symbols, Release 10.4

is_ambient()
Return True if self is a space of boundary symbols associated to an ambient space of modular symbols.
EXAMPLES:
sage: M = ModularSymbols(Gamma1(6), 4)
sage: M.is_ambient()
True
sage: M.boundary_space().is_ambient()True>>> from sage.all import *>>> M = ModularSymbols(Gamma1(Integer(6)), Integer(4))>>> M.is_ambient()
True>>> M.boundary_space().is_ambient()Truerank()The rank of the space generated by boundary symbols that have been found so far in the course of computing
the boundary map.
Warning: This number may change as more elements are coerced into this space!! (This is an implementation detail that will likely change.)
EXAMPLES:
sage: M = ModularSymbols(Gamma0(72), 2) ; B = M.boundary_space()sage: B.rank()0sage: _ = [ B(x) for x in M.basis() ]sage: B.rank()
16>>> from sage.all import *>>> M = ModularSymbols(Gamma0(Integer(72)), Integer(2)) ; B = M.boundary_
˓→space()>>> B.rank()0>>> _ = [ B(x) for x in M.basis() ]>>> B.rank()
16

Test that Issue #7837 is fixed:
sage: ModularSymbols(Gamma1(4),7).boundary_map().codomain().dimension()2
sage: ModularSymbols(Gamma1(4),7, sign=1).boundary_map().codomain().
˓→dimension()1
sage: ModularSymbols(Gamma1(4),7, sign=-1).boundary_map().codomain().
˓→dimension()
1132

Chapter 9. Space of boundary modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(4)),Integer(7)).boundary_map().codomain().
˓→dimension()2>>> ModularSymbols(Gamma1(Integer(4)),Integer(7), sign=Integer(1)).boundary_
˓→map().codomain().dimension()1>>> ModularSymbols(Gamma1(Integer(4)),Integer(7), sign=-Integer(1)).boundary_
˓→map().codomain().dimension()1sign()
Return the sign of the complex conjugation involution on this space of boundary modular symbols.
EXAMPLES:
sage: ModularSymbols(13,2,sign=-1).boundary_space().sign()-1>>> from sage.all import *>>> ModularSymbols(Integer(13),Integer(2),sign=-Integer(1)).boundary_space().
˓→sign()-1weight()Return the weight of this space of boundary modular symbols.
EXAMPLES:
sage: ModularSymbols(Gamma1(9), 5).boundary_space().weight()
5>>> from sage.all import *>>> ModularSymbols(Gamma1(Integer(9)), Integer(5)).boundary_space().weight()
5class sage.modular.modsym.boundary.BoundarySpaceElement(parent, x)
Bases: HeckeModuleElement
Create a boundary symbol.
INPUT:• parent – BoundarySpace; a space of boundary modular symbols• x – a dict with integer keys and values in the base field of parent.
EXAMPLES:
sage: B = ModularSymbols(Gamma0(32), sign=-1).boundary_space()sage: B(Cusp(1,8))[1/8]
sage: B.0
[1/8]
sage: type(B.0)<class sage.modular.modsym.boundary.BoundarySpaceElement >133

Modular Symbols, Release 10.4>>> from sage.all import *>>> B = ModularSymbols(Gamma0(Integer(32)), sign=-Integer(1)).boundary_space()>>> B(Cusp(Integer(1),Integer(8)))[1/8]>>> B.gen(0)[1/8]>>> type(B.gen(0))<class sage.modular.modsym.boundary.BoundarySpaceElement >coordinate_vector()
Return self as a vector on the QQ-vector space with basis self.parent()._known_cusps().
EXAMPLES:
sage: B = ModularSymbols(18,4,sign=1).boundary_space()sage: x = B(Cusp(1/2)) ; x[1/2]
sage: x.coordinate_vector()(1)
sage: ((18/5)*x).coordinate_vector()(18/5)
sage: B(Cusp(0))[0]sage: x.coordinate_vector()(1)
sage: x = B(Cusp(1/2)) ; x[1/2]
sage: x.coordinate_vector()(1, 0)>>> from sage.all import *>>> B = ModularSymbols(Integer(18),Integer(4),sign=Integer(1)).boundary_
˓→space()>>> x = B(Cusp(Integer(1)/Integer(2))) ; x[1/2]>>> x.coordinate_vector()(1)>>> ((Integer(18)/Integer(5))*x).coordinate_vector()(18/5)>>> B(Cusp(Integer(0)))[0]>>> x.coordinate_vector()(1)>>> x = B(Cusp(Integer(1)/Integer(2))) ; x[1/2]>>> x.coordinate_vector()(1, 0)

class sage.modular.modsym.boundary.BoundarySpace_wtk_eps(eps, weight, sign=0)
Bases: BoundarySpaceSpace of boundary modular symbols with given weight, character, and sign.
INPUT:• eps – dirichlet.DirichletCharacter, the “Nebentypus” character.
• weight – int, the weight = 2

134

Chapter 9. Space of boundary modular symbols

Modular Symbols, Release 10.4

• sign – int, either -1, 0, or 1
EXAMPLES:
sage: B = ModularSymbols(DirichletGroup(6).0, 4).boundary_space() ; B
Boundary Modular Symbols space of level 6, weight 4, character [-1] and dimension␣˓→0 over Rational Field
sage: type(B)<class sage.modular.modsym.boundary.BoundarySpace_wtk_eps_with_category >sage: B == loads(dumps(B))
True>>> from sage.all import *>>> B = ModularSymbols(DirichletGroup(Integer(6)).gen(0), Integer(4)).boundary_
˓→space() ; B
Boundary Modular Symbols space of level 6, weight 4, character [-1] and dimension␣˓→0 over Rational Field>>> type(B)<class sage.modular.modsym.boundary.BoundarySpace_wtk_eps_with_category >>>> B == loads(dumps(B))
Trueclass sage.modular.modsym.boundary.BoundarySpace_wtk_g0(level, weight, sign, F)
Bases: BoundarySpace
Initialize a space of boundary symbols of weight k for Gamma_0(N) over base field F.
INPUT:• level – int, the level• weight – integer weight = 2.
• sign – int, either -1, 0, or 1
• F – field
EXAMPLES:
sage: B = ModularSymbols(Gamma0(2), 5).boundary_space()sage: type(B)<class sage.modular.modsym.boundary.BoundarySpace_wtk_g0_with_category >sage: B == loads(dumps(B))
True>>> from sage.all import *>>> B = ModularSymbols(Gamma0(Integer(2)), Integer(5)).boundary_space()>>> type(B)<class sage.modular.modsym.boundary.BoundarySpace_wtk_g0_with_category >>>> B == loads(dumps(B))
Trueclass sage.modular.modsym.boundary.BoundarySpace_wtk_g1(level, weight, sign, F)
Bases: BoundarySpace
Initialize a space of boundary modular symbols for Gamma1(N).
INPUT:• level – int, the level• weight – int, the weight = 2135

Modular Symbols, Release 10.4

• sign – int, either -1, 0, or 1
• F – base ring
EXAMPLES:
sage: from sage.modular.modsym.boundary import BoundarySpace_wtk_g1
sage: B = BoundarySpace_wtk_g1(17, 2, 0, QQ) ; B
Boundary Modular Symbols space for Gamma_1(17) of weight 2 over Rational Field
sage: B == loads(dumps(B))
True>>> from sage.all import *>>> from sage.modular.modsym.boundary import BoundarySpace_wtk_g1>>> B = BoundarySpace_wtk_g1(Integer(17), Integer(2), Integer(0), QQ) ; B
Boundary Modular Symbols space for Gamma_1(17) of weight 2 over Rational Field>>> B == loads(dumps(B))
Trueclass sage.modular.modsym.boundary.BoundarySpace_wtk_gamma_h(group, weight, sign, F)
Bases: BoundarySpace
Initialize a space of boundary modular symbols for GammaH(N).
INPUT:• group – congruence subgroup Gamma_H(N).
• weight – int, the weight = 2• sign – int, either -1, 0, or 1
• F – base ring
EXAMPLES:
sage: from sage.modular.modsym.boundary import BoundarySpace_wtk_gamma_h
sage: B = BoundarySpace_wtk_gamma_h(GammaH(13,[3]), 2, 0, QQ) ; B
Boundary Modular Symbols space for Congruence Subgroup Gamma_H(13) with H␣
˓→generated by [3] of weight 2 over Rational Field
sage: B == loads(dumps(B))
True>>> from sage.all import *>>> from sage.modular.modsym.boundary import BoundarySpace_wtk_gamma_h>>> B = BoundarySpace_wtk_gamma_h(GammaH(Integer(13),[Integer(3)]), Integer(2),␣
˓→Integer(0), QQ) ; B
Boundary Modular Symbols space for Congruence Subgroup Gamma_H(13) with H␣
˓→generated by [3] of weight 2 over Rational Field>>> B == loads(dumps(B))
True

A test case from Issue #6072:
sage: ModularSymbols(GammaH(8,[5]), 3).boundary_map()
Hecke module morphism boundary map defined by the matrix[-1 0 0 0]
[ 0 -1 0 0]
[ 0 0 -1 0][ 0 0 0 -1](continues on next page)

136

Chapter 9. Space of boundary modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

Domain: Modular Symbols space of dimension 4 for Congruence Subgroup ...
Codomain: Boundary Modular Symbols space for Congruence Subgroup Gamma_H(8) ...
>>> from sage.all import *>>> ModularSymbols(GammaH(Integer(8),[Integer(5)]), Integer(3)).boundary_map()
Hecke module morphism boundary map defined by the matrix[-1 0 0 0]
[ 0 -1 0 0]
[ 0 0 -1 0][ 0 0 0 -1]
Domain: Modular Symbols space of dimension 4 for Congruence Subgroup ...
Codomain: Boundary Modular Symbols space for Congruence Subgroup Gamma_H(8) ...

137

Modular Symbols, Release 10.4

138

Chapter 9. Space of boundary modular symbols

CHAPTERTENHEILBRONN MATRIX COMPUTATION

class sage.modular.modsym.heilbronn.Heilbronn
Bases: object
apply(u, v, N)
Return a list of pairs ((𝑐, 𝑑), 𝑚), which is obtained as follows:
1) Compute the images (𝑎, 𝑏) of the vector (𝑢, 𝑣) (mod 𝑁 ) acted on by each of the HeilbronnCremonamatrices in self.
2) Reduce each (𝑎, 𝑏) to canonical form (𝑐, 𝑑) using p1normalize.
3) Sort.
4) Create the list ((𝑐, 𝑑), 𝑚), where 𝑚 is the number of times that (𝑐, 𝑑) appears in the list created in steps
1-3 above. Note that the pairs ((𝑐, 𝑑), 𝑚) are sorted lexicographically by (𝑐, 𝑑).
INPUT:• u, v, N – integers
OUTPUT: list
EXAMPLES:
sage: H = sage.modular.modsym.heilbronn.HeilbronnCremona(2); H
The Cremona-Heilbronn matrices of determinant 2
sage: H.apply(1,2,7)[((1, 1), 1), ((1, 4), 1), ((1, 5), 1), ((1, 6), 1)]>>> from sage.all import *>>> H = sage.modular.modsym.heilbronn.HeilbronnCremona(Integer(2)); H
The Cremona-Heilbronn matrices of determinant 2>>> H.apply(Integer(1),Integer(2),Integer(7))[((1, 1), 1), ((1, 4), 1), ((1, 5), 1), ((1, 6), 1)]

to_list()Return the list of Heilbronn matrices corresponding to self.
Each matrix is given as a list of four integers.
EXAMPLES:
sage: H = HeilbronnCremona(2); H
The Cremona-Heilbronn matrices of determinant 2
sage: H.to_list()[[1, 0, 0, 2], [2, 0, 0, 1], [2, 1, 0, 1], [1, 0, 1, 2]]139

Modular Symbols, Release 10.4>>> from sage.all import *>>> H = HeilbronnCremona(Integer(2)); H
The Cremona-Heilbronn matrices of determinant 2>>> H.to_list()[[1, 0, 0, 2], [2, 0, 0, 1], [2, 1, 0, 1], [1, 0, 1, 2]]class sage.modular.modsym.heilbronn.HeilbronnCremonaBases: Heilbronn
Create the list of Heilbronn-Cremona matrices of determinant 𝑝.
EXAMPLES:
sage: H = HeilbronnCremona(3) ; H
The Cremona-Heilbronn matrices of determinant 3
sage: H.to_list()[[1, 0, 0, 3],[3, 1, 0, 1],[1, 0, 1, 3],[3, 0, 0, 1],[3, -1, 0, 1],[-1, 0, 1, -3]]>>> from sage.all import *>>> H = HeilbronnCremona(Integer(3)) ; H
The Cremona-Heilbronn matrices of determinant 3>>> H.to_list()[[1, 0, 0, 3],[3, 1, 0, 1],[1, 0, 1, 3],[3, 0, 0, 1],[3, -1, 0, 1],[-1, 0, 1, -3]]pclass sage.modular.modsym.heilbronn.HeilbronnMerel
Bases: Heilbronn
Initialize the list of Merel-Heilbronn matrices of determinant 𝑛.
EXAMPLES:
sage: H = HeilbronnMerel(3) ; H
The Merel-Heilbronn matrices of determinant 3
sage: H.to_list()[[1, 0, 0, 3],[1, 0, 1, 3],[1, 0, 2, 3],[2, 1, 1, 2],[3, 0, 0, 1],[3, 1, 0, 1],[3, 2, 0, 1]]>>> from sage.all import *>>> H = HeilbronnMerel(Integer(3)) ; H
The Merel-Heilbronn matrices of determinant 3(continues on next page)

140

Chapter 10. Heilbronn matrix computation

Modular Symbols, Release 10.4

(continued from previous page)>>> H.to_list()[[1, 0, 0, 3],[1, 0, 1, 3],[1, 0, 2, 3],[2, 1, 1, 2],[3, 0, 0, 1],[3, 1, 0, 1],[3, 2, 0, 1]]nsage.modular.modsym.heilbronn.hecke_images_gamma0_weight2(u, v, N, indices, R)
INPUT:• u, v, N – integers so that gcd(𝑢, 𝑣, 𝑁 ) = 1• indices – a list of positive integers• R – matrix overthat writes each elements of P1 = P1List(𝑁 ) in terms of a subset of P1.

OUTPUT: a dense matrix whose columns are the images 𝑇𝑛 (𝑥) for 𝑛 in indices and 𝑥 the Manin symbol (𝑢, 𝑣),
expressed in terms of the basis.
EXAMPLES:
sage: M = ModularSymbols(23,2,1)
sage: A = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight2(1,0,23,[1..6],
˓→M.manin_gens_to_basis())
sage: rowsA = A.rows()
sage: z = M((1,0))
sage: all(M.T(n)(z).element() == rowsA[n-1] for n in [1..6])True>>> from sage.all import *>>> M = ModularSymbols(Integer(23),Integer(2),Integer(1))>>> A = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight2(Integer(1),˓→Integer(0),Integer(23),(ellipsis_range(Integer(1),Ellipsis,Integer(6))),M.manin_
˓→gens_to_basis())>>> rowsA = A.rows()>>> z = M((Integer(1),Integer(0)))>>> all(M.T(n)(z).element() == rowsA[n-Integer(1)] for n in (ellipsis_
˓→range(Integer(1),Ellipsis,Integer(6))))True

sage.modular.modsym.heilbronn.hecke_images_gamma0_weight_k(u, v, i, N, k, indices, R)
INPUT:• u, v, N – integers so that gcd(𝑢, 𝑣, 𝑁 ) = 1• i – integer with 0 ≤ 𝑖 ≤ 𝑘 − 2• k – weight• indices – a list of positive integers• R – matrix overthat writes each elements of P1 = P1List(𝑁 ) in terms of a subset of P1.

OUTPUT: a dense matrix with rational entries whose columns are the images 𝑇𝑛 (𝑥) for 𝑛 in indices and 𝑥 theManin symbol [𝑋 𝑖 * 𝑌 (𝑘−2−𝑖) , (𝑢, 𝑣)], expressed in terms of the basis.
EXAMPLES:141

Modular Symbols, Release 10.4

sage: M = ModularSymbols(15,6,sign=-1)
sage: R = M.manin_gens_to_basis()
sage: a,b,c = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight_k(4,1,3,15,
˓→6,[1,11,12], R)
sage: x = M((3,4,1)) ; x.element() == aTruesage: M.T(11)(x).element() == b
True
sage: M.T(12)(x).element() == c
True>>> from sage.all import *>>> M = ModularSymbols(Integer(15),Integer(6),sign=-Integer(1))>>> R = M.manin_gens_to_basis()>>> a,b,c = sage.modular.modsym.heilbronn.hecke_images_gamma0_weight_k(Integer(4),˓→Integer(1),Integer(3),Integer(15),Integer(6),[Integer(1),Integer(11),
˓→Integer(12)], R)>>> x = M((Integer(3),Integer(4),Integer(1))) ; x.element() == aTrue>>> M.T(Integer(11))(x).element() == b
True>>> M.T(Integer(12))(x).element() == cTruesage.modular.modsym.heilbronn.hecke_images_nonquad_character_weight2(u, v, N,
indices, chi,R)
Return images of the Hecke operators 𝑇𝑛 for 𝑛 in the list indices, where 𝜒 must be a quadratic Dirichlet characterwith values in .
𝑅 is assumed to be the relation matrix of a weight modular symbols space overwith character 𝜒.

INPUT:• u, v, N – integers so that gcd(𝑢, 𝑣, 𝑁 ) = 1• indices – a list of positive integers• chi – a Dirichlet character that takes values in a nontrivial extension of• R – matrix over.

that writes each elements of P1 = P1List(𝑁 ) in terms of a subset of P1.

OUTPUT: a dense matrix with entries in the field (𝜒) (the values of 𝜒) whose columns are the images 𝑇𝑛 (𝑥) for𝑛 in indices and 𝑥 the Manin symbol (𝑢, 𝑣), expressed in terms of the basis.
EXAMPLES:
sage: chi = DirichletGroup(13).0^2
sage: M = ModularSymbols(chi)sage: eps = M.character()sage: R = M.manin_gens_to_basis()
sage: sage.modular.modsym.heilbronn.hecke_images_nonquad_character_weight2(1,0,13,
˓→[1,2,6],eps,R)
[
1
0
0
0]
[
zeta6 + 2
00-1][
7 -2*zeta6 + 1-zeta6 - 1-2*zeta6]
sage: x = M((1,0)); x.element()(1, 0, 0, 0)
sage: M.T(2)(x).element()(continues on next page)

142

Chapter 10. Heilbronn matrix computation

Modular Symbols, Release 10.4

(continued from previous page)(zeta6 + 2, 0, 0, -1)
sage: M.T(6)(x).element()(7, -2*zeta6 + 1, -zeta6 - 1, -2*zeta6)>>> from sage.all import *>>> chi = DirichletGroup(Integer(13)).gen(0)**Integer(2)>>> M = ModularSymbols(chi)>>> eps = M.character()>>> R = M.manin_gens_to_basis()>>> sage.modular.modsym.heilbronn.hecke_images_nonquad_character_˓→weight2(Integer(1),Integer(0),Integer(13),[Integer(1),Integer(2),Integer(6)],˓→eps,R)
[
1
0
0
0]
[
zeta6 + 2
00-1][
7 -2*zeta6 + 1-zeta6 - 1-2*zeta6]>>> x = M((Integer(1),Integer(0))); x.element()(1, 0, 0, 0)>>> M.T(Integer(2))(x).element()(zeta6 + 2, 0, 0, -1)>>> M.T(Integer(6))(x).element()(7, -2*zeta6 + 1, -zeta6 - 1, -2*zeta6)

sage.modular.modsym.heilbronn.hecke_images_quad_character_weight2(u, v, N, indices,chi, R)INPUT:• u, v, N – integers so that gcd(𝑢, 𝑣, 𝑁 ) = 1• indices – a list of positive integers• chi – a Dirichlet character that takes values in• R – matrix over(𝜒) that writes each elements of P1 = P1List(𝑁 ) in terms of a subset of P1.

OUTPUT: a dense matrix with entries in the rational field (the values of 𝜒) whose columns are the images 𝑇𝑛 (𝑥)for 𝑛 in indices and 𝑥 the Manin symbol (𝑢, 𝑣), expressed in terms of the basis.
EXAMPLES:
sage: chi = DirichletGroup(29,QQ).0
sage: M = ModularSymbols(chi)sage: R = M.manin_gens_to_basis()
sage: sage.modular.modsym.heilbronn.hecke_images_quad_character_weight2(2,1,29,[1,˓→3,4],chi,R)[ 0 0 0 0 0 -1][ 0 1 0 1 1 1]
[ 0 -2 0 2 -2 -1]
sage: x = M((2,1)) ; x.element()(0, 0, 0, 0, 0, -1)
sage: M.T(3)(x).element()(0, 1, 0, 1, 1, 1)
sage: M.T(4)(x).element()(0, -2, 0, 2, -2, -1)>>> from sage.all import *>>> chi = DirichletGroup(Integer(29),QQ).gen(0)>>> M = ModularSymbols(chi)(continues on next page)143

Modular Symbols, Release 10.4

(continued from previous page)>>> R = M.manin_gens_to_basis()>>> sage.modular.modsym.heilbronn.hecke_images_quad_character_weight2(Integer(2),˓→Integer(1),Integer(29),[Integer(1),Integer(3),Integer(4)],chi,R)[ 0 0 0 0 0 -1][ 0 1 0 1 1 1]
[ 0 -2 0 2 -2 -1]>>> x = M((Integer(2),Integer(1))) ; x.element()(0, 0, 0, 0, 0, -1)>>> M.T(Integer(3))(x).element()(0, 1, 0, 1, 1, 1)>>> M.T(Integer(4))(x).element()(0, -2, 0, 2, -2, -1)

144

Chapter 10. Heilbronn matrix computation

CHAPTERELEVENLISTS OF MANIN SYMBOLS OVER

, ELEMENTS OF P1 ( /𝑁 )class sage.modular.modsym.p1list.P1List
Bases: object
The class for P1 ( /𝑁 ), the projective line modulo 𝑁 .
EXAMPLES:
sage: P = P1List(12); P
The projective line over the integers modulo 12
sage: list(P)[(0, 1), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8),␣
˓→(1, 9), (1, 10), (1, 11), (2, 1), (2, 3), (2, 5), (3, 1), (3, 2), (3, 4), (3,␣˓→7), (4, 1), (4, 3), (4, 5), (6, 1)]>>> from sage.all import *>>> P = P1List(Integer(12)); P
The projective line over the integers modulo 12>>> list(P)[(0, 1), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8),␣
˓→(1, 9), (1, 10), (1, 11), (2, 1), (2, 3), (2, 5), (3, 1), (3, 2), (3, 4), (3,␣˓→7), (4, 1), (4, 3), (4, 5), (6, 1)]

Saving and loading works.
sage: loads(dumps(P)) == P
True>>> from sage.all import *>>> loads(dumps(P)) == P
True

N()
Return the level or modulus of this P1List.
EXAMPLES:
sage: L = P1List(120)sage: L.N()
120>>> from sage.all import *>>> L = P1List(Integer(120))>>> L.N()
120

145

Modular Symbols, Release 10.4

apply_I(i)Return the index of the result of applying the matrix 𝐼 = [−1, 0; 0, 1] to the 𝑖’th element of this P1List.
INPUT:• i – integer (the index of the element to act on).
EXAMPLES:
sage: L = P1List(120)sage: L[10](1, 9)
sage: L.apply_I(10)112
sage: L[112](1, 111)sage: L.normalize(-1,9)(1, 111)>>> from sage.all import *>>> L = P1List(Integer(120))>>> L[Integer(10)](1, 9)>>> L.apply_I(Integer(10))
112>>> L[Integer(112)](1, 111)>>> L.normalize(-Integer(1),Integer(9))(1, 111)This operation is an involution:
sage: all(L.apply_I(L.apply_I(i)) == i for i in range(len(L)))
True>>> from sage.all import *>>> all(L.apply_I(L.apply_I(i)) == i for i in range(len(L)))
True

apply_S(i)Return the index of the result of applying the matrix 𝑆 = [0, −1; 1, 0] to the 𝑖’th element of this P1List.
INPUT:• i – integer (the index of the element to act on).
EXAMPLES:
sage: L = P1List(120)sage: L[10](1, 9)
sage: L.apply_S(10)159
sage: L[159](3, 13)sage: L.normalize(-9,1)(3, 13)146

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

Modular Symbols, Release 10.4>>> from sage.all import *>>> L = P1List(Integer(120))>>> L[Integer(10)](1, 9)>>> L.apply_S(Integer(10))
159>>> L[Integer(159)](3, 13)>>> L.normalize(-Integer(9),Integer(1))(3, 13)This operation is an involution:
sage: all(L.apply_S(L.apply_S(i)) == i for i in range(len(L)))
True>>> from sage.all import *>>> all(L.apply_S(L.apply_S(i)) == i for i in range(len(L)))
True

apply_T(i)Return the index of the result of applying the matrix 𝑇 = [0, 1; −1, −1] to the 𝑖’th element of this P1List.
INPUT:• i – integer (the index of the element to act on).
EXAMPLES:
sage: L = P1List(120)sage: L[10](1, 9)
sage: L.apply_T(10)157sage: L[157](3, 10)sage: L.normalize(9,-10)(3, 10)>>> from sage.all import *>>> L = P1List(Integer(120))>>> L[Integer(10)](1, 9)>>> L.apply_T(Integer(10))
157>>> L[Integer(157)](3, 10)>>> L.normalize(Integer(9),-Integer(10))(3, 10)This operation has order three:sage: all(L.apply_T(L.apply_T(L.apply_T(i))) == i for i in range(len(L)))
True

147

Modular Symbols, Release 10.4>>> from sage.all import *>>> all(L.apply_T(L.apply_T(L.apply_T(i))) == i for i in range(len(L)))
True

index(u, v)
Return the index of the class of (𝑢, 𝑣) in the fixed list of representatives of P1 ( /𝑁 ).
INPUT:• u, v – integers, with gcd(𝑢, 𝑣, 𝑁 ) = 1.
OUTPUT:• i – the index of 𝑢, 𝑣, in the P1list.
EXAMPLES:
sage: L = P1List(120)sage: L[100](1, 99)sage: L.index(1,99)
100
sage: all(L.index(L[i][0],L[i][1])==i for i in range(len(L)))
True>>> from sage.all import *>>> L = P1List(Integer(120))>>> L[Integer(100)](1, 99)>>> L.index(Integer(1),Integer(99))
100>>> all(L.index(L[i][Integer(0)],L[i][Integer(1)])==i for i in range(len(L)))
True

index_of_normalized_pair(u, v)
Return the index of the class of (𝑢, 𝑣) in the fixed list of representatives of P1 ( /𝑁 ).
INPUT:• u, v – integers, with gcd(𝑢, 𝑣, 𝑁 ) = 1, normalized so they lie in the list.
OUTPUT:• i – the index of (𝑢 : 𝑣), in the P1list.
EXAMPLES:
sage: L = P1List(120)sage: L[100](1, 99)sage: L.index_of_normalized_pair(1,99)
100
sage: all(L.index_of_normalized_pair(L[i][0],L[i][1])==i for i in␣
˓→range(len(L)))
True>>> from sage.all import *>>> L = P1List(Integer(120))>>> L[Integer(100)](continues on next page)

148

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

Modular Symbols, Release 10.4

(continued from previous page)(1, 99)>>> L.index_of_normalized_pair(Integer(1),Integer(99))
100>>> all(L.index_of_normalized_pair(L[i][Integer(0)],L[i][Integer(1)])==i for␣
˓→i in range(len(L)))
True

lift_to_sl2z(i)Lift the 𝑖’th element of this P1list to an element of 𝑆𝐿(2, ).
If the 𝑖’th element is (𝑐, 𝑑), this function computes and returns a list [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that defines a 2x2 matrix withdeterminant 1 and integer entries, such that 𝑐 = 𝑐′ (mod 𝑁 ) and 𝑑 = 𝑑′ (mod 𝑁 ).
INPUT:• i – integer (the index of the element to lift).
EXAMPLES:
sage: p = P1List(11)sage: p.list()[3](1, 2)
sage: p.lift_to_sl2z(3)[0, -1, 1, 2]>>> from sage.all import *>>> p = P1List(Integer(11))>>> p.list()[Integer(3)](1, 2)>>> p.lift_to_sl2z(Integer(3))[0, -1, 1, 2]

AUTHORS:• Justin Walker
list()
Return the underlying list of this P1List object.
EXAMPLES:
sage: L = P1List(8)sage: type(L)<... sage.modular.modsym.p1list.P1List >sage: type(L.list())<... list >>>> from sage.all import *>>> L = P1List(Integer(8))>>> type(L)<... sage.modular.modsym.p1list.P1List >>>> type(L.list())<... list >normalize(u, v)
Return a normalised element of P1 ( /𝑁 ).
149

Modular Symbols, Release 10.4

INPUT:• u, v – integers, with gcd(𝑢, 𝑣, 𝑁 ) = 1.
OUTPUT:• a 2-tuple (uu,vv) where (𝑢𝑢 : 𝑣𝑣) is a normalized representative of (𝑢 : 𝑣).
NOTE: See also normalize_with_scalar() which also returns the normalizing scalar.
EXAMPLES:
sage: L = P1List(120)sage: (u,v) = (555555555,7777)
sage: uu,vv = L.normalize(555555555,7777)
sage: (uu,vv)(15, 13)sage: (uu*v-vv*u) % L.N() == 0
True>>> from sage.all import *>>> L = P1List(Integer(120))>>> (u,v) = (Integer(555555555),Integer(7777))>>> uu,vv = L.normalize(Integer(555555555),Integer(7777))>>> (uu,vv)(15, 13)>>> (uu*v-vv*u) % L.N() == Integer(0)Truenormalize_with_scalar(u, v)
Return a normalised element of P1 ( /𝑁 ), together with the normalizing scalar.
INPUT:• u, v – integers, with gcd(𝑢, 𝑣, 𝑁 ) = 1.
OUTPUT:• a 3-tuple (uu,vv,ss) where (𝑢𝑢 : 𝑣𝑣) is a normalized representative of (𝑢 : 𝑣), and 𝑠𝑠 is a scalarsuch that (𝑠𝑠 * 𝑢𝑢, 𝑠𝑠 * 𝑣𝑣) = (𝑢, 𝑣) (mod 𝑁 ).
EXAMPLES:
sage: L = P1List(120)sage: (u,v) = (555555555,7777)
sage: uu,vv,ss = L.normalize_with_scalar(555555555,7777)
sage: (uu,vv)(15, 13)sage: ((ss*uu-u)%L.N(), (ss*vv-v)%L.N())(0, 0)
sage: (uu*v-vv*u) % L.N() == 0
True>>> from sage.all import *>>> L = P1List(Integer(120))>>> (u,v) = (Integer(555555555),Integer(7777))>>> uu,vv,ss = L.normalize_with_scalar(Integer(555555555),Integer(7777))>>> (uu,vv)(15, 13)>>> ((ss*uu-u)%L.N(), (ss*vv-v)%L.N())(continues on next page)

150

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

Modular Symbols, Release 10.4

(continued from previous page)(0, 0)>>> (uu*v-vv*u) % L.N() == Integer(0)Trueclass sage.modular.modsym.p1list.export
Bases: object
sage.modular.modsym.p1list.lift_to_sl2z(c, d, N)
Return a list of Python ints [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that are the entries of a 2x2 matrix with determinant 1 and lower two entries
congruent to 𝑐, 𝑑 modulo 𝑁 .
INPUT:• c,d,N – Python ints or longs such that gcd(𝑐, 𝑑, 𝑁 ) = 1.
EXAMPLES:
sage: lift_to_sl2z(2,3,6)[1, 1, 2, 3]
sage: lift_to_sl2z(2,3,6000000)[1, 1, 2, 3]>>> from sage.all import *>>> lift_to_sl2z(Integer(2),Integer(3),Integer(6))[1, 1, 2, 3]>>> lift_to_sl2z(Integer(2),Integer(3),Integer(6000000))[1, 1, 2, 3]

You will get a ValueError exception if the input is invalid. Note that here gcd(15,6,24)=3:
sage: lift_to_sl2z(15,6,24)
Traceback (most recent call last):...
ValueError: input must have gcd 1>>> from sage.all import *>>> lift_to_sl2z(Integer(15),Integer(6),Integer(24))
Traceback (most recent call last):...
ValueError: input must have gcd 1

This function is not implemented except for N at most 2**31:
sage: lift_to_sl2z(1,1,2^32)
Traceback (most recent call last):...
NotImplementedError: N too large>>> from sage.all import *>>> lift_to_sl2z(Integer(1),Integer(1),Integer(2)**Integer(32))
Traceback (most recent call last):...
NotImplementedError: N too large

sage.modular.modsym.p1list.lift_to_sl2z_int(c, d, N)
Lift a pair (𝑐, 𝑑) to an element of 𝑆𝐿(2, ).

151

Modular Symbols, Release 10.4

(𝑐, 𝑑) is assumed to be an element of P1 ( /𝑁 ). This function computes and returns a list [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that defines
a 2x2 matrix, with determinant 1 and integer entries, such that 𝑐 = 𝑐′ (mod 𝑁 ) and 𝑑 = 𝑑′ (mod 𝑁 ).
INPUT:• c,d,N – integers such that gcd(𝑐, 𝑑, 𝑁 ) = 1.
EXAMPLES:
sage: from sage.modular.modsym.p1list import lift_to_sl2z_int
sage: lift_to_sl2z_int(2,6,11)[1, 8, 2, 17]
sage: m = Matrix(Integers(),2,2,lift_to_sl2z_int(2,6,11)); m[ 1 8][ 2 17]>>> from sage.all import *>>> from sage.modular.modsym.p1list import lift_to_sl2z_int>>> lift_to_sl2z_int(Integer(2),Integer(6),Integer(11))[1, 8, 2, 17]>>> m = Matrix(Integers(),Integer(2),Integer(2),lift_to_sl2z_int(Integer(2),˓→Integer(6),Integer(11))); m[ 1 8][ 2 17]AUTHOR:• Justin Walker
sage.modular.modsym.p1list.lift_to_sl2z_llong(c, d, N)
Lift a pair (𝑐, 𝑑) (modulo 𝑁 ) to an element of 𝑆𝐿(2, ).
(𝑐, 𝑑) is assumed to be an element of P1 ( /𝑁 ). This function computes and returns a list [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that defines
a 2x2 matrix, with determinant 1 and integer entries, such that 𝑐 = 𝑐′ (mod 𝑁 ) and 𝑑 = 𝑑′ (mod 𝑁 ).
INPUT:• c,d,N – integers such that gcd(𝑐, 𝑑, 𝑁 ) = 1.
EXAMPLES:
sage: from sage.modular.modsym.p1list import lift_to_sl2z_llong
sage: lift_to_sl2z_llong(2,6,11)[1, 8, 2, 17]
sage: m = Matrix(Integers(),2,2,lift_to_sl2z_llong(2,6,11)); m[ 1 8][ 2 17]>>> from sage.all import *>>> from sage.modular.modsym.p1list import lift_to_sl2z_llong>>> lift_to_sl2z_llong(Integer(2),Integer(6),Integer(11))[1, 8, 2, 17]>>> m = Matrix(Integers(),Integer(2),Integer(2),lift_to_sl2z_llong(Integer(2),˓→Integer(6),Integer(11))); m[ 1 8][ 2 17]AUTHOR:• Justin Walker

152

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

Modular Symbols, Release 10.4

sage.modular.modsym.p1list.p1_normalize(N, u, v)
Computes the canonical representative of P1 ( /𝑁 ) equivalent to (𝑢, 𝑣) along with a transforming scalar.
INPUT:• N – an integer• u – an integer• v – an integer
OUTPUT: If gcd(u,v,N) = 1, then returns• uu – an integer• vv – an integer• ss – an integer such that (𝑠𝑠 * 𝑢𝑢, 𝑠𝑠 * 𝑣𝑣) is equivalent to (𝑢, 𝑣) mod 𝑁 ;if gcd(𝑢, 𝑣, 𝑁 ) ̸= 1, returns 0, 0, 0.
EXAMPLES:
sage: from sage.modular.modsym.p1list import p1_normalize
sage: p1_normalize(90,7,77)(1, 11, 7)
sage: p1_normalize(90,7,78)(1, 24, 7)
sage: (7*24-78*1) % 90
0
sage: (7*24) % 90
78>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1_normalize>>> p1_normalize(Integer(90),Integer(7),Integer(77))(1, 11, 7)>>> p1_normalize(Integer(90),Integer(7),Integer(78))(1, 24, 7)>>> (Integer(7)*Integer(24)-Integer(78)*Integer(1)) % Integer(90)0>>> (Integer(7)*Integer(24)) % Integer(90)78
sage: from sage.modular.modsym.p1list import p1_normalize
sage: p1_normalize(50001,12345,54322)(3, 4667, 4115)
sage: (12345*4667-54321*3) % 50001
3
sage: 4115*3 % 50001
12345
sage: 4115*4667 % 50001 == 54322 % 50001
True>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1_normalize>>> p1_normalize(Integer(50001),Integer(12345),Integer(54322))(3, 4667, 4115)>>> (Integer(12345)*Integer(4667)-Integer(54321)*Integer(3)) % Integer(50001)
3(continues on next page)153

Modular Symbols, Release 10.4

(continued from previous page)>>> Integer(4115)*Integer(3) % Integer(50001)
12345>>> Integer(4115)*Integer(4667) % Integer(50001) == Integer(54322) %␣
˓→Integer(50001)
True

sage.modular.modsym.p1list.p1_normalize_int(N, u, v)
Computes the canonical representative of P1 ( /𝑁 ) equivalent to (𝑢, 𝑣) along with a transforming scalar.
INPUT:• N – an integer• u – an integer• v – an integer
OUTPUT: If gcd(u,v,N) = 1, then returns• uu – an integer• vv – an integer• ss – an integer such that (𝑠𝑠 * 𝑢𝑢, 𝑠𝑠 * 𝑣𝑣) is congruent to (𝑢, 𝑣) (mod 𝑁 );if gcd(𝑢, 𝑣, 𝑁 ) ̸= 1, returns 0, 0, 0.
EXAMPLES:
sage: from sage.modular.modsym.p1list import p1_normalize_int
sage: p1_normalize_int(90,7,77)(1, 11, 7)
sage: p1_normalize_int(90,7,78)(1, 24, 7)
sage: (7*24-78*1) % 90
0
sage: (7*24) % 90
78>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1_normalize_int>>> p1_normalize_int(Integer(90),Integer(7),Integer(77))(1, 11, 7)>>> p1_normalize_int(Integer(90),Integer(7),Integer(78))(1, 24, 7)>>> (Integer(7)*Integer(24)-Integer(78)*Integer(1)) % Integer(90)0>>> (Integer(7)*Integer(24)) % Integer(90)78

sage.modular.modsym.p1list.p1_normalize_llong(N, u, v)
Computes the canonical representative of P1 ( /𝑁 ) equivalent to (𝑢, 𝑣) along with a transforming scalar.
INPUT:• N – an integer• u – an integer• v – an integer
OUTPUT: If gcd(u,v,N) = 1, then returns
154

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

Modular Symbols, Release 10.4

• uu – an integer• vv – an integer• ss – an integer such that (𝑠𝑠 * 𝑢𝑢, 𝑠𝑠 * 𝑣𝑣) is equivalent to (𝑢, 𝑣) mod 𝑁 ;if gcd(𝑢, 𝑣, 𝑁 ) ̸= 1, returns 0, 0, 0.
EXAMPLES:
sage: from sage.modular.modsym.p1list import p1_normalize_llong
sage: p1_normalize_llong(90000,7,77)(1, 11, 7)
sage: p1_normalize_llong(90000,7,78)(1, 77154, 7)
sage: (7*77154-78*1) % 90000
0sage: (7*77154) % 90000
78>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1_normalize_llong>>> p1_normalize_llong(Integer(90000),Integer(7),Integer(77))(1, 11, 7)>>> p1_normalize_llong(Integer(90000),Integer(7),Integer(78))(1, 77154, 7)>>> (Integer(7)*Integer(77154)-Integer(78)*Integer(1)) % Integer(90000)0>>> (Integer(7)*Integer(77154)) % Integer(90000)
78

sage.modular.modsym.p1list.p1list(N)Return the elements of the projective line modulo 𝑁 , P1 ( /𝑁 ), as a plain list of 2-tuples.
INPUT:• N (integer) – a positive integer (less than 2^31).
OUTPUT:
A list of the elements of the projective line P1 ( /𝑁 ), as plain 2-tuples.
EXAMPLES:
sage: from sage.modular.modsym.p1list import p1list
sage: list(p1list(7))[(0, 1), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6)]
sage: N = 23456
sage: len(p1list(N)) == N*prod([1+1/p for p,e in N.factor()])
True>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1list>>> list(p1list(Integer(7)))[(0, 1), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6)]>>> N = Integer(23456)>>> len(p1list(N)) == N*prod([Integer(1)+Integer(1)/p for p,e in N.factor()])
True

155

Modular Symbols, Release 10.4

sage.modular.modsym.p1list.p1list_int(N)Return a list of the normalized elements of P1 ( /𝑁 ).
INPUT:• N – integer (the level or modulus).
EXAMPLES:
sage: from sage.modular.modsym.p1list import p1list_int
sage: p1list_int(6)[(0, 1),(1, 0),(1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 3),(2, 5),(3, 1),(3, 2)]>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1list_int>>> p1list_int(Integer(6))[(0, 1),(1, 0),(1, 1),(1, 2),(1, 3),(1, 4),(1, 5),(2, 1),(2, 3),(2, 5),(3, 1),(3, 2)]
sage: p1list_int(120)[(0, 1),(1, 0),(1, 1),(1, 2),(1, 3),...
(30, 7),(40, 1),(40, 3),(40, 11),(60, 1)]>>> from sage.all import *>>> p1list_int(Integer(120))[(0, 1),(1, 0),(1, 1),(continues on next page)

156

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

Modular Symbols, Release 10.4

(continued from previous page)(1, 2),(1, 3),...
(30, 7),(40, 1),(40, 3),(40, 11),(60, 1)]sage.modular.modsym.p1list.p1list_llong(N)Return a list of the normalized elements of P1 ( /𝑁 ), as a plain list of 2-tuples.
INPUT:• N – integer (the level or modulus).
EXAMPLES:
sage: from sage.modular.modsym.p1list import p1list_llong
sage: N = 50000
sage: L = p1list_llong(50000)
sage: len(L) == N*prod([1+1/p for p,e in N.factor()])
True
sage: L[0](0, 1)
sage: L[len(L)-1](25000, 1)>>> from sage.all import *>>> from sage.modular.modsym.p1list import p1list_llong>>> N = Integer(50000)>>> L = p1list_llong(Integer(50000))>>> len(L) == N*prod([Integer(1)+Integer(1)/p for p,e in N.factor()])
True>>> L[Integer(0)](0, 1)>>> L[len(L)-Integer(1)](25000, 1)

157Modular Symbols, Release 10.4

158

Chapter 11. Lists of Manin symbols over, elements of P1 ( /𝑁 )

CHAPTERTWELVE

LIST OF COSET REPRESENTATIVES FOR Γ1 (𝑁 ) IN SL2 ( )class sage.modular.modsym.g1list.G1list(N)Bases: SageObject
A class representing a list of coset representatives for Γ1 (𝑁 ) in SL2 ( ). What we actually calculate is a list ofelements of ( /𝑁 )2 of exact order 𝑁 .
list()
Return a list of vectors representing the cosets.
Do not change the returned list!
EXAMPLES:
sage: L = sage.modular.modsym.g1list.G1list(4); L.list()[(0, 1), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 1), (2, 3), (3, 0), (3,␣˓→1), (3, 2), (3, 3)]>>> from sage.all import *>>> L = sage.modular.modsym.g1list.G1list(Integer(4)); L.list()[(0, 1), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 1), (2, 3), (3, 0), (3,␣˓→1), (3, 2), (3, 3)]

normalize(u, v)Given a pair (𝑢, 𝑣) of integers, return the unique pair (𝑢′ , 𝑣 ′ ) such that the pair (𝑢′ , 𝑣 ′ ) appears in self.
list() and (𝑢, 𝑣) is equivalent to (𝑢′ , 𝑣 ′ ). This is rather trivial, but is here for consistency with the P1List
class which is the equivalent for Γ0 (where the problem is rather harder).
This will only make sense if gcd(𝑢, 𝑣, 𝑁 ) = 1; otherwise the output will not be an element of self.
EXAMPLES:
sage: L = sage.modular.modsym.g1list.G1list(4); L.normalize(6, 1)(2, 1)
sage: L = sage.modular.modsym.g1list.G1list(4); L.normalize(6, 2) # nonsense!
(2, 2)>>> from sage.all import *>>> L = sage.modular.modsym.g1list.G1list(Integer(4)); L.normalize(Integer(6),˓→ Integer(1))(2, 1)>>> L = sage.modular.modsym.g1list.G1list(Integer(4)); L.normalize(Integer(6),˓→ Integer(2)) # nonsense!
(2, 2)

159

Modular Symbols, Release 10.4

160

Chapter 12. List of coset representatives for Γ1 (𝑁 ) in SL2 ( )CHAPTERTHIRTEEN

LIST OF COSET REPRESENTATIVES FOR Γ𝐻 (𝑁 ) IN SL2 ( )class sage.modular.modsym.ghlist.GHlist(group)
Bases: SageObject
A class representing a list of coset representatives for Γ𝐻 (𝑁 ) in SL2 ( ).
list()
Return a list of vectors representing the cosets. Do not change the returned list!
EXAMPLES:
sage: L = sage.modular.modsym.ghlist.GHlist(GammaH(4,[])); L.list()[(0, 1), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 1), (2, 3), (3, 0), (3,␣˓→1), (3, 2), (3, 3)]>>> from sage.all import *>>> L = sage.modular.modsym.ghlist.GHlist(GammaH(Integer(4),[])); L.list()[(0, 1), (0, 3), (1, 0), (1, 1), (1, 2), (1, 3), (2, 1), (2, 3), (3, 0), (3,␣˓→1), (3, 2), (3, 3)]

normalize(u, v)Given a pair (𝑢, 𝑣) of integers, return the unique pair (𝑢′ , 𝑣 ′ ) such that the pair (𝑢′ , 𝑣 ′ ) appears in self.
list() and (𝑢, 𝑣) is equivalent to (𝑢′ , 𝑣 ′ ).
This will only make sense if gcd(𝑢, 𝑣, 𝑁 ) = 1; otherwise the output will not be an element of self.
EXAMPLES:
sage: sage.modular.modsym.ghlist.GHlist(GammaH(24, [17, 19])).normalize(17, 6)(1, 6)
sage: sage.modular.modsym.ghlist.GHlist(GammaH(24, [7, 13])).normalize(17, 6)(5, 6)
sage: sage.modular.modsym.ghlist.GHlist(GammaH(24, [5, 23])).normalize(17, 6)(7, 18)>>> from sage.all import *>>> sage.modular.modsym.ghlist.GHlist(GammaH(Integer(24), [Integer(17),␣
˓→Integer(19)])).normalize(Integer(17), Integer(6))(1, 6)>>> sage.modular.modsym.ghlist.GHlist(GammaH(Integer(24), [Integer(7),␣
˓→Integer(13)])).normalize(Integer(17), Integer(6))(5, 6)>>> sage.modular.modsym.ghlist.GHlist(GammaH(Integer(24), [Integer(5),␣
˓→Integer(23)])).normalize(Integer(17), Integer(6))(7, 18)161

Modular Symbols, Release 10.4

162

Chapter 13. List of coset representatives for Γ𝐻 (𝑁 ) in SL2 ( )CHAPTERFOURTEEN

RELATION MATRICES FOR AMBIENT MODULAR SYMBOLSSPACESThis file contains functions that are used by the various ambient modular symbols classes to compute presentations ofspaces in terms of generators and relations, using the standard methods based on Manin symbols.
sage.modular.modsym.relation_matrix.T_relation_matrix_wtk_g0(syms, mod, field, sparse)
Compute a matrix whose echelon form gives the quotient by 3-term T relations. Despite the name, this is used forall modular symbols spaces (including those with character and those for Γ1 and Γ𝐻 groups), not just Γ0 .
INPUT:• syms – ManinSymbolList• mod – list that gives quotient modulo some two-term relations, i.e., the S relations, and if sign is nonzero, theI relations.
• field – base_ring• sparse – (True or False) whether to use sparse rather than dense linear algebra
OUTPUT: A sparse matrix whose rows correspond to the reduction of the T relations modulo the S and I relations.
EXAMPLES:
sage: from sage.modular.modsym.relation_matrix import sparse_2term_quotient, T_
˓→relation_matrix_wtk_g0, modS_relations
sage: L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma_h(GammaH(36,˓→ [17,19]), 2)
sage: modS = sparse_2term_quotient(modS_relations(L), 216, QQ)
sage: T_relation_matrix_wtk_g0(L, modS, QQ, False)
72 x 216 dense matrix over Rational Field (use the .str() method to see the␣˓→entries)
sage: T_relation_matrix_wtk_g0(L, modS, GF(17), True)
72 x 216 sparse matrix over Finite Field of size 17 (use the .str() method to␣˓→see the entries)>>> from sage.all import *>>> from sage.modular.modsym.relation_matrix import sparse_2term_quotient, T_
˓→relation_matrix_wtk_g0, modS_relations>>> L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma_
˓→h(GammaH(Integer(36), [Integer(17),Integer(19)]), Integer(2))>>> modS = sparse_2term_quotient(modS_relations(L), Integer(216), QQ)>>> T_relation_matrix_wtk_g0(L, modS, QQ, False)
72 x 216 dense matrix over Rational Field (use the .str() method to see the␣˓→entries)>>> T_relation_matrix_wtk_g0(L, modS, GF(Integer(17)), True)(continues on next page)163

Modular Symbols, Release 10.4

(continued from previous page)72 x 216 sparse matrix over Finite Field of size 17 (use the˓→see the entries).str()

method to␣

sage.modular.modsym.relation_matrix.compute_presentation(syms, sign, field, sparse=None)
Compute the presentation for self, as a quotient of Manin symbols modulo relations.
INPUT:• syms – ManinSymbolList• sign – integer (-1, 0, 1)• field – a field
OUTPUT:• sparse matrix whose rows give each generator in terms of a basis for the quotient• list of integers that give the basis for the quotient• mod: list where mod[i]=(j,s) means that x_i = s*x_j modulo the 2-term S (and possibly I) relations.
ALGORITHM:
1. Let 𝑆 = [0, −1; 1, 0], 𝑇 = [0, −1; 1, −1], and 𝐼 = [−1, 0; 0, 1].
2. Let 𝑥0 , . . . , 𝑥𝑛−1 by a list of all non-equivalent Manin symbols.
3. Form quotient by 2-term S and (possibly) I relations.
4. Create a sparse matrix 𝐴 with 𝑚 columns, whose rows encode the relations[𝑥𝑖 ] + [𝑥𝑖 𝑇 ] + [𝑥𝑖 𝑇 2 ] = 0.
There are about n such rows. The number of nonzero entries per row is at most 3*(k-1). Note that we must
include rows for all i, since even if [𝑥𝑖 ] = [𝑥𝑗 ], it need not be the case that [𝑥𝑖 𝑇 ] = [𝑥𝑗 𝑇 ], since 𝑆 and 𝑇 do
not commute. However, in many cases we have an a priori formula for the dimension of the quotient by allthese relations, so we can omit many relations and just check that there are enough at the end–if there aren’t,
we add in more.
5. Compute the reduced row echelon form of 𝐴 using sparse Gaussian elimination.
6. Use what we’ve done above to read off a sparse matrix R that uniquely expresses each of the n Manin symbols
in terms of a subset of Manin symbols, modulo the relations. This subset of Manin symbols is a basis for thequotient by the relations.
EXAMPLES:
sage: L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma0(8,2)
sage: sage.modular.modsym.relation_matrix.compute_presentation(L, 1, GF(9, a ),␣
˓→True)([2 0 0][1 0 0][0 0 0][0 2 0][0 0 0][0 0 2][0 0 0][0 2 0][0 0 0](continues on next page)

164

Chapter 14. Relation matrices for ambient modular symbols spaces

Modular Symbols, Release 10.4

(continued from previous page)[0 1 0][0 1 0][0 0 1], [1, 9, 11], [(1, 2), (1, 1), (0, 0), (9, 2), (0, 0), (11, 2), (0, 0), (9,˓→ 2), (0, 0), (9, 1), (9, 1), (11, 1)])>>> from sage.all import *>>> L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma0(Integer(8),˓→Integer(2))>>> sage.modular.modsym.relation_matrix.compute_presentation(L, Integer(1),␣
˓→GF(Integer(9), a ), True)([2 0 0][1 0 0][0 0 0][0 2 0][0 0 0][0 0 2][0 0 0][0 2 0][0 0 0][0 1 0][0 1 0][0 0 1], [1, 9, 11], [(1, 2), (1, 1), (0, 0), (9, 2), (0, 0), (11, 2), (0, 0), (9,˓→ 2), (0, 0), (9, 1), (9, 1), (11, 1)])

sage.modular.modsym.relation_matrix.gens_to_basis_matrix(syms, relation_matrix, mod,field, sparse)
Compute echelon form of 3-term relation matrix, and read off each generator in terms of basis.
INPUT:• syms – ManinSymbolList• relation_matrix – as output by __compute_T_relation_matrix(self, mod)• mod – quotient of modular symbols modulo the 2-term S (and possibly I) relations• field – base field• sparse – (bool): whether or not matrix should be sparse
OUTPUT:• matrix – a matrix whose ith row expresses the Manin symbol generators in terms of a basis of Maninsymbols (modulo the S, (possibly I,) and T rels) Note that the entries of the matrix need not be integers.
• list – integers i, such that the Manin symbols 𝑥𝑖 are a basis.
EXAMPLES:
sage: from sage.modular.modsym.relation_matrix import sparse_2term_quotient, T_
˓→relation_matrix_wtk_g0, gens_to_basis_matrix, modS_relations
sage: L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma1(4, 3)
sage: modS = sparse_2term_quotient(modS_relations(L), 24, GF(3))
sage: gens_to_basis_matrix(L, T_relation_matrix_wtk_g0(L, modS, GF(3), 24), modS,␣
˓→GF(3), True)(24 x 2 sparse matrix over Finite Field of size 3, [13, 23])165

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.modsym.relation_matrix import sparse_2term_quotient, T_
˓→relation_matrix_wtk_g0, gens_to_basis_matrix, modS_relations>>> L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma1(Integer(4),␣
˓→Integer(3))>>> modS = sparse_2term_quotient(modS_relations(L), Integer(24), GF(Integer(3)))>>> gens_to_basis_matrix(L, T_relation_matrix_wtk_g0(L, modS, GF(Integer(3)),␣
˓→Integer(24)), modS, GF(Integer(3)), True)(24 x 2 sparse matrix over Finite Field of size 3, [13, 23])sage.modular.modsym.relation_matrix.modI_relations(syms, sign)Compute quotient of Manin symbols by the I relations.
INPUT:• syms – ManinSymbolList• sign – int (either -1, 0, or 1)
OUTPUT:• rels – set of pairs of pairs (j, s), where if mod[i] = (j,s), then x_i = s*x_j (mod S relations)
EXAMPLES:
sage: L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma1(4, 3)
sage: sage.modular.modsym.relation_matrix.modI_relations(L, 1){((0, 1), (0, -1)),((1, 1), (1, -1)),((2, 1), (8, -1)),((3, 1), (9, -1)),((4, 1), (10, -1)),((5, 1), (11, -1)),((6, 1), (6, -1)),((7, 1), (7, -1)),((8, 1), (2, -1)),((9, 1), (3, -1)),((10, 1), (4, -1)),((11, 1), (5, -1)),((12, 1), (12, 1)),((13, 1), (13, 1)),((14, 1), (20, 1)),((15, 1), (21, 1)),((16, 1), (22, 1)),((17, 1), (23, 1)),((18, 1), (18, 1)),((19, 1), (19, 1)),((20, 1), (14, 1)),((21, 1), (15, 1)),((22, 1), (16, 1)),((23, 1), (17, 1))}>>> from sage.all import *>>> L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma1(Integer(4),␣
˓→Integer(3))>>> sage.modular.modsym.relation_matrix.modI_relations(L, Integer(1)){((0, 1), (0, -1)),((1, 1), (1, -1)),((2, 1), (8, -1)),(continues on next page)

166

Chapter 14. Relation matrices for ambient modular symbols spaces

Modular Symbols, Release 10.4

(continued from previous page)((3, 1), (9, -1)),((4, 1), (10, -1)),((5, 1), (11, -1)),((6, 1), (6, -1)),((7, 1), (7, -1)),((8, 1), (2, -1)),((9, 1), (3, -1)),((10, 1), (4, -1)),((11, 1), (5, -1)),((12, 1), (12, 1)),((13, 1), (13, 1)),((14, 1), (20, 1)),((15, 1), (21, 1)),((16, 1), (22, 1)),((17, 1), (23, 1)),((18, 1), (18, 1)),((19, 1), (19, 1)),((20, 1), (14, 1)),((21, 1), (15, 1)),((22, 1), (16, 1)),((23, 1), (17, 1))}

Warning: We quotient by the involution eta((u,v)) = (-u,v), which has the opposite sign as the involution in
Merel’s Springer LNM 1585 paper! Thus our +1 eigenspace is his -1 eigenspace, etc. We do this for consistency
with MAGMA.
sage.modular.modsym.relation_matrix.modS_relations(syms)
Compute quotient of Manin symbols by the S relations.
Here S is the 2x2 matrix [0, -1; 1, 0].
INPUT:• syms – ManinSymbolList
OUTPUT:• rels – set of pairs of pairs (j, s), where if mod[i] = (j,s), then x_i = s*x_j (mod S relations)
EXAMPLES:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0
sage: from sage.modular.modsym.relation_matrix import modS_relations>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma0>>> from sage.modular.modsym.relation_matrix import modS_relations
sage: syms = ManinSymbolList_gamma0(2, 4); syms
Manin Symbol List of weight 4 for Gamma0(2)sage: modS_relations(syms){((0, 1), (7, 1)),((1, 1), (6, 1)),((2, 1), (8, 1)),((3, -1), (4, 1)),
(continues on next page)

167

Modular Symbols, Release 10.4

(continued from previous page)((3, 1), (4, -1)),((5, -1), (5, 1))}>>> from sage.all import *>>> syms = ManinSymbolList_gamma0(Integer(2), Integer(4)); syms
Manin Symbol List of weight 4 for Gamma0(2)>>> modS_relations(syms){((0, 1), (7, 1)),((1, 1), (6, 1)),((2, 1), (8, 1)),((3, -1), (4, 1)),((3, 1), (4, -1)),((5, -1), (5, 1))}
sage: syms = ManinSymbolList_gamma0(7, 2); syms
Manin Symbol List of weight 2 for Gamma0(7)sage: modS_relations(syms){((0, 1), (1, 1)), ((2, 1), (7, 1)), ((3, 1), (4, 1)), ((5, 1), (6, 1))}>>> from sage.all import *>>> syms = ManinSymbolList_gamma0(Integer(7), Integer(2)); syms
Manin Symbol List of weight 2 for Gamma0(7)>>> modS_relations(syms){((0, 1), (1, 1)), ((2, 1), (7, 1)), ((3, 1), (4, 1)), ((5, 1), (6, 1))}

Next we do an example with Gamma1:
sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1
sage: syms = ManinSymbolList_gamma1(3,2); syms
Manin Symbol List of weight 2 for Gamma1(3)sage: modS_relations(syms){((0, 1), (2, 1)),((0, 1), (5, 1)),((1, 1), (2, 1)),((1, 1), (5, 1)),((3, 1), (4, 1)),((3, 1), (6, 1)),((4, 1), (7, 1)),((6, 1), (7, 1))}>>> from sage.all import *>>> from sage.modular.modsym.manin_symbol_list import ManinSymbolList_gamma1>>> syms = ManinSymbolList_gamma1(Integer(3),Integer(2)); syms
Manin Symbol List of weight 2 for Gamma1(3)>>> modS_relations(syms){((0, 1), (2, 1)),((0, 1), (5, 1)),((1, 1), (2, 1)),((1, 1), (5, 1)),((3, 1), (4, 1)),((3, 1), (6, 1)),((4, 1), (7, 1)),((6, 1), (7, 1))}sage.modular.modsym.relation_matrix.relation_matrix_wtk_g0(syms, sign, field, sparse)
Compute the matrix of relations. Despite the name, this is used for all spaces (not just for Gamma0). For a
168

Chapter 14. Relation matrices for ambient modular symbols spaces

Modular Symbols, Release 10.4

description of the algorithm, see the docstring for compute_presentation.
INPUT:• syms – ManinSymbolList• sign: integer (0, 1 or -1)• field: the base field (non-field base rings not supported at present)• sparse: (True or False) whether to use sparse arithmetic.
Note that ManinSymbolList objects already have a specific weight, so there is no need for an extra weight parameter.
OUTPUT: a pair (R, mod) where• R is a matrix as output by T_relation_matrix_wtk_g0• mod is a set of 2-term relations as output by sparse_2term_quotient
EXAMPLES:
sage: L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma0(8,2)
sage: A = sage.modular.modsym.relation_matrix.relation_matrix_wtk_g0(L, 0, GF(2),␣
˓→True); A([0 0 0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0 1 1 1 0]
[0 0 0 0 0 0 1 0 0 1 1 0]
[0 0 0 0 0 0 1 0 0 0 0 0], [(1, 1), (1, 1), (8, 1), (10, 1), (6, 1), (11, 1), (6,␣˓→1), (9, 1), (8, 1), (9, 1), (10, 1), (11, 1)])
sage: A[0].is_sparse()
True>>> from sage.all import *>>> L = sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma0(Integer(8),˓→Integer(2))>>> A = sage.modular.modsym.relation_matrix.relation_matrix_wtk_g0(L, Integer(0),␣
˓→GF(Integer(2)), True); A([0 0 0 0 0 0 0 0 1 0 0 0]
[0 0 0 0 0 0 0 0 1 1 1 0]
[0 0 0 0 0 0 1 0 0 1 1 0]
[0 0 0 0 0 0 1 0 0 0 0 0], [(1, 1), (1, 1), (8, 1), (10, 1), (6, 1), (11, 1), (6,␣˓→1), (9, 1), (8, 1), (9, 1), (10, 1), (11, 1)])>>> A[Integer(0)].is_sparse()
Truesage.modular.modsym.relation_matrix.sparse_2term_quotient(rels, n, F)
Perform Sparse Gauss elimination on a matrix all of whose columns have at most 2 nonzero entries. We use an
obvious algorithm, which runs fast enough. (Typically making the list of relations takes more time than computing
this quotient.) This algorithm is more subtle than just “identify symbols in pairs”, since complicated relations cancause generators to surprisingly equal 0.
INPUT:• rels – iterable made of pairs ((i,s), (j,t)). The pair represents the relation s*x_i + t*x_j = 0, where the i, j
must be Python int’s.

169Modular Symbols, Release 10.4

• n – int, the x_i are x_0, …, x_n-1.
• F – base field
OUTPUT:• mod – list such that mod[i] = (j,s), which means that x_i is equivalent to s*x_j, where the x_j are a basis forthe quotient.
EXAMPLES: We quotient out by the relations
3 * 𝑥0 − 𝑥1 = 0,𝑥1 + 𝑥3 = 0,𝑥2 + 𝑥3 = 0,𝑥4 − 𝑥5 = 0

to getsage: rels = [((int(0),3), (int(1),-1)), ((int(1),1), (int(3),1)), ((int(2),1),
˓→(int(3),1)), ((int(4),1),(int(5),-1))]
sage: n = 6
sage: from sage.modular.modsym.relation_matrix import sparse_2term_quotient
sage: sparse_2term_quotient(rels, n, QQ)[(3, -1/3), (3, -1), (3, -1), (3, 1), (5, 1), (5, 1)]>>> from sage.all import *>>> rels = [((int(Integer(0)),Integer(3)), (int(Integer(1)),-Integer(1))),␣
˓→((int(Integer(1)),Integer(1)), (int(Integer(3)),Integer(1))), ((int(Integer(2)),
˓→Integer(1)),(int(Integer(3)),Integer(1))), ((int(Integer(4)),Integer(1)),˓→(int(Integer(5)),-Integer(1)))]>>> n = Integer(6)>>> from sage.modular.modsym.relation_matrix import sparse_2term_quotient>>> sparse_2term_quotient(rels, n, QQ)[(3, -1/3), (3, -1), (3, -1), (3, 1), (5, 1), (5, 1)]

170

Chapter 14. Relation matrices for ambient modular symbols spaces

CHAPTERFIFTEEN

LISTS OF MANIN SYMBOLS OVER NUMBER FIELDS, ELEMENTS
OF P1 (𝑅/𝑁 )Lists of elements of P1 (𝑅/𝑁 ) where 𝑅 is the ring of integers of a number field 𝐾 and 𝑁 is an integral ideal.
AUTHORS:• Maite Aranes (2009): Initial version
EXAMPLES:
We define a P1NFList:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a^2 - a + 1)
sage: P = P1NFList(N); P
The projective line over
the ring of integers modulo the Fractional ideal (5, a^2 - a + 1)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(Integer(5), a**Integer(2) - a + Integer(1))>>> P = P1NFList(N); P
The projective line over
the ring of integers modulo the Fractional ideal (5, a^2 - a + 1)

List operations with the P1NFList:
sage: len(P)26
sage: [p for p in P][M-symbol (0: 1) of level Fractional ideal (5, a^2 - a + 1),...
M-symbol (1: 2*a^2 + 2*a) of level Fractional ideal (5, a^2 - a + 1)]>>> from sage.all import *>>> len(P)26>>> [p for p in P][M-symbol (0: 1) of level Fractional ideal (5, a^2 - a + 1),...
M-symbol (1: 2*a^2 + 2*a) of level Fractional ideal (5, a^2 - a + 1)]

The elements of the P1NFList are M-symbols:
171

Modular Symbols, Release 10.4

sage: type(P[2])<class sage.modular.modsym.p1list_nf.MSymbol >>>> from sage.all import *>>> type(P[Integer(2)])<class sage.modular.modsym.p1list_nf.MSymbol >Definition of MSymbols:
sage: alpha = MSymbol(N, 3, a^2); alphaM-symbol (3: a^2) of level Fractional ideal (5, a^2 - a + 1)>>> from sage.all import *>>> alpha = MSymbol(N, Integer(3), a**Integer(2)); alphaM-symbol (3: a^2) of level Fractional ideal (5, a^2 - a + 1)

Find the index of the class of an M-Symbol (𝑐 : 𝑑) in the list:
sage: i = P.index(alpha)sage: P[i].c*alpha.d - P[i].d*alpha.c in N
True>>> from sage.all import *>>> i = P.index(alpha)>>> P[i].c*alpha.d - P[i].d*alpha.c in N
True

Lift an MSymbol to a matrix in 𝑆𝐿(2, 𝑅):
sage: alpha = MSymbol(N, a + 2, 3*a^2)
sage: alpha.lift_to_sl2_Ok()[-1, 4*a^2 - 13*a + 23, a + 2, 5*a^2 + 3*a - 3]sage: Ok = k.ring_of_integers()
sage: M = Matrix(Ok, 2, alpha.lift_to_sl2_Ok())
sage: det(M)1sage: M[1][1] - alpha.d in N
True>>> from sage.all import *>>> alpha = MSymbol(N, a + Integer(2), Integer(3)*a**Integer(2))>>> alpha.lift_to_sl2_Ok()[-1, 4*a^2 - 13*a + 23, a + 2, 5*a^2 + 3*a - 3]>>> Ok = k.ring_of_integers()>>> M = Matrix(Ok, Integer(2), alpha.lift_to_sl2_Ok())>>> det(M)1>>> M[Integer(1)][Integer(1)] - alpha.d in N
True

Lift an MSymbol from P1NFList to a matrix in 𝑆𝐿(2, 𝑅)
sage: P[3]M-symbol (1: -2*a) of level Fractional ideal (5, a^2 - a + 1)
sage: P.lift_to_sl2_Ok(3)[0, -1, 1, -2*a]

172

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4>>> from sage.all import *>>> P[Integer(3)]M-symbol (1: -2*a) of level Fractional ideal (5, a^2 - a + 1)>>> P.lift_to_sl2_Ok(Integer(3))[0, -1, 1, -2*a]class sage.modular.modsym.p1list_nf.MSymbol(N, c, d=None, check=True)
Bases: SageObject
The constructor for an M-symbol over a number field.
INPUT:• N – integral ideal (the modulus or level).
• c – integral element of the underlying number field or an MSymbol of level N.
• d – (optional) when present, it must be an integral element such that ⟨𝑐⟩ + ⟨𝑑⟩ + 𝑁 = 𝑅, where 𝑅 is thecorresponding ring of integers.
• check – bool (default True). If check=False the constructor does not check the condition ⟨𝑐⟩ + ⟨𝑑⟩ +𝑁 = 𝑅.
OUTPUT:An M-symbol modulo the given ideal 𝑁 , i.e. an element of the projective line P1 (𝑅/𝑁 ), where 𝑅 is the ring ofintegers of the underlying number field.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(a + 1, 2)
sage: MSymbol(N, 3, a^2 + 1)
M-symbol (3: a^2 + 1) of level Fractional ideal (2, a + 1)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(a + Integer(1), Integer(2))>>> MSymbol(N, Integer(3), a**Integer(2) + Integer(1))
M-symbol (3: a^2 + 1) of level Fractional ideal (2, a + 1)

We can give a tuple as input:
sage: MSymbol(N, (1, 0))M-symbol (1: 0) of level Fractional ideal (2, a + 1)>>> from sage.all import *>>> MSymbol(N, (Integer(1), Integer(0)))
M-symbol (1: 0) of level Fractional ideal (2, a + 1)

We get an error if ⟨𝑐⟩, ⟨𝑑⟩ and 𝑁 are not coprime:
sage: MSymbol(N, 2*a, a - 1)
Traceback (most recent call last):...
ValueError: (2*a, a - 1) is not an element of P1(R/N).
(continues on next page)173

Modular Symbols, Release 10.4

(continued from previous page)

sage: MSymbol(N, (0, 0))Traceback (most recent call last):...
ValueError: (0, 0) is not an element of P1(R/N).
>>> from sage.all import *>>> MSymbol(N, Integer(2)*a, a - Integer(1))
Traceback (most recent call last):...
ValueError: (2*a, a - 1) is not an element of P1(R/N).
>>> MSymbol(N, (Integer(0), Integer(0)))
Traceback (most recent call last):...
ValueError: (0, 0) is not an element of P1(R/N).

Saving and loading works:
sage: alpha = MSymbol(N, 3, a^2 + 1)
sage: loads(dumps(alpha))==alphaTrue>>> from sage.all import *>>> alpha = MSymbol(N, Integer(3), a**Integer(2) + Integer(1))>>> loads(dumps(alpha))==alpha
True

N()
Return the level or modulus of this MSymbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3, a - 1)sage: alpha = MSymbol(N, 3, a)sage: alpha.N()
Fractional ideal (3, 1/2*a - 1/2)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(3), a - Integer(1))>>> alpha = MSymbol(N, Integer(3), a)>>> alpha.N()
Fractional ideal (3, 1/2*a - 1/2)

property c
Return the first coefficient of the M-symbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(a + 1, 2)(continues on next page)

174

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

(continued from previous page)

sage: alpha = MSymbol(N, 3, a^2 + 1)
sage: alpha.c # indirect doctest
3>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(a + Integer(1), Integer(2))>>> alpha = MSymbol(N, Integer(3), a**Integer(2) + Integer(1))>>> alpha.c # indirect doctest
3

property d
Return the second coefficient of the M-symbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(a + 1, 2)
sage: alpha = MSymbol(N, 3, a^2 + 1)
sage: alpha.d # indirect doctesta^2 + 1>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(a + Integer(1), Integer(2))>>> alpha = MSymbol(N, Integer(3), a**Integer(2) + Integer(1))>>> alpha.d # indirect doctesta^2 + 1

lift_to_sl2_Ok()
Lift the MSymbol to an element of 𝑆𝐿(2, 𝑂𝑘 ), where 𝑂𝑘 is the ring of integers of the corresponding number
field.
OUTPUT:
A list of integral elements [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that are the entries of a 2 × 2 matrix with determinant 1. The lower
two entries are congruent (modulo the level) to the coefficients 𝑐, 𝑑 of the MSymbol self.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3, a - 1)sage: alpha = MSymbol(N, 3*a + 1, a)
sage: alpha.lift_to_sl2_Ok()[0, -1, 1, a]>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._˓→first_ngens(1)(continues on next page)

175

Modular Symbols, Release 10.4

(continued from previous page)>>> N = k.ideal(Integer(3), a - Integer(1))>>> alpha = MSymbol(N, Integer(3)*a + Integer(1), a)>>> alpha.lift_to_sl2_Ok()[0, -1, 1, a]

normalize(with_scalar=False)
Return a normalized MSymbol (a canonical representative of an element of P1 (𝑅/𝑁 )) equivalent to self.
INPUT:• with_scalar – bool (default False)
OUTPUT:• (only if with_scalar=True) a transforming scalar 𝑢, such that (𝑢 * 𝑐′ , 𝑢 * 𝑑′ ) is congruent to (𝑐 : 𝑑)(mod 𝑁 ), where (𝑐 : 𝑑) are the coefficients of self and 𝑁 is the level.
• a normalized MSymbol (𝑐′ : 𝑑′ ) equivalent to self.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3, a - 1)sage: alpha1 = MSymbol(N, 3, a); alpha1
M-symbol (3: a) of level Fractional ideal (3, 1/2*a - 1/2)
sage: alpha1.normalize()
M-symbol (0: 1) of level Fractional ideal (3, 1/2*a - 1/2)
sage: alpha2 = MSymbol(N, 4, a + 1)
sage: alpha2.normalize()
M-symbol (1: -a) of level Fractional ideal (3, 1/2*a - 1/2)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(3), a - Integer(1))>>> alpha1 = MSymbol(N, Integer(3), a); alpha1
M-symbol (3: a) of level Fractional ideal (3, 1/2*a - 1/2)>>> alpha1.normalize()
M-symbol (0: 1) of level Fractional ideal (3, 1/2*a - 1/2)>>> alpha2 = MSymbol(N, Integer(4), a + Integer(1))>>> alpha2.normalize()
M-symbol (1: -a) of level Fractional ideal (3, 1/2*a - 1/2)

We get the scaling factor by setting with_scalar=True:
sage: alpha1.normalize(with_scalar=True)(a, M-symbol (0: 1) of level Fractional ideal (3, 1/2*a - 1/2))
sage: r, beta1 = alpha1.normalize(with_scalar=True)
sage: r*beta1.c - alpha1.c in N
True
sage: r*beta1.d - alpha1.d in N
True
sage: r, beta2 = alpha2.normalize(with_scalar=True)
sage: r*beta2.c - alpha2.c in N
True(continues on next page)

176

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

(continued from previous page)

sage: r*beta2.d - alpha2.d in N
True>>> from sage.all import *>>> alpha1.normalize(with_scalar=True)(a, M-symbol (0: 1) of level Fractional ideal (3, 1/2*a - 1/2))>>> r, beta1 = alpha1.normalize(with_scalar=True)>>> r*beta1.c - alpha1.c in N
True>>> r*beta1.d - alpha1.d in N
True>>> r, beta2 = alpha2.normalize(with_scalar=True)>>> r*beta2.c - alpha2.c in N
True>>> r*beta2.d - alpha2.d in N
True

tuple()
Return the MSymbol as a list (𝑐, 𝑑).
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3, a - 1)sage: alpha = MSymbol(N, 3, a); alphaM-symbol (3: a) of level Fractional ideal (3, 1/2*a - 1/2)
sage: alpha.tuple()(3, a)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(3), a - Integer(1))>>> alpha = MSymbol(N, Integer(3), a); alphaM-symbol (3: a) of level Fractional ideal (3, 1/2*a - 1/2)>>> alpha.tuple()(3, a)

class sage.modular.modsym.p1list_nf.P1NFList(N)Bases: SageObject
The class for P1 (𝑅/𝑁 ), the projective line modulo 𝑁 , where 𝑅 is the ring of integers of a number field 𝐾 and 𝑁
is an integral ideal.
INPUT:• N – integral ideal (the modulus or level).
OUTPUT:A P1NFList object representing P1 (𝑅/𝑁 ).
EXAMPLES:

177

Modular Symbols, Release 10.4

sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a + 1)
sage: P = P1NFList(N); P
The projective line over the ring of integers modulo the Fractional ideal (5, a +␣˓→1)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(Integer(5), a + Integer(1))>>> P = P1NFList(N); P
The projective line over the ring of integers modulo the Fractional ideal (5, a +␣˓→1)

Saving and loading works.
sage: loads(dumps(P)) == P
True>>> from sage.all import *>>> loads(dumps(P)) == P
True

N()
Return the level or modulus of this P1NFList.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 31)
sage: N = k.ideal(5, a + 3)
sage: P = P1NFList(N)sage: P.N()
Fractional ideal (5, 1/2*a + 3/2)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(31), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(3))>>> P = P1NFList(N)>>> P.N()
Fractional ideal (5, 1/2*a + 3/2)

apply_J_epsilon(i, e1, e2=1)
Apply the matrix 𝐽𝜖 = [e1, 0, 0, e2] to the 𝑖-th M-Symbol of the list.
e1, e2 are units of the underlying number field.
INPUT:• i – integer• e1 – unit
• e2 – unit (default 1)
178

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

OUTPUT:
integer – the index of the M-Symbol obtained by the right action of the matrix 𝐽𝜖 = [e1, 0, 0, e2] on the 𝑖-th
M-Symbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a + 1)
sage: P = P1NFList(N)sage: u = k.unit_group().gens_values(); u[-1, -2*a^2 - 4*a + 1]
sage: P.apply_J_epsilon(4, -1)
2
sage: P.apply_J_epsilon(4, u[0], u[1])5>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(1))>>> P = P1NFList(N)>>> u = k.unit_group().gens_values(); u[-1, -2*a^2 - 4*a + 1]>>> P.apply_J_epsilon(Integer(4), -Integer(1))
2>>> P.apply_J_epsilon(Integer(4), u[Integer(0)], u[Integer(1)])
5sage: k.<a> = NumberField(x^4 + 13*x - 7)sage: N = k.ideal(a + 1)
sage: P = P1NFList(N)sage: u = k.unit_group().gens_values(); u[-1, -a^3 - a^2 - a - 12, -a^3 - 3*a^2 + 1]
sage: P.apply_J_epsilon(3, u[2]^2)==P.apply_J_epsilon(P.apply_J_epsilon(3,␣˓→u[2]),u[2])True>>> from sage.all import *>>> k = NumberField(x**Integer(4) + Integer(13)*x - Integer(7), names=( a ,));
˓→ (a,) = k._first_ngens(1)>>> N = k.ideal(a + Integer(1))>>> P = P1NFList(N)>>> u = k.unit_group().gens_values(); u[-1, -a^3 - a^2 - a - 12, -a^3 - 3*a^2 + 1]>>> P.apply_J_epsilon(Integer(3), u[Integer(2)]**Integer(2))==P.apply_J_
˓→epsilon(P.apply_J_epsilon(Integer(3), u[Integer(2)]),u[Integer(2)])
True

apply_S(i)Applies the matrix 𝑆 = [0, -1, 1, 0] to the 𝑖-th M-Symbol of the list.
INPUT:• i – integer
OUTPUT:
179

Modular Symbols, Release 10.4

integer – the index of the M-Symbol obtained by the right action of the matrix 𝑆 = [0, -1, 1, 0] on the 𝑖-th
M-Symbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a + 1)
sage: P = P1NFList(N)sage: j = P.apply_S(P.index_of_normalized_pair(1, 0))
sage: P[j]M-symbol (0: 1) of level Fractional ideal (5, a + 1)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(1))>>> P = P1NFList(N)>>> j = P.apply_S(P.index_of_normalized_pair(Integer(1), Integer(0)))>>> P[j]M-symbol (0: 1) of level Fractional ideal (5, a + 1)

We test that S has order 2:
sage: j = randint(0,len(P)-1)
sage: P.apply_S(P.apply_S(j))==j
True>>> from sage.all import *>>> j = randint(Integer(0),len(P)-Integer(1))>>> P.apply_S(P.apply_S(j))==j
True

apply_TS(i)Applies the matrix 𝑇 𝑆 = [1, -1, 0, 1] to the 𝑖-th M-Symbol of the list.
INPUT:• i – integer
OUTPUT:
integer – the index of the M-Symbol obtained by the right action of the matrix 𝑇 𝑆 = [1, -1, 0, 1] on the 𝑖-th
M-Symbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a + 1)
sage: P = P1NFList(N)sage: P.apply_TS(3)2>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._(continues on next page)

180

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

(continued from previous page)

first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(1))>>> P = P1NFList(N)>>> P.apply_TS(Integer(3))
2˓→

We test that 𝑇 𝑆 has order 3:
sage: j = randint(0,len(P)-1)
sage: P.apply_TS(P.apply_TS(P.apply_TS(j)))==j
True>>> from sage.all import *>>> j = randint(Integer(0),len(P)-Integer(1))>>> P.apply_TS(P.apply_TS(P.apply_TS(j)))==j
True

apply_T_alpha(i, alpha=1)
Applies the matrix 𝑇𝑎𝑙𝑝ℎ𝑎 = [1, 𝑎𝑙𝑝ℎ𝑎, 0, 1] to the 𝑖-th M-Symbol of the list.
INPUT:• i – integer• alpha – (default 1) element of the corresponding ring of integers
OUTPUT:
integer – the index of the M-Symbol obtained by the right action of the matrix 𝑇𝑎𝑙𝑝ℎ𝑎 = [1, 𝑎𝑙𝑝ℎ𝑎, 0, 1] on
the i-th M-Symbol.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a + 1)
sage: P = P1NFList(N)sage: P.apply_T_alpha(4, a^ 2 - 2)
3>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(1))>>> P = P1NFList(N)>>> P.apply_T_alpha(Integer(4), a** Integer(2) - Integer(2))
3

We test that 𝑇𝑎 * 𝑇𝑏 = 𝑇(𝑎+𝑏) :sage: P.apply_T_alpha(3, a^2 - 2)==P.apply_T_alpha(P.apply_T_alpha(3,a^2),-2)
True>>> from sage.all import *>>> P.apply_T_alpha(Integer(3), a**Integer(2) - Integer(2))==P.apply_T_˓→alpha(P.apply_T_alpha(Integer(3),a**Integer(2)),-Integer(2))
True

181

Modular Symbols, Release 10.4

index(c, d=None, with_scalar=False)
Return the index of the class of the pair (𝑐, 𝑑) in the fixed list of representatives of P1 (𝑅/𝑁 ).
INPUT:• c – integral element of the corresponding number field, or an MSymbol.
• d – (optional) when present, it must be an integral element of the number field such that (𝑐, 𝑑) defines
an M-symbol of level 𝑁 .
• with_scalar – bool (default False)
OUTPUT:• u – the normalizing scalar (only if with_scalar=True)• i – the index of (𝑐, 𝑑) in the list.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 31)
sage: N = k.ideal(5, a + 3)
sage: P = P1NFList(N)sage: P.index(3,a)
5sage: P[5]==MSymbol(N, 3, a).normalize()
True>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(31), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(3))>>> P = P1NFList(N)>>> P.index(Integer(3),a)5>>> P[Integer(5)]==MSymbol(N, Integer(3), a).normalize()True

We can give an MSymbol as input:
sage: alpha = MSymbol(N, 3, a)sage: P.index(alpha)5>>> from sage.all import *>>> alpha = MSymbol(N, Integer(3), a)>>> P.index(alpha)5

We cannot look for the class of an MSymbol of a different level:
sage: M = k.ideal(a + 1)
sage: beta = MSymbol(M, 0, 1)
sage: P.index(beta)
Traceback (most recent call last):...
ValueError: The MSymbol is of a different level

182

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4>>> from sage.all import *>>> M = k.ideal(a + Integer(1))>>> beta = MSymbol(M, Integer(0), Integer(1))>>> P.index(beta)
Traceback (most recent call last):...
ValueError: The MSymbol is of a different level

If we are interested in the transforming scalar:sage: alpha = MSymbol(N, 3, a)sage: P.index(alpha, with_scalar=True)(-a, 5)sage: u, i = P.index(alpha, with_scalar=True)
sage: (u*P[i].c - alpha.c in N) and (u*P[i].d - alpha.d in N)
True>>> from sage.all import *>>> alpha = MSymbol(N, Integer(3), a)>>> P.index(alpha, with_scalar=True)(-a, 5)>>> u, i = P.index(alpha, with_scalar=True)>>> (u*P[i].c - alpha.c in N) and (u*P[i].d - alpha.d in N)
True

index_of_normalized_pair(c, d=None)
Return the index of the class (𝑐, 𝑑) in the fixed list of representatives of (𝑃 )1 (𝑅/𝑁 ).
INPUT:• c – integral element of the corresponding number field, or a normalized MSymbol.
• d – (optional) when present, it must be an integral element of the number field such that (𝑐, 𝑑) defines anormalized M-symbol of level 𝑁 .
OUTPUT:• i – the index of (𝑐, 𝑑) in the list.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 31)
sage: N = k.ideal(5, a + 3)
sage: P = P1NFList(N)sage: P.index_of_normalized_pair(1, 0)
3
sage: j = randint(0,len(P)-1)
sage: P.index_of_normalized_pair(P[j])==j
True>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(31), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(3))>>> P = P1NFList(N)>>> P.index_of_normalized_pair(Integer(1), Integer(0))(continues on next page)183

Modular Symbols, Release 10.4

(continued from previous page)3>>> j = randint(Integer(0),len(P)-Integer(1))>>> P.index_of_normalized_pair(P[j])==j
True

lift_to_sl2_Ok(i)Lift the 𝑖-th element of this P1NFList to an element of 𝑆𝐿(2, 𝑅), where 𝑅 is the ring of integers of thecorresponding number field.
INPUT:• i – integer (index of the element to lift)
OUTPUT:
If the 𝑖-th element is (𝑐 : 𝑑), the function returns a list of integral elements [𝑎, 𝑏, 𝑐′ , 𝑑′ ] that defines a 2 × 2
matrix with determinant 1 and such that 𝑐 = 𝑐′ (mod 𝑁 ) and 𝑑 = 𝑑′ (mod 𝑁 ).
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3)sage: P = P1NFList(N)sage: len(P)16sage: P[5]M-symbol (1/2*a + 1/2: -a) of level Fractional ideal (3)sage: P.lift_to_sl2_Ok(5)[-a, 2*a - 2, 1/2*a + 1/2, -a]>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(3))>>> P = P1NFList(N)>>> len(P)16>>> P[Integer(5)]M-symbol (1/2*a + 1/2: -a) of level Fractional ideal (3)>>> P.lift_to_sl2_Ok(Integer(5))[-a, 2*a - 2, 1/2*a + 1/2, -a]sage: Ok = k.ring_of_integers()
sage: L = [Matrix(Ok, 2, P.lift_to_sl2_Ok(i)) for i in range(len(P))]
sage: all(det(L[i]) == 1 for i in range(len(L)))
True>>> from sage.all import *>>> Ok = k.ring_of_integers()>>> L = [Matrix(Ok, Integer(2), P.lift_to_sl2_Ok(i)) for i in range(len(P))]>>> all(det(L[i]) == Integer(1) for i in range(len(L)))
Truelist()
Return the underlying list of this P1NFList object.
184

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(5, a+1)
sage: P = P1NFList(N)sage: type(P)<class sage.modular.modsym.p1list_nf.P1NFList >sage: type(P.list())<... list >>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a+Integer(1))>>> P = P1NFList(N)>>> type(P)<class sage.modular.modsym.p1list_nf.P1NFList >>>> type(P.list())<... list >normalize(c, d=None, with_scalar=False)
Return a normalised element of P1 (𝑅/𝑁 ).
INPUT:• c – integral element of the underlying number field, or an MSymbol.
• d – (optional) when present, it must be an integral element of the number field such that (𝑐, 𝑑) defines
an M-symbol of level 𝑁 .
• with_scalar – bool (default False)
OUTPUT:• (only if with_scalar=True) a transforming scalar 𝑢, such that (𝑢 * 𝑐′ , 𝑢 * 𝑑′ ) is congruent to (𝑐 : 𝑑)(mod 𝑁 ).
• a normalized MSymbol (𝑐′ : 𝑑′ ) equivalent to (𝑐 : 𝑑).
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 31)
sage: N = k.ideal(5, a + 3)
sage: P = P1NFList(N)sage: P.normalize(3, a)M-symbol (1: 2*a) of level Fractional ideal (5, 1/2*a + 3/2)>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(31), names=( a ,)); (a,) = k._˓→first_ngens(1)>>> N = k.ideal(Integer(5), a + Integer(3))>>> P = P1NFList(N)>>> P.normalize(Integer(3), a)
M-symbol (1: 2*a) of level Fractional ideal (5, 1/2*a + 3/2)

We can use an MSymbol as input:

185Modular Symbols, Release 10.4

sage: alpha = MSymbol(N, 3, a)sage: P.normalize(alpha)M-symbol (1: 2*a) of level Fractional ideal (5, 1/2*a + 3/2)>>> from sage.all import *>>> alpha = MSymbol(N, Integer(3), a)>>> P.normalize(alpha)M-symbol (1: 2*a) of level Fractional ideal (5, 1/2*a + 3/2)

If we are interested in the normalizing scalar:sage: P.normalize(alpha, with_scalar=True)(-a, M-symbol (1: 2*a) of level Fractional ideal (5, 1/2*a + 3/2))
sage: r, beta = P.normalize(alpha, with_scalar=True)
sage: (r*beta.c - alpha.c in N) and (r*beta.d - alpha.d in N)
True>>> from sage.all import *>>> P.normalize(alpha, with_scalar=True)(-a, M-symbol (1: 2*a) of level Fractional ideal (5, 1/2*a + 3/2))>>> r, beta = P.normalize(alpha, with_scalar=True)>>> (r*beta.c - alpha.c in N) and (r*beta.d - alpha.d in N)
True

sage.modular.modsym.p1list_nf.P1NFList_clear_level_cache()
Clear the global cache of data for the level ideals.
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^3 + 11)
sage: N = k.ideal(a+1)
sage: alpha = MSymbol(N, 2*a^2, 5)
sage: alpha.normalize()
M-symbol (-4*a^2: 5*a^2) of level Fractional ideal (a + 1)
sage: sage.modular.modsym.p1list_nf._level_cache{Fractional ideal (a + 1): (...)}
sage: sage.modular.modsym.p1list_nf.P1NFList_clear_level_cache()sage: sage.modular.modsym.p1list_nf._level_cache{}>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(a+Integer(1))>>> alpha = MSymbol(N, Integer(2)*a**Integer(2), Integer(5))>>> alpha.normalize()
M-symbol (-4*a^2: 5*a^2) of level Fractional ideal (a + 1)>>> sage.modular.modsym.p1list_nf._level_cache{Fractional ideal (a + 1): (...)}>>> sage.modular.modsym.p1list_nf.P1NFList_clear_level_cache()>>> sage.modular.modsym.p1list_nf._level_cache{}sage.modular.modsym.p1list_nf.lift_to_sl2_Ok(N, c, d)
Lift a pair (c, d) to an element of 𝑆𝐿(2, 𝑂𝑘 ), where 𝑂𝑘 is the ring of integers of the corresponding number field.
186

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

INPUT:• N – number field ideal• c – integral element of the number field• d – integral element of the number field
OUTPUT:
A list [𝑎, 𝑏, 𝑐′ , 𝑑′ ] of integral elements that are the entries of a 2 × 2 matrix with determinant 1. The lower two
entries are congruent to 𝑐, 𝑑 modulo the ideal 𝑁 .
EXAMPLES:
sage: from sage.modular.modsym.p1list_nf import lift_to_sl2_Ok
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: Ok = k.ring_of_integers()
sage: N = k.ideal(3)sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 1, a))sage: det(M)1sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 0, a))sage: det(M)1sage: (M[1][0] in N) and (M[1][1] - a in N)
True
sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 0, 0))Traceback (most recent call last):...
ValueError: Cannot lift (0, 0) to an element of Sl2(Ok).
>>> from sage.all import *>>> from sage.modular.modsym.p1list_nf import lift_to_sl2_Ok>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> Ok = k.ring_of_integers()>>> N = k.ideal(Integer(3))>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(1), a))>>> det(M)1>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(0), a))>>> det(M)1>>> (M[Integer(1)][Integer(0)] in N) and (M[Integer(1)][Integer(1)] - a in N)
True>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(0), Integer(0)))
Traceback (most recent call last):...
ValueError: Cannot lift (0, 0) to an element of Sl2(Ok).
sage: k.<a> = NumberField(x^3 + 11)
sage: Ok = k.ring_of_integers()
sage: N = k.ideal(3, a - 1)sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 2*a, 0))
sage: det(M)1(continues on next page)187

Modular Symbols, Release 10.4

(continued from previous page)

sage: (M[1][0] - 2*a in N) and (M[1][1] in N)
True
sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 4*a^2, a + 1))
sage: det(M)1sage: (M[1][0] - 4*a^2 in N) and (M[1][1] - (a+1) in N)
True>>> from sage.all import *>>> k = NumberField(x**Integer(3) + Integer(11), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> Ok = k.ring_of_integers()>>> N = k.ideal(Integer(3), a - Integer(1))>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(2)*a, Integer(0)))>>> det(M)1>>> (M[Integer(1)][Integer(0)] - Integer(2)*a in N) and␣
˓→(M[Integer(1)][Integer(1)] in N)
True>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(4)*a**Integer(2), a +␣˓→Integer(1)))>>> det(M)1>>> (M[Integer(1)][Integer(0)] - Integer(4)*a**Integer(2) in N) and␣
˓→(M[Integer(1)][Integer(1)] - (a+Integer(1)) in N)
True
sage: k.<a> = NumberField(x^4 - x^3 -21*x^2 + 17*x + 133)
sage: Ok = k.ring_of_integers()
sage: N = k.ideal(7, a)sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 0, a^2 - 1))sage: det(M)1sage: (M[1][0] in N) and (M[1][1] - (a^2-1) in N)
True
sage: M = Matrix(Ok, 2, lift_to_sl2_Ok(N, 0, 7))
Traceback (most recent call last):...
ValueError: <0> + <7> and the Fractional ideal (7, a) are not coprime.
>>> from sage.all import *>>> k = NumberField(x**Integer(4) - x**Integer(3) -Integer(21)*x**Integer(2) +␣˓→Integer(17)*x + Integer(133), names=( a ,)); (a,) = k._first_ngens(1)>>> Ok = k.ring_of_integers()>>> N = k.ideal(Integer(7), a)>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(0), a**Integer(2) -␣˓→Integer(1)))>>> det(M)1>>> (M[Integer(1)][Integer(0)] in N) and (M[Integer(1)][Integer(1)] -␣˓→(a**Integer(2)-Integer(1)) in N)
True>>> M = Matrix(Ok, Integer(2), lift_to_sl2_Ok(N, Integer(0), Integer(7)))
Traceback (most recent call last):...
ValueError: <0> + <7> and the Fractional ideal (7, a) are not coprime.

188

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )Modular Symbols, Release 10.4

sage.modular.modsym.p1list_nf.make_coprime(N, c, d)Return (c, d’) so d’ is congruent to d modulo N, and such that c and d’ are coprime (⟨𝑐⟩ + ⟨𝑑′ ⟩ = 𝑅).
INPUT:• N – number field ideal• c – integral element of the number field• d – integral element of the number field
OUTPUT:
A pair (𝑐, 𝑑′ ) where 𝑐, 𝑑′ are integral elements of the corresponding number field, with 𝑑′ congruent to 𝑑 mod 𝑁 ,and such that ⟨𝑐⟩ + ⟨𝑑′ ⟩ = 𝑅 (𝑅 being the corresponding ring of integers).
EXAMPLES:
sage: from sage.modular.modsym.p1list_nf import make_coprime
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3, a - 1)sage: c = 2*a; d = a + 1
sage: N.is_coprime(k.ideal(c, d))Truesage: k.ideal(c).is_coprime(d)Falsesage: c, dp = make_coprime(N, c, d)sage: k.ideal(c).is_coprime(dp)True>>> from sage.all import *>>> from sage.modular.modsym.p1list_nf import make_coprime>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(Integer(3), a - Integer(1))>>> c = Integer(2)*a; d = a + Integer(1)>>> N.is_coprime(k.ideal(c, d))True>>> k.ideal(c).is_coprime(d)False>>> c, dp = make_coprime(N, c, d)>>> k.ideal(c).is_coprime(dp)Truesage.modular.modsym.p1list_nf.p1NFlist(N)Return a list of the normalized elements of P1 (𝑅/𝑁 ), where 𝑁 is an integral ideal.
INPUT:• N – integral ideal (the level or modulus).
EXAMPLES:
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3)sage: from sage.modular.modsym.p1list_nf import p1NFlist, psi
sage: len(p1NFlist(N))==psi(N)
True

189

Modular Symbols, Release 10.4>>> from sage.all import *>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(Integer(3))>>> from sage.modular.modsym.p1list_nf import p1NFlist, psi>>> len(p1NFlist(N))==psi(N)Truesage.modular.modsym.p1list_nf.psi(N)The index [Γ : Γ0 (𝑁 )], where Γ = 𝐺𝐿(2, 𝑅) for 𝑅 the corresponding ring of integers, and Γ0 (𝑁 ) standard
congruence subgroup.
EXAMPLES:
sage: from sage.modular.modsym.p1list_nf import psi
sage: x = polygen(QQ, x )sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(3, a - 1)sage: psi(N)4>>> from sage.all import *>>> from sage.modular.modsym.p1list_nf import psi>>> x = polygen(QQ, x )>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(Integer(3), a - Integer(1))>>> psi(N)4sage: k.<a> = NumberField(x^2 + 23)
sage: N = k.ideal(5)sage: psi(N)26>>> from sage.all import *>>> k = NumberField(x**Integer(2) + Integer(23), names=( a ,)); (a,) = k._first_
˓→ngens(1)>>> N = k.ideal(Integer(5))>>> psi(N)26

190

Chapter 15. Lists of Manin symbols over number fields, elements of P1 (𝑅/𝑁 )CHAPTERSIXTEEN

MONOMIAL EXPANSION OF (𝐴𝑋 + 𝐵𝑌 )𝐼 (𝐶𝑋 + 𝐷𝑌 )𝐽−𝐼

class sage.modular.modsym.apply.Apply
Bases: object
sage.modular.modsym.apply.apply_to_monomial(i, j, a, b, c, d)Return a list of the coefficients of(𝑎𝑋 + 𝑏𝑌 )𝑖 (𝑐𝑋 + 𝑑𝑌 )𝑗−𝑖 ,where 0 ≤ 𝑖 ≤ 𝑗, and 𝑎, 𝑏, 𝑐, 𝑑 are integers.
One should think of 𝑗 as being 𝑘 − 2 for the application to modular symbols.
INPUT:• i, j, a, b, c, d – all ints
OUTPUT:
list of ints, which are the coefficients of 𝑌 𝑗 , 𝑌 𝑗−1 𝑋, . . . , 𝑋 𝑗 , respectively.
EXAMPLES:
We compute that (𝑋 + 𝑌 )2 (𝑋 − 𝑌 ) = 𝑋 3 + 𝑋 2 𝑌 − 𝑋𝑌 2 − 𝑌 3 :sage: from sage.modular.modsym.apply import apply_to_monomial
sage: apply_to_monomial(2, 3, 1,1,1,-1)[-1, -1, 1, 1]
sage: apply_to_monomial(5, 8, 1,2,3,4)[2048, 9728, 20096, 23584, 17200, 7984, 2304, 378, 27]
sage: apply_to_monomial(6,12, 1,1,1,-1)[1, 0, -6, 0, 15, 0, -20, 0, 15, 0, -6, 0, 1]>>> from sage.all import *>>> from sage.modular.modsym.apply import apply_to_monomial>>> apply_to_monomial(Integer(2), Integer(3), Integer(1),Integer(1),Integer(1),˓→Integer(1))[-1, -1, 1, 1]>>> apply_to_monomial(Integer(5), Integer(8), Integer(1),Integer(2),Integer(3),˓→Integer(4))[2048, 9728, 20096, 23584, 17200, 7984, 2304, 378, 27]>>> apply_to_monomial(Integer(6),Integer(12), Integer(1),Integer(1),Integer(1),˓→Integer(1))[1, 0, -6, 0, 15, 0, -20, 0, 15, 0, -6, 0, 1]

191Modular Symbols, Release 10.4

192

Chapter 16. Monomial expansion of (𝑎𝑋 + 𝑏𝑌 )𝑖 (𝑐𝑋 + 𝑑𝑌 )𝑗−𝑖

CHAPTERSEVENTEENSPARSE ACTION OF HECKE OPERATORS

class sage.modular.modsym.hecke_operator.HeckeOperator(parent, n)
Bases: HeckeOperator
apply_sparse(x)Return the image of x under self.
If x is not in self.domain(), raise a TypeError.
EXAMPLES:
sage: M = ModularSymbols(17,4,-1)
sage: T = M.hecke_operator(4)sage: T.apply_sparse(M.0)-27*[X^2,(1,7)] - 167/2*[X^2,(1,9)] - 21/2*[X^2,(1,13)] + 53/2*[X^2,(1,15)]
sage: [T.apply_sparse(x) == T.hecke_module_morphism()(x) for x in M.basis()][True, True, True, True]
sage: N = ModularSymbols(17,4,1)
sage: T.apply_sparse(N.0)
Traceback (most recent call last):...
TypeError: x (=[X^2,(0,1)]) must be in Modular Symbols spaceof dimension 4 for Gamma_0(17) of weight 4 with sign -1
over Rational Field>>> from sage.all import *>>> M = ModularSymbols(Integer(17),Integer(4),-Integer(1))>>> T = M.hecke_operator(Integer(4))>>> T.apply_sparse(M.gen(0))-27*[X^2,(1,7)] - 167/2*[X^2,(1,9)] - 21/2*[X^2,(1,13)] + 53/2*[X^2,(1,15)]>>> [T.apply_sparse(x) == T.hecke_module_morphism()(x) for x in M.basis()][True, True, True, True]>>> N = ModularSymbols(Integer(17),Integer(4),Integer(1))>>> T.apply_sparse(N.gen(0))
Traceback (most recent call last):...
TypeError: x (=[X^2,(0,1)]) must be in Modular Symbols spaceof dimension 4 for Gamma_0(17) of weight 4 with sign -1
over Rational Field

193

Modular Symbols, Release 10.4

194

Chapter 17. Sparse action of Hecke operators

CHAPTEREIGHTEEN

OPTIMIZED COMPUTING OF RELATION MATRICES IN CERTAIN
CASES

sage.modular.modsym.relation_matrix_pyx.sparse_2term_quotient_only_pm1(rels, n)
Perform Sparse Gauss elimination on a matrix all of whose columns have at most 2 nonzero entries with relations
all 1 or -1.
This algorithm is more subtle than just “identify symbols in pairs”, since complicated relations can cause generators
to equal 0.
Note: Note the condition on the s,t coefficients in the relations being 1 or -1 for this optimized function. There isa more general function in relation_matrix.py, which is much, much slower.
INPUT:• rels – iterable made of pairs ((i,s), (j,t)). The pair represents the relation s*x_i + t*x_j = 0, where the i, j
must be Python int’s, and the s,t must all be 1 or -1.
• n – int, the x_i are x_0, …, x_n-1.
OUTPUT:• mod – list such that mod[i] = (j,s), which means that x_i is equivalent to s*x_j, where the x_j are a basis forthe quotient.
The output depends on the order of the input.
EXAMPLES:
sage: from sage.modular.modsym.relation_matrix_pyx import sparse_2term_quotient_
˓→only_pm1
sage: rels = [((0,1), (1,-1)), ((1,1), (3,1)), ((2,1),(3,1)), ((4,1),(5,-1))]
sage: n = 6
sage: sparse_2term_quotient_only_pm1(rels, n)[(3, -1), (3, -1), (3, -1), (3, 1), (5, 1), (5, 1)]>>> from sage.all import *>>> from sage.modular.modsym.relation_matrix_pyx import sparse_2term_quotient_
˓→only_pm1>>> rels = [((Integer(0),Integer(1)), (Integer(1),-Integer(1))), ((Integer(1),˓→Integer(1)), (Integer(3),Integer(1))), ((Integer(2),Integer(1)),(Integer(3),˓→Integer(1))), ((Integer(4),Integer(1)),(Integer(5),-Integer(1)))]>>> n = Integer(6)>>> sparse_2term_quotient_only_pm1(rels, n)[(3, -1), (3, -1), (3, -1), (3, 1), (5, 1), (5, 1)]

195Modular Symbols, Release 10.4

196

Chapter 18. Optimized computing of relation matrices in certain cases

CHAPTERNINETEENOVERCONVERGENT MODULAR SYMBOLS

19.1 Pollack-Stevens’ modular symbols spaces
This module contains a class for spaces of modular symbols that use Glenn Stevens’ conventions, as explained in [PS2011].
There are two main differences between the modular symbols in this directory and the ones in sage.modular.
modsym:• There is a shift in the weight: weight 𝑘 = 0 here corresponds to weight 𝑘 = 2 there.
• There is a duality: these modular symbols are functions from Div0 (𝑃 1 ( )) (cohomological objects), the others areformal linear combinations of Div0 (𝑃 1 ( )) (homological objects).
EXAMPLES:First we create the space of modular symbols of weight 0 (𝑘 = 2) and level 11:
sage: M = PollackStevensModularSymbols(Gamma0(11), 0); M
Space of modular symbols for Congruence Subgroup Gamma0(11) with sign 0 and values in␣˓→Sym^0 Q^2>>> from sage.all import *>>> M = PollackStevensModularSymbols(Gamma0(Integer(11)), Integer(0)); M
Space of modular symbols for Congruence Subgroup Gamma0(11) with sign 0 and values in␣˓→Sym^0 Q^2

One can also create a space of overconvergent modular symbols, by specifying a prime and a precision:
sage: M = PollackStevensModularSymbols(Gamma0(11), p = 5, prec_cap = 10, weight = 0);␣˓→MSpace of overconvergent modular symbols for Congruence Subgroup Gamma0(11) with sign␣
˓→0 and values in Space of 5-adic distributions with k=0 action and precision cap 10>>> from sage.all import *>>> M = PollackStevensModularSymbols(Gamma0(Integer(11)), p = Integer(5), prec_cap =␣
˓→Integer(10), weight = Integer(0)); M
Space of overconvergent modular symbols for Congruence Subgroup Gamma0(11) with sign␣
˓→0 and values in Space of 5-adic distributions with k=0 action and precision cap 10

Currently not much functionality is available on the whole space, and these spaces are mainly used as parents for themodular symbols. These can be constructed from the corresponding classical modular symbols (or even elliptic curves)
as follows:197

Modular Symbols, Release 10.4

sage: A = ModularSymbols(13, sign=1, weight=4).decomposition()[0]sage: A.is_cuspidal()Truesage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→spacesage: f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 13 with values in Sym^2 Q^2sage: f.values()[(-13, 0, -1),
(247/2, 13/2, -6),
(39/2, 117/2, 42),(-39/2, 39, 111/2),(-247/2, -117, -209/2)]
sage: f.parent()
Space of modular symbols for Congruence Subgroup Gamma0(13) with sign 1 and values in␣˓→Sym^2 Q^2>>> from sage.all import *>>> A = ModularSymbols(Integer(13), sign=Integer(1), weight=Integer(4)).
˓→decomposition()[Integer(0)]>>> A.is_cuspidal()True>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space>>> f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 13 with values in Sym^2 Q^2>>> f.values()[(-13, 0, -1),
(247/2, 13/2, -6),
(39/2, 117/2, 42),(-39/2, 39, 111/2),(-247/2, -117, -209/2)]>>> f.parent()
Space of modular symbols for Congruence Subgroup Gamma0(13) with sign 1 and values in␣˓→Sym^2 Q^2sage: E = EllipticCurve( 37a1 )sage: phi = E.pollack_stevens_modular_symbol(); phi
Modular symbol of level 37 with values in Sym^0 Q^2
sage: phi.values()[0, 1, 0, 0, 0, -1, 1, 0, 0]
sage: phi.parent()
Space of modular symbols for Congruence Subgroup Gamma0(37) with sign 0 and values in␣˓→Sym^0 Q^2>>> from sage.all import *>>> E = EllipticCurve( 37a1 )>>> phi = E.pollack_stevens_modular_symbol(); phi
Modular symbol of level 37 with values in Sym^0 Q^2>>> phi.values()[0, 1, 0, 0, 0, -1, 1, 0, 0]>>> phi.parent()
Space of modular symbols for Congruence Subgroup Gamma0(37) with sign 0 and values in␣˓→Sym^0 Q^2class sage.modular.pollack_stevens.space.PollackStevensModularSymbols_factory
Bases: UniqueFactory

198

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

Create a space of Pollack-Stevens modular symbols.
INPUT:• group – integer or congruence subgroup• weight – integer ≥ 0, or None
• sign – integer; -1, 0, 1
• base_ring – ring or None
• p – prime or None
• prec_cap – positive integer or None
• coefficients – the coefficient module (a special type of module, typically distributions), or None
If an explicit coefficient module is given, then the arguments weight, base_ring, prec_cap, and p are
redundant and must be None. They are only relevant if coefficients is None, in which case the coefficientmodule is inferred from the other data.
Note: We emphasize that in the Pollack-Stevens notation, the weight is the usual weight minus 2, so a classicalweight 2 modular form corresponds to a modular symbol of “weight 0”.
EXAMPLES:
sage: M = PollackStevensModularSymbols(Gamma0(7), weight=0, prec_cap = None); M
Space of modular symbols for Congruence Subgroup Gamma0(7) with sign 0 and values␣˓→in Sym^0 Q^2>>> from sage.all import *>>> M = PollackStevensModularSymbols(Gamma0(Integer(7)), weight=Integer(0), prec_
˓→cap = None); M
Space of modular symbols for Congruence Subgroup Gamma0(7) with sign 0 and values␣˓→in Sym^0 Q^2

An example with an explicit coefficient module:
sage: D = OverconvergentDistributions(3, 7, prec_cap=10)
sage: M = PollackStevensModularSymbols(Gamma0(7), coefficients=D); M
Space of overconvergent modular symbols for Congruence Subgroup Gamma0(7) with␣
˓→sign 0 and values in Space of 7-adic distributions with k=3 action and␣
˓→precision cap 10>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(3), Integer(7), prec_cap=Integer(10))>>> M = PollackStevensModularSymbols(Gamma0(Integer(7)), coefficients=D); M
Space of overconvergent modular symbols for Congruence Subgroup Gamma0(7) with␣
˓→sign 0 and values in Space of 7-adic distributions with k=3 action and␣
˓→precision cap 10

create_key(group, weight=None, sign=0, base_ring=None, p=None, prec_cap=None, coefficients=None)
Sanitize input.
EXAMPLES:

19.1. Pollack-Stevens’ modular symbols spaces

199

Modular Symbols, Release 10.4

sage: D = OverconvergentDistributions(3, 7, prec_cap=10)
sage: M = PollackStevensModularSymbols(Gamma0(7), coefficients=D) # indirect␣
˓→doctest>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(3), Integer(7), prec_
˓→cap=Integer(10))>>> M = PollackStevensModularSymbols(Gamma0(Integer(7)), coefficients=D) #␣˓→indirect doctest

create_object(version, key)
Create a space of modular symbols from key.
INPUT:• version – the version of the object to create• key – a tuple of parameters, as created by create_key()
EXAMPLES:
sage: D = OverconvergentDistributions(5, 7, 15)
sage: M = PollackStevensModularSymbols(Gamma0(7), coefficients=D) # indirect␣
˓→doctest
sage: M2 = PollackStevensModularSymbols(Gamma0(7), coefficients=D) # indirect␣
˓→doctest
sage: M is M2
True>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(5), Integer(7), Integer(15))>>> M = PollackStevensModularSymbols(Gamma0(Integer(7)), coefficients=D) #␣˓→indirect doctest>>> M2 = PollackStevensModularSymbols(Gamma0(Integer(7)), coefficients=D) #␣˓→indirect doctest>>> M is M2
Trueclass sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace(group,coefficients,
sign=0)
Bases: Module
A class for spaces of modular symbols that use Glenn Stevens’ conventions. This class should not be instantiateddirectly by the user: this is handled by the factory object PollackStevensModularSymbols_factory.
INPUT:• group – congruence subgroup• coefficients – a coefficient module• sign – (default: 0); 0, -1, or 1
EXAMPLES:
sage: D = OverconvergentDistributions(2, 11)
sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D); M.sign()(continues on next page)

200

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)0
sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D, sign=-1); M.
˓→sign()-1
sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D, sign=1); M.
˓→sign()1>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(11))>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D); M.sign()
0>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D, sign=˓→Integer(1)); M.sign()-1>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D,␣
˓→sign=Integer(1)); M.sign()
1change_ring(new_base_ring)
Change the base ring of this space to new_base_ring.
INPUT:• new_base_ring – a ring
OUTPUT:
A space of modular symbols over the specified base.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import Symk
sage: D = Symk(4)sage: M = PollackStevensModularSymbols(Gamma(6), coefficients=D); M
Space of modular symbols for Congruence Subgroup Gamma(6) with sign 0 and␣
˓→values in Sym^4 Q^2sage: M.change_ring(Qp(5,8))
Space of modular symbols for Congruence Subgroup Gamma(6) with sign 0 and␣
˓→values in Sym^4 Q_5^2>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import Symk>>> D = Symk(Integer(4))>>> M = PollackStevensModularSymbols(Gamma(Integer(6)), coefficients=D); M
Space of modular symbols for Congruence Subgroup Gamma(6) with sign 0 and␣
˓→values in Sym^4 Q^2>>> M.change_ring(Qp(Integer(5),Integer(8)))
Space of modular symbols for Congruence Subgroup Gamma(6) with sign 0 and␣
˓→values in Sym^4 Q_5^2coefficient_module()
Return the coefficient module of this space.
EXAMPLES:

19.1. Pollack-Stevens’ modular symbols spaces

201

Modular Symbols, Release 10.4

sage: D = OverconvergentDistributions(2, 11)
sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D)
sage: M.coefficient_module()
Space of 11-adic distributions with k=2 action and precision cap 20
sage: M.coefficient_module() is D
True>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(11))>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D)>>> M.coefficient_module()
Space of 11-adic distributions with k=2 action and precision cap 20>>> M.coefficient_module() is D
Truegroup()
Return the congruence subgroup of this space.
EXAMPLES:
sage: D = OverconvergentDistributions(2, 5)
sage: G = Gamma0(23)sage: M = PollackStevensModularSymbols(G, coefficients=D)
sage: M.group()
Congruence Subgroup Gamma0(23)sage: D = Symk(4)sage: G = Gamma1(11)sage: M = PollackStevensModularSymbols(G, coefficients=D)
sage: M.group()
Congruence Subgroup Gamma1(11)>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(5))>>> G = Gamma0(Integer(23))>>> M = PollackStevensModularSymbols(G, coefficients=D)>>> M.group()
Congruence Subgroup Gamma0(23)>>> D = Symk(Integer(4))>>> G = Gamma1(Integer(11))>>> M = PollackStevensModularSymbols(G, coefficients=D)>>> M.group()
Congruence Subgroup Gamma1(11)level()
Return the level 𝑁 , where this space is of level Γ0 (𝑁 ).
EXAMPLES:
sage: D = OverconvergentDistributions(7, 11)
sage: M = PollackStevensModularSymbols(Gamma1(14), coefficients=D)
sage: M.level()
14>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(7), Integer(11))>>> M = PollackStevensModularSymbols(Gamma1(Integer(14)), coefficients=D)(continues on next page)

202

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> M.level()
14

ncoset_reps()
Return the number of coset representatives defining the domain of the modular symbols in this space.
OUTPUT:
The number of coset representatives stored in the manin relations. (Just the size of 𝑃 1 ( /𝑁 ))EXAMPLES:
sage: D = Symk(2)sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D)
sage: M.ncoset_reps()3>>> from sage.all import *>>> D = Symk(Integer(2))>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D)>>> M.ncoset_reps()
3

ngens()
Returns the number of generators defining this space.
EXAMPLES:
sage: D = OverconvergentDistributions(4, 29)
sage: M = PollackStevensModularSymbols(Gamma1(12), coefficients=D)
sage: M.ngens()
5sage: D = Symk(2)sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D)
sage: M.ngens()2>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(4), Integer(29))>>> M = PollackStevensModularSymbols(Gamma1(Integer(12)), coefficients=D)>>> M.ngens()5>>> D = Symk(Integer(2))>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D)>>> M.ngens()
2

precision_cap()
Return the number of moments of each element of this space.
EXAMPLES:
sage: D = OverconvergentDistributions(2, 5)
sage: M = PollackStevensModularSymbols(Gamma1(13), coefficients=D)
sage: M.precision_cap()
20(continues on next page)

19.1. Pollack-Stevens’ modular symbols spaces

203

Modular Symbols, Release 10.4

(continued from previous page)

sage: D = OverconvergentDistributions(3, 7, prec_cap=10)
sage: M = PollackStevensModularSymbols(Gamma0(7), coefficients=D)
sage: M.precision_cap()
10>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(5))>>> M = PollackStevensModularSymbols(Gamma1(Integer(13)), coefficients=D)>>> M.precision_cap()
20>>> D = OverconvergentDistributions(Integer(3), Integer(7), prec_
˓→cap=Integer(10))>>> M = PollackStevensModularSymbols(Gamma0(Integer(7)), coefficients=D)>>> M.precision_cap()
10

prime()
Return the prime of this space.
EXAMPLES:
sage: D = OverconvergentDistributions(2, 11)
sage: M = PollackStevensModularSymbols(Gamma(2), coefficients=D)
sage: M.prime()
11>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(11))>>> M = PollackStevensModularSymbols(Gamma(Integer(2)), coefficients=D)>>> M.prime()
11

random_element(M=None)
Return a random overconvergent modular symbol in this space with 𝑀 moments
INPUT:• M – positive integer
OUTPUT:An element of the modular symbol space with 𝑀 moments
Returns a random element in this space by randomly choosing values of distributions on all but one divisor,and solves the difference equation to determine the value on the last divisor.
sage: D = OverconvergentDistributions(2, 11)
sage: M = PollackStevensModularSymbols(Gamma0(11), coefficients=D)
sage: M.random_element(10)Traceback (most recent call last):...
NotImplementedError>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(11))>>> M = PollackStevensModularSymbols(Gamma0(Integer(11)), coefficients=D)>>> M.random_element(Integer(10))(continues on next page)

204

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

Traceback (most recent call last):...
NotImplementedErrorsign()
Return the sign of this space.
EXAMPLES:
sage: D = OverconvergentDistributions(3, 17)
sage: M = PollackStevensModularSymbols(Gamma(5), coefficients=D)
sage: M.sign()
0sage: D = Symk(4)sage: M = PollackStevensModularSymbols(Gamma1(8), coefficients=D, sign=-1)
sage: M.sign()-1>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(3), Integer(17))>>> M = PollackStevensModularSymbols(Gamma(Integer(5)), coefficients=D)>>> M.sign()
0>>> D = Symk(Integer(4))>>> M = PollackStevensModularSymbols(Gamma1(Integer(8)), coefficients=D,␣
˓→sign=-Integer(1))>>> M.sign()-1source()Return the domain of the modular symbols in this space.
OUTPUT:
A sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain
EXAMPLES:
sage: D = OverconvergentDistributions(2, 11)
sage: M = PollackStevensModularSymbols(Gamma0(2), coefficients=D)
sage: M.source()
Manin Relations of level 2>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(2), Integer(11))>>> M = PollackStevensModularSymbols(Gamma0(Integer(2)), coefficients=D)>>> M.source()
Manin Relations of level 2

weight()Return the weight of this space.
Warning: We emphasize that in the Pollack-Stevens notation, this is the usual weight minus 2, so aclassical weight 2 modular form corresponds to a modular symbol of “weight 0”.

19.1. Pollack-Stevens’ modular symbols spaces

205

Modular Symbols, Release 10.4

EXAMPLES:
sage: D = Symk(5)sage: M = PollackStevensModularSymbols(Gamma1(7), coefficients=D)
sage: M.weight()
5>>> from sage.all import *>>> D = Symk(Integer(5))>>> M = PollackStevensModularSymbols(Gamma1(Integer(7)), coefficients=D)>>> M.weight()
5sage.modular.pollack_stevens.space.cusps_from_mat(g)Return the cusps associated to an element of a congruence subgroup.
INPUT:• g – an element of a congruence subgroup or a matrix
OUTPUT:
A tuple of cusps associated to g.
EXAMPLES:
sage: from sage.modular.pollack_stevens.space import cusps_from_mat
sage: g = SL2Z.one()sage: cusps_from_mat(g)(+Infinity, 0)>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import cusps_from_mat>>> g = SL2Z.one()>>> cusps_from_mat(g)(+Infinity, 0)

You can also just give the matrix of g:sage: type(g)<class sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement >sage: cusps_from_mat(g.matrix())(+Infinity, 0)>>> from sage.all import *>>> type(g)<class sage.modular.arithgroup.arithgroup_element.ArithmeticSubgroupElement >>>> cusps_from_mat(g.matrix())(+Infinity, 0)

Another example:
sage: from sage.modular.pollack_stevens.space import cusps_from_mat
sage: g = GammaH(3, [2]).generators()[1].matrix(); g[-1 1][-3 2]
sage: cusps_from_mat(g)(1/3, 1/2)

206

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import cusps_from_mat>>> g = GammaH(Integer(3), [Integer(2)]).generators()[Integer(1)].matrix(); g[-1 1][-3 2]>>> cusps_from_mat(g)(1/3, 1/2)

sage.modular.pollack_stevens.space.ps_modsym_from_elliptic_curve(E, sign=0, implementation='eclib')
Return the overconvergent modular symbol associated to an elliptic curve defined over the rationals.
INPUT:• E – an elliptic curve defined over the rationals• sign – the sign (default: 0). If nonzero, returns either the plus (if sign == 1) or the minus (if sign ==-1) modular symbol. The default of 0 returns the sum of the plus and minus symbols.
• implementation – either ‘eclib’ (default) or ‘sage’. This determines which implementation of the underlying classical modular symbols is used.
OUTPUT:
The overconvergent modular symbol associated to E
EXAMPLES:
sage: E = EllipticCurve( 113a1 )sage: symb = E.pollack_stevens_modular_symbol() # indirect doctest
sage: symb
Modular symbol of level 113 with values in Sym^0 Q^2
sage: symb.values()[-1/2, 1, -1, 0, 0, 1, 1, -1, 0, -1, 0, 0, 0, 1, -1, 0, 0, 0, 1, 0, 0]
sage: E = EllipticCurve([0,1])
sage: symb = E.pollack_stevens_modular_symbol()sage: symb.values()[-1/6, 1/3, 1/2, 1/6, -1/6, 1/3, -1/3, -1/2, -1/6, 1/6, 0, -1/6, -1/6]>>> from sage.all import *>>> E = EllipticCurve( 113a1 )>>> symb = E.pollack_stevens_modular_symbol() # indirect doctest>>> symb
Modular symbol of level 113 with values in Sym^0 Q^2>>> symb.values()[-1/2, 1, -1, 0, 0, 1, 1, -1, 0, -1, 0, 0, 0, 1, -1, 0, 0, 0, 1, 0, 0]>>> E = EllipticCurve([Integer(0),Integer(1)])>>> symb = E.pollack_stevens_modular_symbol()>>> symb.values()[-1/6, 1/3, 1/2, 1/6, -1/6, 1/3, -1/3, -1/2, -1/6, 1/6, 0, -1/6, -1/6]

sage.modular.pollack_stevens.space.ps_modsym_from_simple_modsym_space(A,name='alpha')
Returns some choice – only well defined up a nonzero scalar (!) – of an overconvergent modular symbol that
corresponds to A.

19.1. Pollack-Stevens’ modular symbols spaces

207

Modular Symbols, Release 10.4

INPUT:• A – nonzero simple Hecke equivariant new space of modular symbols, which need not be cuspidal.
OUTPUT:
A choice of corresponding overconvergent modular symbols; when dim(A)>1, we make an arbitrary choice ofdefining polynomial for the codomain field.
EXAMPLES:
The level 11 example:
sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→spacesage: A = ModularSymbols(11, sign=1, weight=2).decomposition()[0]sage: A.is_cuspidal()Truesage: f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 11 with values in Sym^0 Q^2
sage: f.values()[1, -5/2, -5/2]
sage: f.weight()# this is A.weight()-2 !!!!!!
0>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→space>>> A = ModularSymbols(Integer(11), sign=Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(0)]>>> A.is_cuspidal()True>>> f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 11 with values in Sym^0 Q^2>>> f.values()[1, -5/2, -5/2]>>> f.weight()# this is A.weight()-2 !!!!!!
0

And the -1 sign for the level 11 example:
sage: A = ModularSymbols(11, sign=-1, weight=2).decomposition()[0]sage: f = ps_modsym_from_simple_modsym_space(A); f.values()[0, 1, -1]>>> from sage.all import *>>> A = ModularSymbols(Integer(11), sign=-Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(0)]>>> f = ps_modsym_from_simple_modsym_space(A); f.values()[0, 1, -1]

A does not have to be cuspidal; it can be Eisenstein:sage: A = ModularSymbols(11, sign=1, weight=2).decomposition()[1]sage: A.is_cuspidal()False
sage: f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 11 with values in Sym^0 Q^2(continues on next page)

208

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: f.values()[1, 0, 0]>>> from sage.all import *>>> A = ModularSymbols(Integer(11), sign=Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(1)]>>> A.is_cuspidal()False>>> f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 11 with values in Sym^0 Q^2>>> f.values()[1, 0, 0]

We create the simplest weight 2 example in which A has dimension bigger than 1:
sage: A = ModularSymbols(23, sign=1, weight=2).decomposition()[0]sage: f = ps_modsym_from_simple_modsym_space(A); f.values()[1, 0, 0, 0, 0]
sage: A = ModularSymbols(23, sign=-1, weight=2).decomposition()[0]sage: f = ps_modsym_from_simple_modsym_space(A); f.values()[0, 1, -alpha, alpha, -1]
sage: f.base_ring()
Number Field in alpha with defining polynomial x^2 + x - 1>>> from sage.all import *>>> A = ModularSymbols(Integer(23), sign=Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(0)]>>> f = ps_modsym_from_simple_modsym_space(A); f.values()[1, 0, 0, 0, 0]>>> A = ModularSymbols(Integer(23), sign=-Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(0)]>>> f = ps_modsym_from_simple_modsym_space(A); f.values()[0, 1, -alpha, alpha, -1]>>> f.base_ring()
Number Field in alpha with defining polynomial x^2 + x - 1

We create the +1 modular symbol attached to the weight 12 modular form Delta:
sage: A = ModularSymbols(1, sign=+1, weight=12).decomposition()[0]sage: f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 1 with values in Sym^10 Q^2
sage: f.values()[(-1620/691, 0, 1, 0, -9/14, 0, 9/14, 0, -1, 0, 1620/691), (1620/691, 1620/691,␣
˓→929/691, -453/691, -29145/9674, -42965/9674, -2526/691, -453/691, 1620/691,␣
˓→1620/691, 0), (0, -1620/691, -1620/691, 453/691, 2526/691, 42965/9674, 29145/
˓→9674, 453/691, -929/691, -1620/691, -1620/691)]>>> from sage.all import *>>> A = ModularSymbols(Integer(1), sign=+Integer(1), weight=Integer(12)).
˓→decomposition()[Integer(0)]>>> f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 1 with values in Sym^10 Q^2>>> f.values()[(-1620/691, 0, 1, 0, -9/14, 0, 9/14, 0, -1, 0, 1620/691), (1620/691, 1620/691,␣
˓→929/691, -453/691, -29145/9674, -42965/9674, -2526/691, -453/691, 1620/691,␣
(continues on next page)

19.1. Pollack-Stevens’ modular symbols spaces

209

Modular Symbols, Release 10.4

(continued from previous page)1620/691, 0), (0, -1620/691, -1620/691, 453/691, 2526/691, 42965/9674, 29145/
˓→9674, 453/691, -929/691, -1620/691, -1620/691)]
˓→And, the -1 modular symbol attached to Delta:
sage: A = ModularSymbols(1, sign=-1, weight=12).decomposition()[0]sage: f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 1 with values in Sym^10 Q^2
sage: f.values()[(0, 1, 0, -25/48, 0, 5/12, 0, -25/48, 0, 1, 0), (0, -1, -2, -119/48, -23/12, -5/
˓→24, 23/12, 3, 2, 0, 0), (0, 0, 2, 3, 23/12, -5/24, -23/12, -119/48, -2, -1, 0)]>>> from sage.all import *>>> A = ModularSymbols(Integer(1), sign=-Integer(1), weight=Integer(12)).
˓→decomposition()[Integer(0)]>>> f = ps_modsym_from_simple_modsym_space(A); f
Modular symbol of level 1 with values in Sym^10 Q^2>>> f.values()[(0, 1, 0, -25/48, 0, 5/12, 0, -25/48, 0, 1, 0), (0, -1, -2, -119/48, -23/12, -5/
˓→24, 23/12, 3, 2, 0, 0), (0, 0, 2, 3, 23/12, -5/24, -23/12, -119/48, -2, -1, 0)]A
consistency
check
with
ps_modsym_from_simple_modsym_space():sage.modular.pollack_stevens.space.

sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→spacesage: E = EllipticCurve( 11a )sage: f_E = E.pollack_stevens_modular_symbol(); f_E.values()[-1/5, 1, 0]
sage: A = ModularSymbols(11, sign=1, weight=2).decomposition()[0]sage: f_plus = ps_modsym_from_simple_modsym_space(A); f_plus.values()[1, -5/2, -5/2]
sage: A = ModularSymbols(11, sign=-1, weight=2).decomposition()[0]sage: f_minus = ps_modsym_from_simple_modsym_space(A); f_minus.values()[0, 1, -1]>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→space>>> E = EllipticCurve( 11a )>>> f_E = E.pollack_stevens_modular_symbol(); f_E.values()[-1/5, 1, 0]>>> A = ModularSymbols(Integer(11), sign=Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(0)]>>> f_plus = ps_modsym_from_simple_modsym_space(A); f_plus.values()[1, -5/2, -5/2]>>> A = ModularSymbols(Integer(11), sign=-Integer(1), weight=Integer(2)).
˓→decomposition()[Integer(0)]>>> f_minus = ps_modsym_from_simple_modsym_space(A); f_minus.values()[0, 1, -1]

We find that a linear combination of the plus and minus parts equals the Pollack-Stevens symbol attached to E. Thisillustrates how ps_modsym_from_simple_modsym_space is only well-defined up to a nonzero scalar:sage: (-1/5)*vector(QQ, f_plus.values()) + (1/2)*vector(QQ, f_minus.values())(-1/5, 1, 0)(continues on next page)

210

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: vector(QQ, f_E.values())(-1/5, 1, 0)>>> from sage.all import *>>> (-Integer(1)/Integer(5))*vector(QQ, f_plus.values()) + (Integer(1)/˓→Integer(2))*vector(QQ, f_minus.values())(-1/5, 1, 0)>>> vector(QQ, f_E.values())(-1/5, 1, 0)

The next few examples all illustrate the ways in which exceptions are raised if A does not satisfy various constraints.
First, A must be new:sage: A = ModularSymbols(33,sign=1).cuspidal_subspace().old_subspace()sage: ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must be new>>> from sage.all import *>>> A = ModularSymbols(Integer(33),sign=Integer(1)).cuspidal_subspace().old_
˓→subspace()>>> ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must be new

A must be simple:
sage: A = ModularSymbols(43,sign=1).cuspidal_subspace()sage: ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must be simple>>> from sage.all import *>>> A = ModularSymbols(Integer(43),sign=Integer(1)).cuspidal_subspace()>>> ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must be simple

A must have sign -1 or +1 in order to be simple:
sage: A = ModularSymbols(11).cuspidal_subspace()sage: ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must have sign +1 or -1 (otherwise it is not simple)>>> from sage.all import *>>> A = ModularSymbols(Integer(11)).cuspidal_subspace()>>> ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):(continues on next page)

19.1. Pollack-Stevens’ modular symbols spaces

211

Modular Symbols, Release 10.4

(continued from previous page)...
ValueError: A must have sign +1 or -1 (otherwise it is not simple)

The dimension must be positive:
sage: A = ModularSymbols(10).cuspidal_subspace(); A
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 3␣
˓→for Gamma_0(10) of weight 2 with sign 0 over Rational Field
sage: ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must have positive dimension>>> from sage.all import *>>> A = ModularSymbols(Integer(10)).cuspidal_subspace(); A
Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 3␣
˓→for Gamma_0(10) of weight 2 with sign 0 over Rational Field>>> ps_modsym_from_simple_modsym_space(A)Traceback (most recent call last):...
ValueError: A must have positive dimension

We check that forms of nontrivial character are getting handled correctly:
sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→spacesage: f = Newforms(Gamma1(13), names= a )[0]sage: phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(1))
sage: phi.hecke(7)Modular symbol of level 13 with values in Sym^0 (Number Field in alpha with␣
˓→defining polynomial x^2 + 3*x + 3)^2 twisted by Dirichlet character modulo 13␣˓→of conductor 13 mapping 2 |--> -alpha - 1
sage: phi.hecke(7).values()[0, 0, 0, 0, 0]>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→space>>> f = Newforms(Gamma1(Integer(13)), names= a )[Integer(0)]>>> phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(Integer(1)))>>> phi.hecke(Integer(7))
Modular symbol of level 13 with values in Sym^0 (Number Field in alpha with␣
˓→defining polynomial x^2 + 3*x + 3)^2 twisted by Dirichlet character modulo 13␣˓→of conductor 13 mapping 2 |--> -alpha - 1>>> phi.hecke(Integer(7)).values()[0, 0, 0, 0, 0]

212

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

19.2 Spaces of distributions for Pollack-Stevens modular symbols
The Pollack-Stevens version of modular symbols take values on a Σ0 (𝑁 )-module which can be either a symmetric powerof the standard representation of GL2, or a finite approximation module to the module of overconvergent distributions.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import Symk
sage: S = Symk(6); S
Sym^6 Q^2
sage: v = S(list(range(7))); v(0, 1, 2, 3, 4, 5, 6)
sage: v.act_right([1,2,3,4])(18432, 27136, 39936, 58752, 86400, 127008, 186624)
sage: S = Symk(4,Zp(5)); S
Sym^4 Z_5^2
sage: S([1,2,3,4,5])(1 + O(5^20), 2 + O(5^20), 3 + O(5^20), 4 + O(5^20), 5 + O(5^21))>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import Symk>>> S = Symk(Integer(6)); S
Sym^6 Q^2>>> v = S(list(range(Integer(7)))); v(0, 1, 2, 3, 4, 5, 6)>>> v.act_right([Integer(1),Integer(2),Integer(3),Integer(4)])(18432, 27136, 39936, 58752, 86400, 127008, 186624)>>> S = Symk(Integer(4),Zp(Integer(5))); S
Sym^4 Z_5^2>>> S([Integer(1),Integer(2),Integer(3),Integer(4),Integer(5)])(1 + O(5^20), 2 + O(5^20), 3 + O(5^20), 4 + O(5^20), 5 + O(5^21))
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions
sage: D = OverconvergentDistributions(3, 11, 5); DSpace of 11-adic distributions with k=3 action and precision cap 5
sage: D([1,2,3,4,5])(1 + O(11^5), 2 + O(11^4), 3 + O(11^3), 4 + O(11^2), 5 + O(11))>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import OverconvergentDistributions>>> D = OverconvergentDistributions(Integer(3), Integer(11), Integer(5)); DSpace of 11-adic distributions with k=3 action and precision cap 5>>> D([Integer(1),Integer(2),Integer(3),Integer(4),Integer(5)])(1 + O(11^5), 2 + O(11^4), 3 + O(11^3), 4 + O(11^2), 5 + O(11))

19.2. Spaces of distributions for Pollack-Stevens modular symbols

213

Modular Symbols, Release 10.4class sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract(k,p=Non
prec_cabase=Ncharacter=No
adjuster=
act_ondettwist=N
act_paimplementation=N
Bases: Module
Parent object for distributions. Not to be used directly, see derived classes Symk_class and OverconvergentDistributions_class.
INPUT:• k – integer; 𝑘 is the usual modular forms weight minus 2• p – None or prime• prec_cap – None or positive integer• base – None or the base ring over which to construct the distributions• character – None or Dirichlet character• adjuster – None or a way to specify the action among different conventions• act_on_left – bool (default: False)• dettwist – None or integer (twist by determinant). Ignored for Symk spaces• act_padic – bool (default: False) If true, will allow action by 𝑝-adic matrices.
• implementation – string (default: None) Either automatic (if None), ‘vector’ or ‘long’.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions
sage: OverconvergentDistributions(2, 17, 100)
Space of 17-adic distributions with k=2 action and precision cap 100
sage: D = OverconvergentDistributions(2, 3, 5); DSpace of 3-adic distributions with k=2 action and precision cap 5
sage: type(D)<class sage.modular.pollack_stevens.distributions.OverconvergentDistributions_
˓→class_with_category >>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣
(continues on next page)

214

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

OverconvergentDistributions>>> OverconvergentDistributions(Integer(2), Integer(17), Integer(100))
Space of 17-adic distributions with k=2 action and precision cap 100
˓→>>> D = OverconvergentDistributions(Integer(2), Integer(3), Integer(5)); DSpace of 3-adic distributions with k=2 action and precision cap 5>>> type(D)<class sage.modular.pollack_stevens.distributions.OverconvergentDistributions_
˓→class_with_category >acting_matrix(g, M)
Return the matrix for the action of 𝑔 on self, truncated to the first 𝑀 moments.
EXAMPLES:
sage: V = Symk(3)sage: from sage.modular.pollack_stevens.sigma0 import Sigma0
sage: V.acting_matrix(Sigma0(1)([3,4,0,1]), 4)[27 36 48 64][ 0 9 24 48][ 0 0 3 12][ 0 0 0 1]
sage: from sage.modular.btquotients.pautomorphicform import _btquot_adjuster
sage: V = Symk(3, adjuster = _btquot_adjuster())
sage: from sage.modular.pollack_stevens.sigma0 import Sigma0
sage: V.acting_matrix(Sigma0(1)([3,4,0,1]), 4)[ 1
4 16 64][ 0
3 24 144][ 0
0
9 108][ 00
0 27]>>> from sage.all import *>>> V = Symk(Integer(3))>>> from sage.modular.pollack_stevens.sigma0 import Sigma0>>> V.acting_matrix(Sigma0(Integer(1))([Integer(3),Integer(4),Integer(0),˓→Integer(1)]), Integer(4))[27 36 48 64][ 0 9 24 48][ 0 0 3 12][ 0 0 0 1]>>> from sage.modular.btquotients.pautomorphicform import _btquot_adjuster>>> V = Symk(Integer(3), adjuster = _btquot_adjuster())>>> from sage.modular.pollack_stevens.sigma0 import Sigma0>>> V.acting_matrix(Sigma0(Integer(1))([Integer(3),Integer(4),Integer(0),˓→Integer(1)]), Integer(4))[ 1
4 16 64][ 0
3 24 144][ 0
0
9 108][ 00
0 27]

approx_module(M=None)
Return the 𝑀 -th approximation module, or if 𝑀 is not specified, return the largest approximation module.
INPUT:• M – None or nonnegative integer that is at most the precision cap
19.2. Spaces of distributions for Pollack-Stevens modular symbols

215

Modular Symbols, Release 10.4

EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions
sage: D = OverconvergentDistributions(0, 5, 10)
sage: D.approx_module()
Ambient free module of rank 10 over the principal ideal domain 5-adic Ring␣˓→with capped absolute precision 10
sage: D.approx_module(1)Ambient free module of rank 1 over the principal ideal domain 5-adic Ring␣˓→with capped absolute precision 10
sage: D.approx_module(0)Ambient free module of rank 0 over the principal ideal domain 5-adic Ring␣˓→with capped absolute precision 10>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions>>> D = OverconvergentDistributions(Integer(0), Integer(5), Integer(10))>>> D.approx_module()
Ambient free module of rank 10 over the principal ideal domain 5-adic Ring␣˓→with capped absolute precision 10>>> D.approx_module(Integer(1))
Ambient free module of rank 1 over the principal ideal domain 5-adic Ring␣˓→with capped absolute precision 10>>> D.approx_module(Integer(0))
Ambient free module of rank 0 over the principal ideal domain 5-adic Ring␣˓→with capped absolute precision 10

Note that M must be at most the precision cap, and must be nonnegative:
sage: D.approx_module(11)Traceback (most recent call last):...
ValueError: M (=11) must be less than or equal to the precision cap (=10)
sage: D.approx_module(-1)
Traceback (most recent call last):...
ValueError: rank (=-1) must be nonnegative>>> from sage.all import *>>> D.approx_module(Integer(11))
Traceback (most recent call last):...
ValueError: M (=11) must be less than or equal to the precision cap (=10)>>> D.approx_module(-Integer(1))
Traceback (most recent call last):...
ValueError: rank (=-1) must be nonnegativebasis(M=None)
Return a basis for this space of distributions.
INPUT:• M – (Default: None) If not None, specifies the M-th approximation module, in case that this makes sense.
EXAMPLES:

216

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7, 4); D
Space of 7-adic distributions with k=0 action and precision cap 4
sage: D.basis()[(1 + O(7^4), O(7^3), O(7^2), O(7)),(O(7^4), 1 + O(7^3), O(7^2), O(7)),(O(7^4), O(7^3), 1 + O(7^2), O(7)),(O(7^4), O(7^3), O(7^2), 1 + O(7))]
sage: D.basis(2)[(1 + O(7^2), O(7)), (O(7^2), 1 + O(7))]
sage: D = Symk(3, base=QQ); D
Sym^3 Q^2
sage: D.basis()[(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)]
sage: D.basis(2)Traceback (most recent call last):...
ValueError: Sym^k objects do not support approximation modules>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7), Integer(4)); DSpace of 7-adic distributions with k=0 action and precision cap 4>>> D.basis()[(1 + O(7^4), O(7^3), O(7^2), O(7)),(O(7^4), 1 + O(7^3), O(7^2), O(7)),(O(7^4), O(7^3), 1 + O(7^2), O(7)),(O(7^4), O(7^3), O(7^2), 1 + O(7))]>>> D.basis(Integer(2))[(1 + O(7^2), O(7)), (O(7^2), 1 + O(7))]>>> D = Symk(Integer(3), base=QQ); D
Sym^3 Q^2>>> D.basis()[(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)]>>> D.basis(Integer(2))
Traceback (most recent call last):...
ValueError: Sym^k objects do not support approximation modules

clear_cache()
Clear some caches that are created only for speed purposes.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7, 10)
sage: D.clear_cache()>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7), Integer(10))>>> D.clear_cache()19.2. Spaces of distributions for Pollack-Stevens modular symbols

217

Modular Symbols, Release 10.4

lift(p=None, M=None, new_base_ring=None)
Return distribution space that contains lifts with given p, precision cap M, and base ring new_base_ring.
INPUT:• p – prime or None
• M – nonnegative integer or None
• new_base_ring – ring or None
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = Symk(0, Qp(7)); DSym^0 Q_7^2sage: D.lift(M=20)
Space of 7-adic distributions with k=0 action and precision cap 20
sage: D.lift(p=7, M=10)
Space of 7-adic distributions with k=0 action and precision cap 10
sage: D.lift(p=7, M=10, new_base_ring=QpCR(7,15)).base_ring()
7-adic Field with capped relative precision 15>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = Symk(Integer(0), Qp(Integer(7))); DSym^0 Q_7^2>>> D.lift(M=Integer(20))
Space of 7-adic distributions with k=0 action and precision cap 20>>> D.lift(p=Integer(7), M=Integer(10))
Space of 7-adic distributions with k=0 action and precision cap 10>>> D.lift(p=Integer(7), M=Integer(10), new_base_ring=QpCR(Integer(7),˓→Integer(15))).base_ring()
7-adic Field with capped relative precision 15

precision_cap()
Return the precision cap on distributions.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7, 10); D
Space of 7-adic distributions with k=0 action and precision cap 10
sage: D.precision_cap()
10
sage: D = Symk(389, base=QQ); D
Sym^389 Q^2sage: D.precision_cap()390>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7), Integer(10)); DSpace of 7-adic distributions with k=0 action and precision cap 10>>> D.precision_cap()(continues on next page)

218

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)10>>> D = Symk(Integer(389), base=QQ); D
Sym^389 Q^2>>> D.precision_cap()390

prime()
Return prime 𝑝 such that this is a space of 𝑝-adic distributions.
In case this space is Symk of a non-padic field, we return 0.
OUTPUT:• a prime or 0
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7); DSpace of 7-adic distributions with k=0 action and precision cap 20
sage: D.prime()
7
sage: D = Symk(4, base=GF(7)); D
Sym^4 (Finite Field of size 7)^2
sage: D.prime()
0>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7)); DSpace of 7-adic distributions with k=0 action and precision cap 20>>> D.prime()
7>>> D = Symk(Integer(4), base=GF(Integer(7))); D
Sym^4 (Finite Field of size 7)^2>>> D.prime()
0

But Symk of a 𝑝-adic field does work:
sage: D = Symk(4, base=Qp(7)); D
Sym^4 Q_7^2sage: D.prime()
7
sage: D.is_symk()
True>>> from sage.all import *>>> D = Symk(Integer(4), base=Qp(Integer(7))); D
Sym^4 Q_7^2>>> D.prime()
7>>> D.is_symk()
True

19.2. Spaces of distributions for Pollack-Stevens modular symbols

219

Modular Symbols, Release 10.4

random_element(M=None, **args)
Return a random element of the 𝑀 -th approximation module with non-negative valuation.
INPUT:• M – None or a nonnegative integer
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions
sage: D = OverconvergentDistributions(0, 5, 10)
sage: D.random_element()(..., ..., ..., ..., ..., ..., ..., ..., ..., ...)
sage: D.random_element(0)()
sage: D.random_element(5)(..., ..., ..., ..., ...)
sage: D.random_element(-1)
Traceback (most recent call last):...
ValueError: rank (=-1) must be nonnegative
sage: D.random_element(11)Traceback (most recent call last):...
ValueError: M (=11) must be less than or equal to the precision cap (=10)>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions>>> D = OverconvergentDistributions(Integer(0), Integer(5), Integer(10))>>> D.random_element()(..., ..., ..., ..., ..., ..., ..., ..., ..., ...)>>> D.random_element(Integer(0))()>>> D.random_element(Integer(5))(..., ..., ..., ..., ...)>>> D.random_element(-Integer(1))
Traceback (most recent call last):...
ValueError: rank (=-1) must be nonnegative>>> D.random_element(Integer(11))
Traceback (most recent call last):...
ValueError: M (=11) must be less than or equal to the precision cap (=10)

weight()Return the weight of this distribution space.
The standard caveat applies, namely that the weight of 𝑆𝑦𝑚𝑘 is defined to be 𝑘, not 𝑘 + 2.
OUTPUT:nonnegative integer
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
(continues on next page)

220

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: D = OverconvergentDistributions(0, 7); DSpace of 7-adic distributions with k=0 action and precision cap 20
sage: D.weight()
0sage: OverconvergentDistributions(389, 7).weight()
389>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7)); DSpace of 7-adic distributions with k=0 action and precision cap 20>>> D.weight()
0>>> OverconvergentDistributions(Integer(389), Integer(7)).weight()
389

class sage.modular.pollack_stevens.distributions.OverconvergentDistributions_class(k,p=None,prec_cap=N
base=None
character=None,
adjuster=None
act_on_left=dettwist=None
act_padic=
implementation=None)
Bases: OverconvergentDistributions_abstract
The class of overconvergent distributions
This class represents the module of finite approximation modules, which are finite-dimensional spaces with aΣ0 (𝑁 ) action which approximate the module of overconvergent distributions. There is a specialization map to
the finite-dimensional Symk module as well.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions
sage: D = OverconvergentDistributions(0, 5, 10)
sage: TestSuite(D).run()>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions>>> D = OverconvergentDistributions(Integer(0), Integer(5), Integer(10))>>> TestSuite(D).run()

19.2. Spaces of distributions for Pollack-Stevens modular symbols

221

Modular Symbols, Release 10.4

change_ring(new_base_ring)
Return space of distributions like this one, but with the base ring changed.
INPUT: a ring over which the distribution can be coerced.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7, 4); D
Space of 7-adic distributions with k=0 action and precision cap 4
sage: D.base_ring()
7-adic Ring with capped absolute precision 4
sage: D2 = D.change_ring(QpCR(7)); D2
Space of 7-adic distributions with k=0 action and precision cap 4
sage: D2.base_ring()
7-adic Field with capped relative precision 20>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7), Integer(4)); DSpace of 7-adic distributions with k=0 action and precision cap 4>>> D.base_ring()
7-adic Ring with capped absolute precision 4>>> D2 = D.change_ring(QpCR(Integer(7))); D2
Space of 7-adic distributions with k=0 action and precision cap 4>>> D2.base_ring()
7-adic Field with capped relative precision 20

is_symk()
Whether or not this distributions space is 𝑆𝑦𝑚𝑘 (𝑅) for some ring 𝑅.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(4, 17, 10); D
Space of 17-adic distributions with k=4 action and precision cap 10
sage: D.is_symk()
False
sage: D = Symk(4); D
Sym^4 Q^2
sage: D.is_symk()
Truesage: D = Symk(4, base=GF(7)); D
Sym^4 (Finite Field of size 7)^2
sage: D.is_symk()
True>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(4), Integer(17), Integer(10)); DSpace of 17-adic distributions with k=4 action and precision cap 10>>> D.is_symk()
False>>> D = Symk(Integer(4)); D(continues on next page)

222

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)Sym^4 Q^2>>> D.is_symk()
True>>> D = Symk(Integer(4), base=GF(Integer(7))); D
Sym^4 (Finite Field of size 7)^2>>> D.is_symk()
Truespecialize(new_base_ring=None)
Return distribution space got by specializing to 𝑆𝑦𝑚𝑘 , over the new_base_ring. If new_base_ring
is not given, use current base_ring.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7, 4); D
Space of 7-adic distributions with k=0 action and precision cap 4
sage: D.is_symk()
False
sage: D2 = D.specialize(); D2
Sym^0 Z_7^2
sage: D2.is_symk()
Truesage: D2 = D.specialize(QQ); D2
Sym^0 Q^2>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7), Integer(4)); DSpace of 7-adic distributions with k=0 action and precision cap 4>>> D.is_symk()
False>>> D2 = D.specialize(); D2
Sym^0 Z_7^2>>> D2.is_symk()
True>>> D2 = D.specialize(QQ); D2
Sym^0 Q^2

class
sage.modular.pollack_stevens.distributions.OverconvergentDistributions_factory
Bases: UniqueFactory
Create a space of distributions.
INPUT:• k – nonnegative integer• p – prime number or None
• prec_cap – positive integer or None
• base – ring or None
• character – a Dirichlet character or None

19.2. Spaces of distributions for Pollack-Stevens modular symbols

223

Modular Symbols, Release 10.4

• adjuster – None or callable that turns 2 x 2 matrices into a 4-tuple• act_on_left – bool (default: False)• dettwist – integer or None (interpreted as 0)• act_padic – whether monoid should allow 𝑝-adic coefficients• implementation – string (default: None). Either None (for automatic), ‘long’, or ‘vector’
EXAMPLES:
sage: D = OverconvergentDistributions(3, 11, 20)
sage: DSpace of 11-adic distributions with k=3 action and precision cap 20
sage: v = D([1,0,0,0,0])
sage: v.act_right([2,1,0,1])(8 + O(11^5), 4 + O(11^4), 2 + O(11^3), 1 + O(11^2), 6 + O(11))>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(3), Integer(11), Integer(20))>>> DSpace of 11-adic distributions with k=3 action and precision cap 20>>> v = D([Integer(1),Integer(0),Integer(0),Integer(0),Integer(0)])>>> v.act_right([Integer(2),Integer(1),Integer(0),Integer(1)])(8 + O(11^5), 4 + O(11^4), 2 + O(11^3), 1 + O(11^2), 6 + O(11))
sage: D = OverconvergentDistributions(3, 11, 20, dettwist=1)
sage: v = D([1,0,0,0,0])
sage: v.act_right([2,1,0,1])(5 + 11 + O(11^5), 8 + O(11^4), 4 + O(11^3), 2 + O(11^2), 1 + O(11))>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(3), Integer(11), Integer(20),␣
˓→dettwist=Integer(1))>>> v = D([Integer(1),Integer(0),Integer(0),Integer(0),Integer(0)])>>> v.act_right([Integer(2),Integer(1),Integer(0),Integer(1)])(5 + 11 + O(11^5), 8 + O(11^4), 4 + O(11^3), 2 + O(11^2), 1 + O(11))

create_key(k, p=None, prec_cap=None, base=None, character=None, adjuster=None, act_on_left=False,
dettwist=None, act_padic=False, implementation=None)
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions
sage: OverconvergentDistributions(20, 3, 10)# indirect doctest
Space of 3-adic distributions with k=20 action and precision cap 10
sage: TestSuite(OverconvergentDistributions).run()>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions>>> OverconvergentDistributions(Integer(20), Integer(3), Integer(10))˓→# indirect doctest
Space of 3-adic distributions with k=20 action and precision cap 10>>> TestSuite(OverconvergentDistributions).run()224

␣

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

create_object(version, key)
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: OverconvergentDistributions(0, 7, 5)# indirect doctest
Space of 7-adic distributions with k=0 action and precision cap 5>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> OverconvergentDistributions(Integer(0), Integer(7), Integer(5))˓→# indirect doctest
Space of 7-adic distributions with k=0 action and precision cap 5␣class sage.modular.pollack_stevens.distributions.Symk_class(k, base, character, adjuster,
act_on_left, dettwist,
act_padic, implementation)
Bases: OverconvergentDistributions_abstract
EXAMPLES:
sage: D = sage.modular.pollack_stevens.distributions.Symk(4); D
Sym^4 Q^2
sage: TestSuite(D).run() # indirect doctest>>> from sage.all import *>>> D = sage.modular.pollack_stevens.distributions.Symk(Integer(4)); D
Sym^4 Q^2>>> TestSuite(D).run() # indirect doctest

base_extend(new_base_ring)
Extend scalars to a new base ring.
EXAMPLES:
sage: Symk(3).base_extend(Qp(3))
Sym^3 Q_3^2>>> from sage.all import *>>> Symk(Integer(3)).base_extend(Qp(Integer(3)))
Sym^3 Q_3^2change_ring(new_base_ring)
Return a Symk with the same 𝑘 but a different base ring.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(0, 7, 4); D
Space of 7-adic distributions with k=0 action and precision cap 4
sage: D.base_ring()
7-adic Ring with capped absolute precision 4
sage: D2 = D.change_ring(QpCR(7)); D2
Space of 7-adic distributions with k=0 action and precision cap 4(continues on next page)

19.2. Spaces of distributions for Pollack-Stevens modular symbols

225

Modular Symbols, Release 10.4

(continued from previous page)

sage: D2.base_ring()
7-adic Field with capped relative precision 20>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(0), Integer(7), Integer(4)); DSpace of 7-adic distributions with k=0 action and precision cap 4>>> D.base_ring()
7-adic Ring with capped absolute precision 4>>> D2 = D.change_ring(QpCR(Integer(7))); D2
Space of 7-adic distributions with k=0 action and precision cap 4>>> D2.base_ring()
7-adic Field with capped relative precision 20

is_symk()
Whether or not this distributions space is 𝑆𝑦𝑚𝑘 (𝑅) for some ring 𝑅.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk
sage: D = OverconvergentDistributions(4, 17, 10); D
Space of 17-adic distributions with k=4 action and precision cap 10
sage: D.is_symk()
False
sage: D = Symk(4); D
Sym^4 Q^2
sage: D.is_symk()
Truesage: D = Symk(4, base=GF(7)); D
Sym^4 (Finite Field of size 7)^2
sage: D.is_symk()
True>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import␣˓→OverconvergentDistributions, Symk>>> D = OverconvergentDistributions(Integer(4), Integer(17), Integer(10)); DSpace of 17-adic distributions with k=4 action and precision cap 10>>> D.is_symk()
False>>> D = Symk(Integer(4)); D
Sym^4 Q^2>>> D.is_symk()
True>>> D = Symk(Integer(4), base=GF(Integer(7))); D
Sym^4 (Finite Field of size 7)^2>>> D.is_symk()
Trueclass sage.modular.pollack_stevens.distributions.Symk_factory
Bases: UniqueFactory
Create the space of polynomial distributions of degree 𝑘 (stored as a sequence of 𝑘 + 1 moments).
INPUT:
226

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

• k – (integer): the degree (degree 𝑘 corresponds to weight 𝑘 + 2 modular forms)• base – (ring, default None): the base ring (None is interpreted as)• character – (Dirichlet character or None, default None) the character• adjuster – (None or a callable that turns 2 × 2 matrices into a 4-tuple, default None)• act_on_left – (boolean, default: False) whether to have the group acting on the left rather than theright.
• dettwist (integer or None) – power of determinant to twist by
EXAMPLES:
sage: D = Symk(4)sage: loads(dumps(D)) is D
True
sage: loads(dumps(D)) == D
True
sage: from sage.modular.pollack_stevens.distributions import Symk
sage: Symk(5)Sym^5 Q^2
sage: Symk(5, RR)
Sym^5 (Real Field with 53 bits of precision)^2
sage: Symk(5, oo.parent()) # don t do thisSym^5 (The Infinity Ring)^2
sage: Symk(5, act_on_left = True)
Sym^5 Q^2>>> from sage.all import *>>> D = Symk(Integer(4))>>> loads(dumps(D)) is D
True>>> loads(dumps(D)) == D
True>>> from sage.modular.pollack_stevens.distributions import Symk>>> Symk(Integer(5))
Sym^5 Q^2>>> Symk(Integer(5), RR)
Sym^5 (Real Field with 53 bits of precision)^2>>> Symk(Integer(5), oo.parent()) # don t do thisSym^5 (The Infinity Ring)^2>>> Symk(Integer(5), act_on_left = True)
Sym^5 Q^2

The dettwist attribute:sage: V = Symk(6)sage: v = V([1,0,0,0,0,0,0])
sage: v.act_right([2,1,0,1])(64, 32, 16, 8, 4, 2, 1)
sage: V = Symk(6, dettwist=-1)
sage: v = V([1,0,0,0,0,0,0])
sage: v.act_right([2,1,0,1])(32, 16, 8, 4, 2, 1, 1/2)>>> from sage.all import *>>> V = Symk(Integer(6))(continues on next page)

19.2. Spaces of distributions for Pollack-Stevens modular symbols

227

Modular Symbols, Release 10.4

(continued from previous page)>>> v = V([Integer(1),Integer(0),Integer(0),Integer(0),Integer(0),Integer(0),˓→Integer(0)])>>> v.act_right([Integer(2),Integer(1),Integer(0),Integer(1)])(64, 32, 16, 8, 4, 2, 1)>>> V = Symk(Integer(6), dettwist=-Integer(1))>>> v = V([Integer(1),Integer(0),Integer(0),Integer(0),Integer(0),Integer(0),˓→Integer(0)])>>> v.act_right([Integer(2),Integer(1),Integer(0),Integer(1)])(32, 16, 8, 4, 2, 1, 1/2)

create_key(k, base=None, character=None, adjuster=None, act_on_left=False, dettwist=None,
act_padic=False, implementation=None)
Sanitize input.
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import Symk
sage: Symk(6) # indirect doctest
Sym^6 Q^2
sage: V = Symk(6, Qp(7))
sage: TestSuite(V).run()>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import Symk>>> Symk(Integer(6)) # indirect doctest
Sym^6 Q^2>>> V = Symk(Integer(6), Qp(Integer(7)))>>> TestSuite(V).run()create_object(version, key)
EXAMPLES:
sage: from sage.modular.pollack_stevens.distributions import Symk
sage: Symk(6) # indirect doctest
Sym^6 Q^2>>> from sage.all import *>>> from sage.modular.pollack_stevens.distributions import Symk>>> Symk(Integer(6)) # indirect doctest
Sym^6 Q^2

19.3 Manin relations for overconvergent modular symbols
Code to create the Manin Relations class, which solves the “Manin relations”. That is, a description of 𝐷𝑖𝑣 0 (𝑃 1 ( ))as a [Γ0 (𝑁 )]-module in terms of generators and relations is found. The method used is geometric, constructing anice fundamental domain for Γ0 (𝑁 ) and reading the relevant Manin relations off of that picture. The algorithm follows[PS2011].
AUTHORS:• Robert Pollack, Jonathan Hanke (2012): initial version

228

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage.modular.pollack_stevens.fund_domain.M2Z(x)Create an immutable 2 × 2 integer matrix from x.
INPUT: anything that can be converted into a 2 × 2 matrix.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import M2Z
sage: M2Z([1,2,3,4])
[1 2]
[3 4]
sage: M2Z(1)
[1 0]
[0 1]
>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import M2Z>>> M2Z([Integer(1),Integer(2),Integer(3),Integer(4)])
[1 2]
[3 4]
>>> M2Z(Integer(1))
[1 0]
[0 1]

class sage.modular.pollack_stevens.fund_domain.ManinRelations(N)Bases: PollackStevensModularDomain
This class gives a description of 𝐷𝑖𝑣 0 (𝑃 1 ( )) as a [Γ0 (𝑁 )]-module.
INPUT:• N – a positive integer, the level of Γ0 (𝑁 ) to work with
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: ManinRelations(1)Manin Relations of level 1
sage: ManinRelations(11)Manin Relations of level 11>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> ManinRelations(Integer(1))
Manin Relations of level 1>>> ManinRelations(Integer(11))
Manin Relations of level 11

Large values of N are not supported:
sage: ManinRelations(2^20)
Traceback (most recent call last):...
OverflowError: Modulus is too large (must be <= 46340)>>> from sage.all import *>>> ManinRelations(Integer(2)**Integer(20))
Traceback (most recent call last):(continues on next page)

19.3. Manin relations for overconvergent modular symbols

229

Modular Symbols, Release 10.4

(continued from previous page)...
OverflowError: Modulus is too large (must be <= 46340)

fd_boundary(C)Find matrices whose associated unimodular paths give the boundary of a fundamental domain.
Here the fundamental domain is for Γ0 (𝑁 ). (In the case when Γ0 (𝑁 ) has elements of order three the shape cut
out by these unimodular matrices is a little smaller than a fundamental domain. See Section 2.5 of [PS2011].)INPUT:• C – a list of rational numbers coming from self.form_list_of_cusps()
OUTPUT:
A list of 2 × 2 integer matrices of determinant 1 whose associated unimodular paths give the boundary of afundamental domain for Γ0 (𝑁 ) (or nearly so in the case of 3-torsion).
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: C = A.form_list_of_cusps(); C[-1, -2/3, -1/2, -1/3, 0]
sage: A.fd_boundary(C)[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1][0 1], [-1 0], [ 1 3], [ 3 2], [ 2 3], [ 3 1]]
sage: A = ManinRelations(13)sage: C = A.form_list_of_cusps(); C[-1, -2/3, -1/2, -1/3, 0]
sage: A.fd_boundary(C)[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1][0 1], [-1 0], [ 1 3], [ 3 2], [ 2 3], [ 3 1]]
sage: A = ManinRelations(101)sage: C = A.form_list_of_cusps(); C[-1, -6/7, -5/6, -4/5, -7/9, -3/4, -11/15, -8/11, -5/7, -7/10,-9/13, -2/3, -5/8, -13/21, -8/13, -3/5, -7/12, -11/19, -4/7, -1/2,-4/9, -3/7, -5/12, -7/17, -2/5, -3/8, -4/11, -1/3, -2/7, -3/11,-1/4, -2/9, -1/5, -1/6, 0]
sage: A.fd_boundary(C)[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1] [-1 -3] [-3 -2][0 1], [-1 0], [ 1 6], [ 6 5], [ 5 9], [ 9 4], [ 4 11], [11 7],[-2 -1] [-1 -4] [-4 -3] [-3 -2] [-2 -7] [-7 -5] [-5 -3] [-3 -4][ 7 3], [ 3 11], [11 8], [ 8 5], [ 5 17], [17 12], [12 7], [ 7 9],[-4 -1] [-1 -4] [ -4 -11] [-11
[ 9 2], [ 2 7], [ 7 19], [ 19-7] [-7 -3] [-3 -8] [ -8 -13]12], [12 5], [ 5 13], [ 13 21],

[-13
[ 21

-5] [-5 -2] [-2 -9] [-9 -7] [-7 -5] [-5 -8] [ -8 -11]8], [ 8 3], [ 3 13], [13 10], [10 7], [ 7 11], [ 11 15],

[-11

-3]

[-3 -7][-7 -4][-4 -5][-5 -6][-6 -1](continues on next page)

230

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[ 15]4], [ 49], [ 95], [ 56], [ 67], [ 71]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> C = A.form_list_of_cusps(); C[-1, -2/3, -1/2, -1/3, 0]>>> A.fd_boundary(C)[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1][0 1], [-1 0], [ 1 3], [ 3 2], [ 2 3], [ 3 1]]>>> A = ManinRelations(Integer(13))>>> C = A.form_list_of_cusps(); C[-1, -2/3, -1/2, -1/3, 0]>>> A.fd_boundary(C)[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1][0 1], [-1 0], [ 1 3], [ 3 2], [ 2 3], [ 3 1]]>>> A = ManinRelations(Integer(101))>>> C = A.form_list_of_cusps(); C[-1, -6/7, -5/6, -4/5, -7/9, -3/4, -11/15, -8/11, -5/7, -7/10,-9/13, -2/3, -5/8, -13/21, -8/13, -3/5, -7/12, -11/19, -4/7, -1/2,-4/9, -3/7, -5/12, -7/17, -2/5, -3/8, -4/11, -1/3, -2/7, -3/11,-1/4, -2/9, -1/5, -1/6, 0]>>> A.fd_boundary(C)[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1] [-1 -3] [-3 -2][0 1], [-1 0], [ 1 6], [ 6 5], [ 5 9], [ 9 4], [ 4 11], [11 7],<BLANKLINE>[-2 -1] [-1 -4] [-4 -3] [-3 -2] [-2 -7] [-7 -5] [-5 -3] [-3 -4][ 7 3], [ 3 11], [11 8], [ 8 5], [ 5 17], [17 12], [12 7], [ 7 9],<BLANKLINE>[-4 -1] [-1 -4] [ -4 -11] [-11 -7] [-7 -3] [-3 -8] [ -8 -13]
[ 9 2], [ 2 7], [ 7 19], [ 19 12], [12 5], [ 5 13], [ 13 21],<BLANKLINE>[-13 -5] [-5 -2] [-2 -9] [-9 -7] [-7 -5] [-5 -8] [ -8 -11]
[ 218], [ 8 3], [ 3 13], [13 10], [10 7], [ 7 11], [ 11 15],<BLANKLINE>[-11 -3] [-3 -7] [-7 -4] [-4 -5] [-5 -6] [-6 -1][ 154], [ 4 9], [ 9 5], [ 5 6], [ 6 7], [ 7 1]]

form_list_of_cusps()
Return the intersection of a fundamental domain for Γ0 (𝑁 ) with the real axis.
The construction of this fundamental domain follows the arguments of [PS2011] Section 2. The boundaryof this fundamental domain consists entirely of unimodular paths when Γ0 (𝑁 ) has no elements of order 3.
(See [PS2011] Section 2.5 for the case when there are elements of order 3.)
OUTPUT:
A sorted list of rational numbers marking the intersection of a fundamental domain for Γ0 (𝑁 ) with the real
axis.
EXAMPLES:
19.3. Manin relations for overconvergent modular symbols

231

Modular Symbols, Release 10.4

sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.form_list_of_cusps()[-1, -2/3, -1/2, -1/3, 0]
sage: A = ManinRelations(13)sage: A.form_list_of_cusps()[-1, -2/3, -1/2, -1/3, 0]
sage: A = ManinRelations(101)sage: A.form_list_of_cusps()[-1, -6/7, -5/6, -4/5, -7/9, -3/4, -11/15, -8/11, -5/7, -7/10,-9/13, -2/3, -5/8, -13/21, -8/13, -3/5, -7/12, -11/19, -4/7, -1/2,-4/9, -3/7, -5/12, -7/17, -2/5, -3/8, -4/11, -1/3, -2/7, -3/11,-1/4, -2/9, -1/5, -1/6, 0]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.form_list_of_cusps()[-1, -2/3, -1/2, -1/3, 0]>>> A = ManinRelations(Integer(13))>>> A.form_list_of_cusps()[-1, -2/3, -1/2, -1/3, 0]>>> A = ManinRelations(Integer(101))>>> A.form_list_of_cusps()[-1, -6/7, -5/6, -4/5, -7/9, -3/4, -11/15, -8/11, -5/7, -7/10,-9/13, -2/3, -5/8, -13/21, -8/13, -3/5, -7/12, -11/19, -4/7, -1/2,-4/9, -3/7, -5/12, -7/17, -2/5, -3/8, -4/11, -1/3, -2/7, -3/11,-1/4, -2/9, -1/5, -1/6, 0]

indices_with_three_torsion()
A list of indices of coset representatives whose associated unimodular path contains a point fixed by a Γ0 (𝑁 )element of order 3 in the ideal triangle directly below that path (the order is computed in 𝑃 𝑆𝐿2 ( )).
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(11)sage: MR.indices_with_three_torsion()[]sage: MR = ManinRelations(13)sage: MR.indices_with_three_torsion()[2, 5]
sage: B = MR.reps(2); B[ 0 -1][ 1 3]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(11))>>> MR.indices_with_three_torsion()[]>>> MR = ManinRelations(Integer(13))>>> MR.indices_with_three_torsion()[2, 5]>>> B = MR.reps(Integer(2)); B[ 0 -1][ 1 3]

232

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

The corresponding matrix of order three:sage: A = MR.three_torsion_matrix(B); A[-4 -1][13 3]
sage: A^3
[1 0]
[0 1]
>>> from sage.all import *>>> A = MR.three_torsion_matrix(B); A[-4 -1][13 3]>>> A**Integer(3)
[1 0]
[0 1]

The columns of B and the columns of A*B and A^2*B give the same rational cusps:
sage: B[ 0 -1][ 1 3]
sage: A*B, A^2*B([-1 1] [ 1 0]
[ 3 -4], [-4 1])>>> from sage.all import *>>> B[ 0 -1][ 1 3]>>> A*B, A**Integer(2)*B([-1 1] [ 1 0]
[ 3 -4], [-4 1])

indices_with_two_torsion()
Return the indices of coset representatives whose associated unimodular path contains a point fixed by a
Γ0 (𝑁 ) element of order 2 (where the order is computed in 𝑃 𝑆𝐿2 ( )).
OUTPUT:
A list of integers.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(11)sage: MR.indices_with_two_torsion()[]sage: MR = ManinRelations(13)sage: MR.indices_with_two_torsion()[3, 4]
sage: MR.reps(3), MR.reps(4)([-1 -1] [-1 -2](continues on next page)

19.3. Manin relations for overconvergent modular symbols

233

Modular Symbols, Release 10.4

(continued from previous page)[ 3)2], [ 2

3]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(11))>>> MR.indices_with_two_torsion()[]>>> MR = ManinRelations(Integer(13))>>> MR.indices_with_two_torsion()[3, 4]>>> MR.reps(Integer(3)), MR.reps(Integer(4))([-1 -1] [-1 -2][ 3 2], [ 2 3])

The corresponding matrix of order 2:
sage: A = MR.two_torsion_matrix(MR.reps(3)); A[ 5
2][-13 -5]sage: A^2[-1 0][ 0 -1]>>> from sage.all import *>>> A = MR.two_torsion_matrix(MR.reps(Integer(3))); A[ 5
2][-13 -5]>>> A**Integer(2)[-1 0][ 0 -1]

You can see that multiplication by A just interchanges the rational cusps determined by the columns of thematrix MR.reps(3):sage: MR.reps(3), A*MR.reps(3)([-1 -1] [ 1 -1][ 3 2], [-2 3])>>> from sage.all import *>>> MR.reps(Integer(3)), A*MR.reps(Integer(3))([-1 -1] [ 1 -1][ 3 2], [-2 3])

is_unimodular_path(r1, r2)
Determine whether two (non-infinite) cusps are connected by a unimodular path.
INPUT:• r1, r2 – rational numbers

234

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

OUTPUT:
A boolean expressing whether or not a unimodular path connects r1 to r2.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.is_unimodular_path(0,1/3)
True
sage: A.is_unimodular_path(1/3,0)
True
sage: A.is_unimodular_path(0,2/3)
False
sage: A.is_unimodular_path(2/3,0)
False>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.is_unimodular_path(Integer(0),Integer(1)/Integer(3))
True>>> A.is_unimodular_path(Integer(1)/Integer(3),Integer(0))
True>>> A.is_unimodular_path(Integer(0),Integer(2)/Integer(3))
False>>> A.is_unimodular_path(Integer(2)/Integer(3),Integer(0))
False

prep_hecke_on_gen(l, gen, modulus=None)
This function does some precomputations needed to compute 𝑇𝑙 .
In particular, if 𝜑 is a modular symbol and 𝐷𝑚 is the divisor associated to the generator gen, to compute(𝜑|𝑇𝑙 )(𝐷𝑚 ) one needs to compute 𝜑(𝛾𝑎 𝐷𝑚 )|𝛾𝑎 where 𝛾𝑎 runs through the 𝑙 + 1 matrices defining 𝑇𝑙 . One
then takes 𝛾𝑎 𝐷𝑚 and writes it as a sum of unimodular divisors. For each such unimodular divisor, say [𝑀 ]where 𝑀 is a 𝑆𝐿2 matrix, we then write 𝑀 = 𝛾ℎ where 𝛾 is in Γ0 (𝑁 ) and ℎ is one of our chosen coset
representatives. Then 𝜑([𝑀 ]) = 𝜑([ℎ])|𝛾 −1 . Thus, one has∑︁ ∑︁−1(𝜑|𝛾𝑎 )(𝐷𝑚 ) =𝜑([ℎ])|𝛾ℎ𝑗
· 𝛾𝑎
ℎ

𝑗

as ℎ runs over all coset representatives and 𝑗 simply runs over however many times 𝑀ℎ appears in the above
computation.
Finally, the output of this function is a dictionary D whose keys are the coset representatives in self.
reps() where each value is a list of matrices, and the entries of D satisfy:
𝐷[ℎ][𝑗] = 𝛾ℎ𝑗 * 𝛾𝑎
INPUT:• l – a prime• gen – a generator
OUTPUT:
A list of lists (see above).
EXAMPLES:

19.3. Manin relations for overconvergent modular symbols

235

Modular Symbols, Release 10.4

sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: M = phi.parent().source()
sage: w = M.prep_hecke_on_gen(2, M.gens()[0])sage: one = Matrix(ZZ,2,2,1)
sage: one.set_immutable()sage: w[one][[1 0][0 2], [1 1][0 2], [2 0][0 1]]>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> M = phi.parent().source()>>> w = M.prep_hecke_on_gen(Integer(2), M.gens()[Integer(0)])>>> one = Matrix(ZZ,Integer(2),Integer(2),Integer(1))>>> one.set_immutable()>>> w[one][[1 0][0 2], [1 1][0 2], [2 0][0 1]]

prep_hecke_on_gen_list(l, gen, modulus=None)
Return the precomputation to compute 𝑇𝑙 in a way that speeds up the Hecke calculation.
Namely, returns a list of the form [h,A].
INPUT:• l – a prime• gen – a generator
OUTPUT:
A list of lists (see above).
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: M = phi.parent().source()
sage: len(M.prep_hecke_on_gen_list(2, M.gens()[0]))4>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0](continues on next page)

236

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> M = phi.parent().source()>>> len(M.prep_hecke_on_gen_list(Integer(2), M.gens()[Integer(0)]))4

reps_with_three_torsion()
A list of coset representatives whose associated unimodular path contains a point fixed by a Γ0 (𝑁 ) elementof order 3 in the ideal triangle directly below that path (the order is computed in 𝑃 𝑆𝐿2 ( )).
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(13)sage: B = MR.reps_with_three_torsion()[0]; B[ 0 -1][ 1 3]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(13))>>> B = MR.reps_with_three_torsion()[Integer(0)]; B[ 0 -1][ 1 3]

The corresponding matrix of order three:sage: A = MR.three_torsion_matrix(B); A[-4 -1][13 3]
sage: A^3
[1 0]
[0 1]
>>> from sage.all import *>>> A = MR.three_torsion_matrix(B); A[-4 -1][13 3]>>> A**Integer(3)
[1 0]
[0 1]

The columns of B and the columns of A*B and A^2*B give the same rational cusps:
sage: B[ 0 -1][ 1 3]
sage: A*B, A^2*B([-1 1] [ 1 0]
[ 3 -4], [-4 1])>>> from sage.all import *>>> B[ 0 -1][ 1 3](continues on next page)

19.3. Manin relations for overconvergent modular symbols

237

Modular Symbols, Release 10.4

(continued from previous page)>>> A*B, A**Integer(2)*B([-1 1] [ 1 0]
[ 3 -4], [-4 1])

reps_with_two_torsion()
The coset representatives whose associated unimodular path contains a point fixed by a Γ0 (𝑁 ) element oforder 2 (where the order is computed in 𝑃 𝑆𝐿2 ( )).
OUTPUT:
A list of matrices.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(11)sage: MR.reps_with_two_torsion()[]sage: MR = ManinRelations(13)sage: MR.reps_with_two_torsion()[[-1 -1] [-1 -2][ 3 2], [ 2 3]]
sage: B = MR.reps_with_two_torsion()[0]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(11))>>> MR.reps_with_two_torsion()[]>>> MR = ManinRelations(Integer(13))>>> MR.reps_with_two_torsion()[[-1 -1] [-1 -2][ 3 2], [ 2 3]]>>> B = MR.reps_with_two_torsion()[Integer(0)]The corresponding matrix of order 2:
sage: A = MR.two_torsion_matrix(B); A[ 5
2][-13 -5]sage: A^2[-1 0][ 0 -1]>>> from sage.all import *>>> A = MR.two_torsion_matrix(B); A[ 5
2][-13 -5]>>> A**Integer(2)[-1 0][ 0 -1]

238

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

You can see that multiplication by A just interchanges the rational cusps determined by the columns of thematrix MR.reps(3):sage: B, A*B([-1 -1] [ 1 -1][ 3 2], [-2 3])>>> from sage.all import *>>> B, A*B([-1 -1] [ 1 -1][ 3 2], [-2 3])

three_torsion_matrix(A)Return the matrix of order two
reps_with_two_torsion().

inΓ0 (𝑁 )

which

corresponds

to

an

A

in

self.

INPUT:• A – a matrix in self.reps_with_two_torsion()
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(37)sage: B = MR.reps_with_three_torsion()[0]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(37))>>> B = MR.reps_with_three_torsion()[Integer(0)]The corresponding matrix of order 3:
sage: A = MR.three_torsion_matrix(B); A[-11 -3][ 37 10]sage: A^3
[1 0]
[0 1]
>>> from sage.all import *>>> A = MR.three_torsion_matrix(B); A[-11 -3][ 37 10]>>> A**Integer(3)
[1 0]
[0 1]

two_torsion_matrix(A)Return the matrix of order two
reps_with_two_torsion().

inΓ0 (𝑁 )

which

corresponds

to

an

A

in

self.

INPUT:

19.3. Manin relations for overconvergent modular symbols

239

Modular Symbols, Release 10.4

• A – a matrix in self.reps_with_two_torsion()
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(25)sage: B = MR.reps_with_two_torsion()[0]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(25))>>> B = MR.reps_with_two_torsion()[Integer(0)]The corresponding matrix of order 2:
sage: A = MR.two_torsion_matrix(B); A[ 7
2][-25 -7]sage: A^2[-1 0][ 0 -1]>>> from sage.all import *>>> A = MR.two_torsion_matrix(B); A[ 7
2][-25 -7]>>> A**Integer(2)[-1 0][ 0 -1]

unimod_to_matrices(r1, r2)
Return the two matrices whose associated unimodular paths connect r1 and r2 and r2 and r1, respectively.
INPUT:• r1, r2 – rational numbers (that are assumed to be connected by a unimodular path)
OUTPUT:
A pair of 2 × 2 matrices of determinant 1
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.unimod_to_matrices(0,1/3)([ 0 1] [1 0][-1 3], [3 1])>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.unimod_to_matrices(Integer(0),Integer(1)/Integer(3))([ 0 1] [1 0][-1 3], [3 1])240

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4class sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain(N,reps,indices,rels,
equiv_ind)
Bases: SageObject
The domain of a modular symbol.
INPUT:• N – a positive integer, the level of the congruence subgroup Γ0 (𝑁 )• reps – a list of 2 × 2 matrices, the coset representatives of 𝐷𝑖𝑣 0 (𝑃 1 ( ))• indices – a list of integers; indices of elements in reps which are generators• rels – a list of list of triples (d, A, i), one for each coset representative of reps which describes how
to express the elements of reps in terms of generators specified by indices. See relations() for a
detailed explanations of these triples.
• equiv_ind – a dictionary which maps normalized coordinates on 𝑃 1 ( /𝑁 ) to an integer such that amatrix whose bottom row is equivalent to [𝑎 : 𝑏] in 𝑃 1 ( /𝑁 ) is in the coset of reps[equiv_ind[(a,b)]]
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import␣
˓→PollackStevensModularDomain, M2Z
sage: PollackStevensModularDomain(2 , [M2Z([1,0,0,1]), M2Z([1,1,-1,0]), M2Z([0,-1,
˓→1,1])], [0,2], [[(1, M2Z([1,0,0,1]), 0)], [(-1,M2Z([-1,-1,0,-1]),0)], [(1,␣˓→M2Z([1,0,0,1]), 2)]], {(0,1): 0, (1,0): 1, (1,1): 2})
Modular Symbol domain of level 2>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import␣
˓→PollackStevensModularDomain, M2Z>>> PollackStevensModularDomain(Integer(2) , [M2Z([Integer(1),Integer(0),˓→Integer(0),Integer(1)]), M2Z([Integer(1),Integer(1),-Integer(1),Integer(0)]),␣
˓→M2Z([Integer(0),-Integer(1),Integer(1),Integer(1)])], [Integer(0),Integer(2)],␣
˓→[[(Integer(1), M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]), Integer(0))],˓→ [(-Integer(1),M2Z([-Integer(1),-Integer(1),Integer(0),-Integer(1)]),
˓→Integer(0))], [(Integer(1), M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]),␣
˓→Integer(2))]], {(Integer(0),Integer(1)): Integer(0), (Integer(1),Integer(0)):␣
˓→Integer(1), (Integer(1),Integer(1)): Integer(2)})
Modular Symbol domain of level 2

P1()
Return the Sage representation of 𝑃 1 ( /𝑁 ).
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.P1()
The projective line over the integers modulo 11

19.3. Manin relations for overconvergent modular symbols

241Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.P1()
The projective line over the integers modulo 11

equivalent_index(A)Return the index of the coset representative equivalent to A.
Here by equivalent we mean the unique coset representative whose bottom row is equivalent to the bottom
row of A in 𝑃 1 ( /𝑁 ).
INPUT:• A – an element of 𝑆𝐿2 ( )OUTPUT:
The unique integer j satisfying that the bottom row of self.reps(j) is equivalent to the bottom row ofA.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(11)sage: A = matrix(ZZ,2,2,[1,5,3,16])
sage: j = MR.equivalent_index(A); j
11
sage: MR.reps(11)[ 1 -1][-1 2]
sage: MR.equivalent_rep(A)[ 1 -1][-1 2]
sage: MR.P1().normalize(3,16)(1, 9)>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(11))>>> A = matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(5),Integer(3),˓→Integer(16)])>>> j = MR.equivalent_index(A); j
11>>> MR.reps(Integer(11))[ 1 -1][-1 2]>>> MR.equivalent_rep(A)[ 1 -1][-1 2]>>> MR.P1().normalize(Integer(3),Integer(16))(1, 9)

equivalent_rep(A)Return a coset representative that is equivalent to A modulo Γ0 (𝑁 ).
INPUT:• A – a matrix in 𝑆𝐿2 ( )242Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

OUTPUT:
The unique generator congruent to A modulo Γ0 (𝑁 ).
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = matrix([[5,3],[38,23]])
sage: ManinRelations(60).equivalent_rep(A)[-7 -3][26 11]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = matrix([[Integer(5),Integer(3)],[Integer(38),Integer(23)]])>>> ManinRelations(Integer(60)).equivalent_rep(A)[-7 -3][26 11]gen(n=0)
Return the n-th generator.
INPUT:• n – integer (default: 0), which generator is desired
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(137)sage: A.gen(17)[-4 -1][ 9 2]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(137))>>> A.gen(Integer(17))[-4 -1][ 9 2]

gens()
Return the list of coset representatives chosen as generators.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.gens()[[1 0] [ 0 -1] [-1 -1][0 1], [ 1 3], [ 3 2]]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.gens()(continues on next page)

19.3. Manin relations for overconvergent modular symbols

243Modular Symbols, Release 10.4

(continued from previous page)[[1 0] [ 0 -1] [-1 -1][0 1], [ 1 3], [ 3 2]]

indices(n=None)
Return the 𝑛-th index of the coset representatives which were chosen as our generators.
In particular, the divisors associated to these coset representatives generate all divisors over [Γ0 (𝑁 )], andthus a modular symbol is uniquely determined by its values on these divisors.
INPUT:• n – integer (default: None)OUTPUT:
The n-th index of the generating set in self.reps() or all indices if n is None.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.indices()[0, 2, 3]
sage: A.indices(2)3sage: A = ManinRelations(13)sage: A.indices()[0, 2, 3, 4, 5]
sage: A = ManinRelations(101)sage: A.indices()[0, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 16, 17, 19, 20, 23, 24, 26, 28]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.indices()[0, 2, 3]>>> A.indices(Integer(2))
3>>> A = ManinRelations(Integer(13))>>> A.indices()[0, 2, 3, 4, 5]>>> A = ManinRelations(Integer(101))>>> A.indices()[0, 2, 3, 4, 5, 6, 8, 9, 11, 13, 14, 16, 17, 19, 20, 23, 24, 26, 28]

level()
Return the level 𝑁 of Γ0 (𝑁 ) that we work with.
OUTPUT:

244

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

The integer 𝑁 of the group Γ0 (𝑁 ) for which the Manin Relations are being computed.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.level()
11>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.level()
11

ngens()
Return the number of generators.
OUTPUT:
The number of coset representatives from which a modular symbol’s value on any coset can be derived.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(1137)
sage: A.ngens()
255>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(1137))>>> A.ngens()
255

relations(A=None)
Express the divisor attached to the coset representative of A in terms of our chosen generators.
INPUT:• A – None, an integer, or a coset representative (default: None)OUTPUT:A [Γ0 (𝑁 )]-relation expressing the divisor attached to A in terms of the generating set. The relation is given
as a list of triples (d, B, i) such that the divisor attached to 𝐴` is the sum of d times the divisor attachedto B^{-1} * self.reps(i).
If A is an integer, then return this data for the A-th coset representative.
If A is None, then return this data in a list for all coset representatives.
Note: These relations allow us to recover the value of a modular symbol on any coset representative in termsof its values on our generating set.
EXAMPLES:

19.3. Manin relations for overconvergent modular symbols

245

Modular Symbols, Release 10.4

sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: MR = ManinRelations(11)sage: MR.indices()[0, 2, 3]
sage: MR.relations(0)[(1, [1 0][0 1], 0)]
sage: MR.relations(2)[(1, [1 0][0 1], 2)]
sage: MR.relations(3)[(1, [1 0][0 1], 3)]>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> MR = ManinRelations(Integer(11))>>> MR.indices()[0, 2, 3]>>> MR.relations(Integer(0))[(1, [1 0][0 1], 0)]>>> MR.relations(Integer(2))[(1, [1 0][0 1], 2)]>>> MR.relations(Integer(3))[(1, [1 0][0 1], 3)]

The fourth coset representative can be expressed through the second coset representative:
sage: MR.reps(4)[-1 -2][ 2 3]
sage: d, B, i = MR.relations(4)[0]sage: P = B.inverse()*MR.reps(i); P[ 2 -1][-3 2]
sage: d # the above corresponds to minus the divisor of A.reps(4) since d is ˓→1-1>>> from sage.all import *>>> MR.reps(Integer(4))[-1 -2][ 2 3]>>> d, B, i = MR.relations(Integer(4))[Integer(0)]>>> P = B.inverse()*MR.reps(i); P[ 2 -1][-3 2]>>> d # the above corresponds to minus the divisor of A.reps(4) since d is -1-1

The sixth coset representative can be expressed as the sum of the second and the third:
sage: MR.reps(6)[ 0 -1](continues on next page)

246

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[ 1 2]
sage: MR.relations(6)[(1, [1 0][0 1], 2), (1, [1 0][0 1], 3)]
sage: MR.reps(2), MR.reps(3) # MR.reps(6) is the sum of these divisors([ 0 -1] [-1 -1][ 1 3], [ 3 2])>>> from sage.all import *>>> MR.reps(Integer(6))[ 0 -1][ 1 2]>>> MR.relations(Integer(6))[(1, [1 0][0 1], 2), (1, [1 0][0 1], 3)]>>> MR.reps(Integer(2)), MR.reps(Integer(3)) # MR.reps(6) is the sum of these␣˓→divisors([ 0 -1] [-1 -1][ 1 3], [ 3 2])reps(n=None)
Return the n-th coset representative associated with our fundamental domain.
INPUT:• n – integer (default: None)OUTPUT:
The n-th coset representative or all coset representatives if n is None.
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: A = ManinRelations(11)sage: A.reps(0)
[1 0]
[0 1]
sage: A.reps(1)[ 1 1][-1 0]
sage: A.reps(2)[ 0 -1][ 1 3]
sage: A.reps()[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1] [ 0 -1] [ 1 0]
[0 1], [-1 0], [ 1 3], [ 3 2], [ 2 3], [ 3 1], [ 1 2], [-2 1],[ 0 -1] [ 1[ 1 1], [-1]0] [-1 -1] [ 1 -1]
1], [ 2 1], [-1 2]

19.3. Manin relations for overconvergent modular symbols

247

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> A = ManinRelations(Integer(11))>>> A.reps(Integer(0))
[1 0]
[0 1]
>>> A.reps(Integer(1))[ 1 1][-1 0]>>> A.reps(Integer(2))[ 0 -1][ 1 3]>>> A.reps()[[1 0] [ 1 1] [ 0 -1] [-1 -1] [-1 -2] [-2 -1] [ 0 -1] [ 1 0]
[0 1], [-1 0], [ 1 3], [ 3 2], [ 2 3], [ 3 1], [ 1 2], [-2 1],<BLANKLINE>[ 0 -1] [ 1 0] [-1 -1] [ 1 -1][ 1 1], [-1 1], [ 2 1], [-1 2]]sage.modular.pollack_stevens.fund_domain.basic_hecke_matrix(a, l)Return the 2 × 2 matrix with entries [1, a, 0, l] if a<l and [l, 0, 0, 1] if a>=l.
INPUT:• 𝑎 – an integer or Infinity• l – a prime
OUTPUT:A 2 × 2 matrix of determinant l
EXAMPLES:
sage: from sage.modular.pollack_stevens.fund_domain import basic_hecke_matrix
sage: basic_hecke_matrix(0, 7)
[1 0]
[0 7]
sage: basic_hecke_matrix(5, 7)
[1 5]
[0 7]
sage: basic_hecke_matrix(7, 7)
[7 0]
[0 1]
sage: basic_hecke_matrix(19, 7)
[7 0]
[0 1]
sage: basic_hecke_matrix(infinity, 7)
[7 0]
[0 1]
>>> from sage.all import *>>> from sage.modular.pollack_stevens.fund_domain import basic_hecke_matrix>>> basic_hecke_matrix(Integer(0), Integer(7))
[1 0]
[0 7]
>>> basic_hecke_matrix(Integer(5), Integer(7))(continues on next page)

248

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

[1 5]
[0 7]
>>> basic_hecke_matrix(Integer(7), Integer(7))
[7 0]
[0 1]
>>> basic_hecke_matrix(Integer(19), Integer(7))
[7 0]
[0 1]
>>> basic_hecke_matrix(infinity, Integer(7))
[7 0]
[0 1]

19.4 𝑝-adic 𝐿-series attached to overconvergent eigensymbols
An overconvergent eigensymbol gives rise to a 𝑝-adic 𝐿-series, which is essentially defined as the evaluation of the eigensymbol at the path 0 → ∞. The resulting distribution on 𝑝 can be restricted to ×
𝑝 , thus giving the measure attached tothe sought 𝑝-adic 𝐿-series.
All this is carefully explained in [PS2011].
sage.modular.pollack_stevens.padic_lseries.log_gamma_binomial(p, gamma, n, M)(︀)︀Return the list of coefficients in the power series expansion (up to precision 𝑀 ) of log𝑝 (𝑧)/𝑛log𝑝 (𝛾)INPUT:• p – prime• gamma – topological generator, e.g. 1 + 𝑝• n – nonnegative integer• M – precision
OUTPUT:
The list of coefficients in the power series expansion of(︀log (𝑧)/ log (𝛾))︀
𝑝𝑝𝑛EXAMPLES:
sage: from sage.modular.pollack_stevens.padic_lseries import log_gamma_binomial
sage: log_gamma_binomial(5,1+5,2,4)[0, -3/205, 651/84050, -223/42025]
sage: log_gamma_binomial(5,1+5,3,4)[0, 2/205, -223/42025, 95228/25845375]>>> from sage.all import *>>> from sage.modular.pollack_stevens.padic_lseries import log_gamma_binomial>>> log_gamma_binomial(Integer(5),Integer(1)+Integer(5),Integer(2),Integer(4))[0, -3/205, 651/84050, -223/42025]>>> log_gamma_binomial(Integer(5),Integer(1)+Integer(5),Integer(3),Integer(4))[0, 2/205, -223/42025, 95228/25845375]

class sage.modular.pollack_stevens.padic_lseries.pAdicLseries(symb, gamma=None,quadratic_twist=1,
precision=None)
Bases: SageObject

19.4. 𝑝-adic 𝐿-series attached to overconvergent eigensymbols

249

Modular Symbols, Release 10.4

The 𝑝-adic 𝐿-series associated to an overconvergent eigensymbol.
INPUT:• symb – an overconvergent eigensymbol• gamma – topological generator of 1 + 𝑝 𝑝 (default: 1 + 𝑝 or 5 if 𝑝 = 2)
• quadratic_twist – conductor of quadratic twist 𝜒 (default: 1)• precision – if None (default) is specified, the correct precision bound is computed and the answer isreturned modulo that accuracy
EXAMPLES:
sage: E = EllipticCurve( 37a )sage: p = 5
sage: prec = 4
sage: L = E.padic_lseries(p, implementation="pollackstevens", precision=prec) #␣˓→long time
sage: L[1]# long time
1 + 4*5 + 2*5^2 + O(5^3)
sage: L.series(3)# long timeO(5^4) + (1 + 4*5 + 2*5^2 + O(5^3))*T + (3 + O(5^2))*T^2 + O(T^3)>>> from sage.all import *>>> E = EllipticCurve( 37a )>>> p = Integer(5)>>> prec = Integer(4)>>> L = E.padic_lseries(p, implementation="pollackstevens", precision=prec) #␣˓→long time>>> L[Integer(1)]# long time
1 + 4*5 + 2*5^2 + O(5^3)>>> L.series(Integer(3))# long timeO(5^4) + (1 + 4*5 + 2*5^2 + O(5^3))*T + (3 + O(5^2))*T^2 + O(T^3)
sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
sage: E = EllipticCurve( 20a )sage: phi = E.pollack_stevens_modular_symbol()sage: Phi = phi.p_stabilize_and_lift(3, 4) # long time
sage: L = pAdicLseries(Phi)# long time
sage: L.series(4)# long time
2*3 + O(3^4) + (3 + O(3^2))*T + (2 + O(3))*T^2 + O(3^0)*T^3 + O(T^4)>>> from sage.all import *>>> from sage.modular.pollack_stevens.padic_lseries import pAdicLseries>>> E = EllipticCurve( 20a )>>> phi = E.pollack_stevens_modular_symbol()>>> Phi = phi.p_stabilize_and_lift(Integer(3), Integer(4)) # long time>>> L = pAdicLseries(Phi)# long time>>> L.series(Integer(4))# long time
2*3 + O(3^4) + (3 + O(3^2))*T + (2 + O(3))*T^2 + O(3^0)*T^3 + O(T^4)

An example of a 𝑝-adic 𝐿-series associated to a modular abelian surface. This is not tested as it takes too long.:
sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→spacesage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
sage: A = ModularSymbols(103,2,1).cuspidal_submodule().new_subspace().
(continues on next page)

250

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

decomposition()[0]sage: p = 19
sage: prec = 4
sage: phi = ps_modsym_from_simple_modsym_space(A)sage: ap = phi.Tq_eigenvalue(p,prec)
sage: c1,c2 = phi.completions(p,prec)
sage: phi1,psi1 = c1
sage: phi2,psi2 = c2
sage: phi1p = phi1.p_stabilize_and_lift(p,ap = psi1(ap), M = prec) # not tested -␣˓→too long
sage: L1 = pAdicLseries(phi1p)# not tested -␣˓→too long
sage: phi2p = phi2.p_stabilize_and_lift(p,ap = psi2(ap), M = prec) # not tested -␣˓→too long
sage: L2 = pAdicLseries(phi2p)# not tested -␣˓→too long
sage: L1[1]*L2[1]# not tested -␣˓→too long
13 + 9*19 + 18*19^2 + O(19^3)
˓→>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→space>>> from sage.modular.pollack_stevens.padic_lseries import pAdicLseries>>> A = ModularSymbols(Integer(103),Integer(2),Integer(1)).cuspidal_submodule().
˓→new_subspace().decomposition()[Integer(0)]>>> p = Integer(19)>>> prec = Integer(4)>>> phi = ps_modsym_from_simple_modsym_space(A)>>> ap = phi.Tq_eigenvalue(p,prec)>>> c1,c2 = phi.completions(p,prec)>>> phi1,psi1 = c1>>> phi2,psi2 = c2>>> phi1p = phi1.p_stabilize_and_lift(p,ap = psi1(ap), M = prec) # not tested -␣˓→too long>>> L1 = pAdicLseries(phi1p)# not tested -␣˓→too long>>> phi2p = phi2.p_stabilize_and_lift(p,ap = psi2(ap), M = prec) # not tested -␣˓→too long>>> L2 = pAdicLseries(phi2p)# not tested -␣˓→too long>>> L1[Integer(1)]*L2[Integer(1)]␣˓→ # not tested - too long
13 + 9*19 + 18*19^2 + O(19^3)

interpolation_factor(ap, chip=1, psi=None)
Return the interpolation factor associated to self. This is the 𝑝-adic multiplier that which appears in theinterpolation formula of the 𝑝-adic 𝐿-function. It has the form (1 − 𝛼𝑝−1 )2 , where 𝛼𝑝 is the unit root of
𝑋 2 − 𝜓(𝑎𝑝 )𝜒(𝑝)𝑋 + 𝑝.
INPUT:• ap – the eigenvalue of the Up operator• chip – the value of the nebentype at p (default: 1)• psi – a twisting character (default: None)

19.4. 𝑝-adic 𝐿-series attached to overconvergent eigensymbols

251Modular Symbols, Release 10.4

OUTPUT: a 𝑝-adic number
EXAMPLES:
sage: E = EllipticCurve( 19a2 )sage: L = E.padic_lseries(3,implementation="pollackstevens",precision=6)
˓→long time
sage: ap = E.ap(3)# long time
sage: L.interpolation_factor(ap) # long time3^2 + 3^3 + 2*3^5 + 2*3^6 + O(3^7)#␣>>> from sage.all import *>>> E = EllipticCurve( 19a2 )>>> L = E.padic_lseries(Integer(3),implementation="pollackstevens",
˓→precision=Integer(6))# long time>>> ap = E.ap(Integer(3))# long time>>> L.interpolation_factor(ap) # long time3^2 + 3^3 + 2*3^5 + 2*3^6 + O(3^7)

Comparing against a different implementation:
sage: L = E.padic_lseries(3)sage: (1-1/L.alpha(prec=4))^23^2 + 3^3 + O(3^5)>>> from sage.all import *>>> L = E.padic_lseries(Integer(3))>>> (Integer(1)-Integer(1)/L.alpha(prec=Integer(4)))**Integer(2)3^2 + 3^3 + O(3^5)

prime()
Return the prime 𝑝 as in 𝑝-adic 𝐿-series.
EXAMPLES:
sage: E = EllipticCurve( 19a )sage: L = E.padic_lseries(19, implementation="pollackstevens",precision=6) #␣˓→long time
sage: L.prime()# long time
19>>> from sage.all import *>>> E = EllipticCurve( 19a )>>> L = E.padic_lseries(Integer(19), implementation="pollackstevens",
˓→precision=Integer(6)) # long time>>> L.prime()# long time
19

quadratic_twist()
Return the discriminant of the quadratic twist.
EXAMPLES:
sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
sage: E = EllipticCurve( 37a )sage: phi = E.pollack_stevens_modular_symbol()sage: Phi = phi.lift(37,4)(continues on next page)

252

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: L = pAdicLseries(Phi, quadratic_twist=-3)
sage: L.quadratic_twist()-3>>> from sage.all import *>>> from sage.modular.pollack_stevens.padic_lseries import pAdicLseries>>> E = EllipticCurve( 37a )>>> phi = E.pollack_stevens_modular_symbol()>>> Phi = phi.lift(Integer(37),Integer(4))>>> L = pAdicLseries(Phi, quadratic_twist=-Integer(3))>>> L.quadratic_twist()-3

series(prec=5)
Return the prec-th approximation to the 𝑝-adic 𝐿-series associated to self, as a power series in 𝑇 (corresponding to 𝛾 − 1 with 𝛾 the chosen generator of 1 + 𝑝 𝑝 ).
INPUT:• prec – (default 5) is the precision of the power series
EXAMPLES:
sage: E = EllipticCurve( 14a2 )sage: p = 3
sage: prec = 6
sage: L = E.padic_lseries(p,implementation="pollackstevens",precision=prec) #␣˓→long time
sage: L.series(4)# long time
2*3 + 3^4 + 3^5 + O(3^6) + (2*3 + 3^2 + O(3^4))*T + (2*3 + O(3^2))*T^2 + (3 +␣˓→O(3^2))*T^3 + O(T^4)
sage: E = EllipticCurve("15a3")
sage: L = E.padic_lseries(5,implementation="pollackstevens",precision=15) #␣˓→long time
sage: L.series(3)# long timeO(5^15) + (2 + 4*5^2 + 3*5^3 + 5^5 + 2*5^6 + 3*5^7 + 3*5^8 + 2*5^9 + 2*5^10 +␣
˓→3*5^11 + 5^12 + O(5^13))*T + (4*5 + 4*5^3 + 3*5^4 + 4*5^5 + 3*5^6 + 2*5^7 +␣
˓→5^8 + 4*5^9 + 3*5^10 + O(5^11))*T^2 + O(T^3)
sage: E = EllipticCurve("79a1")
sage: L = E.padic_lseries(2,implementation="pollackstevens",precision=10) #␣˓→not tested
sage: L.series(4) # not tested
O(2^9) + (2^3 + O(2^4))*T + O(2^0)*T^2 + (O(2^-3))*T^3 + O(T^4)>>> from sage.all import *>>> E = EllipticCurve( 14a2 )>>> p = Integer(3)>>> prec = Integer(6)>>> L = E.padic_lseries(p,implementation="pollackstevens",precision=prec) #␣˓→long time>>> L.series(Integer(4))# long time
2*3 + 3^4 + 3^5 + O(3^6) + (2*3 + 3^2 + O(3^4))*T + (2*3 + O(3^2))*T^2 + (3 +␣˓→O(3^2))*T^3 + O(T^4)>>> E = EllipticCurve("15a3")(continues on next page)

19.4. 𝑝-adic 𝐿-series attached to overconvergent eigensymbols

253

Modular Symbols, Release 10.4

(continued from previous page)>>> L = E.padic_lseries(Integer(5),implementation="pollackstevens",
˓→precision=Integer(15))# long time>>> L.series(Integer(3))# long timeO(5^15) + (2 + 4*5^2 + 3*5^3 + 5^5 + 2*5^6 + 3*5^7 + 3*5^8 + 2*5^9 + 2*5^10 +␣
˓→3*5^11 + 5^12 + O(5^13))*T + (4*5 + 4*5^3 + 3*5^4 + 4*5^5 + 3*5^6 + 2*5^7 +␣
˓→5^8 + 4*5^9 + 3*5^10 + O(5^11))*T^2 + O(T^3)>>> E = EllipticCurve("79a1")>>> L = E.padic_lseries(Integer(2),implementation="pollackstevens",
˓→precision=Integer(10)) # not tested>>> L.series(Integer(4)) # not tested
O(2^9) + (2^3 + O(2^4))*T + O(2^0)*T^2 + (O(2^-3))*T^3 + O(T^4)

symbol()Return the overconvergent modular symbol.
EXAMPLES:
sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
sage: E = EllipticCurve( 21a4 )sage: phi = E.pollack_stevens_modular_symbol()sage: Phi = phi.p_stabilize_and_lift(2,5)# long time
sage: L = pAdicLseries(Phi)# long time
sage: L.symbol()# long time
Modular symbol of level 42 with values in Space of 2-adic
distributions with k=0 action and precision cap 15
sage: L.symbol() is Phi# long timeTrue>>> from sage.all import *>>> from sage.modular.pollack_stevens.padic_lseries import pAdicLseries>>> E = EllipticCurve( 21a4 )>>> phi = E.pollack_stevens_modular_symbol()>>> Phi = phi.p_stabilize_and_lift(Integer(2),Integer(5))# long time>>> L = pAdicLseries(Phi)# long time>>> L.symbol()# long time
Modular symbol of level 42 with values in Space of 2-adic
distributions with k=0 action and precision cap 15>>> L.symbol() is Phi# long timeTrue

19.5 Manin map
Represents maps from a set of right coset representatives to a coefficient module.
This is a basic building block for implementing modular symbols, and provides basic arithmetic and right action of
matrices.
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi
Modular symbol of level 11 with values in Sym^0 Q^2(continues on next page)

254

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: phi.values()[-1/5, 1, 0]
sage: from sage.modular.pollack_stevens.manin_map import ManinMap, M2Z
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: D = OverconvergentDistributions(0, 11, 10)
sage: MR = ManinRelations(11)sage: data = {M2Z([1,0,0,1]):D([1,2]), M2Z([0,-1,1,3]):D([3,5]), M2Z([-1,-1,3,
˓→2]):D([1,1])}
sage: f = ManinMap(D, MR, data)
sage: f(M2Z([1,0,0,1]))(1 + O(11^2), 2 + O(11))
sage: S = Symk(0,QQ)
sage: MR = ManinRelations(37)sage: data = {M2Z([-2,-3,5,7]): S(0), M2Z([1,0,0,1]): S(0), M2Z([-1,-2,3,5]): S(0),␣
˓→M2Z([-1,-4,2,7]): S(1), M2Z([0,-1,1,4]): S(1), M2Z([-3,-1,7,2]): S(-1), M2Z([-2,-3,
˓→3,4]): S(0), M2Z([-4,-3,7,5]): S(0), M2Z([-1,-1,4,3]): S(0)}sage: f = ManinMap(S,MR,data)
sage: f(M2Z([2,3,4,5]))
1>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi
Modular symbol of level 11 with values in Sym^0 Q^2>>> phi.values()[-1/5, 1, 0]>>> from sage.modular.pollack_stevens.manin_map import ManinMap, M2Z>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> D = OverconvergentDistributions(Integer(0), Integer(11), Integer(10))>>> MR = ManinRelations(Integer(11))>>> data = {M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):D([Integer(1),˓→Integer(2)]), M2Z([Integer(0),-Integer(1),Integer(1),Integer(3)]):D([Integer(3),˓→Integer(5)]), M2Z([-Integer(1),-Integer(1),Integer(3),Integer(2)]):D([Integer(1),˓→Integer(1)])}>>> f = ManinMap(D, MR, data)>>> f(M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]))(1 + O(11^2), 2 + O(11))>>> S = Symk(Integer(0),QQ)>>> MR = ManinRelations(Integer(37))>>> data = {M2Z([-Integer(2),-Integer(3),Integer(5),Integer(7)]): S(Integer(0)),␣
˓→M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]): S(Integer(0)), M2Z([-Integer(1),˓→-Integer(2),Integer(3),Integer(5)]): S(Integer(0)), M2Z([-Integer(1),-Integer(4),˓→Integer(2),Integer(7)]): S(Integer(1)), M2Z([Integer(0),-Integer(1),Integer(1),˓→Integer(4)]): S(Integer(1)), M2Z([-Integer(3),-Integer(1),Integer(7),Integer(2)]):␣
˓→S(-Integer(1)), M2Z([-Integer(2),-Integer(3),Integer(3),Integer(4)]): S(Integer(0)),˓→ M2Z([-Integer(4),-Integer(3),Integer(7),Integer(5)]): S(Integer(0)), M2Z([˓→Integer(1),-Integer(1),Integer(4),Integer(3)]): S(Integer(0))}>>> f = ManinMap(S,MR,data)>>> f(M2Z([Integer(2),Integer(3),Integer(4),Integer(5)]))
1class sage.modular.pollack_stevens.manin_map.ManinMap(codomain, manin_relations,defining_data, check=True)
19.5. Manin map

255

Modular Symbols, Release 10.4

Bases: object
Map from a set of right coset representatives of Γ0 (𝑁 ) in 𝑆𝐿2 ( ) to a coefficient module that satisfies the Manin
relations.
INPUT:• codomain – coefficient module• manin_relations–
ManinRelations objectasage.modular.pollack_stevens.fund_domain.

• defining_data – a dictionary whose keys are a superset of manin_relations.gens() and a subset
of manin_relations.reps(), and whose values are in the codomain.
• check – do numerous (slow) checks and transformations to ensure that the input data is perfect.
EXAMPLES:
sage: from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap
sage: D = OverconvergentDistributions(0, 11, 10)
sage: manin = sage.modular.pollack_stevens.fund_domain.ManinRelations(11)sage: data = {M2Z([1,0,0,1]):D([1,2]), M2Z([0,-1,1,3]):D([3,5]), M2Z([-1,-1,3,
˓→2]):D([1,1])}
sage: f = ManinMap(D, manin, data); f # indirect doctest
Map from the set of right cosets of Gamma0(11) in SL_2(Z) to Space of 11-adic␣
˓→distributions with k=0 action and precision cap 10
sage: f(M2Z([1,0,0,1]))(1 + O(11^2), 2 + O(11))>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap>>> D = OverconvergentDistributions(Integer(0), Integer(11), Integer(10))>>> manin = sage.modular.pollack_stevens.fund_domain.ManinRelations(Integer(11))>>> data = {M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):D([Integer(1),˓→Integer(2)]), M2Z([Integer(0),-Integer(1),Integer(1),Integer(3)]):D([Integer(3),˓→Integer(5)]), M2Z([-Integer(1),-Integer(1),Integer(3),˓→Integer(2)]):D([Integer(1),Integer(1)])}>>> f = ManinMap(D, manin, data); f # indirect doctest
Map from the set of right cosets of Gamma0(11) in SL_2(Z) to Space of 11-adic␣
˓→distributions with k=0 action and precision cap 10>>> f(M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]))(1 + O(11^2), 2 + O(11))

apply(f, codomain=None, to_moments=False)
Return Manin map given by 𝑥 ↦→ 𝑓 (𝑠𝑒𝑙𝑓 (𝑥)), where 𝑓 is anything that can be called with elements of thecoefficient module.
This might be used to normalize, reduce modulo a prime, change base ring, etc.
INPUT:• f – anything that can be called with elements of the coefficient module• codomain – (default: None) the codomain of the return map• to_moments – (default: False) if True, will apply f to each of the moments instead
EXAMPLES:

256

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage: from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: S = Symk(0,QQ)
sage: MR = ManinRelations(37)sage: data = {M2Z([-2,-3,5,7]): S(0), M2Z([1,0,0,1]): S(0), M2Z([-1,-2,3,
˓→5]): S(0), M2Z([-1,-4,2,7]): S(1), M2Z([0,-1,1,4]): S(1), M2Z([-3,-1,7,2]):␣
˓→S(-1), M2Z([-2,-3,3,4]): S(0), M2Z([-4,-3,7,5]): S(0), M2Z([-1,-1,4,3]):␣
˓→S(0)}
sage: f = ManinMap(S,MR,data)
sage: list(f.apply(lambda t:2*t))[0, 2, 0, 0, 0, -2, 2, 0, 0]>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> S = Symk(Integer(0),QQ)>>> MR = ManinRelations(Integer(37))>>> data = {M2Z([-Integer(2),-Integer(3),Integer(5),Integer(7)]):␣
˓→S(Integer(0)), M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(2),Integer(3),Integer(5)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(4),Integer(2),Integer(7)]):␣
˓→S(Integer(1)), M2Z([Integer(0),-Integer(1),Integer(1),Integer(4)]):␣
˓→S(Integer(1)), M2Z([-Integer(3),-Integer(1),Integer(7),Integer(2)]): S(˓→Integer(1)), M2Z([-Integer(2),-Integer(3),Integer(3),Integer(4)]):␣
˓→S(Integer(0)), M2Z([-Integer(4),-Integer(3),Integer(7),Integer(5)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(1),Integer(4),Integer(3)]):␣
˓→S(Integer(0))}>>> f = ManinMap(S,MR,data)>>> list(f.apply(lambda t:Integer(2)*t))[0, 2, 0, 0, 0, -2, 2, 0, 0]

compute_full_data()
Compute the values of self on all coset reps from its values on our generating set.
EXAMPLES:
sage: from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: S = Symk(0,QQ)
sage: MR = ManinRelations(37); MR.gens()[[1 0] [ 0 -1] [-1 -1] [-1 -2] [-2 -3] [-3 -1] [-1 -4] [-4 -3][0 1], [ 1 4], [ 4 3], [ 3 5], [ 5 7], [ 7 2], [ 2 7], [ 7 5],[-2 -3][ 3 4]]
sage: data = {M2Z([-2,-3,5,7]): S(0), M2Z([1,0,0,1]): S(0), M2Z([-1,-2,3,
˓→5]): S(0), M2Z([-1,-4,2,7]): S(1), M2Z([0,-1,1,4]): S(1), M2Z([-3,-1,7,2]):␣
˓→S(-1), M2Z([-2,-3,3,4]): S(0), M2Z([-4,-3,7,5]): S(0), M2Z([-1,-1,4,3]):␣
˓→S(0)}
sage: f = ManinMap(S,MR,data)
sage: len(f._dict)9
sage: f.compute_full_data()
sage: len(f._dict)(continues on next page)

19.5. Manin map

257

Modular Symbols, Release 10.4

(continued from previous page)38>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> S = Symk(Integer(0),QQ)>>> MR = ManinRelations(Integer(37)); MR.gens()[[1 0] [ 0 -1] [-1 -1] [-1 -2] [-2 -3] [-3 -1] [-1 -4] [-4 -3][0 1], [ 1 4], [ 4 3], [ 3 5], [ 5 7], [ 7 2], [ 2 7], [ 7 5],<BLANKLINE>[-2 -3][ 3 4]]>>> data = {M2Z([-Integer(2),-Integer(3),Integer(5),Integer(7)]):␣
˓→S(Integer(0)), M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(2),Integer(3),Integer(5)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(4),Integer(2),Integer(7)]):␣
˓→S(Integer(1)), M2Z([Integer(0),-Integer(1),Integer(1),Integer(4)]):␣
˓→S(Integer(1)), M2Z([-Integer(3),-Integer(1),Integer(7),Integer(2)]): S(˓→Integer(1)), M2Z([-Integer(2),-Integer(3),Integer(3),Integer(4)]):␣
˓→S(Integer(0)), M2Z([-Integer(4),-Integer(3),Integer(7),Integer(5)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(1),Integer(4),Integer(3)]):␣
˓→S(Integer(0))}>>> f = ManinMap(S,MR,data)>>> len(f._dict)9>>> f.compute_full_data()>>> len(f._dict)38

extend_codomain(new_codomain, check=True)
Extend the codomain of self to new_codomain. There must be a valid conversion operation from the old tothe new codomain. This is most often used for extension of scalars from to 𝑝 .
EXAMPLES:
sage: from sage.modular.pollack_stevens.manin_map import ManinMap, M2Z
sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
sage: S = Symk(0,QQ)
sage: MR = ManinRelations(37)sage: data = {M2Z([-2,-3,5,7]): S(0), M2Z([1,0,0,1]): S(0), M2Z([-1,-2,3,
˓→5]): S(0), M2Z([-1,-4,2,7]): S(1), M2Z([0,-1,1,4]): S(1), M2Z([-3,-1,7,2]):␣
˓→S(-1), M2Z([-2,-3,3,4]): S(0), M2Z([-4,-3,7,5]): S(0), M2Z([-1,-1,4,3]):␣
˓→S(0)}
sage: m = ManinMap(S, MR, data); m
Map from the set of right cosets of Gamma0(37) in SL_2(Z) to Sym^0 Q^2
sage: m.extend_codomain(Symk(0, Qp(11)))
Map from the set of right cosets of Gamma0(37) in SL_2(Z) to Sym^0 Q_11^2>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import ManinMap, M2Z>>> from sage.modular.pollack_stevens.fund_domain import ManinRelations>>> S = Symk(Integer(0),QQ)>>> MR = ManinRelations(Integer(37))(continues on next page)

258

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> data = {M2Z([-Integer(2),-Integer(3),Integer(5),Integer(7)]):␣
˓→S(Integer(0)), M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(2),Integer(3),Integer(5)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(4),Integer(2),Integer(7)]):␣
˓→S(Integer(1)), M2Z([Integer(0),-Integer(1),Integer(1),Integer(4)]):␣
˓→S(Integer(1)), M2Z([-Integer(3),-Integer(1),Integer(7),Integer(2)]): S(˓→Integer(1)), M2Z([-Integer(2),-Integer(3),Integer(3),Integer(4)]):␣
˓→S(Integer(0)), M2Z([-Integer(4),-Integer(3),Integer(7),Integer(5)]):␣
˓→S(Integer(0)), M2Z([-Integer(1),-Integer(1),Integer(4),Integer(3)]):␣
˓→S(Integer(0))}>>> m = ManinMap(S, MR, data); m
Map from the set of right cosets of Gamma0(37) in SL_2(Z) to Sym^0 Q^2>>> m.extend_codomain(Symk(Integer(0), Qp(Integer(11))))
Map from the set of right cosets of Gamma0(37) in SL_2(Z) to Sym^0 Q_11^2

hecke(ell, algorithm='prep')
Return the image of this Manin map under the Hecke operator 𝑇ℓ .
INPUT:• ell – a prime• algorithm – a string, either ‘prep’ (default) or ‘naive’
OUTPUT:• The image of this ManinMap under the Hecke operator 𝑇ℓ
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: phi.is_Tq_eigensymbol(7,7,10)
True
sage: phi.hecke(7).values()[2/5, -2, 0]
sage: phi.Tq_eigenvalue(7,7,10)-2>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> phi.is_Tq_eigensymbol(Integer(7),Integer(7),Integer(10))
True>>> phi.hecke(Integer(7)).values()[2/5, -2, 0]>>> phi.Tq_eigenvalue(Integer(7),Integer(7),Integer(10))-2normalize()
Normalize every value of self – e.g., reduces each value’s 𝑗-th moment modulo 𝑝𝑁 −𝑗
EXAMPLES:

19.5. Manin map

259

Modular Symbols, Release 10.4

sage: from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap
sage: D = OverconvergentDistributions(0, 11, 10)
sage: manin = sage.modular.pollack_stevens.fund_domain.ManinRelations(11)sage: data = {M2Z([1,0,0,1]):D([1,2]), M2Z([0,-1,1,3]):D([3,5]), M2Z([-1,-1,
˓→3,2]):D([1,1])}
sage: f = ManinMap(D, manin, data)
sage: f._dict[M2Z([1,0,0,1])](1 + O(11^2), 2 + O(11))
sage: g = f.normalize()
sage: g._dict[M2Z([1,0,0,1])](1 + O(11^2), 2 + O(11))>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap>>> D = OverconvergentDistributions(Integer(0), Integer(11), Integer(10))>>> manin = sage.modular.pollack_stevens.fund_domain.
˓→ManinRelations(Integer(11))>>> data = {M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):D([Integer(1),˓→Integer(2)]), M2Z([Integer(0),-Integer(1),Integer(1),˓→Integer(3)]):D([Integer(3),Integer(5)]), M2Z([-Integer(1),-Integer(1),˓→Integer(3),Integer(2)]):D([Integer(1),Integer(1)])}>>> f = ManinMap(D, manin, data)>>> f._dict[M2Z([Integer(1),Integer(0),Integer(0),Integer(1)])](1 + O(11^2), 2 + O(11))>>> g = f.normalize()>>> g._dict[M2Z([Integer(1),Integer(0),Integer(0),Integer(1)])](1 + O(11^2), 2 + O(11))

p_stabilize(p, alpha, V)
Return the 𝑝-stabilization of self to level 𝑁 * 𝑝 on which 𝑈𝑝 acts by 𝛼.
INPUT:• p – a prime.
• alpha – a 𝑈𝑝 -eigenvalue.
• V – a space of modular symbols.
OUTPUT:• The image of this ManinMap under the Hecke operator 𝑇ℓ
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: f = phi._map
sage: V = phi.parent()
sage: f.p_stabilize(5,1,V)
Map from the set of right cosets of Gamma0(11) in SL_2(Z) to Sym^0 Q^2>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> f = phi._map>>> V = phi.parent()>>> f.p_stabilize(Integer(5),Integer(1),V)
Map from the set of right cosets of Gamma0(11) in SL_2(Z) to Sym^0 Q^2260

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

reduce_precision(M)Reduce the precision of all the values of the Manin map.
INPUT:• M – an integer, the new precision.
EXAMPLES:
sage: from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap
sage: D = OverconvergentDistributions(0, 11, 10)
sage: manin = sage.modular.pollack_stevens.fund_domain.ManinRelations(11)sage: data = {M2Z([1,0,0,1]):D([1,2]), M2Z([0,-1,1,3]):D([3,5]), M2Z([-1,-1,
˓→3,2]):D([1,1])}
sage: f = ManinMap(D, manin, data)
sage: f._dict[M2Z([1,0,0,1])](1 + O(11^2), 2 + O(11))
sage: g = f.reduce_precision(1)sage: g._dict[M2Z([1,0,0,1])]
1 + O(11^2)>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap>>> D = OverconvergentDistributions(Integer(0), Integer(11), Integer(10))>>> manin = sage.modular.pollack_stevens.fund_domain.
˓→ManinRelations(Integer(11))>>> data = {M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):D([Integer(1),˓→Integer(2)]), M2Z([Integer(0),-Integer(1),Integer(1),˓→Integer(3)]):D([Integer(3),Integer(5)]), M2Z([-Integer(1),-Integer(1),˓→Integer(3),Integer(2)]):D([Integer(1),Integer(1)])}>>> f = ManinMap(D, manin, data)>>> f._dict[M2Z([Integer(1),Integer(0),Integer(0),Integer(1)])](1 + O(11^2), 2 + O(11))>>> g = f.reduce_precision(Integer(1))>>> g._dict[M2Z([Integer(1),Integer(0),Integer(0),Integer(1)])]
1 + O(11^2)

specialize(*args)
Specialize all the values of the Manin map to a new coefficient module. Assumes that the codomain has a
specialize method, and passes all its arguments to that method.
EXAMPLES:
sage: from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap
sage: D = OverconvergentDistributions(0, 11, 10)
sage: manin = sage.modular.pollack_stevens.fund_domain.ManinRelations(11)sage: data = {M2Z([1,0,0,1]):D([1,2]), M2Z([0,-1,1,3]):D([3,5]), M2Z([-1,-1,
˓→3,2]):D([1,1])}
sage: f = ManinMap(D, manin, data)
sage: g = f.specialize()
sage: g._codomainSym^0 Z_11^2>>> from sage.all import *>>> from sage.modular.pollack_stevens.manin_map import M2Z, ManinMap>>> D = OverconvergentDistributions(Integer(0), Integer(11), Integer(10))>>> manin = sage.modular.pollack_stevens.fund_domain.
˓→ManinRelations(Integer(11))(continues on next page)

19.5. Manin map

261

Modular Symbols, Release 10.4

(continued from previous page)>>> data = {M2Z([Integer(1),Integer(0),Integer(0),Integer(1)]):D([Integer(1),˓→Integer(2)]), M2Z([Integer(0),-Integer(1),Integer(1),˓→Integer(3)]):D([Integer(3),Integer(5)]), M2Z([-Integer(1),-Integer(1),˓→Integer(3),Integer(2)]):D([Integer(1),Integer(1)])}>>> f = ManinMap(D, manin, data)>>> g = f.specialize()>>> g._codomainSym^0 Z_11^2

sage.modular.pollack_stevens.manin_map.unimod_matrices_from_infty(r, s)
Return a list of matrices whose associated unimodular paths connect ∞ to r/s.
INPUT:• r, s – rational numbers
OUTPUT:• a list of 𝑆𝐿2 ( ) matrices
EXAMPLES:
sage: v = sage.modular.pollack_stevens.manin_map.unimod_matrices_from_infty(19,˓→23); v[[ 0 1] [-1 0] [-4 1] [-5 -4] [-195][-1 0], [-1 -1], [-5 1], [-6 -5], [-236]]sage: [a.det() for a in v][1, 1, 1, 1, 1]
sage: sage.modular.pollack_stevens.manin_map.unimod_matrices_from_infty(11,25)[[ 0 1] [-1 0] [-3 1] [-4 -3] [-114][-1 0], [-2 -1], [-7 2], [-9 -7], [-259]]>>> from sage.all import *>>> v = sage.modular.pollack_stevens.manin_map.unimod_matrices_from_˓→infty(Integer(19),Integer(23)); v[[ 0 1] [-1 0] [-4 1] [-5 -4] [-195][-1 0], [-1 -1], [-5 1], [-6 -5], [-236]]>>> [a.det() for a in v][1, 1, 1, 1, 1]>>> sage.modular.pollack_stevens.manin_map.unimod_matrices_from_infty(Integer(11),
˓→Integer(25))[[ 0 1] [-1 0] [-3 1] [-4 -3] [-114][-1 0], [-2 -1], [-7 2], [-9 -7], [-259]]

ALGORITHM:
This is Manin’s continued fraction trick, which gives an expression {∞, 𝑟/𝑠} = {∞, 0}+...+{𝑎, 𝑏}+...+{*, 𝑟/𝑠},
where each {𝑎, 𝑏} is the image of {0, ∞} under a matrix in 𝑆𝐿2 ( ).

262

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage.modular.pollack_stevens.manin_map.unimod_matrices_to_infty(r, s)
Return a list of matrices whose associated unimodular paths connect 0 to r/s.
INPUT:• r, s – rational numbers
OUTPUT:• a list of matrices in 𝑆𝐿2 ( )EXAMPLES:
sage: v = sage.modular.pollack_stevens.manin_map.unimod_matrices_to_infty(19,23);␣
˓→v[[1 0] [ 0 1] [1 4] [-4 5] [ 5 19][0 1], [-1 1], [1 5], [-5 6], [ 6 23]]
sage: [a.det() for a in v][1, 1, 1, 1, 1]
sage: sage.modular.pollack_stevens.manin_map.unimod_matrices_to_infty(11,25)[[1 0] [ 0 1] [1 3] [-3 4] [ 4 11][0 1], [-1 2], [2 7], [-7 9], [ 9 25]]>>> from sage.all import *>>> v = sage.modular.pollack_stevens.manin_map.unimod_matrices_to_˓→infty(Integer(19),Integer(23)); v[[1 0] [ 0 1] [1 4] [-4 5] [ 5 19][0 1], [-1 1], [1 5], [-5 6], [ 6 23]]>>> [a.det() for a in v][1, 1, 1, 1, 1]>>> sage.modular.pollack_stevens.manin_map.unimod_matrices_to_infty(Integer(11),
˓→Integer(25))[[1 0] [ 0 1] [1 3] [-3 4] [ 4 11][0 1], [-1 2], [2 7], [-7 9], [ 9 25]]

ALGORITHM:
This is Manin’s continued fraction trick, which gives an expression {0, 𝑟/𝑠} = {0, ∞}+...+{𝑎, 𝑏}+...+{*, 𝑟/𝑠},
where each {𝑎, 𝑏} is the image of {0, ∞} under a matrix in 𝑆𝐿2 ( ).

19.5. Manin map

263

Modular Symbols, Release 10.4

19.6 Element class for Pollack-Stevens’ modular symbols
This is the class of elements in the spaces of Pollack-Steven’s modular symbols as described in [PS2011].
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol(); phi
Modular symbol of level 11 with values in Sym^0 Q^2
sage: phi.weight() # Note that weight k=2 of a modular form corresponds here to␣˓→weight 00sage: phi.values()[-1/5, 1, 0]
sage: phi.is_ordinary(11)Truesage: phi_lift = phi.lift(11, 5, eigensymbol = True) # long time
sage: phi_lift.padic_lseries().series(5) # long timeO(11^5) + (10 + 3*11 + 6*11^2 + 9*11^3 + O(11^4))*T + (6 + 3*11 + 2*11^2 + O(11^3))*T^
˓→2 + (2 + 2*11 + O(11^2))*T^3 + (5 + O(11))*T^4 + O(T^5)>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol(); phi
Modular symbol of level 11 with values in Sym^0 Q^2>>> phi.weight() # Note that weight k=2 of a modular form corresponds here to weight 00>>> phi.values()[-1/5, 1, 0]>>> phi.is_ordinary(Integer(11))
True>>> phi_lift = phi.lift(Integer(11), Integer(5), eigensymbol = True) # long time>>> phi_lift.padic_lseries().series(Integer(5)) # long timeO(11^5) + (10 + 3*11 + 6*11^2 + 9*11^3 + O(11^4))*T + (6 + 3*11 + 2*11^2 + O(11^3))*T^
˓→2 + (2 + 2*11 + O(11^2))*T^3 + (5 + O(11))*T^4 + O(T^5)
sage: A = ModularSymbols(Gamma1(8),4).decomposition()[0].plus_submodule().new_
˓→subspace()sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_
˓→spacesage: phi = ps_modsym_from_simple_modsym_space(A)sage: phi.values()[(-1, 0, 0), (1, 0, 0), (-9, -6, -4)]>>> from sage.all import *>>> A = ModularSymbols(Gamma1(Integer(8)),Integer(4)).decomposition()[Integer(0)].
˓→plus_submodule().new_subspace()>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_modsym_space>>> phi = ps_modsym_from_simple_modsym_space(A)>>> phi.values()[(-1, 0, 0), (1, 0, 0), (-9, -6, -4)]class sage.modular.pollack_stevens.modsym.PSModSymAction(actor, MSspace)
Bases: Action
Create the action
EXAMPLES:
264

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: g = phi._map._codomain._act._Sigma0(matrix(ZZ,2,2,[1,2,3,4]))
sage: phi * g # indirect doctest
Modular symbol of level 11 with values in Sym^0 Q^2>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> g = phi._map._codomain._act._Sigma0(matrix(ZZ,Integer(2),Integer(2),˓→[Integer(1),Integer(2),Integer(3),Integer(4)]))>>> phi * g # indirect doctest
Modular symbol of level 11 with values in Sym^0 Q^2class sage.modular.pollack_stevens.modsym.PSModularSymbolElement(map_data, parent,
construct=False)
Bases: ModuleElement
Initialize a modular symbol
EXAMPLES:
sage: E = EllipticCurve( 37a )sage: phi = E.pollack_stevens_modular_symbol()>>> from sage.all import *>>> E = EllipticCurve( 37a )>>> phi = E.pollack_stevens_modular_symbol()

Tq_eigenvalue(q, p=None, M=None, check=True)
Eigenvalue of 𝑇𝑞 modulo 𝑝𝑀
INPUT:• q – prime of the Hecke operator• p – prime we are working modulo (default: None)• M – degree of accuracy of approximation (default: None)• check – check that self is an eigensymbol
OUTPUT:• Constant 𝑐 such that 𝑠𝑒𝑙𝑓 |𝑇𝑞 − 𝑐 * 𝑠𝑒𝑙𝑓 has valuation greater than or equal to 𝑀 (if it exists), otherwise
raises ValueError
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: phi_ord = phi.p_stabilize(p = 3, ap = E.ap(3), M = 10, ordinary = True)
sage: phi_ord.Tq_eigenvalue(2,3,10) + 2
O(3^10)sage: phi_ord.Tq_eigenvalue(3,3,10)
2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + O(3^10)(continues on next page)

19.6. Element class for Pollack-Stevens’ modular symbols

265Modular Symbols, Release 10.4

(continued from previous page)

sage: phi_ord.Tq_eigenvalue(3,3,100)
Traceback (most recent call last):...
ValueError: result not determined to high enough precision>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> phi_ord = phi.p_stabilize(p = Integer(3), ap = E.ap(Integer(3)), M =␣˓→Integer(10), ordinary = True)>>> phi_ord.Tq_eigenvalue(Integer(2),Integer(3),Integer(10)) + Integer(2)O(3^10)>>> phi_ord.Tq_eigenvalue(Integer(3),Integer(3),Integer(10))
2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + O(3^10)>>> phi_ord.Tq_eigenvalue(Integer(3),Integer(3),Integer(100))
Traceback (most recent call last):...
ValueError: result not determined to high enough precision

diagonal_valuation(p)Return the minimum of the diagonal valuation on the values of self
INPUT:• p – a positive integral prime
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: phi.diagonal_valuation(2)0sage: phi.diagonal_valuation(3)0sage: phi.diagonal_valuation(5)-1sage: phi.diagonal_valuation(7)0>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> phi.diagonal_valuation(Integer(2))
0>>> phi.diagonal_valuation(Integer(3))
0>>> phi.diagonal_valuation(Integer(5))-1>>> phi.diagonal_valuation(Integer(7))
0266

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

dict()
Return dictionary on the modular symbol self, where keys are generators and values are the corresponding
values of self on generators
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: Set([x.moment(0) for x in phi.dict().values()]) == Set([-1/5, 1, 0])
True>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> Set([x.moment(Integer(0)) for x in phi.dict().values()]) == Set([˓→Integer(1)/Integer(5), Integer(1), Integer(0)])
Trueevaluate_twisted(a, chi)
Return Φ𝜒 ({𝑎/𝑝} − {∞}) where Φ is self and 𝜒 is a quadratic character
INPUT:• a – integer in the range range(p)• chi – the modulus of a quadratic character.
OUTPUT:The distribution Φ𝜒 ({𝑎/𝑝} − {∞}).
EXAMPLES:
sage: E = EllipticCurve( 17a1 )sage: L = E.padic_lseries(5, implementation="pollackstevens", precision=4)
˓→#long time
sage: D = L.quadratic_twist()# long time
sage: L.symbol().evaluate_twisted(1,D) # long time
(1 + 5 + 3*5^2 + 5^3 + O(5^4), 5^2 + O(5^3), 1 + O(5^2), 2 + O(5))
sage: E = EllipticCurve( 40a4 )sage: L = E.padic_lseries(7, implementation="pollackstevens", precision=4)
˓→#long time
sage: D = L.quadratic_twist()# long time
sage: L.symbol().evaluate_twisted(1,D) # long time
(4 + 6*7 + 3*7^2 + O(7^4), 6*7 + 6*7^2 + O(7^3), 6 + O(7^2), 1 + O(7))>>> from sage.all import *>>> E = EllipticCurve( 17a1 )>>> L = E.padic_lseries(Integer(5), implementation="pollackstevens",␣
˓→precision=Integer(4)) #long time>>> D = L.quadratic_twist()# long time>>> L.symbol().evaluate_twisted(Integer(1),D) # long time
(1 + 5 + 3*5^2 + 5^3 + O(5^4), 5^2 + O(5^3), 1 + O(5^2), 2 + O(5))>>> E = EllipticCurve( 40a4 )>>> L = E.padic_lseries(Integer(7), implementation="pollackstevens",␣
˓→precision=Integer(4)) #long time>>> D = L.quadratic_twist()# long time(continues on next page)

19.6. Element class for Pollack-Stevens’ modular symbols

267

Modular Symbols, Release 10.4

(continued from previous page)>>> L.symbol().evaluate_twisted(Integer(1),D) # long time
(4 + 6*7 + 3*7^2 + O(7^4), 6*7 + 6*7^2 + O(7^3), 6 + O(7^2), 1 + O(7))

hecke(ell, algorithm='prep')
Return self | 𝑇ℓ by making use of the precomputations in self.prep_hecke()
INPUT:• ell – a prime• algorithm – a string, either ‘prep’ (default) or ‘naive’
OUTPUT:• The image of this element under the Hecke operator 𝑇ℓ
ALGORITHMS:• If algorithm == prep , precomputes a list of matrices that only depend on the level, then uses
them to speed up the action.
• If algorithm == naive , just acts by the matrices defining the Hecke operator. That is, it
computes sum_a self | [1,a,0,ell] + self | [ell,0,0,1], the last term occurring only if the level is prime toell.
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: phi.hecke(2) == phi * E.ap(2)True
sage: phi.hecke(3) == phi * E.ap(3)Truesage: phi.hecke(5) == phi * E.ap(5)Truesage: phi.hecke(101) == phi * E.ap(101)True
sage: all(phi.hecke(p, algorithm= naive ) == phi * E.ap(p) for p in [2,3,5,
˓→101]) # long timeTrue>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> phi.hecke(Integer(2)) == phi * E.ap(Integer(2))
True>>> phi.hecke(Integer(3)) == phi * E.ap(Integer(3))
True>>> phi.hecke(Integer(5)) == phi * E.ap(Integer(5))
True>>> phi.hecke(Integer(101)) == phi * E.ap(Integer(101))
True>>> all(phi.hecke(p, algorithm= naive ) == phi * E.ap(p) for p in [Integer(2),(continues on next page)

268

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

Integer(3),Integer(5),Integer(101)]) # long timeTrue˓→

is_Tq_eigensymbol(q, p=None, M=None)
Determine if self is an eigenvector for 𝑇𝑞 modulo 𝑝𝑀
INPUT:• q – prime of the Hecke operator• p – prime we are working modulo• M – degree of accuracy of approximation
OUTPUT:• True/False
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: phi_ord = phi.p_stabilize(p = 3, ap = E.ap(3), M = 10, ordinary = True)
sage: phi_ord.is_Tq_eigensymbol(2,3,10)
True
sage: phi_ord.is_Tq_eigensymbol(2,3,100)
False
sage: phi_ord.is_Tq_eigensymbol(2,3,1000)
False
sage: phi_ord.is_Tq_eigensymbol(3,3,10)
True
sage: phi_ord.is_Tq_eigensymbol(3,3,100)
False>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> phi_ord = phi.p_stabilize(p = Integer(3), ap = E.ap(Integer(3)), M =␣˓→Integer(10), ordinary = True)>>> phi_ord.is_Tq_eigensymbol(Integer(2),Integer(3),Integer(10))
True>>> phi_ord.is_Tq_eigensymbol(Integer(2),Integer(3),Integer(100))
False>>> phi_ord.is_Tq_eigensymbol(Integer(2),Integer(3),Integer(1000))
False>>> phi_ord.is_Tq_eigensymbol(Integer(3),Integer(3),Integer(10))
True>>> phi_ord.is_Tq_eigensymbol(Integer(3),Integer(3),Integer(100))
False

is_ordinary(p=None, P=None)
Return true if the 𝑝-th eigenvalue is a 𝑝-adic unit.
INPUT:

19.6. Element class for Pollack-Stevens’ modular symbols

269

Modular Symbols, Release 10.4

• p – a positive integral prime, or None (default None)• P – a prime of the base ring above 𝑝, or None. This is ignored unless the base ring is a number field.
OUTPUT:• True/False
EXAMPLES:
sage: E = EllipticCurve( 11a1 )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.is_ordinary(2)False
sage: E.ap(2)-2sage: phi.is_ordinary(3)Truesage: E.ap(3)-1sage: phip = phi.p_stabilize(3,20)
sage: phip.is_ordinary()True>>> from sage.all import *>>> E = EllipticCurve( 11a1 )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.is_ordinary(Integer(2))
False>>> E.ap(Integer(2))-2>>> phi.is_ordinary(Integer(3))
True>>> E.ap(Integer(3))-1>>> phip = phi.p_stabilize(Integer(3),Integer(20))>>> phip.is_ordinary()True

A number field example. Here there are multiple primes above 𝑝, and 𝜑 is ordinary at one but not the other.:sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space
sage: f = Newforms(32, 8, names= a )[1]sage: phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(1))
sage: (p1, _), (p2, _) = phi.base_ring().ideal(3).factor()sage: phi.is_ordinary(p1) != phi.is_ordinary(p2)Truesage: phi.is_ordinary(3)Traceback (most recent call last):...
TypeError: P must be an ideal>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space>>> f = Newforms(Integer(32), Integer(8), names= a )[Integer(1)]>>> phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(Integer(1)))>>> (p1, _), (p2, _) = phi.base_ring().ideal(Integer(3)).factor()(continues on next page)

270

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> phi.is_ordinary(p1) != phi.is_ordinary(p2)True>>> phi.is_ordinary(Integer(3))
Traceback (most recent call last):...
TypeError: P must be an ideal

minus_part()
Return the minus part of self – i.e. self - self | [1,0,0,-1]
Note that we haven’t divided by 2. Is this a problem?
OUTPUT:• self – self | [1,0,0,-1]
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: (phi.plus_part()+phi.minus_part()) == phi * 2
True>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> (phi.plus_part()+phi.minus_part()) == phi * Integer(2)Trueplus_part()
Return the plus part of self – i.e. self + self | [1,0,0,-1].
Note that we haven’t divided by 2. Is this a problem?
OUTPUT:• self + self | [1,0,0,-1]
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: (phi.plus_part()+phi.minus_part()) == 2 * phi
True>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> (phi.plus_part()+phi.minus_part()) == Integer(2) * phi
True

19.6. Element class for Pollack-Stevens’ modular symbols

271

Modular Symbols, Release 10.4

valuation(p=None)
Return the valuation of self at 𝑝.
Here the valuation is the minimum of the valuations of the values of self.
INPUT:• p – prime
OUTPUT:• The valuation of self at 𝑝
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: phi.valuation(2)0sage: phi.valuation(3)0sage: phi.valuation(5)-1sage: phi.valuation(7)0sage: phi.valuation()
Traceback (most recent call last):...
ValueError: you must specify a prime
sage: phi2 = phi.lift(11, M=2)
sage: phi2.valuation()0
sage: phi2.valuation(3)Traceback (most recent call last):...
ValueError: inconsistent prime
sage: phi2.valuation(11)0>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> phi.valuation(Integer(2))
0>>> phi.valuation(Integer(3))
0>>> phi.valuation(Integer(5))-1>>> phi.valuation(Integer(7))
0>>> phi.valuation()
Traceback (most recent call last):...
ValueError: you must specify a prime(continues on next page)272

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> phi2 = phi.lift(Integer(11), M=Integer(2))>>> phi2.valuation()0>>> phi2.valuation(Integer(3))
Traceback (most recent call last):...
ValueError: inconsistent prime>>> phi2.valuation(Integer(11))
0values()Return the values of the symbol self on our chosen generators.
The generators are listed in self.dict().
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.values()[-1/5, 1, 0]
sage: sorted(phi.dict())[[-1 -1] [ 0 -1] [1 0][ 3 2], [ 1 3], [0 1]]sage: sorted(phi.values()) == sorted(phi.dict().values())
True>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> phi.values()[-1/5, 1, 0]>>> sorted(phi.dict())[[-1 -1] [ 0 -1] [1 0][ 3 2], [ 1 3], [0 1]]>>> sorted(phi.values()) == sorted(phi.dict().values())
Trueweight()Return the weight of this Pollack-Stevens modular symbol.
This is 𝑘 − 2, where 𝑘 is the usual notion of weight for modular forms!
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: phi.weight()
0>>> from sage.all import *>>> E = EllipticCurve( 11a )(continues on next page)

19.6. Element class for Pollack-Stevens’ modular symbols

273

Modular Symbols, Release 10.4

(continued from previous page)>>> phi = E.pollack_stevens_modular_symbol()>>> phi.weight()
0class sage.modular.pollack_stevens.modsym.PSModularSymbolElement_dist(map_data,
parent, construct=False)
Bases: PSModularSymbolElement
padic_lseries(*args, **kwds)
Return the 𝑝-adic L-series of this modular symbol.
EXAMPLES:
sage: E = EllipticCurve( 37a )sage: phi = E.pollack_stevens_modular_symbol()sage: L = phi.lift(37, M=6, eigensymbol=True).padic_lseries(); L # long time
37-adic L-series of Modular symbol of level 37 with values in Space of 37˓→adic distributions with k=0 action and precision cap 7
sage: L.series(2) # long timeO(37^6) + (4 + 37 + 36*37^2 + 19*37^3 + 21*37^4 + O(37^5))*T + O(T^2)>>> from sage.all import *>>> E = EllipticCurve( 37a )>>> phi = E.pollack_stevens_modular_symbol()>>> L = phi.lift(Integer(37), M=Integer(6), eigensymbol=True).padic_lseries();
˓→ L# long time
37-adic L-series of Modular symbol of level 37 with values in Space of 37˓→adic distributions with k=0 action and precision cap 7>>> L.series(Integer(2)) # long timeO(37^6) + (4 + 37 + 36*37^2 + 19*37^3 + 21*37^4 + O(37^5))*T + O(T^2)

precision_relative()
Return the number of moments of each value of self.
EXAMPLES:
sage: D = OverconvergentDistributions(0, 5, 10)
sage: M = PollackStevensModularSymbols(Gamma0(5), coefficients=D)
sage: f = M(1)sage: f.precision_relative()1>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(0), Integer(5), Integer(10))>>> M = PollackStevensModularSymbols(Gamma0(Integer(5)), coefficients=D)>>> f = M(Integer(1))>>> f.precision_relative()1

reduce_precision(M)Only hold on to 𝑀 moments of each value of self
EXAMPLES:

274

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage: D = OverconvergentDistributions(0, 5, 10)
sage: M = PollackStevensModularSymbols(Gamma0(5), coefficients=D)
sage: f = M(1)sage: f.reduce_precision(1)Modular symbol of level 5 with values in Space of 5-adic distributions with␣
˓→k=0 action and precision cap 10>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(0), Integer(5), Integer(10))>>> M = PollackStevensModularSymbols(Gamma0(Integer(5)), coefficients=D)>>> f = M(Integer(1))>>> f.reduce_precision(Integer(1))
Modular symbol of level 5 with values in Space of 5-adic distributions with␣
˓→k=0 action and precision cap 10

specialize(new_base_ring=None)
Return the underlying classical symbol of weight 𝑘.
Namely, this applies the canonical map 𝐷𝑘 → 𝑆𝑦𝑚𝑘 to all values of self.
EXAMPLES:
sage: D = OverconvergentDistributions(0, 5, 10); M =␣˓→PollackStevensModularSymbols(Gamma0(5), coefficients=D); M
Space of overconvergent modular symbols for Congruence Subgroup Gamma0(5)␣
˓→with sign 0
and values in Space of 5-adic distributions with k=0 action and precision cap␣˓→10
sage: f = M(1)sage: f.specialize()
Modular symbol of level 5 with values in Sym^0 Z_5^2
sage: f.specialize().values()[1 + O(5), 1 + O(5), 1 + O(5)]sage: f.values()[1 + O(5), 1 + O(5), 1 + O(5)]sage: f.specialize().parent()
Space of modular symbols for Congruence Subgroup Gamma0(5) with sign 0 and␣
˓→values in Sym^0 Z_5^2
sage: f.specialize().parent().coefficient_module()
Sym^0 Z_5^2
sage: f.specialize().parent().coefficient_module().is_symk()
Truesage: f.specialize(Qp(5,20))
Modular symbol of level 5 with values in Sym^0 Q_5^2>>> from sage.all import *>>> D = OverconvergentDistributions(Integer(0), Integer(5), Integer(10)); M␣
˓→= PollackStevensModularSymbols(Gamma0(Integer(5)), coefficients=D); M
Space of overconvergent modular symbols for Congruence Subgroup Gamma0(5)␣
˓→with sign 0
and values in Space of 5-adic distributions with k=0 action and precision cap␣˓→10>>> f = M(Integer(1))>>> f.specialize()
Modular symbol of level 5 with values in Sym^0 Z_5^2>>> f.specialize().values()[1 + O(5), 1 + O(5), 1 + O(5)](continues on next page)

19.6. Element class for Pollack-Stevens’ modular symbols

275

Modular Symbols, Release 10.4

(continued from previous page)>>> f.values()[1 + O(5), 1 + O(5), 1 + O(5)]>>> f.specialize().parent()
Space of modular symbols for Congruence Subgroup Gamma0(5) with sign 0 and␣
˓→values in Sym^0 Z_5^2>>> f.specialize().parent().coefficient_module()
Sym^0 Z_5^2>>> f.specialize().parent().coefficient_module().is_symk()
True>>> f.specialize(Qp(Integer(5),Integer(20)))
Modular symbol of level 5 with values in Sym^0 Q_5^2class sage.modular.pollack_stevens.modsym.PSModularSymbolElement_symk(map_data,
parent, construct=False)
Bases: PSModularSymbolElement
completions(p, M)
If 𝐾 is the base_ring of self, this function takes all maps 𝐾 → 𝑝 and applies them to self return a list of(modular symbol,map: 𝐾 → 𝑝 ) as map varies over all such maps.
Note: This only returns all completions when 𝑝 splits completely in 𝐾
INPUT:• p – prime• M – precision
OUTPUT:• A list of tuples (modular symbol,map: 𝐾 →𝑝 ) as map varies over all such maps

EXAMPLES:
sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space
sage: D = ModularSymbols(67,2,1).cuspidal_submodule().new_subspace().
˓→decomposition()[1]sage: f = ps_modsym_from_simple_modsym_space(D)sage: S = f.completions(41,10); S[(Modular symbol of level 67 with values in Sym^0 Q_41^2, Ring morphism:
From: Number Field in alpha with defining polynomial x^2 + 3*x + 1
To:
41-adic Field with capped relative precision 10
Defn: alpha |--> 5 + 22*41 + 19*41^2 + 10*41^3 + 28*41^4 + 22*41^5 + 9*41^6␣
˓→+ 25*41^7 + 40*41^8 + 8*41^9 + O(41^10)), (Modular symbol of level 67 with␣
˓→values in Sym^0 Q_41^2, Ring morphism:
From: Number Field in alpha with defining polynomial x^2 + 3*x + 1
To:
41-adic Field with capped relative precision 10
Defn: alpha |--> 33 + 18*41 + 21*41^2 + 30*41^3 + 12*41^4 + 18*41^5 + 31*41^
˓→6 + 15*41^7 + 32*41^9 + O(41^10))]sage: TestSuite(S[0][0]).run(skip=[ _test_category ])>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space(continues on next page)

276

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> D = ModularSymbols(Integer(67),Integer(2),Integer(1)).cuspidal_
˓→submodule().new_subspace().decomposition()[Integer(1)]>>> f = ps_modsym_from_simple_modsym_space(D)>>> S = f.completions(Integer(41),Integer(10)); S[(Modular symbol of level 67 with values in Sym^0 Q_41^2, Ring morphism:
From: Number Field in alpha with defining polynomial x^2 + 3*x + 1
To:
41-adic Field with capped relative precision 10
Defn: alpha |--> 5 + 22*41 + 19*41^2 + 10*41^3 + 28*41^4 + 22*41^5 + 9*41^6␣
˓→+ 25*41^7 + 40*41^8 + 8*41^9 + O(41^10)), (Modular symbol of level 67 with␣
˓→values in Sym^0 Q_41^2, Ring morphism:
From: Number Field in alpha with defining polynomial x^2 + 3*x + 1
To:
41-adic Field with capped relative precision 10
Defn: alpha |--> 33 + 18*41 + 21*41^2 + 30*41^3 + 12*41^4 + 18*41^5 + 31*41^
˓→6 + 15*41^7 + 32*41^9 + O(41^10))]>>> TestSuite(S[Integer(0)][Integer(0)]).run(skip=[ _test_category ])lift(p=None, M=None, alpha=None, new_base_ring=None, algorithm=None, eigensymbol=False,
check=True)
Return a (𝑝-adic) overconvergent modular symbol with 𝑀 moments which lifts self up to an Eisenstein error
Here the Eisenstein error is a symbol whose system of Hecke eigenvalues equals ℓ + 1 for 𝑇ℓ when ℓ does notdivide 𝑁 𝑝 and 1 for 𝑈𝑞 when 𝑞 divides 𝑁 𝑝.
INPUT:• p – prime• M – integer equal to the number of moments• alpha – 𝑈𝑝 eigenvalue• new_base_ring – change of base ring• algorithm – ‘stevens’ or ‘greenberg’ (default ‘stevens’)• eigensymbol – if True, lifts to Hecke eigensymbol (self must be a 𝑝-ordinary eigensymbol)(Note: eigensymbol = True does not just indicate to the code that self is an eigensymbol; it solves awholly different problem, lifting an eigensymbol to an eigensymbol.)
OUTPUT:An overconvergent modular symbol whose specialization equals self, up to some Eisenstein error if eigensymbol is False. If eigensymbol = True then the output will be an overconvergent Hecke eigensymbol(and it will lift the input exactly, the Eisenstein error disappears).
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: f = E.pollack_stevens_modular_symbol()sage: g = f.lift(11,4,algorithm= stevens ,eigensymbol=True)
sage: g.is_Tq_eigensymbol(2)True
sage: g.Tq_eigenvalue(3)10 + 10*11 + 10*11^2 + 10*11^3 + O(11^4)sage: g.Tq_eigenvalue(11)1 + O(11^4)>>> from sage.all import *>>> E = EllipticCurve( 11a )(continues on next page)

19.6. Element class for Pollack-Stevens’ modular symbols

277

Modular Symbols, Release 10.4

(continued from previous page)>>> f = E.pollack_stevens_modular_symbol()>>> g = f.lift(Integer(11),Integer(4),algorithm= stevens ,eigensymbol=True)>>> g.is_Tq_eigensymbol(Integer(2))
True>>> g.Tq_eigenvalue(Integer(3))
10 + 10*11 + 10*11^2 + 10*11^3 + O(11^4)>>> g.Tq_eigenvalue(Integer(11))
1 + O(11^4)

We check that lifting and then specializing gives back the original symbol:
sage: g.specialize() == f
True>>> from sage.all import *>>> g.specialize() == f
True

Another example, which showed precision loss in an earlier version of the code:
sage: E = EllipticCurve( 37a )sage: p = 5
sage: prec = 4
sage: phi = E.pollack_stevens_modular_symbol()sage: Phi = phi.p_stabilize_and_lift(p,prec, algorithm= stevens ,␣˓→eigensymbol=True) # long time
sage: Phi.Tq_eigenvalue(5,M = 4) # long time
3 + 2*5 + 4*5^2 + 2*5^3 + O(5^4)>>> from sage.all import *>>> E = EllipticCurve( 37a )>>> p = Integer(5)>>> prec = Integer(4)>>> phi = E.pollack_stevens_modular_symbol()>>> Phi = phi.p_stabilize_and_lift(p,prec, algorithm= stevens ,␣˓→eigensymbol=True) # long time>>> Phi.Tq_eigenvalue(Integer(5),M = Integer(4)) # long time
3 + 2*5 + 4*5^2 + 2*5^3 + O(5^4)

Another example:
sage: from sage.modular.pollack_stevens.padic_lseries import pAdicLseries
sage: E = EllipticCurve( 37a )sage: p = 5
sage: prec = 6
sage: phi = E.pollack_stevens_modular_symbol()sage: Phi = phi.p_stabilize_and_lift(p=p,M=prec,alpha=None,algorithm= stevens
˓→ ,eigensymbol=True) #long time
sage: L = pAdicLseries(Phi)# long time
sage: L.symbol() is Phi# long timeTrue>>> from sage.all import *>>> from sage.modular.pollack_stevens.padic_lseries import pAdicLseries>>> E = EllipticCurve( 37a )(continues on next page)

278

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> p = Integer(5)>>> prec = Integer(6)>>> phi = E.pollack_stevens_modular_symbol()>>> Phi = phi.p_stabilize_and_lift(p=p,M=prec,alpha=None,algorithm= stevens ,˓→eigensymbol=True) #long time>>> L = pAdicLseries(Phi)# long time>>> L.symbol() is Phi# long time
True

Examples using Greenberg’s algorithm:
sage: E = EllipticCurve( 11a )sage: phi = E.pollack_stevens_modular_symbol()sage: Phi = phi.lift(11,8,algorithm= greenberg ,eigensymbol=True)
sage: Phi2 = phi.lift(11,8,algorithm= stevens ,eigensymbol=True)
sage: Phi == Phi2
True>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> phi = E.pollack_stevens_modular_symbol()>>> Phi = phi.lift(Integer(11),Integer(8),algorithm= greenberg ,˓→eigensymbol=True)>>> Phi2 = phi.lift(Integer(11),Integer(8),algorithm= stevens ,˓→eigensymbol=True)>>> Phi == Phi2
True

An example in higher weight:
sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space
sage: f = ps_modsym_from_simple_modsym_space(Newforms(7, 4)[0].modular_
˓→symbols(1))
sage: fs = f.p_stabilize(5)sage: FsG = fs.lift(M=6, eigensymbol=True,algorithm= greenberg ) # long time
sage: FsG.values()[0]# long time5^-1 * (2*5 + 5^2 + 3*5^3 + 4*5^4 + O(5^7), O(5^6), 2*5^2 + 3*5^3 + O(5^5),␣
˓→O(5^4), 5^2 + O(5^3), O(5^2))sage: FsS = fs.lift(M=6, eigensymbol=True,algorithm= stevens )# long time
sage: FsS == FsG# long timeTrue>>> from sage.all import *>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space>>> f = ps_modsym_from_simple_modsym_space(Newforms(Integer(7),␣
˓→Integer(4))[Integer(0)].modular_symbols(Integer(1)))>>> fs = f.p_stabilize(Integer(5))>>> FsG = fs.lift(M=Integer(6), eigensymbol=True,algorithm= greenberg ) #␣˓→long time>>> FsG.values()[Integer(0)]#␣˓→long time5^-1 * (2*5 + 5^2 + 3*5^3 + 4*5^4 + O(5^7), O(5^6), 2*5^2 + 3*5^3 + O(5^5),␣
˓→O(5^4), 5^2 + O(5^3), O(5^2))>>> FsS = fs.lift(M=Integer(6), eigensymbol=True,algorithm= stevens )#␣(continues on next page)

19.6. Element class for Pollack-Stevens’ modular symbols

279

Modular Symbols, Release 10.4

(continued from previous page)long time>>> FsS == FsG
True˓→# long time

p_stabilize(p=None, M=20, alpha=None, ap=None, new_base_ring=None, ordinary=True, check=True)
Return the 𝑝-stabilization of self to level 𝑁 𝑝 on which 𝑈𝑝 acts by 𝛼.
Note that since 𝛼 is 𝑝-adic, the resulting symbol is just an approximation to the true 𝑝-stabilization (depending
on how well 𝛼 is approximated).
INPUT:• p – prime not dividing the level of self
• M – (default: 20) precision of𝑝• alpha – 𝑈𝑝 eigenvalue• ap – Hecke eigenvalue• new_base_ring – change of base ring
• ordinary – (default: True) whether to return the ordinary(at p) eigensymbol.
• check – (default: True) whether to perform extra sanity checks
OUTPUT:
A modular symbol with the same Hecke eigenvalues as self away from 𝑝 and eigenvalue 𝛼 at 𝑝. The eigenvalue
𝛼 depends on the parameter ordinary.
If ordinary == True: the unique modular symbol of level 𝑁 𝑝 with the same Hecke eigenvalues as selfaway from 𝑝 and unit eigenvalue at 𝑝; else the unique modular symbol of level 𝑁 𝑝 with the same Hecke
eigenvalues as self away from 𝑝 and non-unit eigenvalue at 𝑝.
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: p = 5
sage: prec = 4
sage: phi = E.pollack_stevens_modular_symbol()sage: phis = phi.p_stabilize(p,M = prec)
sage: phis
Modular symbol of level 55 with values in Sym^0 Q_5^2sage: phis.hecke(7) == phis*E.ap(7)Truesage: phis.hecke(5) == phis*E.ap(5)False
sage: phis.hecke(3) == phis*E.ap(3)Truesage: phis.Tq_eigenvalue(5)1 + 4*5 + 3*5^2 + 2*5^3 + O(5^4)
sage: phis.Tq_eigenvalue(5,M = 3)
1 + 4*5 + 3*5^2 + O(5^3)
sage: phis = phi.p_stabilize(p,M = prec,ordinary=False)
sage: phis.Tq_eigenvalue(5)5 + 5^2 + 2*5^3 + O(5^5)

280

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> p = Integer(5)>>> prec = Integer(4)>>> phi = E.pollack_stevens_modular_symbol()>>> phis = phi.p_stabilize(p,M = prec)>>> phis
Modular symbol of level 55 with values in Sym^0 Q_5^2>>> phis.hecke(Integer(7)) == phis*E.ap(Integer(7))
True>>> phis.hecke(Integer(5)) == phis*E.ap(Integer(5))
False>>> phis.hecke(Integer(3)) == phis*E.ap(Integer(3))
True>>> phis.Tq_eigenvalue(Integer(5))
1 + 4*5 + 3*5^2 + 2*5^3 + O(5^4)>>> phis.Tq_eigenvalue(Integer(5),M = Integer(3))
1 + 4*5 + 3*5^2 + O(5^3)>>> phis = phi.p_stabilize(p,M = prec,ordinary=False)>>> phis.Tq_eigenvalue(Integer(5))
5 + 5^2 + 2*5^3 + O(5^5)

A complicated example (with nontrivial character):sage: chi = DirichletGroup(24)([-1, -1, -1])
sage: f = Newforms(chi,names= a )[0]sage: from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space
sage: phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(1))
sage: phi11, h11 = phi.completions(11,20)[0]sage: phi11s = phi11.p_stabilize()
sage: phi11s.is_Tq_eigensymbol(11) # long timeTrue>>> from sage.all import *>>> chi = DirichletGroup(Integer(24))([-Integer(1), -Integer(1), -Integer(1)])>>> f = Newforms(chi,names= a )[Integer(0)]>>> from sage.modular.pollack_stevens.space import ps_modsym_from_simple_
˓→modsym_space>>> phi = ps_modsym_from_simple_modsym_space(f.modular_symbols(Integer(1)))>>> phi11, h11 = phi.completions(Integer(11),Integer(20))[Integer(0)]>>> phi11s = phi11.p_stabilize()>>> phi11s.is_Tq_eigensymbol(Integer(11)) # long timeTruep_stabilize_and_lift(p, M, alpha=None, ap=None, new_base_ring=None, ordinary=True,algorithm='greenberg', eigensymbol=False, check=True)𝑝-stabilize and lift self
INPUT:• p – prime, not dividing the level of self
• M – precision• alpha – (default: None) the 𝑈𝑝 eigenvalue, if known• ap – (default: None) the Hecke eigenvalue at p (before stabilizing), if known
19.6. Element class for Pollack-Stevens’ modular symbols

281

Modular Symbols, Release 10.4

• new_base_ring – (default: None) if specified, force the resulting eigensymbol to take values in thegiven ring
• ordinary – (default: True) whether to return the ordinary(at p) eigensymbol.
• algorithm – (default: ‘greenberg’) a string, either ‘greenberg’ or ‘stevens’, specifying whether to use
the lifting algorithm of M.Greenberg or that of Pollack–Stevens. The latter one solves the difference
equation, which is not needed. The option to use Pollack–Stevens’ algorithm here is just for historicalreasons.
• eigensymbol – (default: False) if True, return an overconvergent eigensymbol. Otherwise just
perform a naive lift
• check – (default: True) whether to perform extra sanity checks
OUTPUT:𝑝-stabilized and lifted version of self.
EXAMPLES:
sage: E = EllipticCurve( 11a )sage: f = E.pollack_stevens_modular_symbol()sage: g = f.p_stabilize_and_lift(3,10) # long time
sage: g.Tq_eigenvalue(5)# long time
1 + O(3^10)sage: g.Tq_eigenvalue(7)# long time
1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^˓→10)
sage: g.Tq_eigenvalue(3)# long time
2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + O(3^10)>>> from sage.all import *>>> E = EllipticCurve( 11a )>>> f = E.pollack_stevens_modular_symbol()>>> g = f.p_stabilize_and_lift(Integer(3),Integer(10)) # long time>>> g.Tq_eigenvalue(Integer(5))# long time
1 + O(3^10)>>> g.Tq_eigenvalue(Integer(7))# long time
1 + 2*3 + 2*3^2 + 2*3^3 + 2*3^4 + 2*3^5 + 2*3^6 + 2*3^7 + 2*3^8 + 2*3^9 + O(3^˓→10)>>> g.Tq_eigenvalue(Integer(3))# long time
2 + 3^2 + 2*3^3 + 2*3^4 + 2*3^6 + 3^8 + 2*3^9 + O(3^10)

19.7 Quotients of the Bruhat-Tits tree
This package contains all the functionality described and developed in [FM2014]. It allows for computations with fundamental domains of the Bruhat-Tits tree, under the action of arithmetic groups arising from units in definite quaternion
algebras.
EXAMPLES:
Create the quotient attached to a maximal order of the quaternion algebra of discriminant 13, at the prime 𝑝 = 5:
sage: Y = BruhatTitsQuotient(5, 13)282

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> Y = BruhatTitsQuotient(Integer(5), Integer(13))

We can query for its genus, as well as get it back as a graph:
sage: Y.genus()
5sage: Y.get_graph()
Multi-graph on 2 vertices>>> from sage.all import *>>> Y.genus()
5>>> Y.get_graph()
Multi-graph on 2 vertices

The rest of functionality can be found in the docstrings below.
AUTHORS:• Cameron Franc and Marc Masdeu (2011): initial version
class sage.modular.btquotients.btquotient.BruhatTitsQuotient(p, Nminus, Nplus=1,
character=None,
use_magma=False,
seed=None,magma_session=None)
Bases: SageObject, UniqueRepresentation
This function computes the quotient of the Bruhat-Tits tree by an arithmetic quaternionic group. The group inquestion is the group of norm 1 elements in an Eichler [1/𝑝]-order of some (tame) level inside of a definite
quaternion algebra that is unramified at the prime 𝑝. Note that this routine relies in Magma in the case 𝑝 = 2 orwhen 𝑁 + > 1.
INPUT:• p – a prime number• Nminus – squarefree integer divisible by an odd number of distinct primes and relatively prime to p. Thisis the discriminant of the definite quaternion algebra that one is quotienting by.
• Nplus – an integer coprime to pNminus (Default: 1). This is the tame level. It need not be squarefree!
If Nplus is not 1 then the user currently needs magma installed due to sage’s inability to compute well withnonmaximal Eichler orders in rational (definite) quaternion algebras.
• character – a Dirichlet character (Default: None) of modulus 𝑝𝑁 − 𝑁 + .
• use_magma – boolean (default: False). If True, uses Magma for quaternion arithmetic.
• magma_session – (default: None). If specified, the Magma session to use.
EXAMPLES:
Here is an example without a Dirichlet character:sage: X = BruhatTitsQuotient(13, 19)
sage: X.genus()
19
sage: G = X.get_graph(); G
Multi-graph on 4 vertices

19.7. Quotients of the Bruhat-Tits tree283

Modular Symbols, Release 10.4>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(13), Integer(19))>>> X.genus()
19>>> G = X.get_graph(); G
Multi-graph on 4 vertices

And an example with a Dirichlet character:sage: f = DirichletGroup(6)[1]sage: X = BruhatTitsQuotient(3,2*5*7,character = f)sage: X.genus()
5>>> from sage.all import *>>> f = DirichletGroup(Integer(6))[Integer(1)]>>> X = BruhatTitsQuotient(Integer(3),Integer(2)*Integer(5)*Integer(7),character␣˓→= f)>>> X.genus()
5

Note: A sage implementation of Eichler orders in rational quaternions algebras would remove the dependency onmagma.
AUTHORS:• Marc Masdeu (2012-02-20)
B_one()
Return the coordinates of 1 in the basis for the quaternion order.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,11)
sage: v,pow = X.B_one()sage: X._conv(v) == 1
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(11))>>> v,pow = X.B_one()>>> X._conv(v) == Integer(1)True

Nminus()Return the discriminant of the relevant definite quaternion algebra.
OUTPUT:
An integer equal to 𝑁 − .
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: X.Nminus()
7284

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> X.Nminus()
7

Nplus()
Return the tame level 𝑁 + .
OUTPUT:
An integer equal to 𝑁 + .
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7,1)
sage: X.Nplus()
1>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7),Integer(1))>>> X.Nplus()1dimension_harmonic_cocycles(k, lev=None, Nplus=None, character=None)
Compute the dimension of the space of harmonic cocycles of weight 𝑘 on self.
OUTPUT:
An integer equal to the dimension
EXAMPLES:
sage: X = BruhatTitsQuotient(3,7)
sage: [X.dimension_harmonic_cocycles(k) for k in range(2,20,2)][1, 4, 4, 8, 8, 12, 12, 16, 16]
sage: X = BruhatTitsQuotient(2,5) # optional - magma
sage: [X.dimension_harmonic_cocycles(k) for k in range(2,40,2)] # optional -␣˓→magma[0, 1, 3, 1, 3, 5, 3, 5, 7, 5, 7, 9, 7, 9, 11, 9, 11, 13, 11]
sage: X = BruhatTitsQuotient(7, 2 * 3 * 5)sage: X.dimension_harmonic_cocycles(4)12sage: X = BruhatTitsQuotient(7, 2 * 3 * 5 * 11 * 13)
sage: X.dimension_harmonic_cocycles(2)481sage: X.dimension_harmonic_cocycles(4)1440>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(7))>>> [X.dimension_harmonic_cocycles(k) for k in range(Integer(2),Integer(20),
˓→Integer(2))][1, 4, 4, 8, 8, 12, 12, 16, 16]>>> X = BruhatTitsQuotient(Integer(2),Integer(5)) # optional - magma>>> [X.dimension_harmonic_cocycles(k) for k in range(Integer(2),Integer(40),(continues on next page)

19.7. Quotients of the Bruhat-Tits tree285

Modular Symbols, Release 10.4

(continued from previous page)

Integer(2))] # optional - magma[0, 1, 3, 1, 3, 5, 3, 5, 7, 5, 7, 9, 7, 9, 11, 9, 11, 13, 11]˓→>>> X = BruhatTitsQuotient(Integer(7), Integer(2) * Integer(3) * Integer(5))>>> X.dimension_harmonic_cocycles(Integer(4))
12>>> X = BruhatTitsQuotient(Integer(7), Integer(2) * Integer(3) * Integer(5) *␣
˓→Integer(11) * Integer(13))>>> X.dimension_harmonic_cocycles(Integer(2))
481>>> X.dimension_harmonic_cocycles(Integer(4))
1440

e3()
Compute the 𝑒3 invariant defined by the formula(︂)︂)︂ ∏︁ (︂(︂)︂)︂ ∏︁
∏︁ (︂
−3
−3
𝑒𝑘 =
1−
1+
𝜈ℓ (3)
ℓ
ℓ
−
+
2
+
ℓ|𝑝𝑁

ℓ‖𝑁

ℓ |𝑁

OUTPUT:an integer
EXAMPLES:
sage: X = BruhatTitsQuotient(31,3)
sage: X.e3
1>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(31),Integer(3))>>> X.e31e4()
Compute the 𝑒4 invariant defined by the formula(︂)︂)︂ ∏︁ (︂(︂)︂)︂ ∏︁
∏︁ (︂
−𝑘
−𝑘
𝑒𝑘 =
1−
1+
𝜈ℓ (𝑘)
ℓ
ℓ
−
+
2
+
ℓ|𝑝𝑁

ℓ‖𝑁

ℓ |𝑁

OUTPUT:an integer
EXAMPLES:
sage: X = BruhatTitsQuotient(31,3)
sage: X.e4
2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(31),Integer(3))>>> X.e42286

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

embed(g, exact=False, prec=None)
Embed the quaternion element g into a matrix algebra.
INPUT:• g a row vector of size 4 whose entries represent a quaternion in our basis.
• exact boolean (default: False) If True, tries to embed g into a matrix algebra over a number field.
If False, the target is the matrix algebra over 𝑝 .
OUTPUT:A 2x2 matrix with coefficients in

𝑝 if exact is False, or a number field if exact is True.

EXAMPLES:
sage: X = BruhatTitsQuotient(7,2)
sage: l = X.get_units_of_order()sage: len(l)12sage: l[3] # random
[-1]
[ 0]
[ 1]
[ 1]
sage: u = X.embed_quaternion(l[3]); u # random[
O(7) 3 + O(7)][2 + O(7) 6 + O(7)]sage: X._increase_precision(5)sage: v = X.embed_quaternion(l[3]); v # random[
7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6)
3 + 7 + 3*7^2 +␣
˓→7^3 + 4*7^4 + O(7^6)][
2 + 7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6) 6 + 5*7 + 3*7^2 + 5*7^3 +␣
˓→2*7^4 + 6*7^5 + O(7^6)]
sage: u == v
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(2))>>> l = X.get_units_of_order()>>> len(l)12>>> l[Integer(3)] # random
[-1]
[ 0]
[ 1]
[ 1]
>>> u = X.embed_quaternion(l[Integer(3)]); u # random[
O(7) 3 + O(7)][2 + O(7) 6 + O(7)]>>> X._increase_precision(Integer(5))>>> v = X.embed_quaternion(l[Integer(3)]); v # random[
7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6)
3 + 7 + 3*7^2 +␣
˓→7^3 + 4*7^4 + O(7^6)][
2 + 7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6) 6 + 5*7 + 3*7^2 + 5*7^3 +␣
˓→2*7^4 + 6*7^5 + O(7^6)]>>> u == v
Trueembed_quaternion(g, exact=False, prec=None)
19.7. Quotients of the Bruhat-Tits tree287

Modular Symbols, Release 10.4

Embed the quaternion element g into a matrix algebra.
INPUT:• g a row vector of size 4 whose entries represent a quaternion in our basis.
• exact boolean (default: False) If True, tries to embed g into a matrix algebra over a number field.
If False, the target is the matrix algebra over 𝑝 .
OUTPUT:A 2x2 matrix with coefficients in

𝑝 if exact is False, or a number field if exact is True.

EXAMPLES:
sage: X = BruhatTitsQuotient(7,2)
sage: l = X.get_units_of_order()sage: len(l)12sage: l[3] # random
[-1]
[ 0]
[ 1]
[ 1]
sage: u = X.embed_quaternion(l[3]); u # random[
O(7) 3 + O(7)][2 + O(7) 6 + O(7)]sage: X._increase_precision(5)sage: v = X.embed_quaternion(l[3]); v # random[
7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6)
3 + 7 + 3*7^2 +␣
˓→7^3 + 4*7^4 + O(7^6)][
2 + 7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6) 6 + 5*7 + 3*7^2 + 5*7^3 +␣
˓→2*7^4 + 6*7^5 + O(7^6)]
sage: u == v
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(2))>>> l = X.get_units_of_order()>>> len(l)12>>> l[Integer(3)] # random
[-1]
[ 0]
[ 1]
[ 1]
>>> u = X.embed_quaternion(l[Integer(3)]); u # random[
O(7) 3 + O(7)][2 + O(7) 6 + O(7)]>>> X._increase_precision(Integer(5))>>> v = X.embed_quaternion(l[Integer(3)]); v # random[
7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6)
3 + 7 + 3*7^2 +␣
˓→7^3 + 4*7^4 + O(7^6)][
2 + 7 + 3*7^2 + 7^3 + 4*7^4 + O(7^6) 6 + 5*7 + 3*7^2 + 5*7^3 +␣
˓→2*7^4 + 6*7^5 + O(7^6)]>>> u == v
Truefundom_rep(v1)288

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

Find an equivalent vertex in the fundamental domain.
INPUT:• v1 – a 2x2 matrix representing a normalized vertex.
OUTPUT:
A Vertex equivalent to v1, in the fundamental domain.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,7)
sage: M = Matrix(ZZ,2,2,[1,3,2,7])
sage: M.set_immutable()sage: X.fundom_rep(M)Vertex of Bruhat-Tits tree for p = 3>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(7))>>> M = Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(3),Integer(2),˓→Integer(7)])>>> M.set_immutable()>>> X.fundom_rep(M)Vertex of Bruhat-Tits tree for p = 3

genus()
Compute the genus of the quotient graph using a formula This should agree with self.genus_no_formula().
Compute the genus of the Shimura curve corresponding to this quotient via Cerednik-Drinfeld. It is computed
via a formula and not in terms of the quotient graph.
INPUT:• level: Integer (default: None) a level. By default, use that of self.
• Nplus: Integer (default: None) a conductor. By default, use that of self.
OUTPUT:
An integer equal to the genus
EXAMPLES:
sage: X = BruhatTitsQuotient(3,2*5*31)
sage: X.genus()
21
sage: X.genus() == X.genus_no_formula()
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(2)*Integer(5)*Integer(31))>>> X.genus()
21>>> X.genus() == X.genus_no_formula()Truegenus_no_formula()
Compute the genus of the quotient from the data of the quotient graph. This should agree with self.genus().
OUTPUT:19.7. Quotients of the Bruhat-Tits tree289

Modular Symbols, Release 10.4

An integer
EXAMPLES:
sage: X = BruhatTitsQuotient(5,2*3*29)
sage: X.genus_no_formula()17
sage: X.genus_no_formula() == X.genus()
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(2)*Integer(3)*Integer(29))>>> X.genus_no_formula()
17>>> X.genus_no_formula() == X.genus()
True

get_edge_list()
Return a list of Edge which represent a fundamental domain inside the Bruhat-Tits tree for the quotient.
OUTPUT:
A list of Edge.
EXAMPLES:
sage: X = BruhatTitsQuotient(37,3)
sage: len(X.get_edge_list())
8>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(37),Integer(3))>>> len(X.get_edge_list())
8

get_edge_stabilizers()
Compute the stabilizers in the arithmetic group of all edges in the Bruhat-Tits tree within a fundamental
domain for the quotient graph. The stabilizers of an edge and its opposite are equal, and so we only store half
the data.
OUTPUT:
A list of lists encoding edge stabilizers. It contains one entry for each edge. Each entry is a list of data
corresponding to the group elements in the stabilizer of the edge. The data consists of: (0) a column matrix
representing a quaternion, (1) the power of 𝑝 that one needs to divide by in order to obtain a quaternion ofnorm 1, and hence an element of the arithmetic group Γ, (2) a boolean that is only used to compute spacesof modular forms.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,2)
sage: s = X.get_edge_stabilizers()
sage: len(s) == X.get_num_ordered_edges()/2
True
sage: len(s[0])3290Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(2))>>> s = X.get_edge_stabilizers()>>> len(s) == X.get_num_ordered_edges()/Integer(2)True>>> len(s[Integer(0)])
3get_eichler_order(magma=False, force_computation=False)
Return the underlying Eichler order of level 𝑁 + .
OUTPUT:
An Eichler order.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: X.get_eichler_order()Order of Quaternion Algebra (-1, -7) with base ring Rational Field with basis␣˓→(1/2 + 1/2*j, 1/2*i + 1/2*k, j, k)>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> X.get_eichler_order()Order of Quaternion Algebra (-1, -7) with base ring Rational Field with basis␣˓→(1/2 + 1/2*j, 1/2*i + 1/2*k, j, k)

get_eichler_order_basis()
Return a basis for the global Eichler order.
OUTPUT:
Basis for the underlying Eichler order of level Nplus.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,11)
sage: X.get_eichler_order_basis()[1/2 + 1/2*j, 1/2*i + 1/2*k, j, k]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(11))>>> X.get_eichler_order_basis()[1/2 + 1/2*j, 1/2*i + 1/2*k, j, k]

get_eichler_order_quadform()
This function return the norm form for the underlying Eichler order of level Nplus. Required for finding
elements in the arithmetic subgroup Gamma.
OUTPUT:
The norm form of the underlying Eichler order
EXAMPLES:
sage: X = BruhatTitsQuotient(7,11)
sage: X.get_eichler_order_quadform()(continues on next page)

19.7. Quotients of the Bruhat-Tits tree291

Modular Symbols, Release 10.4

(continued from previous page)

Quadratic form in 4 variables over Integer Ring with coefficients:[ 3 0 11 0 ][ * 3 0 11 ][ * * 11 0 ][ * * * 11 ]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(11))>>> X.get_eichler_order_quadform()
Quadratic form in 4 variables over Integer Ring with coefficients:[ 3 0 11 0 ][ * 3 0 11 ][ * * 11 0 ][ * * * 11 ]get_eichler_order_quadmatrix()This function returns the matrix of the quadratic form of the underlying Eichler order in the fixed basis.
OUTPUT:A 4x4 integral matrix describing the norm form.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,11)
sage: X.get_eichler_order_quadmatrix()[ 6 0 11 0][ 0 6 0 11][11 0 22 0][ 0 11 0 22]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(11))>>> X.get_eichler_order_quadmatrix()[ 6 0 11 0][ 0 6 0 11][11 0 22 0][ 0 11 0 22]

get_embedding(prec=None)
Return a function which embeds quaternions into a matrix algebra.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,3)
sage: f = X.get_embedding(prec = 4)
sage: b = Matrix(ZZ,4,1,[1,2,3,4])
sage: f(b)[2 + 3*5 + 2*5^2 + 4*5^3 + O(5^4)[
5 + 5^2 + 3*5^3 + O(5^4)

3 + 2*5^2 + 4*5^3 + O(5^4)]
4 + 5 + 2*5^2 + O(5^4)]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(3))>>> f = X.get_embedding(prec = Integer(4))>>> b = Matrix(ZZ,Integer(4),Integer(1),[Integer(1),Integer(2),Integer(3),˓→Integer(4)])(continues on next page)292

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> f(b)[2 + 3*5 + 2*5^2 + 4*5^3 + O(5^4)[
5 + 5^2 + 3*5^3 + O(5^4)

3 + 2*5^2 + 4*5^3 + O(5^4)]
4 + 5 + 2*5^2 + O(5^4)]

get_embedding_matrix(prec=None, exact=False)
Return the matrix of the embedding.
INPUT:• exact boolean (Default: False). If True, return an embedding into a matrix algebra with coefficientsin a number field. Otherwise, embed into matrices over 𝑝-adic numbers.
• prec Integer (Default: None). If specified, return the matrix with precision prec. Otherwise, returnthe cached matrix (with the current working precision).
OUTPUT:• A 4x4 matrix representing the embedding.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,2*3*5)
sage: X.get_embedding_matrix(4)[1 + O(7^4)
5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
6 + 3*7^2 + 4*7^3 + O(7^4)][
O(7^4)
O(7^4)
␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)][
O(7^4)
2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
3 + 3*7 + 3*7^2 + O(7^4)][
1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4)␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)]sage: X.get_embedding_matrix(3)[1 + O(7^4)
5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
6 + 3*7^2 + 4*7^3 + O(7^4)][
O(7^4)
O(7^4)
␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)][
O(7^4)
2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
3 + 3*7 + 3*7^2 + O(7^4)][
1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4)␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)]sage: X.get_embedding_matrix(5)[1 + O(7^5)
5 + 2*7 + 3*7^3 + 6*7^4 +␣
˓→O(7^5) 4 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
6 + 3*7^2 + 4*7^3 +␣
˓→5*7^4 + O(7^5)][
O(7^5)
␣
˓→O(7^5)
3 + 7 + O(7^5)
1 + 6*7 + 3*7^2 + 2*7^3 +␣
˓→7^4 + O(7^5)][
O(7^5)
2 + 5*7 + 6*7^3 + 5*7^4 +␣
˓→O(7^5) 3 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
3 + 3*7 + 3*7^2 +␣
˓→5*7^4 + O(7^5)][
1 + O(7^5)
3 + 4*7 + 6*7^2 + 3*7^3 +␣˓→O(7^5)
3 + 7 + O(7^5)
1 + 6*7 + 3*7^2 + 2*7^3 +␣
˓→7^4 + O(7^5)]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(2)*Integer(3)*Integer(5))>>> X.get_embedding_matrix(Integer(4))[
1 + O(7^4)
5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 +␣
(continues on next page)

19.7. Quotients of the Bruhat-Tits tree293

Modular Symbols, Release 10.4

(continued from previous page)

6*7^2 + 6*7^3 + O(7^4)

6 + 3*7^2 + 4*7^3 + O(7^4)][
O(7^4)
O(7^4)
␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)][
O(7^4)
2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
3 + 3*7 + 3*7^2 + O(7^4)][
1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4)␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)]>>> X.get_embedding_matrix(Integer(3))[
1 + O(7^4)
5 + 2*7 + 3*7^3 + O(7^4) 4 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
6 + 3*7^2 + 4*7^3 + O(7^4)][
O(7^4)
O(7^4)
␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)][
O(7^4)
2 + 5*7 + 6*7^3 + O(7^4) 3 + 5*7 +␣
˓→6*7^2 + 6*7^3 + O(7^4)
3 + 3*7 + 3*7^2 + O(7^4)][
1 + O(7^4) 3 + 4*7 + 6*7^2 + 3*7^3 + O(7^4)␣˓→
3 + 7 + O(7^4) 1 + 6*7 + 3*7^2 + 2*7^3 + O(7^4)]>>> X.get_embedding_matrix(Integer(5))[
1 + O(7^5)
5 + 2*7 + 3*7^3 + 6*7^4 +␣
˓→O(7^5) 4 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
6 + 3*7^2 + 4*7^3 +␣
˓→5*7^4 + O(7^5)][
O(7^5)
␣
˓→O(7^5)
3 + 7 + O(7^5)
1 + 6*7 + 3*7^2 + 2*7^3 +␣
˓→7^4 + O(7^5)][
O(7^5)
2 + 5*7 + 6*7^3 + 5*7^4 +␣
˓→O(7^5) 3 + 5*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
3 + 3*7 + 3*7^2 +␣
˓→5*7^4 + O(7^5)][
1 + O(7^5)
3 + 4*7 + 6*7^2 + 3*7^3 +␣˓→O(7^5)
3 + 7 + O(7^5)
1 + 6*7 + 3*7^2 + 2*7^3 +␣
˓→7^4 + O(7^5)]˓→

get_extra_embedding_matrices()
Return a list of matrices representing the different embeddings.
Note: The precision is very low (currently set to 5 digits), since these embeddings are only used to apply acharacter.
EXAMPLES:This portion of the code is only relevant when working with a nontrivial Dirichlet character. If there is nosuch character then the code returns an empty list. Even if the character is not trivial it might return an empty
list:
sage: f = DirichletGroup(6)[1]sage: X = BruhatTitsQuotient(3,2*5*7,character = f)sage: X.get_extra_embedding_matrices()[]>>> from sage.all import *>>> f = DirichletGroup(Integer(6))[Integer(1)]>>> X = BruhatTitsQuotient(Integer(3),Integer(2)*Integer(5)*Integer(7),˓→character = f)>>> X.get_extra_embedding_matrices()[]

294

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage: f = DirichletGroup(6)[1]sage: X = BruhatTitsQuotient(5,2,3, character = f, use_magma=True) # optional␣˓→- magma
sage: X.get_extra_embedding_matrices() # optional - magma[[1 0 2 0][0 0 2 0][0 0 0 0][1 0 2 2]]>>> from sage.all import *>>> f = DirichletGroup(Integer(6))[Integer(1)]>>> X = BruhatTitsQuotient(Integer(5),Integer(2),Integer(3), character = f,␣
˓→use_magma=True) # optional - magma>>> X.get_extra_embedding_matrices() # optional - magma[[1 0 2 0][0 0 2 0][0 0 0 0][1 0 2 2]]

get_fundom_graph()
Return the fundamental domain (and computes it if needed).
OUTPUT:
A fundamental domain for the action of Γ.
EXAMPLES:
sage: X = BruhatTitsQuotient(11,5)
sage: X.get_fundom_graph()
Graph on 24 vertices>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(11),Integer(5))>>> X.get_fundom_graph()
Graph on 24 vertices

get_generators()
Use a fundamental domain in the Bruhat-Tits tree, and certain gluing data for boundary vertices, in order tocompute a collection of generators for the arithmetic quaternionic group that one is quotienting by. This isanalogous to using a polygonal rep. of a compact real surface to present its fundamental domain.
OUTPUT:• A generating list of elements of an arithmetic quaternionic group.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,2)
sage: len(X.get_generators())
2

19.7. Quotients of the Bruhat-Tits tree295

Modular Symbols, Release 10.4>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(2))>>> len(X.get_generators())
2

get_graph()
Return the quotient graph (and compute it if needed).
OUTPUT:
A graph representing the quotient of the Bruhat-Tits tree.
EXAMPLES:
sage: X = BruhatTitsQuotient(11,5)
sage: X.get_graph()
Multi-graph on 2 vertices>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(11),Integer(5))>>> X.get_graph()
Multi-graph on 2 vertices

get_list()
Return a list of Edge which represent a fundamental domain inside the Bruhat-Tits tree for the quotient,
together with a list of the opposite edges. This is used to work with automorphic forms.
OUTPUT:
A list of Edge.
EXAMPLES:
sage: X = BruhatTitsQuotient(37,3)
sage: len(X.get_list())
16>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(37),Integer(3))>>> len(X.get_list())
16

get_maximal_order(magma=False, force_computation=False)
Return the underlying maximal order containing the Eichler order.
OUTPUT:
A maximal order.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: X.get_maximal_order()Order of Quaternion Algebra (-1, -7) with base ring Rational Field with basis␣˓→(1/2 + 1/2*j, 1/2*i + 1/2*k, j, k)>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))(continues on next page)

296

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> X.get_maximal_order()Order of Quaternion Algebra (-1, -7) with base ring Rational Field with basis␣˓→(1/2 + 1/2*j, 1/2*i + 1/2*k, j, k)

get_nontorsion_generators()
Use a fundamental domain in the Bruhat-Tits tree, and certain gluing data for boundary vertices, in order tocompute a collection of generators for the nontorsion part of the arithmetic quaternionic group that one isquotienting by. This is analogous to using a polygonal rep. of a compact real surface to present its fundamental
domain.
OUTPUT:• A generating list of elements of an arithmetic quaternionic group.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,13)
sage: len(X.get_nontorsion_generators())
3>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(13))>>> len(X.get_nontorsion_generators())
3

get_num_ordered_edges()
Return the number of ordered edges 𝐸 in the quotient using the formula relating the genus 𝑔 with the numberof vertices 𝑉 and that of unordered edges 𝐸/2: 𝐸 = 2(𝑔 + 𝑉 − 1).
OUTPUT:• An integer
EXAMPLES:
sage: X = BruhatTitsQuotient(3,2)
sage: X.get_num_ordered_edges()2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(2))>>> X.get_num_ordered_edges()2

get_num_verts()
Return the number of vertices in the quotient using the formula 𝑉 = 2(𝜇/12 + 𝑒3 /3 + 𝑒4 /4).
OUTPUT:• An integer (the number of vertices)
EXAMPLES:
sage: X = BruhatTitsQuotient(29,11)
sage: X.get_num_verts()
4

19.7. Quotients of the Bruhat-Tits tree297

Modular Symbols, Release 10.4>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(29),Integer(11))>>> X.get_num_verts()4

get_quaternion_algebra()
Return the underlying quaternion algebra.
OUTPUT:
The underlying definite quaternion algebra
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: X.get_quaternion_algebra()
Quaternion Algebra (-1, -7) with base ring Rational Field>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> X.get_quaternion_algebra()
Quaternion Algebra (-1, -7) with base ring Rational Field

get_splitting_field()
Return a quadratic field that splits the quaternion algebra attached to self. Currently requires Magma.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,11)
sage: X.get_splitting_field()
Traceback (most recent call last):...
NotImplementedError: Sage does not know yet how to work with the kind of␣˓→orders that you are trying to use. Try installing Magma first and set it up␣
˓→so that Sage can use it.
>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(11))>>> X.get_splitting_field()
Traceback (most recent call last):...
NotImplementedError: Sage does not know yet how to work with the kind of␣˓→orders that you are trying to use. Try installing Magma first and set it up␣
˓→so that Sage can use it.

If we do have Magma installed, then it works:
sage: X = BruhatTitsQuotient(5,11,use_magma=True) # optional - magma
sage: X.get_splitting_field() # optional - magma
Number Field in a with defining polynomial X1^2 + 11>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(11),use_magma=True) # optional ˓→ magma>>> X.get_splitting_field() # optional - magma
Number Field in a with defining polynomial X1^2 + 11

298

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

get_stabilizers()
Compute the stabilizers in the arithmetic group of all edges in the Bruhat-Tits tree within a fundamental
domain for the quotient graph. This is similar to get_edge_stabilizers, except that here we also store thestabilizers of the opposites.
OUTPUT:
A list of lists encoding edge stabilizers. It contains one entry for each edge. Each entry is a list of data
corresponding to the group elements in the stabilizer of the edge. The data consists of: (0) a column matrix
representing a quaternion, (1) the power of 𝑝 that one needs to divide by in order to obtain a quaternion ofnorm 1, and hence an element of the arithmetic group Γ, (2) a boolean that is only used to compute spacesof modular forms.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,5)
sage: s = X.get_stabilizers()
sage: len(s) == X.get_num_ordered_edges()True
sage: gamma = X.embed_quaternion(s[1][0][0][0],prec = 20)
sage: v = X.get_edge_list()[0].rep
sage: X._BT.edge(gamma*v) == v
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(5))>>> s = X.get_stabilizers()>>> len(s) == X.get_num_ordered_edges()True>>> gamma = X.embed_
˓→quaternion(s[Integer(1)][Integer(0)][Integer(0)][Integer(0)],prec =␣
˓→Integer(20))>>> v = X.get_edge_list()[Integer(0)].rep>>> X._BT.edge(gamma*v) == v
True

get_units_of_order()Return the units of the underlying Eichler -order. This is a finite group since the order lives in a definite
quaternion algebra over .
OUTPUT:
A list of elements of the global Eichler -order of level 𝑁 + .
EXAMPLES:
sage: X = BruhatTitsQuotient(7,11)
sage: X.get_units_of_order()[[ 0] [-2][-2] [ 0][ 0] [ 1][ 1], [ 0]]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(11))>>> X.get_units_of_order()(continues on next page)

19.7. Quotients of the Bruhat-Tits tree299

Modular Symbols, Release 10.4

(continued from previous page)[[ 0] [-2][-2] [ 0][ 0] [ 1][ 1], [ 0]]get_vertex_dict()
This function returns the vertices of the quotient viewed as a dict.
OUTPUT:
A python dict with the vertices of the quotient.
EXAMPLES:
sage: X = BruhatTitsQuotient(37,3)
sage: X.get_vertex_dict(){[1 0][0 1]: Vertex of Bruhat-Tits tree for p = 37, [ 1[ 0 37]: Vertex of Bruhat-Tits tree for p = 37}0]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(37),Integer(3))>>> X.get_vertex_dict(){[1 0][0 1]: Vertex of Bruhat-Tits tree for p = 37, [ 1 0]
[ 0 37]: Vertex of Bruhat-Tits tree for p = 37}

get_vertex_list()
Return a list of the vertices of the quotient.
OUTPUT:• A list with the vertices of the quotient.
EXAMPLES:
sage: X = BruhatTitsQuotient(37,3)
sage: X.get_vertex_list()[Vertex of Bruhat-Tits tree for p = 37, Vertex of Bruhat-Tits tree for p = 37]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(37),Integer(3))>>> X.get_vertex_list()[Vertex of Bruhat-Tits tree for p = 37, Vertex of Bruhat-Tits tree for p = 37]

get_vertex_stabs()
This function computes the stabilizers in the arithmetic group of all vertices in the Bruhat-Tits tree within afundamental domain for the quotient graph.
OUTPUT:
A list of vertex stabilizers. Each vertex stabilizer is a finite cyclic subgroup, so we return generators for thesesubgroups.
EXAMPLES:

300

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

sage: X = BruhatTitsQuotient(13,2)
sage: S = X.get_vertex_stabs()
sage: gamma = X.embed_quaternion(S[0][0][0],prec = 20)
sage: v = X.get_vertex_list()[0].rep
sage: X._BT.vertex(gamma*v) == v
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(13),Integer(2))>>> S = X.get_vertex_stabs()>>> gamma = X.embed_quaternion(S[Integer(0)][Integer(0)][Integer(0)],prec =␣
˓→Integer(20))>>> v = X.get_vertex_list()[Integer(0)].rep>>> X._BT.vertex(gamma*v) == v
Trueharmonic_cocycle_from_elliptic_curve(E, prec=None)
Return a harmonic cocycle with the same Hecke eigenvalues as E.
Given an elliptic curve 𝐸 having a conductor 𝑁 of the form 𝑝𝑁 − 𝑁 + , return the harmonic cocycle overself which is attached to E via modularity. The result is only well-defined up to scaling.
INPUT:• E – an elliptic curve over the rational numbers• prec – (default: None) If specified, the harmonic cocycle will take values in
Otherwise it will take values in .

𝑝 with precision prec.

OUTPUT:A harmonic cocycle attached via modularity to the given elliptic curve.
EXAMPLES:
sage: E = EllipticCurve( 21a1 )sage: X = BruhatTitsQuotient(7,3)
sage: f = X.harmonic_cocycle_from_elliptic_curve(E,10)
sage: T29 = f.parent().hecke_operator(29)sage: T29(f) == E.ap(29) * f
True
sage: E = EllipticCurve( 51a1 )sage: X = BruhatTitsQuotient(3,17)
sage: f = X.harmonic_cocycle_from_elliptic_curve(E,20)
sage: T31 = f.parent().hecke_operator(31)sage: T31(f) == E.ap(31) * f
True>>> from sage.all import *>>> E = EllipticCurve( 21a1 )>>> X = BruhatTitsQuotient(Integer(7),Integer(3))>>> f = X.harmonic_cocycle_from_elliptic_curve(E,Integer(10))>>> T29 = f.parent().hecke_operator(Integer(29))>>> T29(f) == E.ap(Integer(29)) * f
True>>> E = EllipticCurve( 51a1 )>>> X = BruhatTitsQuotient(Integer(3),Integer(17))>>> f = X.harmonic_cocycle_from_elliptic_curve(E,Integer(20))>>> T31 = f.parent().hecke_operator(Integer(31))(continues on next page)

19.7. Quotients of the Bruhat-Tits tree301

Modular Symbols, Release 10.4

(continued from previous page)>>> T31(f) == E.ap(Integer(31)) * f
Trueharmonic_cocycles(k, prec=None, basis_matrix=None, base_field=None)
Compute the space of harmonic cocycles of a given even weight k.
INPUT:• k – integer – The weight. It must be even.
• prec – integer (default: None). If specified, the precision for the coefficient module• basis_matrix – a matrix (default: None).
• base_field – a ring (default: None)OUTPUT: A space of harmonic cocycles
EXAMPLES:
sage: X = BruhatTitsQuotient(31,7)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: HSpace of harmonic cocycles of weight 2 on Quotient of the Bruhat Tits tree of␣
˓→GL_2(QQ_31) with discriminant 7 and level 1
sage: H.basis()[0]Harmonic cocycle with values in Sym^0 Q_31^2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(31),Integer(7))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> H
Space of harmonic cocycles of weight 2 on Quotient of the Bruhat Tits tree of␣
˓→GL_2(QQ_31) with discriminant 7 and level 1>>> H.basis()[Integer(0)]Harmonic cocycle with values in Sym^0 Q_31^2

is_admissible(D)Test whether the imaginary quadratic field of discriminant 𝐷 embeds in the quaternion algebra. It furthermore
tests the Heegner hypothesis in this setting (e.g., is 𝑝 inert in the field, etc).
INPUT:• D – an integer whose squarefree part will define the quadratic field
OUTPUT:
A boolean describing whether the quadratic field is admissible
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: [X.is_admissible(D) for D in range(-1,-20,-1)][False, True, False, False, False, False, False, True, False, False, False,␣
˓→False, False, False, False, False, False, True, False]>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> [X.is_admissible(D) for D in range(-Integer(1),-Integer(20),-Integer(1))](continues on next page)302

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)[False, True, False, False, False, False, False, True, False, False, False,␣
˓→False, False, False, False, False, False, True, False]level()
Return 𝑝𝑁 − , which is the discriminant of the indefinite quaternion algebra that is uniformed by
Cerednik-Drinfeld.
OUTPUT:
An integer equal to 𝑝𝑁 − .
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: X.level()
35>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> X.level()
35

mu()
Compute the mu invariant of self.
OUTPUT:
An integer.
EXAMPLES:
sage: X = BruhatTitsQuotient(29,3)
sage: X.mu
2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(29),Integer(3))>>> X.mu2

padic_automorphic_forms(U, prec=None, t=None, R=None, overconvergent=False)
The module of (quaternionic) 𝑝-adic automorphic forms over self.
INPUT:• U – A distributions module or an integer. If U is a distributions module then this creates the relevant
space of automorphic forms. If U is an integer then the coefficients are the (𝑈 − 2)nd power of thesymmetric representation of 𝐺𝐿2 ( 𝑝 ).
• prec – A precision (default : None). If not None should be a positive integer.
• t – (default : None). The number of additional moments to store. If None, determine it automaticallyfrom prec, U and the overconvergent flag.
• R – (default : None). If specified, coefficient field of the automorphic forms. If not specified it defaults
to the base ring of the distributions U, or to 𝑝 with the working precision prec.
• overconvergent – Boolean (default = False). If True, will construct overconvergent 𝑝-adic automorphic forms. Otherwise it constructs the finite dimensional space of 𝑝-adic automorphic forms which
is isomorphic to the space of harmonic cocycles.
19.7. Quotients of the Bruhat-Tits tree303

Modular Symbols, Release 10.4

EXAMPLES:
sage: X = BruhatTitsQuotient(11,5)
sage: X.padic_automorphic_forms(2,prec=10)Space of automorphic forms on Quotient of the Bruhat Tits tree of GL_2(QQ_11)␣
˓→with discriminant 5 and level 1 with values in Sym^0 Q_11^2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(11),Integer(5))>>> X.padic_automorphic_forms(Integer(2),prec=Integer(10))
Space of automorphic forms on Quotient of the Bruhat Tits tree of GL_2(QQ_11)␣
˓→with discriminant 5 and level 1 with values in Sym^0 Q_11^2

plot(*args, **kwargs)
Plot the quotient graph.
OUTPUT:
A plot of the quotient graph
EXAMPLES:
sage: X = BruhatTitsQuotient(7,23)
sage: X.plot()
˓→needs sage.plot
Graphics object consisting of 17 graphics primitives>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(23))>>> X.plot()
˓→needs sage.plot
Graphics object consisting of 17 graphics primitives#␣#␣

plot_fundom(*args, **kwargs)
Plot a fundamental domain.
OUTPUT:
A plot of the fundamental domain.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,23)
sage: X.plot_fundom()˓→needs sage.plot
Graphics object consisting of 88 graphics primitives>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(23))>>> X.plot_fundom()˓→needs sage.plot
Graphics object consisting of 88 graphics primitives#␣#␣

prime()
Return the prime one is working with.
OUTPUT:
An integer equal to the fixed prime 𝑝
304

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: X.prime()
5>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> X.prime()
5class sage.modular.btquotients.btquotient.BruhatTitsTree(p)Bases: SageObject, UniqueRepresentation
An implementation of the Bruhat-Tits tree for 𝐺𝐿2 (𝑝 ).

INPUT:• p – a prime number. The corresponding tree is then 𝑝 + 1 regular
EXAMPLES:
We create the tree for 𝐺𝐿2 (5 ):sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 5
sage: T = BruhatTitsTree(p)sage: m = Matrix(ZZ,2,2,[p**5,p**2,p**3,1+p+p*3])
sage: e = T.edge(m); e[ 0 25][625 21]sage: v0 = T.origin(e); v0[ 25
0][ 21 125]
sage: v1 = T.target(e); v1[ 25
0][ 21 625]
sage: T.origin(T.opposite(e)) == v1
True
sage: T.target(T.opposite(e)) == v0
True>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(5)>>> T = BruhatTitsTree(p)>>> m = Matrix(ZZ,Integer(2),Integer(2),[p**Integer(5),p**Integer(2),˓→p**Integer(3),Integer(1)+p+p*Integer(3)])>>> e = T.edge(m); e[ 0 25][625 21]>>> v0 = T.origin(e); v0[ 25
0][ 21 125]>>> v1 = T.target(e); v1[ 25
0][ 21 625]>>> T.origin(T.opposite(e)) == v1
True(continues on next page)

19.7. Quotients of the Bruhat-Tits tree305

Modular Symbols, Release 10.4

(continued from previous page)>>> T.target(T.opposite(e)) == v0
True

A value error is raised if a prime is not passed:
sage: T = BruhatTitsTree(4)Traceback (most recent call last):...
ValueError: input (4) must be prime>>> from sage.all import *>>> T = BruhatTitsTree(Integer(4))
Traceback (most recent call last):...
ValueError: input (4) must be prime

AUTHORS:• Marc Masdeu (2012-02-20)
edge(M)
Normalize a matrix to the correct normalized edge representative.
INPUT:• M – a 2x2 integer matrix
OUTPUT:• newM – a 2x2 integer matrix
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: T = BruhatTitsTree(3)sage: T.edge( Matrix(ZZ,2,2,[0,-1,3,0]) )
[0 1]
[3 0]
>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> T = BruhatTitsTree(Integer(3))>>> T.edge( Matrix(ZZ,Integer(2),Integer(2),[Integer(0),-Integer(1),˓→Integer(3),Integer(0)]) )
[0 1]
[3 0]

edge_between_vertices(v1, v2, normalized=False)
Compute the normalized matrix rep. for the edge passing between two vertices.
INPUT:• v1 – 2x2 integer matrix• v2 – 2x2 integer matrix• normalized – boolean (default: False), whether the vertices are normalized.
OUTPUT:

306

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

• 2x2 integer matrix, representing the edge from v1 to v2. If v1 and v2 are not at distance 1, raise a
ValueError.
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 7
sage: T = BruhatTitsTree(p)sage: v1 = T.vertex(Matrix(ZZ,2,2,[p,0,0,1])); v1
[7 0]
[0 1]
sage: v2 = T.vertex(Matrix(ZZ,2,2,[p,1,0,1])); v2
[1 0]
[1 7]
sage: T.edge_between_vertices(v1,v2)
Traceback (most recent call last):...
ValueError: Vertices are not adjacent.
sage: v3 = T.vertex(Matrix(ZZ,2,2,[1,0,0,1])); v3
[1 0]
[0 1]
sage: T.edge_between_vertices(v1,v3)
[0 1]
[1 0]
>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(7)>>> T = BruhatTitsTree(p)>>> v1 = T.vertex(Matrix(ZZ,Integer(2),Integer(2),[p,Integer(0),Integer(0),˓→Integer(1)])); v1
[7 0]
[0 1]
>>> v2 = T.vertex(Matrix(ZZ,Integer(2),Integer(2),[p,Integer(1),Integer(0),˓→Integer(1)])); v2
[1 0]
[1 7]
>>> T.edge_between_vertices(v1,v2)
Traceback (most recent call last):...
ValueError: Vertices are not adjacent.
>>> v3 = T.vertex(Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(0),˓→Integer(0),Integer(1)])); v3
[1 0]
[0 1]
>>> T.edge_between_vertices(v1,v3)
[0 1]
[1 0]

edges_leaving_origin()
Find normalized representatives for the 𝑝 + 1 edges leaving the origin vertex corresponding to the homothety
class of 2𝑝 . These are cached.
OUTPUT:• A list of size 𝑝 + 1 of 2x2 integer matrices

19.7. Quotients of the Bruhat-Tits tree307

Modular Symbols, Release 10.4

EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: T = BruhatTitsTree(3)sage: T.edges_leaving_origin()[[0 1] [3 0] [0 1] [0 1][3 0], [0 1], [3 1], [3 2]]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> T = BruhatTitsTree(Integer(3))>>> T.edges_leaving_origin()[[0 1] [3 0] [0 1] [0 1][3 0], [0 1], [3 1], [3 2]]entering_edges(v)This function returns the edges entering a given vertex.
INPUT:• v – 2x2 integer matrix
OUTPUT:
A list of size 𝑝 + 1 of 2x2 integer matrices
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 7
sage: T = BruhatTitsTree(p)sage: T.entering_edges(Matrix(ZZ,2,2,[1,0,0,1]))[[1 0] [0 1] [1 0] [1 0] [1 0] [1 0] [1 0] [1 0][0 1], [1 0], [1 1], [4 1], [5 1], [2 1], [3 1], [6 1]]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(7)>>> T = BruhatTitsTree(p)>>> T.entering_edges(Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(0),˓→Integer(0),Integer(1)]))[[1 0] [0 1] [1 0] [1 0] [1 0] [1 0] [1 0] [1 0][0 1], [1 0], [1 1], [4 1], [5 1], [2 1], [3 1], [6 1]]find_containing_affinoid(z)Return the vertex corresponding to the affinoid in the 𝑝-adic upper half plane that a given (unramified!) point
reduces to.
INPUT:• z – an element of an unramified extension of308

𝑝 that is not contained in𝑝.

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

OUTPUT:A 2x2 integer matrix representing a vertex of self.
EXAMPLES:
sage: # needs sage.rings.padics
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: T = BruhatTitsTree(5)sage: K.<a> = Qq(5^2,20)
sage: T.find_containing_affinoid(a)
[1 0]
[0 1]
sage: z = 5*a+3
sage: v = T.find_containing_affinoid(z).inverse(); v[10][-2/5 1/5]>>> from sage.all import *>>> # needs sage.rings.padics>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> T = BruhatTitsTree(Integer(5))>>> K = Qq(Integer(5)**Integer(2),Integer(20), names=( a ,)); (a,) = K._first_
˓→ngens(1)>>> T.find_containing_affinoid(a)
[1 0]
[0 1]
>>> z = Integer(5)*a+Integer(3)>>> v = T.find_containing_affinoid(z).inverse(); v[10][-2/5 1/5]

Note that the translate of z belongs to the standard affinoid. That is, it is a 𝑝-adic unit and its reduction modulo
𝑝 is not in 𝑝 :sage: gz = (v[0,0]*z+v[0,1])/(v[1,0]*z+v[1,1]); gz
˓→needs sage.rings.padics(a + 1) + O(5^19)
sage: gz.valuation() == 0
˓→needs sage.rings.padics
True

#␣

#␣

>>> from sage.all import *>>> gz = (v[Integer(0),Integer(0)]*z+v[Integer(0),Integer(1)])/(v[Integer(1),˓→Integer(0)]*z+v[Integer(1),Integer(1)]); gz#␣˓→needs sage.rings.padics(a + 1) + O(5^19)>>> gz.valuation() == Integer(0)␣˓→# needs sage.rings.padics
True

find_covering(z1, z2, level=0)
Compute a covering of 𝑃 1 (𝑝 ) adapted to a certain geodesic in self.

More precisely, the 𝑝-adic upper half plane points z1 and z2 reduce to vertices 𝑣1 , 𝑣2 . The returned covering
consists of all the edges leaving the geodesic from 𝑣1 to 𝑣2 .
INPUT:

19.7. Quotients of the Bruhat-Tits tree309

Modular Symbols, Release 10.4

• z1, z2 – unramified algebraic points of h_p
OUTPUT:a list of 2x2 integer matrices representing edges of self
EXAMPLES:
sage: # needs sage.rings.padics
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 3
sage: K.<a> = Qq(p^2)
sage: T = BruhatTitsTree(p)sage: z1 = a + a*p
sage: z2 = 1 + a*p + a*p^2 - p^6sage: T.find_covering(z1,z2)[[0 1] [3 0] [0 1] [0 1] [0 1] [0 1][3 0], [0 1], [3 2], [9 1], [9 4], [9 7]]>>> from sage.all import *>>> # needs sage.rings.padics>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(3)>>> K = Qq(p**Integer(2), names=( a ,)); (a,) = K._first_ngens(1)>>> T = BruhatTitsTree(p)>>> z1 = a + a*p>>> z2 = Integer(1) + a*p + a*p**Integer(2) - p**Integer(6)>>> T.find_covering(z1,z2)[[0 1] [3 0] [0 1] [0 1] [0 1] [0 1][3 0], [0 1], [3 2], [9 1], [9 4], [9 7]]Note: This function is used to compute certain Coleman integrals on 𝑃 1 . That’s why the input consists of
two points of the 𝑝-adic upper half plane, but decomposes 𝑃 1 ( 𝑝 ). This decomposition is what allows us torepresent the relevant integrand as a locally analytic function. The z1 and z2 appear in the integrand.
find_geodesic(v1, v2, normalized=True)
This function computes the geodesic between two vertices
INPUT:• v1 – 2x2 integer matrix representing a vertex• v2 – 2x2 integer matrix representing a vertex• normalized – boolean (default: True)OUTPUT:
An ordered list of 2x2 integer matrices representing the vertices of the paths joining v1 and v2.
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 3
sage: T = BruhatTitsTree(p)(continues on next page)

310

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: v1 = T.vertex( Matrix(ZZ,2,2,[p^3, 0, 1, p^1]) ); v1[27 0][ 1 3]
sage: v2 = T.vertex( Matrix(ZZ,2,2,[p,2,0,p]) ); v2
[1 0]
[6 9]
sage: T.find_geodesic(v1,v2)[[27 0] [27 0] [9 0] [3 0] [1 0] [1 0] [1 0][ 1 3], [ 0 1], [0 1], [0 1], [0 1], [0 3], [6 9]]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(3)>>> T = BruhatTitsTree(p)>>> v1 = T.vertex( Matrix(ZZ,Integer(2),Integer(2),[p**Integer(3), Integer(0),˓→ Integer(1), p**Integer(1)]) ); v1[27 0][ 1 3]>>> v2 = T.vertex( Matrix(ZZ,Integer(2),Integer(2),[p,Integer(2),Integer(0),˓→p]) ); v2
[1 0]
[6 9]
>>> T.find_geodesic(v1,v2)[[27 0] [27 0] [9 0] [3 0] [1 0] [1 0] [1 0][ 1 3], [ 0 1], [0 1], [0 1], [0 1], [0 3], [6 9]]find_path(v, boundary=None)
Compute a path from a vertex to a given set of so-called boundary vertices, whose interior must contain theorigin vertex. In the case that the boundary is not specified, it computes the geodesic between the given vertex
and the origin. In the case that the boundary contains more than one vertex, it computes the geodesic to somepoint of the boundary.
INPUT:• v – a 2x2 matrix representing a vertex boundary• a list of matrices (default: None). If omitted, finds the geodesic from v to the central vertex.
OUTPUT:
An ordered list of vertices describing the geodesic from v to boundary, followed by the vertex in theboundary that is closest to v.
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 3
sage: T = BruhatTitsTree(p)sage: T.find_path( Matrix(ZZ,2,2,[p^4,0,0,1]) )([[81 0][ 0 1], [27 0][ 0 1], [9 0][0 1], [3 0][1 0](continues on next page)

19.7. Quotients of the Bruhat-Tits tree311

Modular Symbols, Release 10.4

(continued from previous page)[0 1]], [0 1])
sage: T.find_path( Matrix(ZZ,2,2,[p^3,0,134,p^2]) )([[27 0][ 8 9], [27 0][ 2 3], [27 0][ 0 1], [9 0][0 1], [3 0][1 0][0 1]], [0 1])>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(3)>>> T = BruhatTitsTree(p)>>> T.find_path( Matrix(ZZ,Integer(2),Integer(2),[p**Integer(4),Integer(0),˓→Integer(0),Integer(1)]) )([[81 0][ 0 1], [27 0][ 0 1], [9 0][0 1], [3 0][1 0][0 1]], [0 1])>>> T.find_path( Matrix(ZZ,Integer(2),Integer(2),[p**Integer(3),Integer(0),˓→Integer(134),p**Integer(2)]) )([[27 0][ 8 9], [27 0][ 2 3], [27 0][ 0 1], [9 0][0 1], [3 0][1 0][0 1]], [0 1])

get_balls(center=1, level=1)
Return a decomposition of 𝑃 1 (𝑝 ) into compact open balls.

Each vertex in the Bruhat-Tits tree gives a decomposition of 𝑃 1 (balls may be further subdivided, to get a finer decomposition.
This function returns the decomposition of 𝑃 1 (𝑝 ) into 𝑝 + 1 open balls. Each of these𝑝 ) corresponding to center into (𝑝 + 1)𝑝level balls.

EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 2
sage: T = BruhatTitsTree(p)sage: T.get_balls(Matrix(ZZ,2,2,[p,0,0,1]),1)[[0 1] [0 1] [8 0] [0 4] [0 2] [0 2][2 0], [2 1], [0 1], [2 1], [4 1], [4 3]]312

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(2)>>> T = BruhatTitsTree(p)>>> T.get_balls(Matrix(ZZ,Integer(2),Integer(2),[p,Integer(0),Integer(0),˓→Integer(1)]),Integer(1))[[0 1] [0 1] [8 0] [0 4] [0 2] [0 2][2 0], [2 1], [0 1], [2 1], [4 1], [4 3]]leaving_edges(M)Return edges leaving a vertex
INPUT:• M – 2x2 integer matrix
OUTPUT:
List of size 𝑝 + 1 of 2x2 integer matrices
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 7
sage: T = BruhatTitsTree(p)sage: T.leaving_edges(Matrix(ZZ,2,2,[1,0,0,1]))[[0 1] [7 0] [0 1] [0 1] [0 1] [0 1] [0 1] [0 1][7 0], [0 1], [7 1], [7 4], [7 5], [7 2], [7 3], [7 6]]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(7)>>> T = BruhatTitsTree(p)>>> T.leaving_edges(Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(0),˓→Integer(0),Integer(1)]))[[0 1] [7 0] [0 1] [0 1] [0 1] [0 1] [0 1] [0 1][7 0], [0 1], [7 1], [7 4], [7 5], [7 2], [7 3], [7 6]]opposite(e)This function returns the edge oriented oppositely to a given edge.
INPUT:• e – 2x2 integer matrix
OUTPUT:
2x2 integer matrix
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 7
sage: T = BruhatTitsTree(p)(continues on next page)

19.7. Quotients of the Bruhat-Tits tree313

Modular Symbols, Release 10.4

(continued from previous page)

sage: e = Matrix(ZZ,2,2,[1,0,0,1])
sage: T.opposite(e)
[0 1]
[7 0]
sage: T.opposite(T.opposite(e)) == e
True>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(7)>>> T = BruhatTitsTree(p)>>> e = Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(0),Integer(0),˓→Integer(1)])>>> T.opposite(e)
[0 1]
[7 0]
>>> T.opposite(T.opposite(e)) == eTrueorigin(e, normalized=False)
Return the origin vertex of the edge represented by the input matrix e.
INPUT:• e – a 2x2 matrix with integer entries• normalized – boolean (default: false). If True then the input matrix M is assumed to be normalized
OUTPUT:• e – A 2x2 integer matrix
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: T = BruhatTitsTree(7)sage: T.origin(Matrix(ZZ,2,2,[1,5,8,9]))
[1 0]
[1 7]
>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> T = BruhatTitsTree(Integer(7))>>> T.origin(Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(5),˓→Integer(8),Integer(9)]))
[1 0]
[1 7]

subdivide(edgelist, level)(Ordered) edges of self may be regarded as open balls in 𝑃 1 ( 𝑝 ). Given a list of edges, this function returna list of edges corresponding to the level-th subdivision of the corresponding opens. That is, each open ballof the input is broken up into 𝑝level subballs of equal radius.
INPUT:• edgelist – a list of edges• level – an integer

314

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

OUTPUT:
A list of 2x2 integer matrices
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 3
sage: T = BruhatTitsTree(p)sage: T.subdivide([Matrix(ZZ,2,2,[p,0,0,1])],2)[[27 0] [0 9] [0 9] [0 3] [0 3] [0 3] [0 3] [0 3] [0 3][ 0 1], [3 1], [3 2], [9 1], [9 4], [9 7], [9 2], [9 5], [9 8]]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(3)>>> T = BruhatTitsTree(p)>>> T.subdivide([Matrix(ZZ,Integer(2),Integer(2),[p,Integer(0),Integer(0),˓→Integer(1)])],Integer(2))[[27 0] [0 9] [0 9] [0 3] [0 3] [0 3] [0 3] [0 3] [0 3][ 0 1], [3 1], [3 2], [9 1], [9 4], [9 7], [9 2], [9 5], [9 8]]target(e, normalized=False)
Return the target vertex of the edge represented by the input matrix e.
INPUT:• e – a 2x2 matrix with integer entries• normalized – boolean (default: false). If Truethen the input matrix is assumed to be normalized.
OUTPUT:• e – 2x2 integer matrix representing the target of the input edge
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: T = BruhatTitsTree(7)sage: T.target(Matrix(ZZ,2,2,[1,5,8,9]))
[1 0]
[0 1]
>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> T = BruhatTitsTree(Integer(7))>>> T.target(Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(5),˓→Integer(8),Integer(9)]))
[1 0]
[0 1]

vertex(M)Normalize a matrix to the corresponding normalized vertex representative
INPUT:

19.7. Quotients of the Bruhat-Tits tree315

Modular Symbols, Release 10.4

• M – 2x2 integer matrix
OUTPUT:• a 2x2 integer matrix
EXAMPLES:
sage: # needs sage.rings.padics
sage: from sage.modular.btquotients.btquotient import BruhatTitsTree
sage: p = 5
sage: T = BruhatTitsTree(p)sage: m = Matrix(ZZ,2,2,[p**5,p**2,p**3,1+p+p*3])
sage: e = T.edge(m)sage: t = m.inverse()*e
sage: scaling = Qp(p,20)(t.determinant()).sqrt()
sage: t = 1/scaling * t
sage: min([t[ii,jj].valuation(p) for ii in range(2) for jj in range(2)]) >= 0
True
sage: t[1,0].valuation(p) > 0
True>>> from sage.all import *>>> # needs sage.rings.padics>>> from sage.modular.btquotients.btquotient import BruhatTitsTree>>> p = Integer(5)>>> T = BruhatTitsTree(p)>>> m = Matrix(ZZ,Integer(2),Integer(2),[p**Integer(5),p**Integer(2),˓→p**Integer(3),Integer(1)+p+p*Integer(3)])>>> e = T.edge(m)>>> t = m.inverse()*e>>> scaling = Qp(p,Integer(20))(t.determinant()).sqrt()>>> t = Integer(1)/scaling * t>>> min([t[ii,jj].valuation(p) for ii in range(Integer(2)) for jj in␣˓→range(Integer(2))]) >= Integer(0)True>>> t[Integer(1),Integer(0)].valuation(p) > Integer(0)Trueclass sage.modular.btquotients.btquotient.DoubleCosetReduction(Y, x, extrapow=0)
Bases: SageObject
Edges in the Bruhat-Tits tree are represented by cosets of matrices in 𝐺𝐿2 . Given a matrix 𝑥 in 𝐺𝐿2 , this classcomputes and stores the data corresponding to the double coset representation of 𝑥 in terms of a fundamental
domain of edges for the action of the arithmetic group Γ.
More precisely:
Initialized with an element 𝑥 of 𝐺𝐿2 ( ), finds elements 𝛾 in Γ, 𝑡 and an edge 𝑒 such that 𝑔𝑒𝑡 = 𝑥. It stores
these values as members gamma, label and functions self.sign(), self.t() and self.igamma(),satisfying:• if self.sign() == +1: igamma() * edge_list[label].rep * t() == x
• if self.sign() == -1: igamma() * edge_list[label].opposite.rep * t() == x
It also stores a member called power so that:p**(2*power) = gamma.reduced_norm()
The usual decomposition 𝑔𝑒𝑡 = 𝑥 would be:

316

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

• g = gamma / (p ** power)• e = edge_list[label]• t’ = t * p ** power
Here usual denotes that we have rescaled gamma to have unit determinant, and so that the result is honestly anelement of the arithmetic quaternion group under consideration. In practice we store integral multiples and keep
track of the powers of 𝑝.
INPUT:• Y – BruhatTitsQuotient object in which to work
• x – Something coercible into a matrix in 𝐺𝐿2 ( ). In
principle we should allow elements in 𝐺𝐿2 ( 𝑝 ), but it is enough to work with integral entries• extrapow – gets added to the power attribute, and it isused for the Hecke action.
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import DoubleCosetReduction
sage: Y = BruhatTitsQuotient(5, 13)
sage: x = Matrix(ZZ,2,2,[123,153,1231,1231])
sage: d = DoubleCosetReduction(Y,x)
sage: d.sign()-1
sage: d.igamma()*Y._edge_list[d.label - len(Y.get_edge_list())].opposite.rep*d.
˓→t() == x
True
sage: x = Matrix(ZZ,2,2,[1423,113553,11231,12313])
sage: d = DoubleCosetReduction(Y,x)
sage: d.sign()
1
sage: d.igamma()*Y._edge_list[d.label].rep*d.t() == x
True>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import DoubleCosetReduction>>> Y = BruhatTitsQuotient(Integer(5), Integer(13))>>> x = Matrix(ZZ,Integer(2),Integer(2),[Integer(123),Integer(153),Integer(1231),
˓→Integer(1231)])>>> d = DoubleCosetReduction(Y,x)>>> d.sign()-1>>> d.igamma()*Y._edge_list[d.label - len(Y.get_edge_list())].opposite.rep*d.t()␣
˓→== x
True>>> x = Matrix(ZZ,Integer(2),Integer(2),[Integer(1423),Integer(113553),
˓→Integer(11231),Integer(12313)])>>> d = DoubleCosetReduction(Y,x)>>> d.sign()
1>>> d.igamma()*Y._edge_list[d.label].rep*d.t() == x
True

AUTHORS:• Cameron Franc (2012-02-20)• Marc Masdeu
19.7. Quotients of the Bruhat-Tits tree317

Modular Symbols, Release 10.4

igamma(embedding=None, scale=1)
Image under gamma.
Elements of the arithmetic group can be regarded as elements of the global quaternion order, and hence may
be represented exactly. This function computes the image of such an element under the local splitting andreturns the corresponding 𝑝-adic approximation.
INPUT:• embedding – an integer, or a function (default: none). If embedding is None, then the image ofself.gamma under the local splitting associated to self.Y is used. If embedding is an integer,then the precision of the local splitting of self.Y is raised (if necessary) to be larger than this integer, andthis new local splitting is used. If a function is passed, then map self.gamma under embedding.
• scale – (default: 1) scaling factor applied to the output
OUTPUT:a 2x2 matrix with 𝑝-adic entries encoding the image of self under the local splitting
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import DoubleCosetReduction
sage: Y = BruhatTitsQuotient(7, 11)
sage: d = DoubleCosetReduction(Y,Matrix(ZZ,2,2,[123,45,88,1]))
sage: d.igamma()[6 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)␣
˓→O(7^5)][
O(7^5) 6 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 +␣
˓→O(7^5)]
sage: d.igamma(embedding = 7)
[6 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 + O(7^7)␣˓→
O(7^7)][
O(7^7) 6 + 6*7 + 6*7^2 +␣
˓→6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 + O(7^7)]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import DoubleCosetReduction>>> Y = BruhatTitsQuotient(Integer(7), Integer(11))>>> d = DoubleCosetReduction(Y,Matrix(ZZ,Integer(2),Integer(2),[Integer(123),
˓→Integer(45),Integer(88),Integer(1)]))>>> d.igamma()[6 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)␣
˓→O(7^5)][
O(7^5) 6 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 +␣
˓→O(7^5)]>>> d.igamma(embedding = Integer(7))[6 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 + O(7^7)␣˓→
O(7^7)][
O(7^7) 6 + 6*7 + 6*7^2 +␣
˓→6*7^3 + 6*7^4 + 6*7^5 + 6*7^6 + O(7^7)]

sign()
Return the direction of the edge.
The Bruhat-Tits quotients are directed graphs but we only store half the edges (we treat them more likeunordered graphs). The sign tells whether the matrix self.x is equivalent to the representative in the quotient(sign = +1), or to the opposite of one of the representatives (sign = -1).
OUTPUT:

318

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

an int that is +1 or -1 according to the sign of self
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import DoubleCosetReduction
sage: Y = BruhatTitsQuotient(3, 11)
sage: x = Matrix(ZZ,2,2,[123,153,1231,1231])
sage: d = DoubleCosetReduction(Y,x)
sage: d.sign()-1
sage: d.igamma()*Y._edge_list[d.label - len(Y.get_edge_list())].opposite.
˓→rep*d.t() == x
True
sage: x = Matrix(ZZ,2,2,[1423,113553,11231,12313])
sage: d = DoubleCosetReduction(Y,x)
sage: d.sign()
1
sage: d.igamma()*Y._edge_list[d.label].rep*d.t() == x
True>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import DoubleCosetReduction>>> Y = BruhatTitsQuotient(Integer(3), Integer(11))>>> x = Matrix(ZZ,Integer(2),Integer(2),[Integer(123),Integer(153),
˓→Integer(1231),Integer(1231)])>>> d = DoubleCosetReduction(Y,x)>>> d.sign()-1>>> d.igamma()*Y._edge_list[d.label - len(Y.get_edge_list())].opposite.rep*d.
˓→t() == x
True>>> x = Matrix(ZZ,Integer(2),Integer(2),[Integer(1423),Integer(113553),
˓→Integer(11231),Integer(12313)])>>> d = DoubleCosetReduction(Y,x)>>> d.sign()
1>>> d.igamma()*Y._edge_list[d.label].rep*d.t() == x
Truet(prec=None)
Return the ‘t part’ of the decomposition using the rest of the data.
INPUT:• prec – a 𝑝-adic precision that t will be computed to. Defaults to the default working precision of self.
OUTPUT:a 2x2 𝑝-adic matrix with entries of precision prec that is the ‘t-part’ of the decomposition of self
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import DoubleCosetReduction
sage: Y = BruhatTitsQuotient(5, 13)
sage: x = Matrix(ZZ,2,2,[123,153,1231,1232])
sage: d = DoubleCosetReduction(Y,x)
sage: t = d.t(20)sage: t[1,0].valuation() > 0
True

19.7. Quotients of the Bruhat-Tits tree319

Modular Symbols, Release 10.4>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import DoubleCosetReduction>>> Y = BruhatTitsQuotient(Integer(5), Integer(13))>>> x = Matrix(ZZ,Integer(2),Integer(2),[Integer(123),Integer(153),
˓→Integer(1231),Integer(1232)])>>> d = DoubleCosetReduction(Y,x)>>> t = d.t(Integer(20))>>> t[Integer(1),Integer(0)].valuation() > Integer(0)Trueclass sage.modular.btquotients.btquotient.Edge(p, label, rep, origin, target, links=None,
opposite=None, determinant=None,valuation=None)
Bases: SageObject
This is a structure to represent edges of quotients of the Bruhat-Tits tree. It is useful to enrich the representationof an edge as a matrix with extra data.
INPUT:• p – a prime integer.
• label – An integer which uniquely identifies this edge.
• rep – A 2x2 matrix in reduced form representing this edge.
• origin – The origin vertex of self.
• target – The target vertex of self.
• links – (Default: empty list) A list of elements of Γ which identify different edges in the Bruhat-Tits tree
which are equivalent to self.
• opposite – (Default: None) The edge opposite to self
• determinant – (Default: None) The determinant of rep, if known.
• valuation – (Default: None) The valuation of the determinant of rep, if known.
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import Edge, Vertex
sage: v1 = Vertex(7,0,Matrix(ZZ,2,2,[1,2,3,18]))
sage: v2 = Vertex(7,0,Matrix(ZZ,2,2,[3,2,1,18]))
sage: e1 = Edge(7,0,Matrix(ZZ,2,2,[1,2,3,18]),v1,v2)
sage: e1.rep[ 1 2][ 3 18]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import Edge, Vertex>>> v1 = Vertex(Integer(7),Integer(0),Matrix(ZZ,Integer(2),Integer(2),[Integer(1),˓→Integer(2),Integer(3),Integer(18)]))>>> v2 = Vertex(Integer(7),Integer(0),Matrix(ZZ,Integer(2),Integer(2),[Integer(3),˓→Integer(2),Integer(1),Integer(18)]))>>> e1 = Edge(Integer(7),Integer(0),Matrix(ZZ,Integer(2),Integer(2),[Integer(1),˓→Integer(2),Integer(3),Integer(18)]),v1,v2)>>> e1.rep[ 1 2][ 3 18]320

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

AUTHORS:• Marc Masdeu (2012-02-20)class sage.modular.btquotients.btquotient.Vertex(p, label, rep, leaving_edges=None,entering_edges=None, determinant=None,valuation=None)
Bases: SageObject
This is a structure to represent vertices of quotients of the Bruhat-Tits tree. It is useful to enrich the representationof the vertex as a matrix with extra data.
INPUT:• p – a prime integer.
• label – An integer which uniquely identifies this vertex.
• rep – A 2x2 matrix in reduced form representing this vertex.
• leaving_edges – (default: empty list) A list of edges leaving this vertex.
• entering_edges – (default: empty list) A list of edges entering this vertex.
• determinant – (default: None) The determinant of rep, if known.
• valuation – (default: None) The valuation of the determinant of rep, if known.
EXAMPLES:
sage: from sage.modular.btquotients.btquotient import Vertex
sage: v1 = Vertex(5,0,Matrix(ZZ,2,2,[1,2,3,18]))
sage: v1.rep[ 1 2][ 3 18]sage: v1.entering_edges[]>>> from sage.all import *>>> from sage.modular.btquotients.btquotient import Vertex>>> v1 = Vertex(Integer(5),Integer(0),Matrix(ZZ,Integer(2),Integer(2),[Integer(1),˓→Integer(2),Integer(3),Integer(18)]))>>> v1.rep[ 1 2][ 3 18]>>> v1.entering_edges[]

AUTHORS:• Marc Masdeu (2012-02-20)

19.7. Quotients of the Bruhat-Tits tree321

Modular Symbols, Release 10.4

19.8 Spaces of 𝑝-adic automorphic forms
Compute with harmonic cocycles and 𝑝-adic automorphic forms, including overconvergent 𝑝-adic automorphic forms.
For a discussion of nearly rigid analytic modular forms and the rigid analytic Shimura-Maass operator, see [Fra2011]. It
is worth also looking at [FM2014] for information on how these are implemented in this code.
EXAMPLES:
Create a quotient of the Bruhat-Tits tree:
sage: X = BruhatTitsQuotient(13, 11)>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(13), Integer(11))

Declare the corresponding space of harmonic cocycles:
sage: H = X.harmonic_cocycles(2, prec=5)>>> from sage.all import *>>> H = X.harmonic_cocycles(Integer(2), prec=Integer(5))

And the space of 𝑝-adic automorphic forms:
sage: A = X.padic_automorphic_forms(2, prec=5, overconvergent=True)
˓→needs sage.rings.padics#␣>>> from sage.all import *>>> A = X.padic_automorphic_forms(Integer(2), prec=Integer(5), overconvergent=True)˓→# needs sage.rings.padics

␣Harmonic cocycles, unlike 𝑝-adic automorphic forms, can be used to compute a basis:sage: a = H.gen(0)˓→needs sage.rings.padics#␣>>> from sage.all import *>>> a = H.gen(Integer(0))˓→# needs sage.rings.padics

␣This can then be lifted to an overconvergent 𝑝-adic modular form:
sage: A.lift(a) # long time
˓→needs sage.rings.padics
p-adic automorphic form of cohomological weight 0>>> from sage.all import *>>> A.lift(a) # long time
˓→needs sage.rings.padics
p-adic automorphic form of cohomological weight 0#␣#␣class sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement(_parent,
vec)
Bases: HeckeModuleElement
322

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

Γ-invariant harmonic cocycles on the Bruhat-Tits tree. Γ-invariance is necessary so that the cocycle can be stored
in terms of a finite amount of data.
More precisely, given a BruhatTitsQuotient 𝑇 , harmonic cocycles are stored as a list of values in somecoefficient module (e.g. for weight 2 forms can take C𝑝 ) indexed by edges of a fundamental domain for 𝑇 in the
Bruhat-Tits tree. Evaluate the cocycle at other edges using Gamma invariance (although the values may not be
equal over an orbit of edges as the coefficient module action may be nontrivial).
EXAMPLES:
Harmonic cocycles form a vector space, so they can be added and/or subtracted from each other:sage: X = BruhatTitsQuotient(5,23)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: v1 = H.basis()[0]; v2 = H.basis()[1] # indirect doctest
sage: v3 = v1+v2
sage: v1 == v3-v2
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(23))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> v1 = H.basis()[Integer(0)]; v2 = H.basis()[Integer(1)] # indirect doctest>>> v3 = v1+v2>>> v1 == v3-v2
True

and rescaled:sage: v4 = 2*v1
sage: v1 == v4 - v1
True>>> from sage.all import *>>> v4 = Integer(2)*v1>>> v1 == v4 - v1
True

AUTHORS:• Cameron Franc (2012-02-20)• Marc Masdeu
derivative(z=None, level=0, order=1)
Integrate Teitelbaum’s 𝑝-adic Poisson kernel against the measure corresponding to self to evaluate the rigid
analytic Shimura-Maass derivatives of the associated modular form at 𝑧.
If z = None, a function is returned that encodes the derivative of the modular form.
Note: This function uses the integration method of Riemann summation and is incredibly slow! It should
only be used for testing and bug-finding. Overconvergent methods are quicker.
INPUT:• z – an element in the quadratic unramified extension of 𝑝 that is not contained in
If z = None then a function encoding the derivative is returned.

𝑝 (default = None).

• level – an integer. How fine of a mesh should the Riemann sum use.
19.8. Spaces of 𝑝-adic automorphic forms

323

Modular Symbols, Release 10.4

• order – an integer. How many derivatives to take.
OUTPUT:An element of the quadratic unramified extension of𝑝 , or a function encoding the derivative.

EXAMPLES:
sage: X = BruhatTitsQuotient(3,23)
sage: H = X.harmonic_cocycles(2,prec=5)
sage: b = H.basis()[0]sage: R.<a> = Qq(9,prec=10)
sage: b.modular_form(a,level=0) == b.derivative(a,level=0,order=0)
True
sage: b.derivative(a,level=1,order=1)(2*a + 2)*3 + (a + 2)*3^2 + 2*a*3^3 + 2*3^4 + O(3^5)
sage: b.derivative(a,level=2,order=1)(2*a + 2)*3 + 2*a*3^2 + 3^3 + a*3^4 + O(3^5)>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(23))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(5))>>> b = H.basis()[Integer(0)]>>> R = Qq(Integer(9),prec=Integer(10), names=( a ,)); (a,) = R._first_
˓→ngens(1)>>> b.modular_form(a,level=Integer(0)) == b.derivative(a,level=Integer(0),˓→order=Integer(0))
True>>> b.derivative(a,level=Integer(1),order=Integer(1))(2*a + 2)*3 + (a + 2)*3^2 + 2*a*3^3 + 2*3^4 + O(3^5)>>> b.derivative(a,level=Integer(2),order=Integer(1))(2*a + 2)*3 + 2*a*3^2 + 3^3 + a*3^4 + O(3^5)

evaluate(e1)Evaluate a harmonic cocycle on an edge of the Bruhat-Tits tree.
INPUT:• e1 – a matrix corresponding to an edge of the Bruhat-Tits tree
OUTPUT:• An element of the coefficient module of the cocycle which describes the value of the cocycle on e1
EXAMPLES:
sage: X = BruhatTitsQuotient(5,17)
sage: e0 = X.get_edge_list()[0]sage: e1 = X.get_edge_list()[1]sage: H = X.harmonic_cocycles(2,prec=10)
sage: b = H.basis()[0]sage: b.evaluate(e0.rep)
1 + O(5^10)sage: b.evaluate(e1.rep)
4 + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9 + O(5^˓→10)>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(17))>>> e0 = X.get_edge_list()[Integer(0)](continues on next page)

324

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> e1 = X.get_edge_list()[Integer(1)]>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> b = H.basis()[Integer(0)]>>> b.evaluate(e0.rep)
1 + O(5^10)>>> b.evaluate(e1.rep)
4 + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9 + O(5^˓→10)

modular_form(z=None, level=0)
Integrate Teitelbaum’s 𝑝-adic Poisson kernel against the measure corresponding to self to evaluate theassociated modular form at z.
If z = None, a function is returned that encodes the modular form.
Note: This function uses the integration method of Riemann summation and is incredibly slow! It should
only be used for testing and bug-finding. Overconvergent methods are quicker.
INPUT:• z – an element in the quadratic unramified extension of

𝑝 that is not contained in𝑝 (default = None).

• level – an integer. How fine of a mesh should the Riemann sum use.
OUTPUT:An element of the quadratic unramified extension of𝑝.

EXAMPLES:
sage: X = BruhatTitsQuotient(3,23)
sage: H = X.harmonic_cocycles(2,prec = 8)
sage: b = H.basis()[0]sage: R.<a> = Qq(9,prec=10)
sage: x1 = b.modular_form(a,level = 0); x1
a + (2*a + 1)*3 + (a + 1)*3^2 + (a + 1)*3^3 + 3^4 + (a + 2)*3^5 + a*3^7 + O(3^˓→8)
sage: x2 = b.modular_form(a,level = 1); x2
a + (a + 2)*3 + (2*a + 1)*3^3 + (2*a + 1)*3^4 + 3^5 + (a + 2)*3^6 + a*3^7 +␣˓→O(3^8)sage: x3 = b.modular_form(a,level = 2); x3
a + (a + 2)*3 + (2*a + 2)*3^2 + 2*a*3^4 + (a + 1)*3^5 + 3^6 + O(3^8)
sage: x4 = b.modular_form(a,level = 3);x4
a + (a + 2)*3 + (2*a + 2)*3^2 + (2*a + 2)*3^3 + 2*a*3^5 + a*3^6 + (a + 2)*3^7␣
˓→+ O(3^8)
sage: (x4-x3).valuation()3>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(23))>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(8))>>> b = H.basis()[Integer(0)]>>> R = Qq(Integer(9),prec=Integer(10), names=( a ,)); (a,) = R._first_
˓→ngens(1)>>> x1 = b.modular_form(a,level = Integer(0)); x1
a + (2*a + 1)*3 + (a + 1)*3^2 + (a + 1)*3^3 + 3^4 + (a + 2)*3^5 + a*3^7 + O(3^(continues on next page)

19.8. Spaces of 𝑝-adic automorphic forms

325Modular Symbols, Release 10.4

(continued from previous page)8)>>> x2 = b.modular_form(a,level = Integer(1)); x2
a + (a + 2)*3 + (2*a + 1)*3^3 + (2*a + 1)*3^4 + 3^5 + (a + 2)*3^6 + a*3^7 +␣˓→O(3^8)>>> x3 = b.modular_form(a,level = Integer(2)); x3
a + (a + 2)*3 + (2*a + 2)*3^2 + 2*a*3^4 + (a + 1)*3^5 + 3^6 + O(3^8)>>> x4 = b.modular_form(a,level = Integer(3));x4
a + (a + 2)*3 + (2*a + 2)*3^2 + (2*a + 2)*3^3 + 2*a*3^5 + a*3^6 + (a + 2)*3^7␣
˓→+ O(3^8)>>> (x4-x3).valuation()3˓→monomial_coefficients(copy=True)
Return a dictionary whose keys are indices of basis elements in the support of self and whose values are
the corresponding coefficients.
EXAMPLES:
sage: M = BruhatTitsQuotient(3,5).harmonic_cocycles(2, prec=10)
sage: M.monomial_coefficients(){}>>> from sage.all import *>>> M = BruhatTitsQuotient(Integer(3),Integer(5)).harmonic_
˓→cocycles(Integer(2), prec=Integer(10))>>> M.monomial_coefficients(){}

print_values()
Print the values of the cocycle on all of the edges.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,23)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: H.basis()[0].print_values()
0|1 + O(5^10)
1
|0
2
|0
3
|4 + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9␣
˓→+ O(5^10)
4
|0
5
|0
6
|0
7
|0
8
|0
9
|0
10 |0
11 |0
>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(23))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> H.basis()[Integer(0)].print_values()
0|1 + O(5^10)1|0(continues on next page)

326

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)2
3|0|4 + 4*5 + 4*5^2 + 4*5^3 + 4*5^4 + 4*5^5 + 4*5^6 + 4*5^7 + 4*5^8 + 4*5^9␣
˓→+ O(5^10)
4
|0
5
|0
6
|0
7
|0
8
|0
9
|0
10 |0
11 |0

riemann_sum(f, center=1, level=0, E=None)
Evaluate the integral of the function f with respect to the measure determined by self over P1 (𝑝 ).

INPUT:• f – a function on P1 (𝑝 ).

• center – An integer (default = 1). Center of integration.
• level – An integer (default = 0). Determines the size of the covering when computing the Riemannsum. Runtime is exponential in the level.
• E – A list of edges (default = None). They should describe a covering of P1 (𝑝 ).

OUTPUT:A 𝑝-adic number.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,7)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: b = H.basis()[0]sage: R.<z> = PolynomialRing(QQ,1)
sage: f = z^2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(7))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> b = H.basis()[Integer(0)]>>> R = PolynomialRing(QQ,Integer(1), names=( z ,)); (z,) = R._first_ngens(1)>>> f = z**Integer(2)Note that 𝑓 has a pole at infinity, so that the result will be meaningless:sage: b.riemann_sum(f,level=0)
1 + 5 + 2*5^3 + 4*5^4 + 2*5^5 + 3*5^6 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)>>> from sage.all import *>>> b.riemann_sum(f,level=Integer(0))
1 + 5 + 2*5^3 + 4*5^4 + 2*5^5 + 3*5^6 + 3*5^7 + 2*5^8 + 4*5^9 + O(5^10)valuation()
Return the valuation of the cocycle, defined as the minimum of the values it takes on a set of representatives.
OUTPUT:19.8. Spaces of 𝑝-adic automorphic forms

327

Modular Symbols, Release 10.4

An integer.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,17)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: b1 = H.basis()[0]sage: b2 = 3*b1
sage: b1.valuation()0
sage: b2.valuation()1
sage: H(0).valuation()+Infinity>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(17))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> b1 = H.basis()[Integer(0)]>>> b2 = Integer(3)*b1>>> b1.valuation()0>>> b2.valuation()1>>> H(Integer(0)).valuation()+Infinity

class sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles(X, k,
prec=None,
basis_matrix=None,base_field=None)
Bases: AmbientHeckeModule, UniqueRepresentation
Ensure unique representation
EXAMPLES:
sage: X = BruhatTitsQuotient(3,5)
sage: M1 = X.harmonic_cocycles( 2, prec = 10)
sage: M2 = X.harmonic_cocycles( 2, 10)
sage: M1 is M2
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(5))>>> M1 = X.harmonic_cocycles( Integer(2), prec = Integer(10))>>> M2 = X.harmonic_cocycles( Integer(2), Integer(10))>>> M1 is M2
True

Element
alias of BruhatTitsHarmonicCocycleElement
base_extend(base_ring)
Extend the base ring of the coefficient module.

328

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

INPUT:• base_ring – a ring that has a coerce map from the current base ring
OUTPUT:
A new space of HarmonicCocycles with the base extended.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,19)
sage: H = X.harmonic_cocycles(2,10)
sage: H.base_ring()
3-adic Field with capped relative precision 10
sage: H1 = H.base_extend(Qp(3,prec=15))
sage: H1.base_ring()
3-adic Field with capped relative precision 15>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(19))>>> H = X.harmonic_cocycles(Integer(2),Integer(10))>>> H.base_ring()
3-adic Field with capped relative precision 10>>> H1 = H.base_extend(Qp(Integer(3),prec=Integer(15)))>>> H1.base_ring()
3-adic Field with capped relative precision 15

basis_matrix()
Return a basis of self in matrix form.
If the coefficient module 𝑀 is of finite rank then the space of Gamma invariant 𝑀 valued harmonic cocycles
can be represented as a subspace of the finite rank space of all functions from the finitely many edges in
the corresponding BruhatTitsQuotient into 𝑀 . This function computes this representation of the space ofcocycles.
OUTPUT:• A basis matrix describing the cocycles in the spaced of all 𝑀 valued Gamma invariant functions on thetree.
EXAMPLES:
sage: X = BruhatTitsQuotient(5,3)
sage: M = X.harmonic_cocycles(4,prec = 20)
sage: B = M.basis() # indirect doctest
sage: len(B) == X.dimension_harmonic_cocycles(4)True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(3))>>> M = X.harmonic_cocycles(Integer(4),prec = Integer(20))>>> B = M.basis() # indirect doctest>>> len(B) == X.dimension_harmonic_cocycles(Integer(4))
True

AUTHORS:• Cameron Franc (2012-02-20)• Marc Masdeu (2012-02-20)

19.8. Spaces of 𝑝-adic automorphic forms

329

Modular Symbols, Release 10.4

change_ring(new_base_ring)
Change the base ring of the coefficient module.
INPUT:• new_base_ring – a ring that has a coerce map from the current base ring
OUTPUT:
New space of HarmonicCocycles with different base ring
EXAMPLES:
sage: X = BruhatTitsQuotient(5,17)
sage: H = X.harmonic_cocycles(2,10)
sage: H.base_ring()
5-adic Field with capped relative precision 10
sage: H1 = H.base_extend(Qp(5,prec=15)) # indirect doctest
sage: H1.base_ring()
5-adic Field with capped relative precision 15>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5),Integer(17))>>> H = X.harmonic_cocycles(Integer(2),Integer(10))>>> H.base_ring()
5-adic Field with capped relative precision 10>>> H1 = H.base_extend(Qp(Integer(5),prec=Integer(15))) # indirect doctest>>> H1.base_ring()
5-adic Field with capped relative precision 15

character()
The trivial character.
OUTPUT:
The identity map.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,7)
sage: H = X.harmonic_cocycles(2,prec = 10)
sage: f = H.character()sage: f(1)1sage: f(2)2>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(7))>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(10))>>> f = H.character()>>> f(Integer(1))
1>>> f(Integer(2))
2embed_quaternion(g, scale=1, exact=None)
Embed the quaternion element g into the matrix algebra.
INPUT:
330

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

• g – A quaternion, expressed as a 4x1 matrix.
OUTPUT:A 2x2 matrix with 𝑝-adic entries.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,2)
sage: q = X.get_stabilizers()[0][1][0]sage: H = X.harmonic_cocycles(2,prec = 5)
sage: Hmat = H.embed_quaternion(q)sage: Hmat.matrix().trace() == X._conv(q).reduced_trace() and Hmat.matrix().
˓→determinant() == 1
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(2))>>> q = X.get_stabilizers()[Integer(0)][Integer(1)][Integer(0)]>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(5))>>> Hmat = H.embed_quaternion(q)>>> Hmat.matrix().trace() == X._conv(q).reduced_trace() and Hmat.matrix().
˓→determinant() == Integer(1)Truefree_module()
Return the underlying free module
OUTPUT:
A free module.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,7)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: H.free_module()
Vector space of dimension 1 over 3-adic Field withcapped relative precision 10>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(7))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> H.free_module()
Vector space of dimension 1 over 3-adic Field withcapped relative precision 10

is_simple()
Whether self is irreducible.
OUTPUT:
Boolean. True if and only if self is irreducible.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,29)
sage: H = X.harmonic_cocycles(4,prec =10)
sage: H.rank()
14(continues on next page)

19.8. Spaces of 𝑝-adic automorphic forms

331Modular Symbols, Release 10.4

(continued from previous page)

sage: H.is_simple()False
sage: X = BruhatTitsQuotient(7,2)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: H.rank()
1sage: H.is_simple()True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(29))>>> H = X.harmonic_cocycles(Integer(4),prec =Integer(10))>>> H.rank()
14>>> H.is_simple()
False>>> X = BruhatTitsQuotient(Integer(7),Integer(2))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> H.rank()
1>>> H.is_simple()Truemonomial_coefficients()
Void method to comply with pickling.
EXAMPLES:
sage: M = BruhatTitsQuotient(3,5).harmonic_cocycles(2,prec=10)
sage: M.monomial_coefficients(){}>>> from sage.all import *>>> M = BruhatTitsQuotient(Integer(3),Integer(5)).harmonic_
˓→cocycles(Integer(2),prec=Integer(10))>>> M.monomial_coefficients(){}rank()
Return the rank (dimension) of self.
OUTPUT:
An integer.
EXAMPLES:
sage: X = BruhatTitsQuotient(7,11)
sage: H = X.harmonic_cocycles(2,prec = 10)
sage: X.genus() == H.rank()
True
sage: H1 = X.harmonic_cocycles(4,prec = 10)
sage: H1.rank()
16

332

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(11))>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(10))>>> X.genus() == H.rank()
True>>> H1 = X.harmonic_cocycles(Integer(4),prec = Integer(10))>>> H1.rank()
16

submodule(v, check=False)
Return the submodule of self spanned by v.
INPUT:• v – Submodule of self.free_module().
• check – Boolean (default = False).
OUTPUT:
Subspace of harmonic cocycles.
EXAMPLES:
sage: X = BruhatTitsQuotient(3,17)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: H.rank()
3sage: v = H.gen(0)sage: N = H.free_module().span([v.element()])
sage: H1 = H.submodule(N)Traceback (most recent call last):...
NotImplementedError>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(3),Integer(17))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> H.rank()3>>> v = H.gen(Integer(0))>>> N = H.free_module().span([v.element()])>>> H1 = H.submodule(N)Traceback (most recent call last):...
NotImplementedError

sage.modular.btquotients.pautomorphicform.eval_dist_at_powseries(phi, f)
Evaluate a distribution on a powerseries.
A distribution is an element in the dual of the Tate ring. The elements of coefficient modules of overconvergent
modular symbols and overconvergent 𝑝-adic automorphic forms give examples of distributions in Sage.
INPUT:• phi – a distribution• f – a power series over a ring coercible into a 𝑝-adic field
OUTPUT:19.8. Spaces of 𝑝-adic automorphic forms

333Modular Symbols, Release 10.4

The value of phi evaluated at f, which will be an element in the ring of definition of f
EXAMPLES:
sage: from sage.modular.btquotients.pautomorphicform import eval_dist_at_powseries
sage: R.<X> = PowerSeriesRing(ZZ,10)
sage: f = (1 - 7*X)^(-1)
sage: D = OverconvergentDistributions(0,7,10)
˓→needs sage.rings.padics
sage: phi = D(list(range(1,11)))˓→needs sage.rings.padics
sage: eval_dist_at_powseries(phi,f)
˓→needs sage.rings.padics
1 + 2*7 + 3*7^2 + 4*7^3 + 5*7^4 + 6*7^5 + 2*7^7 + 3*7^8 + 4*7^9 + O(7^10)

#␣
#␣
#␣

>>> from sage.all import *>>> from sage.modular.btquotients.pautomorphicform import eval_dist_at_powseries>>> R = PowerSeriesRing(ZZ,Integer(10), names=( X ,)); (X,) = R._first_ngens(1)>>> f = (Integer(1) - Integer(7)*X)**(-Integer(1))>>> D = OverconvergentDistributions(Integer(0),Integer(7),Integer(10))˓→# needs sage.rings.padics>>> phi = D(list(range(Integer(1),Integer(11))))˓→# needs sage.rings.padics>>> eval_dist_at_powseries(phi,f)
˓→needs sage.rings.padics
1 + 2*7 + 3*7^2 + 4*7^3 + 5*7^4 + 6*7^5 + 2*7^7 + 3*7^8 + 4*7^9 + O(7^10)␣␣#␣

class sage.modular.btquotients.pautomorphicform.pAdicAutomorphicFormElement(parent,
vec)
Bases: ModuleElement
Rudimentary implementation of a class for a 𝑝-adic automorphic form on a definite quaternion algebra over .
These are required in order to compute moments of measures associated to harmonic cocycles on the Bruhat-Tits
tree using the overconvergent modules of Darmon-Pollack and Matt Greenberg. See Greenberg’s thesis [Gr2006]
for more details.
INPUT:• vec – A preformatted list of data
EXAMPLES:
sage: X = BruhatTitsQuotient(17,3)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: h = H.an_element()
sage: HH = X.padic_automorphic_forms(2,10)
sage: a = HH(h)sage: ap-adic automorphic form of cohomological weight 0>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(17),Integer(3))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> h = H.an_element()>>> HH = X.padic_automorphic_forms(Integer(2),Integer(10))(continues on next page)

334

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)>>> a = HH(h)>>> ap-adic automorphic form of cohomological weight 0

AUTHORS:• Cameron Franc (2012-02-20)• Marc Masdeu
coleman(t1, t2, E=None, method='moments', mult=False)
If self is a 𝑝-adic automorphic form that corresponds to a rigid modular form, then this computes the
Coleman integral of this form between two points on the boundary 𝑃 1 ( 𝑝 ) of the 𝑝-adic upper half plane.
INPUT:• t1, t2 – elements of 𝑃 1 (𝑝 ) (the endpoints of integration)• E – (default: None). If specified, will not compute the covering adapted to t1 and t2 and instead use
the given one. In that case, E should be a list of matrices corresponding to edges describing the open
balls to be considered.
• method – string (default: ‘moments’). Tells which algorithm to use (alternative is ‘riemann_sum’, whichis unsuitable for computations requiring high precision)• mult – boolean (default: False). Whether to compute the multiplicative version.
OUTPUT:The result of the Coleman integral
EXAMPLES:
sage: p = 7
sage: lev = 2
sage: prec = 10
sage: X = BruhatTitsQuotient(p, lev)
sage: k = 2
sage: M = X.harmonic_cocycles(k, prec)
sage: B = M.basis()
sage: f = 3*B[0]sage: MM = X.padic_automorphic_forms(k, prec, overconvergent=True)
sage: D = -11
sage: X.is_admissible(D)True
sage: K.<a> = QuadraticField(D)sage: Kp.<g> = Qq(p**2, prec)
sage: P = Kp.gen()sage: Q = 2 + Kp.gen() + p*(Kp.gen()+1)
sage: F = MM.lift(f) # long time
sage: J0 = F.coleman(P, Q, mult=True) # long time>>> from sage.all import *>>> p = Integer(7)>>> lev = Integer(2)>>> prec = Integer(10)>>> X = BruhatTitsQuotient(p, lev)>>> k = Integer(2)>>> M = X.harmonic_cocycles(k, prec)(continues on next page)

19.8. Spaces of 𝑝-adic automorphic forms

335

Modular Symbols, Release 10.4

(continued from previous page)>>> B = M.basis()>>> f = Integer(3)*B[Integer(0)]>>> MM = X.padic_automorphic_forms(k, prec, overconvergent=True)>>> D = -Integer(11)>>> X.is_admissible(D)
True>>> K = QuadraticField(D, names=( a ,)); (a,) = K._first_ngens(1)>>> Kp = Qq(p**Integer(2), prec, names=( g ,)); (g,) = Kp._first_ngens(1)>>> P = Kp.gen()>>> Q = Integer(2) + Kp.gen() + p*(Kp.gen()+Integer(1))>>> F = MM.lift(f) # long time>>> J0 = F.coleman(P, Q, mult=True) # long time

AUTHORS:• Cameron Franc (2012-02-20)• Marc Masdeu (2012-02-20)
derivative(z=None, level=0, method='moments', order=1)
Return the derivative of the modular form corresponding to self.
INPUT:• z – (default: None). If specified, evaluates the derivative at the point z in the 𝑝-adic upper half plane.
• level – integer (default: 0). If method is ‘riemann_sum’, will use a covering of 𝑃 1 (of size 𝑝− level.

𝑝 ) with balls• method – string (default: moments). It must be either moments or riemann_sum.
• order – integer (default: 1). The order of the derivative to be computed.
OUTPUT:• A function from the 𝑝-adic upper half plane to C𝑝 . If an argument z was passed, returns instead thevalue of the derivative at that point.
EXAMPLES:
Integrating the Poisson kernel against a measure yields a value of the associated modular form. Such values
can be computed efficiently using the overconvergent method, as long as one starts with an ordinary form:
sage: X = BruhatTitsQuotient(7, 2)
sage: X.genus()
1>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7), Integer(2))>>> X.genus()
1

Since the genus is 1, the space of weight 2 forms is 1 dimensional. Hence any nonzero form will be a 𝑈7
eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in this case the Hecke eigenvalues correspondto that of any nonzero form on Γ0 (14) of weight 2. Such a form is ordinary at 7, and so we can apply theoverconvergent method directly to this form without 𝑝-stabilizing:sage: H = X.harmonic_cocycles(2,prec=5)
sage: h = H.gen(0)(continues on next page)

336

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: A = X.padic_automorphic_forms(2,prec=5,overconvergent=True)
sage: f0 = A.lift(h)>>> from sage.all import *>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(5))>>> h = H.gen(Integer(0))>>> A = X.padic_automorphic_forms(Integer(2),prec=Integer(5),˓→overconvergent=True)>>> f0 = A.lift(h)Now that we’ve lifted our harmonic cocycle to an overconvergent automorphic form, we extract the associatedmodular form as a function and test the modular property:
sage: T.<x> = Qq(49,prec=10)
sage: f = f0.modular_form()
sage: g = X.get_embedding_matrix()*X.get_units_of_order()[1]sage: a,b,c,d = g.change_ring(T).list()
sage: (c*x +d)^2*f(x)-f((a*x + b)/(c*x + d))O(7^5)>>> from sage.all import *>>> T = Qq(Integer(49),prec=Integer(10), names=( x ,)); (x,) = T._first_
˓→ngens(1)>>> f = f0.modular_form()>>> g = X.get_embedding_matrix()*X.get_units_of_order()[Integer(1)]>>> a,b,c,d = g.change_ring(T).list()>>> (c*x +d)**Integer(2)*f(x)-f((a*x + b)/(c*x + d))O(7^5)

We can also compute the Shimura-Maass derivative, which is a nearly rigid analytic modular forms of weight4:
sage: f = f0.derivative()sage: (c*x + d)^4*f(x)-f((a*x + b)/(c*x + d))O(7^5)>>> from sage.all import *>>> f = f0.derivative()>>> (c*x + d)**Integer(4)*f(x)-f((a*x + b)/(c*x + d))O(7^5)

evaluate(e1)Evaluate a 𝑝-adic automorphic form on a matrix in 𝐺𝐿2 (𝑝 ).

INPUT:• e1 – a matrix in 𝐺𝐿2 (𝑝)

OUTPUT:• the value of self evaluated on e1
EXAMPLES:
sage: X = BruhatTitsQuotient(7,5)
sage: M = X.harmonic_cocycles(2,prec=5)
sage: A = X.padic_automorphic_forms(2,prec=5)(continues on next page)

19.8. Spaces of 𝑝-adic automorphic forms

337

Modular Symbols, Release 10.4

(continued from previous page)

sage: a = A(M.basis()[0])sage: a.evaluate(Matrix(ZZ,2,2,[1,2,3,1]))
4 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)
sage: a.evaluate(Matrix(ZZ,2,2,[17,0,0,1]))
1 + O(7^5)>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(5))>>> M = X.harmonic_cocycles(Integer(2),prec=Integer(5))>>> A = X.padic_automorphic_forms(Integer(2),prec=Integer(5))>>> a = A(M.basis()[Integer(0)])>>> a.evaluate(Matrix(ZZ,Integer(2),Integer(2),[Integer(1),Integer(2),˓→Integer(3),Integer(1)]))
4 + 6*7 + 6*7^2 + 6*7^3 + 6*7^4 + O(7^5)>>> a.evaluate(Matrix(ZZ,Integer(2),Integer(2),[Integer(17),Integer(0),˓→Integer(0),Integer(1)]))
1 + O(7^5)

integrate(f, center=1, level=0, method='moments')
Calculate∫︁𝑓 (𝑥)𝑑𝜇(𝑥)
P1 (

𝑝)

were 𝜇 is the measure associated to self.
INPUT:• f – An analytic function.
• center – 2x2 matrix over𝑝 (default: 1)• level – integer (default: 0)• method – string (default: ‘moments’). Which method of integration to use. Either ‘moments’ or ‘riemann_sum’.
EXAMPLES:
Integrating the Poisson kernel against a measure yields a value of the associated modular form. Such values
can be computed efficiently using the overconvergent method, as long as one starts with an ordinary form:
sage: X = BruhatTitsQuotient(7,2)
sage: X.genus()
1>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7),Integer(2))>>> X.genus()
1

Since the genus is 1, the space of weight 2 forms is 1 dimensional. Hence any nonzero form will be a 𝑈7
eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in this case the Hecke eigenvalues correspondto that of any nonzero form on Γ0 (14) of weight 2. Such a form is ordinary at 7, and so we can apply theoverconvergent method directly to this form without 𝑝-stabilizing:sage: H = X.harmonic_cocycles(2,prec = 5)
sage: h = H.gen(0)(continues on next page)

338

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: A = X.padic_automorphic_forms(2,prec = 5,overconvergent=True)
sage: a = A.lift(h)sage: a._value[0].moment(2)2 + 6*7 + 4*7^2 + 4*7^3 + 6*7^4 + O(7^5)>>> from sage.all import *>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(5))>>> h = H.gen(Integer(0))>>> A = X.padic_automorphic_forms(Integer(2),prec = Integer(5),˓→overconvergent=True)>>> a = A.lift(h)>>> a._value[Integer(0)].moment(Integer(2))
2 + 6*7 + 4*7^2 + 4*7^3 + 6*7^4 + O(7^5)

Now that we’ve lifted our harmonic cocycle to an overconvergent automorphic form we simply need to define
the Teitelbaum-Poisson Kernel, and then integrate:
sage: Kp.<x> = Qq(49,prec = 5)
sage: z = Kp[ z ].gen()sage: f = 1/(z-x)
sage: a.integrate(f)(5*x + 5) + (4*x + 4)*7 + (5*x + 5)*7^2 + (5*x + 6)*7^3 + O(7^5)>>> from sage.all import *>>> Kp = Qq(Integer(49),prec = Integer(5), names=( x ,)); (x,) = Kp._first_
˓→ngens(1)>>> z = Kp[ z ].gen()>>> f = Integer(1)/(z-x)>>> a.integrate(f)(5*x + 5) + (4*x + 4)*7 + (5*x + 5)*7^2 + (5*x + 6)*7^3 + O(7^5)

AUTHORS:• Cameron Franc (2012-02-20)• Marc Masdeu (2012-02-20)
modular_form(z=None, level=0, method='moments')
Return the modular form corresponding to self.
INPUT:• z – (default: None). If specified, returns the value of the form at the point z in the 𝑝-adic upper halfplane.
• level – integer (default: 0). If method is ‘riemann_sum’, will use a covering of 𝑃 1 (of size 𝑝− level.

𝑝 ) with balls• method – string (default: moments). It must be either moments or riemann_sum.
OUTPUT:• A function from the 𝑝-adic upper half plane to C𝑝 . If an argument z was passed, returns instead thevalue at that point.
EXAMPLES:
Integrating the Poisson kernel against a measure yields a value of the associated modular form. Such values
can be computed efficiently using the overconvergent method, as long as one starts with an ordinary form:

19.8. Spaces of 𝑝-adic automorphic forms

339

Modular Symbols, Release 10.4

sage: X = BruhatTitsQuotient(7, 2)
sage: X.genus()
1>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(7), Integer(2))>>> X.genus()
1

Since the genus is 1, the space of weight 2 forms is 1 dimensional. Hence any nonzero form will be a 𝑈7
eigenvector. By Jacquet-Langlands and Cerednik-Drinfeld, in this case the Hecke eigenvalues correspondto that of any nonzero form on Γ0 (14) of weight 2. Such a form is ordinary at 7, and so we can apply theoverconvergent method directly to this form without 𝑝-stabilizing:sage: H = X.harmonic_cocycles(2,prec = 5)
sage: A = X.padic_automorphic_forms(2,prec = 5,overconvergent=True)
sage: f0 = A.lift(H.basis()[0])>>> from sage.all import *>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(5))>>> A = X.padic_automorphic_forms(Integer(2),prec = Integer(5),˓→overconvergent=True)>>> f0 = A.lift(H.basis()[Integer(0)])

Now that we’ve lifted our harmonic cocycle to an overconvergent automorphic form, we extract the associatedmodular form as a function and test the modular property:
sage: T.<x> = Qq(7^2,prec = 5)
sage: f = f0.modular_form(method = moments )sage: a,b,c,d = X.embed_quaternion(X.get_units_of_order()[1]).change_ring(T.
˓→base_ring()).list()
sage: ((c*x + d)^2*f(x)-f((a*x + b)/(c*x + d))).valuation()5>>> from sage.all import *>>> T = Qq(Integer(7)**Integer(2),prec = Integer(5), names=( x ,)); (x,) = T._
˓→first_ngens(1)>>> f = f0.modular_form(method = moments )>>> a,b,c,d = X.embed_quaternion(X.get_units_of_order()[Integer(1)]).change_
˓→ring(T.base_ring()).list()>>> ((c*x + d)**Integer(2)*f(x)-f((a*x + b)/(c*x + d))).valuation()
5

valuation()
The valuation of self, defined as the minimum of the valuations of the values that it takes on a set of edge
representatives.
OUTPUT:
An integer.
EXAMPLES:
sage: X = BruhatTitsQuotient(17,3)
sage: M = X.harmonic_cocycles(2,prec=10)
sage: A = X.padic_automorphic_forms(2,prec=10)(continues on next page)

340

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

(continued from previous page)

sage: a = A(M.gen(0))
sage: a.valuation()0
sage: (17*a).valuation()1>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(17),Integer(3))>>> M = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> A = X.padic_automorphic_forms(Integer(2),prec=Integer(10))>>> a = A(M.gen(Integer(0)))>>> a.valuation()0>>> (Integer(17)*a).valuation()
1class sage.modular.btquotients.pautomorphicform.pAdicAutomorphicForms(domain, U,
prec=None,
t=None,R=None,overconvergent=False)
Bases: Module, UniqueRepresentation
Create a space of 𝑝-automorphic forms
EXAMPLES:
sage: X = BruhatTitsQuotient(11,5)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: A = X.padic_automorphic_forms(2,prec=10)
sage: TestSuite(A).run()>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(11),Integer(5))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> A = X.padic_automorphic_forms(Integer(2),prec=Integer(10))>>> TestSuite(A).run()

Element
alias of pAdicAutomorphicFormElement
lift(f)Lift the harmonic cocycle f to a p-automorphic form.
If one is using overconvergent coefficients, then this will compute all of the moments of the measure associated
to f.
INPUT:• f – a harmonic cocycle
OUTPUT:A 𝑝-adic automorphic form
EXAMPLES:
If one does not work with an overconvergent form then lift does nothing:
19.8. Spaces of 𝑝-adic automorphic forms

341

Modular Symbols, Release 10.4

sage: X = BruhatTitsQuotient(13,5)
sage: H = X.harmonic_cocycles(2,prec=10)
sage: h = H.gen(0)sage: A = X.padic_automorphic_forms(2,prec=10)
sage: A.lift(h) # long time
p-adic automorphic form of cohomological weight 0>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(13),Integer(5))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(10))>>> h = H.gen(Integer(0))>>> A = X.padic_automorphic_forms(Integer(2),prec=Integer(10))>>> A.lift(h) # long time
p-adic automorphic form of cohomological weight 0

With overconvergent forms, the input is lifted naively and its moments are computed:
sage: X = BruhatTitsQuotient(13,11)
sage: H = X.harmonic_cocycles(2,prec=5)
sage: A2 = X.padic_automorphic_forms(2,prec=5,overconvergent=True)
sage: a = H.gen(0)sage: A2.lift(a) # long time
p-adic automorphic form of cohomological weight 0>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(13),Integer(11))>>> H = X.harmonic_cocycles(Integer(2),prec=Integer(5))>>> A2 = X.padic_automorphic_forms(Integer(2),prec=Integer(5),˓→overconvergent=True)>>> a = H.gen(Integer(0))>>> A2.lift(a) # long time
p-adic automorphic form of cohomological weight 0

precision_cap()
Return the precision of self.
OUTPUT:
An integer.
EXAMPLES:
sage: X = BruhatTitsQuotient(13,11)
sage: A = X.padic_automorphic_forms(2,prec=10)
sage: A.precision_cap()
10>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(13),Integer(11))>>> A = X.padic_automorphic_forms(Integer(2),prec=Integer(10))>>> A.precision_cap()
10

prime()
Return the underlying prime.
OUTPUT:

342

Chapter 19. Overconvergent modular symbols

Modular Symbols, Release 10.4

• p – a prime integer
EXAMPLES:
sage: X = BruhatTitsQuotient(11,5)
sage: H = X.harmonic_cocycles(2,prec = 10)
sage: A = X.padic_automorphic_forms(2,prec = 10)
sage: A.prime()
11>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(11),Integer(5))>>> H = X.harmonic_cocycles(Integer(2),prec = Integer(10))>>> A = X.padic_automorphic_forms(Integer(2),prec = Integer(10))>>> A.prime()
11

zero()
Return the zero element of self.
EXAMPLES:
sage: X = BruhatTitsQuotient(5, 7)
sage: H1 = X.padic_automorphic_forms( 2, prec=10)
sage: H1.zero() == 0
True>>> from sage.all import *>>> X = BruhatTitsQuotient(Integer(5), Integer(7))>>> H1 = X.padic_automorphic_forms( Integer(2), prec=Integer(10))>>> H1.zero() == Integer(0)True

19.8. Spaces of 𝑝-adic automorphic forms

343

Modular Symbols, Release 10.4

344

Chapter 19. Overconvergent modular symbols

CHAPTERTWENTYINDICES AND TABLES• Index• Module Index• Search Page

345

Modular Symbols, Release 10.4

346

Chapter 20. Indices and Tables

PYTHON MODULE INDEX

msage.modular.btquotients.btquotient, 282
sage.modular.btquotients.pautomorphicform, 322
sage.modular.modsym.ambient, 51
sage.modular.modsym.apply, 191
sage.modular.modsym.boundary, 129
sage.modular.modsym.element, 91
sage.modular.modsym.g1list, 159
sage.modular.modsym.ghlist, 161
sage.modular.modsym.hecke_operator, 193
sage.modular.modsym.heilbronn, 139
sage.modular.modsym.manin_symbol, 101
sage.modular.modsym.manin_symbol_list,
107
sage.modular.modsym.modsym, 1
sage.modular.modsym.modular_symbols, 95
sage.modular.modsym.p1list, 145
sage.modular.modsym.p1list_nf, 171
sage.modular.modsym.relation_matrix, 163
sage.modular.modsym.relation_matrix_pyx, 195
sage.modular.modsym.space, 11
sage.modular.modsym.subspace, 83
sage.modular.pollack_stevens.distributions, 213
sage.modular.pollack_stevens.fund_domain, 228
sage.modular.pollack_stevens.manin_map, 254
sage.modular.pollack_stevens.modsym, 264
sage.modular.pollack_stevens.padic_lseries, 249
sage.modular.pollack_stevens.space, 197

347

Modular Symbols, Release 10.4

348

Python Module Index

INDEXA
abelian_variety()(sage.modular.modsym.space.ModularSymbolsSpace
method), 11
abvarquo_cuspidal_subgroup()(sage.modular.modsym.space.ModularSymbolsSpace
method), 12
abvarquo_rational_cuspidal_subgroup()(sage.modular.modsym.space.ModularSymbolsSpace method), 13
acting_matrix() (sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract
method), 215
alpha() (sage.modular.modsym.modular_symbols.ModularSymbol method), 95
Apply (class in sage.modular.modsym.apply), 191
apply()(sage.modular.modsym.heilbronn.Heilbronn
method), 139
apply()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 107
apply()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),113
apply()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_groupmethod),122
apply() (sage.modular.modsym.manin_symbol.ManinSymbol method), 102
apply() (sage.modular.modsym.modular_symbols.ModularSymbol method), 95
apply()(sage.modular.pollack_stevens.manin_map.ManinMap method),256
apply_I()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 107
apply_I()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),114
apply_I()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_groupmethod),122
apply_I()(sage.modular.modsym.p1list.P1List

method), 145
apply_J_epsilon()(sage.modular.modsym.p1list_nf.P1NFList method), 178
apply_S()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 108
apply_S()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),114
apply_S()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_groupmethod),123
apply_S() (sage.modular.modsym.p1list_nf.P1NFList
method), 179
apply_S()(sage.modular.modsym.p1list.P1List
method), 146
apply_sparse() (sage.modular.modsym.hecke_operator.HeckeOperator method), 193
apply_T()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 108
apply_T()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),115
apply_T()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_groupmethod),124
apply_T()(sage.modular.modsym.p1list.P1List
method), 147
apply_T_alpha()(sage.modular.modsym.p1list_nf.P1NFList method), 181
apply_to_monomial() (in module sage.modular.modsym.apply), 191
apply_TS() (sage.modular.modsym.p1list_nf.P1NFList
method), 180
apply_TT()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 109
apply_TT()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),115
apply_TT()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_group method), 125approx_module() (sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract349

Modular Symbols, Release 10.4

method), 215

BruhatTitsHarmonicCocycleElement(classin sage.modular.btquotients.pautomorphicform),B
322
B_one() (sage.modular.btquotients.btquotient.BruhatTit- BruhatTitsHarmonicCocycles (class in sage.modular.btquotients.pautomorphicform), 328
sQuotient method), 284
base_extend() (sage.modular.btquotients.pautomor- BruhatTitsQuotient (class in sage.modular.btquotients.btquotient), 283
phicform.BruhatTitsHarmonicCocycles method),
BruhatTitsTree (class in sage.modular.btquo328
tients.btquotient), 305
base_extend() (sage.modular.pollack_stevens.distributions.Symk_class method), 225
basic_hecke_matrix() (in module sage.modu- C
lar.pollack_stevens.fund_domain), 248
c (sage.modular.modsym.p1list_nf.MSymbol property), 174
basis()(sage.modular.pollack_stevens.distribu- canonical_parameters() (in module sage.modutions.OverconvergentDistributions_abstract
lar.modsym.modsym), 8
method), 216change_ring() (sage.modular.btquotients.pautomorbasis_matrix() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles method),
phicform.BruhatTitsHarmonicCocycles method),329
329
change_ring() (sage.modular.modsym.ambient.Modbeta() (sage.modular.modsym.modular_symbols.ModuularSymbolsAmbient method), 53
larSymbol method), 96
change_ring()(sage.modular.pollack_stevens.disboundary_map()(sage.modular.modsym.ambitributions.OverconvergentDistributions_classent.ModularSymbolsAmbient method), 52
method), 221
boundary_map()(sage.modular.modsym.sub- change_ring() (sage.modular.pollack_stevens.distrispace.ModularSymbolsSubspacemethod),butions.Symk_class method), 225
83change_ring()(sage.modular.polboundary_space()(sage.modular.modsym.ambilack_stevens.space.PollackStevensModularSyment.ModularSymbolsAmbient method), 53
bolspace method), 201
boundary_space()(sage.modular.modsym.ambi- character() (sage.modular.btquotients.pautomorphicent.ModularSymbolsAmbient_wt2_g0 method),form.BruhatTitsHarmonicCocycles method), 330
74
character() (sage.modular.modsym.boundary.Boundboundary_space()(sage.modular.modsym.ambiarySpace method), 130
ent.ModularSymbolsAmbient_wtk_eps method), character()(sage.modular.modsym.manin_sym75
bol_list.ManinSymbolList_character
method),boundary_space()(sage.modular.modsym.ambi116
ent.ModularSymbolsAmbient_wtk_g0 method), character()(sage.modular.modsym.space.Modu79
larSymbolsSpace method), 14
boundary_space()(sage.modular.modsym.ambi- clear_cache()(sage.modular.pollack_stevens.disent.ModularSymbolsAmbient_wtk_g1 method),
tributions.OverconvergentDistributions_abstract
80
method), 217
boundary_space()(sage.modular.modsym.ambi- codomain() (sage.modular.modsym.space.PeriodMapent.ModularSymbolsAmbient_wtk_gamma_hping method), 49
method), 81
coefficient_module()(sage.modular.polBoundarySpace (class in sage.modular.modsym.boundlack_stevens.space.PollackStevensModularSymary), 130bolspace method), 201
BoundarySpace_wtk_eps (class in sage.modu- coleman()(sage.modular.btquotients.pautomorphiclar.modsym.boundary), 134
form.pAdicAutomorphicFormElement method),
BoundarySpace_wtk_g0 (class in sage.modu335
lar.modsym.boundary), 135
compact_newform_eigenvalues() (sage.modBoundarySpace_wtk_g1 (class in sage.moduular.modsym.ambient.ModularSymbolsAmbient
lar.modsym.boundary), 135
method), 54
BoundarySpace_wtk_gamma_h (class in sage.modu- compact_system_of_eigenvalues()
lar.modsym.boundary), 136(sage.modular.modsym.space.ModularSymBoundarySpaceElement (class in sage.modubolsSpace method), 15
lar.modsym.boundary), 133
350

Index

Modular Symbols, Release 10.4

completions()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement_symk method), 276
compute_full_data()(sage.modular.pollack_stevens.manin_map.ManinMap method),257
compute_presentation() (in module sage.modular.modsym.relation_matrix), 164
compute_presentation()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 56
congruence_number()(sage.modular.modsym.space.ModularSymbolsSpace
method), 15
coordinate_vector()(sage.modular.modsym.boundary.BoundarySpaceElement
method), 134
create_key()(sage.modular.pollack_stevens.distributions.OverconvergentDistributions_factory
method), 224
create_key() (sage.modular.pollack_stevens.distributions.Symk_factory method), 228
create_key()(sage.modular.pollack_stevens.space.PollackStevensModularSymbols_factory method), 199
create_object() (sage.modular.pollack_stevens.distributions.OverconvergentDistributions_factory
method), 224
create_object() (sage.modular.pollack_stevens.distributions.Symk_factory method), 228
create_object()(sage.modular.pollack_stevens.space.PollackStevensModularSymbols_factory method), 200
cuspidal_submodule() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 56
cuspidal_submodule()(sage.modular.modsym.space.ModularSymbolsSpace
method), 16
cuspidal_submodule()(sage.modular.modsym.subspace.ModularSymbolsSubspacemethod), 84
cuspidal_subspace()(sage.modular.modsym.space.ModularSymbolsSpace
method), 16
cusps() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 57
cusps_from_mat() (in module sage.modular.pollack_stevens.space), 206

derivative()(sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement
method), 323
derivative()(sage.modular.btquotients.pautomorphicform.pAdicAutomorphicFormElement
method), 336
diagonal_valuation()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 266
dict() (sage.modular.pollack_stevens.modsym.PSModularSymbolElement method), 266
dimension_harmonic_cocycles() (sage.modular.btquotients.btquotient.BruhatTitsQuotient
method), 285
dimension_of_associated_cuspform_space()(sage.modular.modsym.space.ModularSymbolsSpace
method), 17
domain() (sage.modular.modsym.space.PeriodMapping
method), 49
DoubleCosetReduction (class in sage.modular.btquotients.btquotient), 316
dual_star_involution_matrix() (sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 57
dual_star_involution_matrix() (sage.modular.modsym.space.ModularSymbolsSpace
method), 18
dual_star_involution_matrix() (sage.modular.modsym.subspace.ModularSymbolsSubspacemethod), 85Ee3() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 286
e4() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 286
Edge (class in sage.modular.btquotients.btquotient), 320edge() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 306
edge_between_vertices() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 306
edges_leaving_origin()(sage.modular.btquotients.btquotient.BruhatTitsTree method), 307
eisenstein_submodule()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 57
eisenstein_subspace()(sage.modular.modsym.space.ModularSymbolsSpaceD
method), 18(sage.modud (sage.modular.modsym.p1list_nf.MSymbol property), 175 eisenstein_subspace()
lar.modsym.subspace.ModularSymbolsSubspace
default_prec() (sage.modular.modsym.space.Modumethod), 86
larSymbolsSpace method), 17

Index

351

Modular Symbols, Release 10.4

Element(sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles
attribute),
328
Element(sage.modular.btquotients.pautomorphicform.pAdicAutomorphicForms attribute), 341
Element(sage.modular.modsym.manin_symbol_list.ManinSymbolList attribute), 107
Element (sage.modular.modsym.space.ModularSymbolsSpace attribute), 11
element()(sage.modular.modsym.ambient.ModularSymbolsAmbient method), 57
embed() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 286
embed_quaternion()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),287
embed_quaternion() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles
method), 330
endpoints()(sage.modular.modsym.manin_symbol.ManinSymbol method), 102
entering_edges() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 308
equivalent_index()(sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method), 242
equivalent_rep()(sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method), 242
eval_dist_at_powseries() (in module sage.modular.btquotients.pautomorphicform), 333
evaluate()(sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement
method), 324
evaluate() (sage.modular.btquotients.pautomorphicform.pAdicAutomorphicFormElement method),337
evaluate_twisted()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 267
export (class in sage.modular.modsym.p1list), 151
extend_codomain()(sage.modular.pollack_stevens.manin_map.ManinMap method),258

method), 230
find_containing_affinoid()(sage.modular.btquotients.btquotient.BruhatTitsTree
method), 308
find_covering() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 309
find_geodesic() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 310
find_path()(sage.modular.btquotients.btquotient.BruhatTitsTree method), 311
form_list_of_cusps()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 231
free_module() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles method),331
free_module()(sage.modular.modsym.boundary.BoundarySpace method), 130
fundom_rep()(sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 288

G

G1list (class in sage.modular.modsym.g1list), 159
gen() (sage.modular.modsym.boundary.BoundarySpace
method), 131gen() (sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method), 243gens() (sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method), 243
gens_to_basis_matrix() (in module sage.modular.modsym.relation_matrix), 165
genus() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 289
genus_no_formula()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),289
get_balls()(sage.modular.btquotients.btquotient.BruhatTitsTree method), 312
get_edge_list() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 290
get_edge_stabilizers()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),290
get_eichler_order()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),F
291
factor() (sage.modular.modsym.ambient.ModularSym- get_eichler_order_basis()(sage.modubolsAmbient method), 58
lar.btquotients.btquotient.BruhatTitsQuotient
factorization()(sage.modular.modsym.ambimethod), 291
ent.ModularSymbolsAmbient method), 60
get_eichler_order_quadform()(sage.modfactorization()(sage.modular.modsym.subular.btquotients.btquotient.BruhatTitsQuotient
space.ModularSymbolsSubspace method), 86
method), 291
fd_boundary()(sage.modular.pol- get_eichler_order_quadmatrix() (sage.modlack_stevens.fund_domain.ManinRelations
ular.btquotients.btquotient.BruhatTitsQuotient
352

Index

Modular Symbols, Release 10.4

method), 292
get_embedding() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 292
get_embedding_matrix()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),293
get_extra_embedding_matrices() (sage.modular.btquotients.btquotient.BruhatTitsQuotient
method), 294
get_fundom_graph()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),295
get_generators() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 295
get_graph()(sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 296
get_list()(sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 296
get_maximal_order()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),296
get_nontorsion_generators()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method), 297
get_num_ordered_edges() (sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),297
get_num_verts() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 297
get_quaternion_algebra() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 298
get_splitting_field()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),298
get_stabilizers()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),298
get_units_of_order()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),299
get_vertex_dict()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),300
get_vertex_list()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),300
get_vertex_stabs()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),300
GHlist (class in sage.modular.modsym.ghlist), 161
group() (sage.modular.modsym.boundary.BoundarySpace method), 131
group()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_gamma_h method),
Index

121
group() (sage.modular.modsym.space.ModularSymbolsSpace method), 19
group() (sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 202

H
harmonic_cocycle_from_elliptic_curve()(sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 301
harmonic_cocycles()(sage.modular.btquotients.btquotient.BruhatTitsQuotient
method),302
hecke()(sage.modular.pollack_stevens.manin_map.ManinMap method),259
hecke() (sage.modular.pollack_stevens.modsym.PSModularSymbolElement method), 268
hecke_images_gamma0_weight2() (in module
sage.modular.modsym.heilbronn), 141
hecke_images_gamma0_weight_k() (in module
sage.modular.modsym.heilbronn), 141
hecke_images_nonquad_character_weight2() (in module sage.modular.modsym.heilbronn), 142
hecke_images_quad_character_weight2()(in module sage.modular.modsym.heilbronn),
143
hecke_module_of_level()(sage.modular.modsym.space.ModularSymbolsSpace
method), 19
HeckeOperator(classin
sage.modular.modsym.hecke_operator), 193
Heilbronn (class in sage.modular.modsym.heilbronn),
139
HeilbronnCremona(classin
sage.modular.modsym.heilbronn), 140
HeilbronnMerel (class in sage.modular.modsym.heilbronn), 140Ii (sage.modular.modsym.manin_symbol.ManinSymbol attribute), 103i()(sage.modular.modsym.modular_symbols.ModularSymbol method), 97
igamma() (sage.modular.btquotients.btquotient.DoubleCosetReduction method), 317
index()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 109
index()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),117
index()(sage.modular.modsym.p1list_nf.P1NFList
method), 181353

Modular Symbols, Release 10.4

index() (sage.modular.modsym.p1list.P1List method),148
index_of_normalized_pair()(sage.modular.modsym.p1list_nf.P1NFList method), 183
index_of_normalized_pair()(sage.modular.modsym.p1list.P1List method), 148
indices()(sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method),244
indices_with_three_torsion() (sage.modular.pollack_stevens.fund_domain.ManinRelations method), 232
indices_with_two_torsion()(sage.modular.pollack_stevens.fund_domain.ManinRelations method), 233
integral_basis()(sage.modular.modsym.space.ModularSymbolsSpace
method), 19
integral_hecke_matrix()(sage.modular.modsym.space.ModularSymbolsSpace
method), 21
integral_period_mapping()(sage.modular.modsym.space.ModularSymbolsSpace
method), 22
integral_structure() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 61
integral_structure()(sage.modular.modsym.space.ModularSymbolsSpace
method), 23
IntegralPeriodMapping (class in sage.modular.modsym.space), 11
integrate() (sage.modular.btquotients.pautomorphicform.pAdicAutomorphicFormElement method),338
interpolation_factor()(sage.modular.pollack_stevens.padic_lseries.pAdicLseries method),251
intersection_number()(sage.modular.modsym.space.ModularSymbolsSpace
method), 24
is_admissible() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 302
is_ambient()(sage.modular.modsym.boundary.BoundarySpace method), 131
is_ambient()(sage.modular.modsym.space.ModularSymbolsSpace method), 25
is_cuspidal() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 63
is_cuspidal() (sage.modular.modsym.space.ModularSymbolsSpace method), 25
is_cuspidal()(sage.modular.modsym.subspace.ModularSymbolsSubspacemethod),87
is_eisenstein()(sage.modular.modsym.ambi354

ent.ModularSymbolsAmbient method), 63
is_eisenstein()(sage.modular.modsym.subspace.ModularSymbolsSubspace method), 88
is_ManinSymbol()(inmodulesage.modular.modsym.manin_symbol), 105
is_ModularSymbolsElement()(inmodulesage.modular.modsym.element), 92
is_ModularSymbolsSpace() (in module sage.modular.modsym.space), 50
is_ordinary()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 269
is_simple() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles method), 331
is_simple()(sage.modular.modsym.space.ModularSymbolsSpace method), 25
is_symk()(sage.modular.pollack_stevens.distributions.OverconvergentDistributions_class method),222
is_symk()(sage.modular.pollack_stevens.distributions.Symk_class method), 226
is_Tq_eigensymbol()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 269
is_unimodular_path()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 234

Lleaving_edges() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 313
level() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 303
level()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method),117
level()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_groupmethod),125level() (sage.modular.modsym.manin_symbol.ManinSymbol method), 103
level()(sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method),244
level() (sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 202lift()(sage.modular.btquotients.pautomorphicform.pAdicAutomorphicForms method), 341
lift() (sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract method), 217
lift() (sage.modular.pollack_stevens.modsym.PSModularSymbolElement_symk method), 277
lift_to_sl2_Ok()(inmodulesage.modular.modsym.p1list_nf), 186
Index

Modular Symbols, Release 10.4

lift_to_sl2_Ok()(sage.modular.modsym.p1list_nf.MSymbol method), 175
lift_to_sl2_Ok()(sage.modular.modsym.p1list_nf.P1NFList method), 184
lift_to_sl2z()(inmodulesage.modular.modsym.p1list), 151
lift_to_sl2z() (sage.modular.modsym.manin_symbol.ManinSymbol method), 103
lift_to_sl2z() (sage.modular.modsym.p1list.P1List
method), 149
lift_to_sl2z_int() (in module sage.modular.modsym.p1list), 151
lift_to_sl2z_llong() (in module sage.modular.modsym.p1list), 152list() (sage.modular.modsym.element.ModularSymbolsElement method), 91
list() (sage.modular.modsym.g1list.G1list method), 159
list() (sage.modular.modsym.ghlist.GHlist method),161
list()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 109list()(sage.modular.modsym.p1list_nf.P1NFList
method), 184list() (sage.modular.modsym.p1list.P1List method),149
log_gamma_binomial() (in module sage.modular.pollack_stevens.padic_lseries), 249

M
M2Z() (in module sage.modular.pollack_stevens.fund_domain), 228
make_coprime()(inmodulesage.modular.modsym.p1list_nf), 188
manin_basis() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 64
manin_generators() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 64
manin_gens_to_basis()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 65
manin_symbol()(sage.modular.modsym.ambient.ModularSymbolsAmbient method), 65
manin_symbol() (sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 110
manin_symbol_list()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 111
manin_symbol_rep()(sage.modular.modsym.element.ModularSymbolsElement method), 91
manin_symbol_rep() (sage.modular.modsym.modular_symbols.ModularSymbol method), 97
manin_symbols()(sage.modular.modsym.ambient.ModularSymbolsAmbient method), 66

Index

manin_symbols()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_eps method),76
manin_symbols()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g0 method),79
manin_symbols()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1 method),80
manin_symbols()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_gamma_h
method), 81
manin_symbols_basis()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 66
ManinMap(classin
sage.modular.pollack_stevens.manin_map), 255
ManinRelations(classin
sage.modular.pollack_stevens.fund_domain), 229
ManinSymbol(classin
sage.modular.modsym.manin_symbol), 101
ManinSymbolList(classin
sage.modular.modsym.manin_symbol_list), 107
ManinSymbolList_character (class in sage.modular.modsym.manin_symbol_list), 112
ManinSymbolList_gamma0 (class in sage.modular.modsym.manin_symbol_list), 118
ManinSymbolList_gamma1 (class in sage.modular.modsym.manin_symbol_list), 119ManinSymbolList_gamma_h (class in sage.modular.modsym.manin_symbol_list), 120
ManinSymbolList_group (class in sage.modular.modsym.manin_symbol_list), 121
matrix() (sage.modular.modsym.space.PeriodMapping
method), 49
minus_part()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 271
minus_submodule()(sage.modular.modsym.space.ModularSymbolsSpace
method), 26
modI_relations()(inmodulesage.modular.modsym.relation_matrix), 166
modS_relations()(inmodulesage.modular.modsym.relation_matrix), 167
modular_form() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement
method), 325
modular_form()(sage.modular.btquotients.pautomorphicform.pAdicAutomorphicFormElement
method), 339
modular_symbol()(sage.modular.modsym.ambient.ModularSymbolsAmbient method), 66
modular_symbol_rep() (sage.modular.modsym.ele355

Modular Symbols, Release 10.4

ment.ModularSymbolsElement method), 91
modular_symbol_rep()(sage.modular.modsym.manin_symbol.ManinSymbol
method), 103
modular_symbol_sum() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 68
modular_symbols_of_level()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 68
modular_symbols_of_level()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_eps method), 76
modular_symbols_of_sign()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 69
modular_symbols_of_sign()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_eps method), 77
modular_symbols_of_sign()(sage.modular.modsym.space.ModularSymbolsSpace
method), 27
modular_symbols_of_weight()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 69
modular_symbols_of_weight()(sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_eps method), 77
modular_symbols_space()(sage.modular.modsym.space.PeriodMapping
method),50
ModularSymbol (class in sage.modular.modsym.modular_symbols), 95
ModularSymbols()(inmodulesage.modular.modsym.modsym), 3
ModularSymbols_clear_cache() (in module
sage.modular.modsym.modsym), 8
ModularSymbolsAmbient (class in sage.modular.modsym.ambient), 52
ModularSymbolsAmbient_wt2_g0(classin
sage.modular.modsym.ambient), 73
ModularSymbolsAmbient_wtk_eps (class insage.modular.modsym.ambient), 74
ModularSymbolsAmbient_wtk_g0(classin
sage.modular.modsym.ambient), 78
ModularSymbolsAmbient_wtk_g1(classin
sage.modular.modsym.ambient), 79
ModularSymbolsAmbient_wtk_gamma_h (classin sage.modular.modsym.ambient), 80
ModularSymbolsElement (class in sage.modular.modsym.element), 91
ModularSymbolsSpace (class in sage.modular.modsym.space), 11
ModularSymbolsSubspace (class in sage.modular.modsym.subspace), 83
356

modulesage.modular.btquotients.btquotient, 282
sage.modular.btquotients.pautomorphicform, 322
sage.modular.modsym.ambient, 51
sage.modular.modsym.apply, 191
sage.modular.modsym.boundary, 129
sage.modular.modsym.element, 91
sage.modular.modsym.g1list, 159
sage.modular.modsym.ghlist, 161
sage.modular.modsym.hecke_operator,
193
sage.modular.modsym.heilbronn, 139
sage.modular.modsym.manin_symbol,
101
sage.modular.modsym.manin_symbol_list, 107
sage.modular.modsym.modsym, 1
sage.modular.modsym.modular_symbols, 95
sage.modular.modsym.p1list, 145
sage.modular.modsym.p1list_nf, 171
sage.modular.modsym.relation_matrix, 163
sage.modular.modsym.relation_matrix_pyx, 195
sage.modular.modsym.space, 11
sage.modular.modsym.subspace, 83
sage.modular.pollack_stevens.distributions, 213
sage.modular.pollack_stevens.fund_domain, 228
sage.modular.pollack_stevens.manin_map, 254
sage.modular.pollack_stevens.modsym, 264
sage.modular.pollack_stevens.padic_lseries, 249
sage.modular.pollack_stevens.space,197
monomial_coefficients() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement method), 326
monomial_coefficients() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles method), 332
MSymbol (class in sage.modular.modsym.p1list_nf), 173mu() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 303
multiplicity() (sage.modular.modsym.space.ModularSymbolsSpace method), 28

Index

Modular Symbols, Release 10.4

N

origin() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 314
n(sage.modular.modsym.heilbronn.HeilbronnMerel
OverconvergentDistributions_abstract
attribute), 141(class in sage.modular.pollack_stevens.distribuN() (sage.modular.modsym.p1list_nf.MSymbol method),
tions), 213
174
OverconvergentDistributions_class(classN() (sage.modular.modsym.p1list_nf.P1NFList method),insage.modular.pollack_stevens.distributions),
178
221
N() (sage.modular.modsym.p1list.P1List method), 145
OverconvergentDistributions_factory
ncoset_reps()(sage.modular.pol(class in sage.modular.pollack_stevens.distribulack_stevens.space.PollackStevensModularSymtions), 223bolspace method), 203
new_submodule()(sage.modular.modsym.ambiP
ent.ModularSymbolsAmbient method), 70
new_subspace() (sage.modular.modsym.space.Modu- p (sage.modular.modsym.heilbronn.HeilbronnCremona attribute), 140
larSymbolsSpace method), 29
P1()(sage.modular.pollack_stevens.fund_domain.Polngens() (sage.modular.modsym.space.ModularSymbollackStevensModularDomain method), 241
sSpace method), 29
p1_normalize()(inmodulesage.modungens()(sage.modular.pollack_stevens.fund_dolar.modsym.p1list),152
main.PollackStevensModularDomain method),
p1_normalize_int() (in module sage.modu245
lar.modsym.p1list), 154ngens() (sage.modular.pollack_stevens.space.Pollackp1_normalize_llong()(in module sage.moduStevensModularSymbolspace method), 203
lar.modsym.p1list),154
Nminus() (sage.modular.btquotients.btquotient.BruhatP1List (class in sage.modular.modsym.p1list), 145
TitsQuotient method), 284
normalize()(sage.modular.modsym.g1list.G1list p1list() (in module sage.modular.modsym.p1list), 155
p1list() (sage.modular.modsym.ambient.ModularSymmethod), 159
bolsAmbient method), 70
normalize()(sage.modular.modsym.ghlist.GHlist
p1list_int()(inmodulesage.modumethod), 161
lar.modsym.p1list),
155
normalize()(sage.modular.modsym.manin_symp1list_llong()(inmodulesage.modubol_list.ManinSymbolList method), 111
lar.modsym.p1list), 157
normalize()(sage.modular.modsym.manin_symbol_list.ManinSymbolList_character
method), P1NFList (class in sage.modular.modsym.p1list_nf), 177
p1NFlist()(inmodulesage.modu118
lar.modsym.p1list_nf), 189
normalize()(sage.modular.modsym.manin_symP1NFList_clear_level_cache() (in module
bol_list.ManinSymbolList_group method), 126
sage.modular.modsym.p1list_nf), 186
normalize() (sage.modular.modsym.p1list_nf.MSymp_stabilize()(sage.modular.polbol method), 176
lack_stevens.manin_map.ManinMap method),
normalize()(sage.modu260
lar.modsym.p1list_nf.P1NFList method), 185(sage.modular.polnormalize()(sage.modular.modsym.p1list.P1List p_stabilize()lack_stevens.modsym.PSModularSymbolElemethod), 149
ment_symk method), 280
normalize()(sage.modular.pol(sage.modular.pollack_stevens.manin_map.ManinMap method), p_stabilize_and_lift()lack_stevens.modsym.PSModularSymbolEle259
ment_symk method), 281
normalize_with_scalar()(sage.modupadic_automorphic_forms()(sage.modular.modsym.p1list.P1List method), 150
lar.btquotients.btquotient.BruhatTitsQuotient
Nplus() (sage.modular.btquotients.btquotient.BruhatTitmethod), 303
sQuotient method), 285
padic_lseries()(sage.modular.polO
lack_stevens.modsym.PSModularSymbolElement_dist method), 274
old_subspace() (sage.modular.modsym.space.ModupAdicAutomorphicFormElement(classin
larSymbolsSpace method), 30
sage.modular.btquotients.pautomorphicform),
opposite()(sage.modular.btquotients.btquo334
tient.BruhatTitsTree method), 313
Index

357

Modular Symbols, Release 10.4

pAdicAutomorphicForms (class in sage.modular.btquotients.pautomorphicform), 341
pAdicLseries(classin
sage.modular.pollack_stevens.padic_lseries), 249
PeriodMapping (class in sage.modular.modsym.space),49
plot() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 304
plot_fundom()(sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 304
plus_part()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 271
plus_submodule()(sage.modular.modsym.space.ModularSymbolsSpace
method), 30
PollackStevensModularDomain(classin
sage.modular.pollack_stevens.fund_domain),
240
PollackStevensModularSymbols_factory(class in sage.modular.pollack_stevens.space),
198
PollackStevensModularSymbolspace (class insage.modular.pollack_stevens.space), 200
polynomial_part() (sage.modular.modsym.modular_symbols.ModularSymbol method), 98
precision_cap() (sage.modular.btquotients.pautomorphicform.pAdicAutomorphicForms method),342
precision_cap() (sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract
method), 218
precision_cap()(sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 203
precision_relative()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement_dist method), 274
prep_hecke_on_gen()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 235
prep_hecke_on_gen_list() (sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 236
prime() (sage.modular.btquotients.btquotient.BruhatTitsQuotient method), 304
prime()(sage.modular.btquotients.pautomorphicform.pAdicAutomorphicForms method), 342
prime()(sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract
method), 219
prime()(sage.modular.pollack_stevens.padic_lseries.pAdicLseries method),252
358

prime() (sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 204
print_values() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement
method), 326
ps_modsym_from_elliptic_curve() (in module
sage.modular.pollack_stevens.space), 207
ps_modsym_from_simple_modsym_space()(in module sage.modular.pollack_stevens.space),
207
psi() (in module sage.modular.modsym.p1list_nf), 190
PSModSymAction(classin
sage.modular.pollack_stevens.modsym), 264
PSModularSymbolElement (class in sage.modular.pollack_stevens.modsym), 265
PSModularSymbolElement_dist(classin
sage.modular.pollack_stevens.modsym), 274
PSModularSymbolElement_symk(classin
sage.modular.pollack_stevens.modsym), 276

Q
q_eigenform() (sage.modular.modsym.space.ModularSymbolsSpace method), 31
q_eigenform_character()(sage.modular.modsym.space.ModularSymbolsSpace
method), 31
q_expansion_basis()(sage.modular.modsym.space.ModularSymbolsSpace
method), 33
q_expansion_cuspforms()(sage.modular.modsym.space.ModularSymbolsSpace
method), 35
q_expansion_module()(sage.modular.modsym.space.ModularSymbolsSpace
method), 37
quadratic_twist()(sage.modular.pollack_stevens.padic_lseries.pAdicLseries method),252

Rrandom_element()(sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract method), 219
random_element()(sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 204rank()(sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles
method),332
rank() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 70
rank() (sage.modular.modsym.boundary.BoundarySpace method), 132

Index

Modular Symbols, Release 10.4

rational_period_mapping()(sage.modular.modsym.space.ModularSymbolsSpace
method), 42
RationalPeriodMapping (class in sage.modular.modsym.space), 50
reduce_precision()(sage.modular.pollack_stevens.manin_map.ManinMap method),260
reduce_precision()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement_dist method), 274
relation_matrix_wtk_g0() (in module sage.modular.modsym.relation_matrix), 168
relations() (sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method),245
reps() (sage.modular.pollack_stevens.fund_domain.PollackStevensModularDomain method), 247
reps_with_three_torsion() (sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 237
reps_with_two_torsion()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 238
riemann_sum() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement
method), 327

S
sage.modular.btquotients.btquotient
module, 282
sage.modular.btquotients.pautomorphicformmodule, 322
sage.modular.modsym.ambient
module, 51
sage.modular.modsym.apply
module, 191
sage.modular.modsym.boundary
module, 129
sage.modular.modsym.element
module, 91
sage.modular.modsym.g1list
module, 159
sage.modular.modsym.ghlist
module, 161
sage.modular.modsym.hecke_operator
module, 193
sage.modular.modsym.heilbronn
module, 139
sage.modular.modsym.manin_symbol
module, 101
sage.modular.modsym.manin_symbol_list
module, 107
Indexsage.modular.modsym.modsym
module, 1
sage.modular.modsym.modular_symbols
module, 95
sage.modular.modsym.p1list
module, 145
sage.modular.modsym.p1list_nf
module, 171
sage.modular.modsym.relation_matrix
module, 163
sage.modular.modsym.relation_matrix_pyx
module, 195
sage.modular.modsym.spacemodule, 11
sage.modular.modsym.subspacemodule, 83
sage.modular.pollack_stevens.distributions
module, 213
sage.modular.pollack_stevens.fund_domain
module, 228
sage.modular.pollack_stevens.manin_map
module, 254
sage.modular.pollack_stevens.modsym
module, 264
sage.modular.pollack_stevens.padic_lseries
module, 249
sage.modular.pollack_stevens.spacemodule, 197
series()(sage.modular.pollack_stevens.padic_lseries.pAdicLseries method),253
set_default_prec()(sage.modular.modsym.space.ModularSymbolsSpace
method), 44
set_modsym_print_mode() (in module sage.modular.modsym.element), 92
set_precision() (sage.modular.modsym.space.ModularSymbolsSpace method), 44
sign() (sage.modular.btquotients.btquotient.DoubleCosetReduction method), 318
sign() (sage.modular.modsym.boundary.BoundarySpace method), 133sign() (sage.modular.modsym.space.ModularSymbolsSpace method), 44
sign()(sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 205
sign_submodule()(sage.modular.modsym.space.ModularSymbolsSpace
method), 45
simple_factors()(sage.modu359

Modular Symbols, Release 10.4

lar.modsym.space.ModularSymbolsSpace
method), 46
source() (sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 205
space() (sage.modular.modsym.modular_symbols.ModularSymbol method), 98
sparse_2term_quotient() (in module sage.modular.modsym.relation_matrix), 169
sparse_2term_quotient_only_pm1() (in module sage.modular.modsym.relation_matrix_pyx),
195
specialize() (sage.modular.pollack_stevens.distributions.OverconvergentDistributions_class method),223
specialize()(sage.modular.pollack_stevens.manin_map.ManinMap method),261
specialize()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement_dist method), 275
star_decomposition()(sage.modular.modsym.space.ModularSymbolsSpace
method), 47
star_eigenvalues()(sage.modular.modsym.space.ModularSymbolsSpace
method), 47
star_involution() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 71
star_involution()(sage.modular.modsym.space.ModularSymbolsSpace
method), 48
star_involution()(sage.modular.modsym.subspace.ModularSymbolsSubspace method), 88
sturm_bound() (sage.modular.modsym.space.ModularSymbolsSpace method), 48
subdivide()(sage.modular.btquotients.btquotient.BruhatTitsTree method), 314
submodule() (sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycles method), 333
submodule() (sage.modular.modsym.ambient.ModularSymbolsAmbient method), 72
symbol()(sage.modular.pollack_stevens.padic_lseries.pAdicLseries method),254
symbol_list() (sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 112
Symk_class (class in sage.modular.pollack_stevens.distributions), 225
Symk_factory(classin
sage.modular.pollack_stevens.distributions), 226Tt() (sage.modular.btquotients.btquotient.DoubleCosetReduction method), 319
360

T_relation_matrix_wtk_g0()(inmodulesage.modular.modsym.relation_matrix), 163
target() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 315
three_torsion_matrix()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 239
to_list() (sage.modular.modsym.heilbronn.Heilbronn
method), 139
Tq_eigenvalue()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 265
tuple() (sage.modular.modsym.manin_symbol.ManinSymbol method), 104tuple()(sage.modular.modsym.p1list_nf.MSymbol
method), 177
twisted_winding_element()(sage.modular.modsym.ambient.ModularSymbolsAmbient
method), 73
two_torsion_matrix()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 239

Uu (sage.modular.modsym.manin_symbol.ManinSymbol attribute), 104
unimod_matrices_from_infty() (in module
sage.modular.pollack_stevens.manin_map), 262
unimod_matrices_to_infty()(inmodulesage.modular.pollack_stevens.manin_map), 262
unimod_to_matrices()(sage.modular.pollack_stevens.fund_domain.ManinRelations
method), 240Vv (sage.modular.modsym.manin_symbol.ManinSymbol attribute), 104
valuation()(sage.modular.btquotients.pautomorphicform.BruhatTitsHarmonicCocycleElement
method), 327
valuation() (sage.modular.btquotients.pautomorphicform.pAdicAutomorphicFormElement method),
340
valuation()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 271
values()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 273
Vertex (class in sage.modular.btquotients.btquotient), 321vertex() (sage.modular.btquotients.btquotient.BruhatTitsTree method), 315

Index

Modular Symbols, Release 10.4

W
weight() (sage.modular.modsym.boundary.BoundarySpace method), 133
weight()(sage.modular.modsym.manin_symbol_list.ManinSymbolList method), 112
weight()(sage.modular.modsym.manin_symbol.ManinSymbol method), 104weight()(sage.modular.modsym.modular_symbols.ModularSymbol method), 98
weight()(sage.modular.pollack_stevens.distributions.OverconvergentDistributions_abstract
method), 220
weight()(sage.modular.pollack_stevens.modsym.PSModularSymbolElement
method), 273
weight() (sage.modular.pollack_stevens.space.PollackStevensModularSymbolspace method), 205Zzero()

Index(sage.modular.btquotients.pautomorphicform.pAdicAutomorphicForms method), 343

361