Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241849 views
1
r"""
2
Interface for elements which provide a Fourier expansion.
3
4
AUTHOR :
5
-- Martin Raum (2009 - 08 - 03) 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
class FourierExpansionWrapper :
28
r"""
29
Abstract class for elements, which do not represent Fourier
30
expansions on their own, but encapsulate one.
31
32
SEE:
33
:class:~`fourier_expansion_framework.gradedexpansions.GradedExpansion_class`.
34
"""
35
36
def fourier_expansion(self, cache = True) :
37
r"""
38
The Fourier expansion which is associated with ``self``.
39
40
INPUT:
41
- ``cache`` -- A boolean (default: ``True``); If ``True`` the return value
42
will be cached.
43
44
OUTPUT:
45
A (equivariant) monoid power series.
46
47
NOTE:
48
The parent has to implement the function ``_fourier_expansion_of_element``.
49
50
TESTS::
51
sage: from psage.modform.fourier_expansion_framework.gradedexpansions import *
52
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries import *
53
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
54
sage: emps = EquivariantMonoidPowerSeriesRing(NNMonoid(True), TrivialCharacterMonoid("1", ZZ), TrivialRepresentation("1", ZZ))
55
sage: em = ExpansionModule(Sequence([emps.one_element().truncate(3), emps.one_element(), emps.one_element()]))
56
sage: h = em([1,2,-3])
57
sage: fe = h.fourier_expansion()
58
"""
59
try :
60
return self.__fourier_expansion
61
except AttributeError :
62
if cache :
63
self.__fourier_expansion = \
64
self.parent()._fourier_expansion_of_element(self)
65
return self.__fourier_expansion
66
else :
67
return self.parent()._fourier_expansion_of_element(self)
68
69
def _set_fourier_expansion(self, expansion ) :
70
r"""
71
Set the cache for the Fourier expansion to an given monoid power series.
72
73
INPUT:
74
- ``expansion`` -- A (equivariant) monoid power series.
75
76
OUTPUT:
77
``None``
78
79
TESTS::
80
sage: from psage.modform.fourier_expansion_framework.gradedexpansions import *
81
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries import *
82
sage: from psage.modform.fourier_expansion_framework.monoidpowerseries.monoidpowerseries_basicmonoids import *
83
sage: emps = EquivariantMonoidPowerSeriesRing(NNMonoid(True), TrivialCharacterMonoid("1", ZZ), TrivialRepresentation("1", ZZ))
84
sage: em = ExpansionModule(Sequence([emps.one_element().truncate(3), emps.one_element(), emps.one_element()]))
85
sage: h = em([1,2,5])
86
sage: fe = h.fourier_expansion()
87
sage: h = em([1,2,0])
88
sage: h._set_fourier_expansion(fe)
89
sage: h.fourier_expansion() == fe
90
True
91
"""
92
self.__fourier_expansion = expansion
93
94