Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241852 views
1
r"""
2
A functor creating rings of orthogonal modular forms.
3
4
AUTHOR :
5
-- Martin Raum (2009 - 07 - 30) Initial version
6
"""
7
8
#===============================================================================
9
#
10
# Copyright (C) 2009 Martin Raum
11
#
12
# This program is free software; you can redistribute it and/or
13
# modify it under the terms of the GNU General Public License
14
# as published by the Free Software Foundation; either version 3
15
# of the License, or (at your option) any later version.
16
#
17
# This program is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20
# General Public License for more details.
21
#
22
# You should have received a copy of the GNU General Public License
23
# along with this program; if not, see <http://www.gnu.org/licenses/>.
24
#
25
#===============================================================================
26
27
from sage.categories.rings import Rings
28
from sage.categories.pushout import ConstructionFunctor
29
30
class ModularFormsFunctor ( ConstructionFunctor ) :
31
32
rank = 10
33
34
def __init__(self, type, precision) :
35
"""
36
A functor constructing a ring or module of modular forms.
37
38
INPUT:
39
- ``type`` -- A type of modular forms.
40
- ``precision`` -- A precision.
41
42
NOTE:
43
This does not respect keyword and has to be extended as soon as subclasses of
44
ModularFormsAmbient_abstract demand for it.
45
46
TESTS::
47
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_functor import *
48
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
49
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
50
sage: F = ModularFormsFunctor( ModularFormTestType_scalar(), NNFilter(5) )
51
"""
52
self.__type = type
53
self.__precision = precision
54
55
ConstructionFunctor.__init__(self, Rings(), Rings())
56
57
def __call__(self, A) :
58
"""
59
INPUT:
60
- `A` -- A ring.
61
62
TESTS::
63
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_functor import *
64
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
65
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
66
sage: F = ModularFormsFunctor( ModularFormTestType_scalar(), NNFilter(5) )
67
sage: F(QQ)
68
Graded expansion ring with generators g1, g2, g3, g4, g5
69
"""
70
from modularform_ambient import ModularFormsAmbient
71
72
return ModularFormsAmbient(A, self.__type, self.__precision)
73
74
def merge(self, other) :
75
"""
76
TESTS::
77
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_functor import *
78
sage: from psage.modform.fourier_expansion_framework.modularforms.modularform_testtype import *
79
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
80
sage: F = ModularFormsFunctor( ModularFormTestType_scalar(), NNFilter(5) )
81
sage: G = ModularFormsFunctor( ModularFormTestType_vectorvalued(), NNFilter(5) )
82
sage: F.merge(F) is F
83
True
84
sage: F.merge(G) is None
85
True
86
sage: G.merge(F) is G
87
True
88
"""
89
if type(other) != type(self) :
90
return None
91
92
if self.__type == other.__type and \
93
self.__precision == other.__precision :
94
return self
95
else :
96
try :
97
if other.__type.vector_valued() == self.__type and \
98
self.__precision == other.__precision :
99
return self
100
except AttributeError, NotImplementedError :
101
return None
102
103
return None
104
105