Modular forms with character#

EXAMPLES:

sage: eps = DirichletGroup(13).0
sage: M = ModularForms(eps^2, 2); M
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 6 and degree 2

sage: S = M.cuspidal_submodule(); S
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3,
 character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2
sage: S.modular_symbols()
Modular Symbols subspace of dimension 2 of
 Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6],
  sign 0, over Cyclotomic Field of order 6 and degree 2
>>> from sage.all import *
>>> eps = DirichletGroup(Integer(13)).gen(0)
>>> M = ModularForms(eps**Integer(2), Integer(2)); M
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 6 and degree 2

>>> S = M.cuspidal_submodule(); S
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3,
 character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2
>>> S.modular_symbols()
Modular Symbols subspace of dimension 2 of
 Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6],
  sign 0, over Cyclotomic Field of order 6 and degree 2

We create a spaces associated to Dirichlet characters of modulus 225:

sage: e = DirichletGroup(225).0
sage: e.order()
6
sage: e.base_ring()
Cyclotomic Field of order 60 and degree 16
sage: M = ModularForms(e,3)
>>> from sage.all import *
>>> e = DirichletGroup(Integer(225)).gen(0)
>>> e.order()
6
>>> e.base_ring()
Cyclotomic Field of order 60 and degree 16
>>> M = ModularForms(e,Integer(3))

Notice that the base ring is “minimized”:

sage: M
Modular Forms space of dimension 66, character [zeta6, 1] and weight 3
over Cyclotomic Field of order 6 and degree 2
>>> from sage.all import *
>>> M
Modular Forms space of dimension 66, character [zeta6, 1] and weight 3
over Cyclotomic Field of order 6 and degree 2

If we don’t want the base ring to change, we can explicitly specify it:

sage: ModularForms(e, 3, e.base_ring())
Modular Forms space of dimension 66, character [zeta6, 1] and weight 3
over Cyclotomic Field of order 60 and degree 16
>>> from sage.all import *
>>> ModularForms(e, Integer(3), e.base_ring())
Modular Forms space of dimension 66, character [zeta6, 1] and weight 3
over Cyclotomic Field of order 60 and degree 16

Next we create a space associated to a Dirichlet character of order 20:

sage: e = DirichletGroup(225).1
sage: e.order()
20
sage: e.base_ring()
Cyclotomic Field of order 60 and degree 16
sage: M = ModularForms(e,17); M
Modular Forms space of dimension 484, character [1, zeta20] and
weight 17 over Cyclotomic Field of order 20 and degree 8
>>> from sage.all import *
>>> e = DirichletGroup(Integer(225)).gen(1)
>>> e.order()
20
>>> e.base_ring()
Cyclotomic Field of order 60 and degree 16
>>> M = ModularForms(e,Integer(17)); M
Modular Forms space of dimension 484, character [1, zeta20] and
weight 17 over Cyclotomic Field of order 20 and degree 8

We compute the Eisenstein subspace, which is fast even though the dimension of the space is large (since an explicit basis of \(q\)-expansions has not been computed yet).

sage: M.eisenstein_submodule()
Eisenstein subspace of dimension 8 of Modular Forms space of
dimension 484, character [1, zeta20] and weight 17 over
Cyclotomic Field of order 20 and degree 8

sage: M.cuspidal_submodule()
Cuspidal subspace of dimension 476 of Modular Forms space of dimension 484,
character [1, zeta20] and weight 17 over Cyclotomic Field of order 20 and degree 8
>>> from sage.all import *
>>> M.eisenstein_submodule()
Eisenstein subspace of dimension 8 of Modular Forms space of
dimension 484, character [1, zeta20] and weight 17 over
Cyclotomic Field of order 20 and degree 8

>>> M.cuspidal_submodule()
Cuspidal subspace of dimension 476 of Modular Forms space of dimension 484,
character [1, zeta20] and weight 17 over Cyclotomic Field of order 20 and degree 8
class sage.modular.modform.ambient_eps.ModularFormsAmbient_eps(character, weight=2, base_ring=None, eis_only=False)[source]#

Bases: ModularFormsAmbient

A space of modular forms with character.

change_ring(base_ring)[source]#

Return space with same defining parameters as this ambient space of modular symbols, but defined over a different base ring.

EXAMPLES:

sage: m = ModularForms(DirichletGroup(13).0^2,2); m
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 6 and degree 2
sage: m.change_ring(CyclotomicField(12))
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 12 and degree 4
>>> from sage.all import *
>>> m = ModularForms(DirichletGroup(Integer(13)).gen(0)**Integer(2),Integer(2)); m
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 6 and degree 2
>>> m.change_ring(CyclotomicField(Integer(12)))
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 12 and degree 4

