Skip to content

Commit 0c873c6

Browse files
author
Release Manager
committed
gh-35029: Implement basis_of_weight for rings of quasimodular forms <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes #1234" use "Introduce new method to calculate 1+1" --> ### 📚 Description <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If it resolves an open issue, please link to the issue here. For example "Closes #1337" --> This PR implements the method `QuasiModularForms.basis_of_weight(k)`. It returns a list of quasimodular forms which generate the space of weight k. Some examples: ``` sage: QM = QuasiModularForms(1) sage: QM.basis_of_weight(12) [q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6), 1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + 3199218815520/691*q^5 + O(q^6), 1 - 288*q - 129168*q^2 - 1927296*q^3 + 65152656*q^4 + 1535768640*q^5 + O(q^6), 1 + 432*q + 39312*q^2 - 1711296*q^3 - 14159664*q^4 + 317412000*q^5 + O(q^6), 1 - 576*q + 21168*q^2 + 308736*q^3 - 15034608*q^4 - 39208320*q^5 + O(q^6), 1 + 144*q - 17712*q^2 + 524736*q^3 - 2279088*q^4 - 79760160*q^5 + O(q^6), 1 - 144*q + 8208*q^2 - 225216*q^3 + 2634192*q^4 + 1488672*q^5 + O(q^6)] sage: QM = QuasiModularForms(Gamma1(3)) sage: QM.basis_of_weight(3) [1 + 54*q^2 + 72*q^3 + 432*q^5 + O(q^6), q + 3*q^2 + 9*q^3 + 13*q^4 + 24*q^5 + O(q^6)] sage: QM.basis_of_weight(5) [1 - 90*q^2 - 240*q^3 - 3744*q^5 + O(q^6), q + 15*q^2 + 81*q^3 + 241*q^4 + 624*q^5 + O(q^6), 1 - 24*q - 18*q^2 - 1320*q^3 - 5784*q^4 - 10080*q^5 + O(q^6), q - 21*q^2 - 135*q^3 - 515*q^4 - 1392*q^5 + O(q^6)] ``` CC: @videlec ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [ ] I have linked an issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open pull requests that this PR logically depends on --> <!-- - #xyz: short description why this is a dependency - #abc: ... --> URL: #35029 Reported by: David Ayotte Reviewer(s): David Ayotte, grhkm21
2 parents ccc11b6 + 4df388b commit 0c873c6

File tree

1 file changed

+46
-0
lines changed
  • src/sage/modular/quasimodform

1 file changed

+46
-0
lines changed

src/sage/modular/quasimodform/ring.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,3 +779,49 @@ def from_polynomial(self, polynomial):
779779
raise ValueError("the number of variables (%s) of the given polynomial cannot exceed the number of generators (%s) of the quasimodular forms ring" % (nb_var, self.ngens()))
780780
gens_dict = {poly_parent.gen(i):self.gen(i) for i in range(0, nb_var)}
781781
return self(polynomial.subs(gens_dict))
782+
783+
def basis_of_weight(self, weight):
784+
r"""
785+
Return a basis of elements generating the subspace of the given
786+
weight.
787+
788+
INPUT:
789+
790+
- ``weight`` (integer) -- the weight of the subspace
791+
792+
OUTPUT:
793+
794+
A list of quasimodular forms of the given weight.
795+
796+
EXAMPLES::
797+
798+
sage: QM = QuasiModularForms(1)
799+
sage: QM.basis_of_weight(12)
800+
[q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6),
801+
1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + 3199218815520/691*q^5 + O(q^6),
802+
1 - 288*q - 129168*q^2 - 1927296*q^3 + 65152656*q^4 + 1535768640*q^5 + O(q^6),
803+
1 + 432*q + 39312*q^2 - 1711296*q^3 - 14159664*q^4 + 317412000*q^5 + O(q^6),
804+
1 - 576*q + 21168*q^2 + 308736*q^3 - 15034608*q^4 - 39208320*q^5 + O(q^6),
805+
1 + 144*q - 17712*q^2 + 524736*q^3 - 2279088*q^4 - 79760160*q^5 + O(q^6),
806+
1 - 144*q + 8208*q^2 - 225216*q^3 + 2634192*q^4 + 1488672*q^5 + O(q^6)]
807+
sage: QM = QuasiModularForms(Gamma1(3))
808+
sage: QM.basis_of_weight(3)
809+
[1 + 54*q^2 + 72*q^3 + 432*q^5 + O(q^6),
810+
q + 3*q^2 + 9*q^3 + 13*q^4 + 24*q^5 + O(q^6)]
811+
sage: QM.basis_of_weight(5)
812+
[1 - 90*q^2 - 240*q^3 - 3744*q^5 + O(q^6),
813+
q + 15*q^2 + 81*q^3 + 241*q^4 + 624*q^5 + O(q^6),
814+
1 - 24*q - 18*q^2 - 1320*q^3 - 5784*q^4 - 10080*q^5 + O(q^6),
815+
q - 21*q^2 - 135*q^3 - 515*q^4 - 1392*q^5 + O(q^6)]
816+
"""
817+
basis = []
818+
E2 = self.weight_2_eisenstein_series()
819+
M = self.__modular_forms_subring
820+
E2_pow = self.one()
821+
for j in range(weight//2):
822+
basis += [f*E2_pow for f
823+
in M.modular_forms_of_weight(weight - 2*j).basis()]
824+
E2_pow *= E2
825+
if not weight%2:
826+
basis.append(E2_pow)
827+
return basis

0 commit comments

Comments
 (0)