| 1 | r""" |
|---|
| 2 | Modular Forms for $\Gamma_0(N)$ over $\Q$. |
|---|
| 3 | |
|---|
| 4 | TESTS: |
|---|
| 5 | sage: m = ModularForms(Gamma0(389),6) |
|---|
| 6 | sage: loads(dumps(m)) == m |
|---|
| 7 | True |
|---|
| 8 | """ |
|---|
| 9 | |
|---|
| 10 | ######################################################################### |
|---|
| 11 | # Copyright (C) 2006 William Stein <wstein@gmail.com> |
|---|
| 12 | # |
|---|
| 13 | # Distributed under the terms of the GNU General Public License (GPL) |
|---|
| 14 | # |
|---|
| 15 | # http://www.gnu.org/licenses/ |
|---|
| 16 | ######################################################################### |
|---|
| 17 | |
|---|
| 18 | import sage.rings.all as rings |
|---|
| 19 | |
|---|
| 20 | import sage.modular.congroup as congroup |
|---|
| 21 | |
|---|
| 22 | import ambient |
|---|
| 23 | import cuspidal_submodule |
|---|
| 24 | import eisenstein_submodule |
|---|
| 25 | import submodule |
|---|
| 26 | |
|---|
| 27 | class ModularFormsAmbient_g0_Q(ambient.ModularFormsAmbient): |
|---|
| 28 | """ |
|---|
| 29 | A space of modular forms for Gamma_0(N) over QQ. |
|---|
| 30 | """ |
|---|
| 31 | def __init__(self, level, weight): |
|---|
| 32 | r""" |
|---|
| 33 | Create a space of modular symbols for $\Gamma_0(N)$ of given |
|---|
| 34 | weight defined over $\QQ$. |
|---|
| 35 | |
|---|
| 36 | EXAMPLES: |
|---|
| 37 | sage: m = ModularForms(Gamma0(11),4); m |
|---|
| 38 | Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) of weight 4 over Rational Field |
|---|
| 39 | sage: type(m) |
|---|
| 40 | <class 'sage.modular.modform.ambient_g0.ModularFormsAmbient_g0_Q'> |
|---|
| 41 | """ |
|---|
| 42 | ambient.ModularFormsAmbient.__init__(self, congroup.Gamma0(level), weight, rings.QQ) |
|---|
| 43 | |
|---|
| 44 | #################################################################### |
|---|
| 45 | # Computation of Special Submodules |
|---|
| 46 | #################################################################### |
|---|
| 47 | def cuspidal_submodule(self): |
|---|
| 48 | r""" |
|---|
| 49 | Return the cuspidal submodule of this space of modular forms for $\Gamma_0(N)$. |
|---|
| 50 | |
|---|
| 51 | EXAMPLES: |
|---|
| 52 | sage: m = ModularForms(Gamma0(33),4) |
|---|
| 53 | sage: s = m.cuspidal_submodule(); s |
|---|
| 54 | Cuspidal subspace of dimension 10 of Modular Forms space of dimension 14 for Congruence Subgroup Gamma0(33) of weight 4 over Rational Field |
|---|
| 55 | sage: type(s) |
|---|
| 56 | <class 'sage.modular.modform.cuspidal_submodule.CuspidalSubmodule_g0_Q'> |
|---|
| 57 | """ |
|---|
| 58 | try: |
|---|
| 59 | return self.__cuspidal_submodule |
|---|
| 60 | except AttributeError: |
|---|
| 61 | if self.level() == 1: |
|---|
| 62 | self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_level1_Q(self) |
|---|
| 63 | else: |
|---|
| 64 | self.__cuspidal_submodule = cuspidal_submodule.CuspidalSubmodule_g0_Q(self) |
|---|
| 65 | return self.__cuspidal_submodule |
|---|
| 66 | |
|---|
| 67 | def eisenstein_submodule(self): |
|---|
| 68 | r""" |
|---|
| 69 | Return the Eisenstein submodule of this space of modular forms for $\Gamma_0(N)$. |
|---|
| 70 | |
|---|
| 71 | EXAMPLES: |
|---|
| 72 | sage: m = ModularForms(Gamma0(389),6) |
|---|
| 73 | sage: m.eisenstein_submodule() |
|---|
| 74 | Eisenstein subspace of dimension 2 of Modular Forms space of dimension 163 for Congruence Subgroup Gamma0(389) of weight 6 over Rational Field |
|---|
| 75 | """ |
|---|
| 76 | try: |
|---|
| 77 | return self.__eisenstein_submodule |
|---|
| 78 | except AttributeError: |
|---|
| 79 | self.__eisenstein_submodule = eisenstein_submodule.EisensteinSubmodule_g0_Q(self) |
|---|
| 80 | return self.__eisenstein_submodule |
|---|