Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241852 views
1
from psage.modform.fourier_expansion_framework.gradedexpansions.gradedexpansion_ambient import GradedExpansionAmbient_abstract
2
r"""
3
A orthogonal modular form, namely a graded expansion providing additional features.
4
5
AUTHOR :
6
-- Martin Raum (2009 - 07 - 30) Initial version
7
"""
8
9
#===============================================================================
10
#
11
# Copyright (C) 2009 Martin Raum
12
#
13
# This program is free software; you can redistribute it and/or
14
# modify it under the terms of the GNU General Public License
15
# as published by the Free Software Foundation; either version 3
16
# of the License, or (at your option) any later version.
17
#
18
# This program is distributed in the hope that it will be useful,
19
# but WITHOUT ANY WARRANTY; without even the implied warranty of
20
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21
# General Public License for more details.
22
#
23
# You should have received a copy of the GNU General Public License
24
# along with this program; if not, see <http://www.gnu.org/licenses/>.
25
#
26
#===============================================================================
27
28
from psage.modform.fourier_expansion_framework.gradedexpansions.gradedexpansion_element import GradedExpansion_class, \
29
GradedExpansionVector_class, GradedExpansion_abstract
30
31
class ModularForm_abstract (object) :
32
"""
33
NOTE:
34
We assume that the deriving classes also derive (indirectly)
35
from GradedExpansion_abstract.
36
"""
37
38
def is_cusp_form(self) :
39
"""
40
Whether ``self`` is a cusp form or not.
41
42
OUTPUT:
43
A boolean.
44
45
TESTS::
46
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_ambient import *
47
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
48
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
49
sage: ma = ModularFormsAmbient( QQ, ModularFormTestType_scalar(), NNFilter(5) )
50
sage: ma.0.is_cusp_form()
51
Traceback (most recent call last):
52
...
53
NotImplementedError
54
"""
55
raise NotImplementedError
56
57
def is_eisenstein_series(self) :
58
"""
59
Whether ``self`` is an Eisenstein series or not.
60
61
OUTPUT:
62
A boolean.
63
64
TESTS::
65
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_ambient import *
66
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
67
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
68
sage: ma = ModularFormsAmbient( QQ, ModularFormTestType_scalar(), NNFilter(5) )
69
sage: ma.0.is_eisenstein_series()
70
Traceback (most recent call last):
71
...
72
NotImplementedError
73
"""
74
raise NotImplementedError
75
76
def _lmul_(self, c) :
77
"""
78
TESTS::
79
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_ambient import *
80
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
81
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
82
sage: ma = ModularFormsAmbient( QQ, ModularFormTestType_scalar(), NNFilter(5) )
83
sage: mavv = ModularFormsAmbient( QQ, ModularFormTestType_vectorvalued(), NNFilter(5) )
84
sage: (mavv.0 * ma.0).polynomial()
85
g1*v1
86
sage: (ma.0 * 5).polynomial()
87
5*g1
88
"""
89
## For vector valued forms we use an extended base ring, which
90
## needs conversion before we can multiply
91
if self.parent().type().is_vector_valued() :
92
return self.parent()._element_class( self.parent(),
93
c.polynomial().subs(c.parent().type()._hom_to_vector_valued(self.parent().relations().base_ring())) \
94
* self.polynomial() )
95
else :
96
return super(ModularForm_abstract, self)._lmul_(c)
97
98
def _rmul_(self, c) :
99
"""
100
TESTS::
101
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_ambient import *
102
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
103
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
104
sage: ma = ModularFormsAmbient( QQ, ModularFormTestType_scalar(), NNFilter(5) )
105
sage: mavv = ModularFormsAmbient( QQ, ModularFormTestType_vectorvalued(), NNFilter(5) )
106
sage: (ma.0 * mavv.0).polynomial()
107
g1*v1
108
sage: (5 * ma.0).polynomial()
109
5*g1
110
"""
111
## For vector valued forms we use an extended base ring, which
112
## needs conversion before we can multiply
113
if self.parent().type().is_vector_valued() :
114
return self.parent()._element_class( self.parent(),
115
c.polynomial().subs(c.parent().type()._hom_to_vector_valued(self.parent().relations().base_ring())) \
116
* self.polynomial() )
117
else :
118
return super(ModularForm_abstract, self)._rmul_(c)
119
120
class ModularForm_generic ( ModularForm_abstract, GradedExpansion_class ) :
121
weight = GradedExpansion_class.grading_index
122
123
124
class ModularFormVector_generic ( ModularForm_abstract, GradedExpansionVector_class ) :
125
weight = GradedExpansionVector_class.grading_index
126
127