It must be possible to change the ring of the underlying Dirichlet character:

sage: m.change_ring(QQ)
Traceback (most recent call last):
...
TypeError: Unable to coerce zeta6 to a rational
>>> from sage.all import *
>>> m.change_ring(QQ)
Traceback (most recent call last):
...
TypeError: Unable to coerce zeta6 to a rational
cuspidal_submodule()[source]#

Return the cuspidal submodule of this ambient space of modular forms.

EXAMPLES:

sage: eps = DirichletGroup(4).0
sage: M = ModularForms(eps, 5); M
Modular Forms space of dimension 3, character [-1] and weight 5
 over Rational Field
sage: M.cuspidal_submodule()
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3,
 character [-1] and weight 5 over Rational Field
>>> from sage.all import *
>>> eps = DirichletGroup(Integer(4)).gen(0)
>>> M = ModularForms(eps, Integer(5)); M
Modular Forms space of dimension 3, character [-1] and weight 5
 over Rational Field
>>> M.cuspidal_submodule()
Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3,
 character [-1] and weight 5 over Rational Field
eisenstein_submodule()[source]#

Return the submodule of this ambient module with character that is spanned by Eisenstein series. This is the Hecke stable complement of the cuspidal submodule.

EXAMPLES:

sage: m = ModularForms(DirichletGroup(13).0^2,2); m
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 6 and degree 2
sage: m.eisenstein_submodule()
Eisenstein subspace of dimension 2 of Modular Forms space of dimension 3,
 character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2
>>> from sage.all import *
>>> m = ModularForms(DirichletGroup(Integer(13)).gen(0)**Integer(2),Integer(2)); m
Modular Forms space of dimension 3, character [zeta6] and weight 2 over
 Cyclotomic Field of order 6 and degree 2
>>> m.eisenstein_submodule()
Eisenstein subspace of dimension 2 of Modular Forms space of dimension 3,
 character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2
hecke_module_of_level(N)[source]#

Return the Hecke module of level N corresponding to self, which is the domain or codomain of a degeneracy map from self. Here N must be either a divisor or a multiple of the level of self, and a multiple of the conductor of the character of self.

EXAMPLES:

sage: M = ModularForms(DirichletGroup(15).0, 3); M.character().conductor()
3
sage: M.hecke_module_of_level(3)
Modular Forms space of dimension 2, character [-1] and weight 3
 over Rational Field
sage: M.hecke_module_of_level(5)
Traceback (most recent call last):
...
ValueError: conductor(=3) must divide M(=5)
sage: M.hecke_module_of_level(30)
Modular Forms space of dimension 16, character [-1, 1] and weight 3
 over Rational Field
>>> from sage.all import *
>>> M = ModularForms(DirichletGroup(Integer(15)).gen(0), Integer(3)); M.character().conductor()
3
>>> M.hecke_module_of_level(Integer(3))
Modular Forms space of dimension 2, character [-1] and weight 3
 over Rational Field
>>> M.hecke_module_of_level(Integer(5))
Traceback (most recent call last):
...
ValueError: conductor(=3) must divide M(=5)
>>> M.hecke_module_of_level(Integer(30))
Modular Forms space of dimension 16, character [-1, 1] and weight 3
 over Rational Field
modular_symbols(sign=0)[source]#

Return corresponding space of modular symbols with given sign.

EXAMPLES:

sage: eps = DirichletGroup(13).0
sage: M = ModularForms(eps^2, 2)
sage: M.modular_symbols()
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.modular_symbols(1)
Modular Symbols space of dimension 3 and level 13, weight 2,
 character [zeta6], sign 1, over Cyclotomic Field of order 6 and degree 2
sage: M.modular_symbols(-1)
Modular Symbols space of dimension 1 and level 13, weight 2,
 character [zeta6], sign -1, over Cyclotomic Field of order 6 and degree 2
sage: M.modular_symbols(2)
Traceback (most recent call last):
...
ValueError: sign must be -1, 0, or 1
>>> from sage.all import *
>>> eps = DirichletGroup(Integer(13)).gen(0)
>>> M = ModularForms(eps**Integer(2), Integer(2))
>>> M.modular_symbols()
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.modular_symbols(Integer(1))
Modular Symbols space of dimension 3 and level 13, weight 2,
 character [zeta6], sign 1, over Cyclotomic Field of order 6 and degree 2
>>> M.modular_symbols(-Integer(1))
Modular Symbols space of dimension 1 and level 13, weight 2,
 character [zeta6], sign -1, over Cyclotomic Field of order 6 and degree 2
>>> M.modular_symbols(Integer(2))
Traceback (most recent call last):
...
ValueError: sign must be -1, 0, or 1