-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
Non-homogeneous GradedModularFormElement multiplication and exponentiation is incorrect #35932
Comments
Is it possible for me to add labels (modular-forms) myself? Or can I not because I haven't made any contributions to the repo before? |
--- a/element.py
+++ b/element.py
@@ -3555,7 +3555,10 @@
f_mul = {}
for k_self in f_self.keys():
for k_other in f_other.keys():
- f_mul[k_self + k_other] = f_self[k_self]*f_other[k_other]
+ if k_self + k_other in f_mul:
+ f_mul[k_self + k_other] += f_self[k_self]*f_other[k_other]
+ else:
+ f_mul[k_self + k_other] = f_self[k_self]*f_other[k_other]
return GM(self.parent(), f_mul)
def _lmul_(self, c): with that I get |
@sheerluck Oops, I forgot to push the patch. I will push it to #35944 since it's relevant for that as well ![]() |
Hello, this is indeed a bug, thank you for reporting this and fixing it. I will review the patch once it is finished. |
sagemathgh-35978: Fix GradedModularFormElement multiplication Fix sagemath#35932 - incorrect multiplication for GradedModularFormElement. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. URL: sagemath#35978 Reported by: grhkm21 Reviewer(s): David Ayotte, grhkm21, Matthias Köppe
sagemathgh-35978: Fix GradedModularFormElement multiplication Fix sagemath#35932 - incorrect multiplication for GradedModularFormElement. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. URL: sagemath#35978 Reported by: grhkm21 Reviewer(s): David Ayotte, grhkm21, Matthias Köppe
sagemathgh-35944: Fix incorrect exponentiation of modular forms Fixes sagemath#35932 incorrect exponentation of modular forms. ~~This is also my first PR, please provide suggestions on any mistakes I made.~~ Not anymore lol URL: sagemath#35944 Reported by: grhkm21 Reviewer(s): David Ayotte, grhkm21
Steps To Reproduce
Code:
Expected Behavior
Well, it should start with
4 + ...
sinceE4 + M(1)
start with2 + ...
. In particular, it should beE4^2 + 2 * E4 + 1
instead of the current computedE4^2 + E4 + 1
.Actual Behavior
I found the buggy line, so I will just report it (and make a PR soon): On line 3558 of
sage.modular.modform
, i.e. inside the_mul_
method ofGradedModularFormElement
, it has the following incorrect line:It should be
+=
instead of=
, just like normal polynomial multiplication.Additional Information
No response
Environment
Checklist
The text was updated successfully, but these errors were encountered: