Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GradedModularFormElement multiplication #35978

Merged
merged 5 commits into from
Oct 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/sage/modular/modform/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -2783,7 +2783,7 @@ def _compute_element(self):
"""
M = self.parent()
S = M.cuspidal_subspace()
# return S.find_in_space( self.__E.q_expansion( S.q_expansion_basis()[0].prec() ) ) + [0] * ( M.dimension() - S.dimension() )
# return S.find_in_space( self.__E.q_expansion( S.q_expansion_basis()[0].prec() ) ) + [0] * ( M.dimension() - S.dimension() )
return vector(S.find_in_space(self.__E.q_expansion(S.sturm_bound())) + [0] * (M.dimension() - S.dimension()))

def _compute_q_expansion(self, prec):
Expand Down Expand Up @@ -3553,16 +3553,17 @@ def _mul_(self, other):
sage: (F4 + M(1))^2
4 + 960*q + 66240*q^2 + 1063680*q^3 + 7961280*q^4 + 37560960*q^5 + O(q^6)
"""
from collections import defaultdict

GM = self.__class__
f_self = self._forms_dictionary
f_other = other._forms_dictionary
f_mul = {}
f_mul = defaultdict(int)

for k_self in f_self.keys():
for k_other in f_other.keys():
try:
f_mul[k_self + k_other] += f_self[k_self]*f_other[k_other]
except KeyError:
f_mul[k_self + k_other] = f_self[k_self]*f_other[k_other]
f_mul[k_self + k_other] += f_self[k_self] * f_other[k_other]

return GM(self.parent(), f_mul)

def _lmul_(self, c):
Expand Down