41.1 Creation of modular symbols spaces

Module: sage.modular.modsym.modsym

Creation of modular symbols spaces

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

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 $ T_2$ .

sage: M = ModularSymbols(23,2,base_ring=QQ)
sage: print M.T(2).charpoly('x').factor()
(x - 3) * (x^2 + x - 1)^2
sage: print 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
]

sage: M = ModularSymbols(23,2,base_ring=QuadraticField(5, 'sqrt5'))
sage: print M.T(2).charpoly('x').factor()
(x - 3) * (x - 1/2*sqrt5 + 1/2)^2 * (x + 1/2*sqrt5 + 1/2)^2
sage: print 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,
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,
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
]

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

Module-level Functions

ModularSymbols( [group=1], [weight=2], [sign=0], [base_ring=Rational Field], [use_cache=True])

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. This is ignored if group is a Dirichlet character.

First we create some spaces with trivial character:

sage: ModularSymbols(Gamma0(11),2).dimension()
3
sage: ModularSymbols(Gamma0(1),12).dimension()
3

If we give an integer N for the congruence subgroup, it defaults to $ \Gamma_0(N)$ :

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

We create some spaces for $ \Gamma_1(N)$ .

sage: ModularSymbols(Gamma1(13),2)
Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2 with sign
0 and 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]
sage: ModularSymbols(Gamma1(5),11).dimension()
20

We create a space for $ \Gamma_H(N)$ :

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, 13]
of weight 2 with sign 0 and 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, 13]
of weight 2 with sign 0 and over Rational Field
]

We create a space with character:

sage: e = (DirichletGroup(13).0)^2
sage: e.order()
6
sage: 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'); f
x^4 + (-zeta6 - 1)*x^3 + (-8*zeta6)*x^2 + (10*zeta6 - 5)*x + 21*zeta6 - 21
sage: f.factor()
(x - 2*zeta6 - 1) * (x - zeta6 - 2) * (x + zeta6 + 1)^2

More examples of spaces with character:

sage: e = DirichletGroup(5, RationalField()).gen(); e
[-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

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

We create a space of modular symbols with nontrivial character in characteristic 2.

sage: G = DirichletGroup(13,GF(4,'a')); G
Group of Dirichlet characters of modulus 13 over Finite Field in a of size
2^2
sage: e = G.list()[2]; e
[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 + 1     a]
[    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]

TESTS: We test use_cache:

sage: ModularSymbols_clear_cache()
sage: M = ModularSymbols(11,use_cache=False)
sage: sage.modular.modsym.modsym._cache
{}
sage: M = ModularSymbols(11,use_cache=True)
sage: sage.modular.modsym.modsym._cache
{(Congruence Subgroup Gamma0(11), 2, 0, Rational Field): <weakref at ...;
to 'ModularSymbolsAmbient_wt2_g0' at ...>}
sage: M is ModularSymbols(11,use_cache=True)
True
sage: M is ModularSymbols(11,use_cache=False)
False

ModularSymbols_clear_cache( )

Clear the global cache of modular symbols spaces.

sage: sage.modular.modsym.modsym.ModularSymbols_clear_cache()
sage: sage.modular.modsym.modsym._cache.keys()
[]
sage: M = ModularSymbols(6,2)
sage: sage.modular.modsym.modsym._cache.keys()
[(Congruence Subgroup Gamma0(6), 2, 0, Rational Field)]
sage: sage.modular.modsym.modsym.ModularSymbols_clear_cache()
sage: sage.modular.modsym.modsym._cache.keys()
[]

canonical_parameters( group, weight, sign, base_ring)

Return the canonically normalized parameters associated to a choice of group, weight, sign, and base_ring. That is, normalize each of these to be of the correct type, perform all appropriate type checking, etc.

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])
<type 'sage.rings.integer.Integer'>

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