#31512 closed enhancement (fixed)

Implementation of the graded quasimodular forms ring

Reported by: David Ayotte Owned by: David Ayotte
Priority: minor Milestone: sage-9.5
Component: modular forms Keywords: quasimodular-forms gsoc2021
Cc: Samuel Lelièvre, Vincent Delecroix Merged in:
Authors: David Ayotte Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: 20e633e (Commits, GitHub, GitLab) Commit: 20e633e7622fbc3097458b6c860772f21fba19e0
Dependencies: #31559, #32135 Stopgaps:

Status badges

Description (last modified by Vincent Delecroix)

The goal of this ticket is to implement the graded ring of quasimodular forms. More precisely, the goal is to first implement a class named QuasiModularFormsRing with similar methods and features as the class ModularFormsRing (though see #31559).

This ticket is part of #31560

Change History (45)

comment:1 Changed 21 months ago by David Ayotte

Branch: u/gh-DavidAyotte/implementation_of_the_graded_quasimodular_forms_ring

comment:2 Changed 21 months ago by David Ayotte

Commit: 7b029adc62b4b8702394638170cff1577e20d8a4
Owner: set to David Ayotte

New commits:

7b029adInitial implementation of quasimodular forms

comment:3 Changed 21 months ago by git

Commit: 7b029adc62b4b8702394638170cff1577e20d8a4d9940aa9be03fca1634bf95d440086eea80edd3e

Branch pushed to git repo; I updated commit sha1. New commits:

d9940aaFixed some typos and syntax in the documentation

comment:4 Changed 21 months ago by Samuel Lelièvre

Cc: Samuel Lelièvre added
Description: modified (diff)

comment:5 Changed 21 months ago by Vincent Delecroix

Hi David,

Great start.

Let us stick to SL(2,Z) in this ticket. Further improvements (other congruence subgroups, Bloch-Okounkov brackets should be reserved for other tickets).

Some concrete remarks

  • QuasiModularFormsRing could simply be QuasiModularForms
  • The main class should inherit from Parent and the category should be properly initialized, see https://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
  • The objective is to manipulate exact formal objects. Not approximate q-series. The following operations should be available on the elements
    • equality tests between two qm-forms
    • decomposition of a qm-form with respect to the grading (ie by level)
    • testing modularity
    • computing the q-series expansion of a qm-form (arbitrary precision)
    • multiplication by a modular form (maybe the simplest to achieve this is to define qm-forms as an algebra over modular forms?)
    • (further ticket) computing algebraic or differential equations (for that purpose it is necessary to have formal derivatives, not the derivative of the q-expansion)
    • (further ticket) asymptotics of coefficients
  • The following methods should be available on the parent (the algebra itself)
    • vector space basis of a given graded component
    • basis and generators up to modular forms

comment:6 Changed 21 months ago by git

Commit: d9940aa9be03fca1634bf95d440086eea80edd3e9fa1397adf5b3412c1974551f1ebe8d564892d38

Branch pushed to git repo; I updated commit sha1. New commits:

9fa1397Changed the name of the main class to QuasiModularForms. Added inheritance from Parent and UniqueRepresentation. Implemented category framework to the main class

comment:7 in reply to:  6 Changed 21 months ago by David Ayotte

Replying to git:

Branch pushed to git repo; I updated commit sha1. New commits:

9fa1397Changed the name of the main class to QuasiModularForms. Added inheritance from Parent and UniqueRepresentation. Implemented category framework to the main class

I just realized that there are some inconsistencies in the code of that commit. They will be fixed this week.

comment:8 Changed 21 months ago by git

Commit: 9fa1397adf5b3412c1974551f1ebe8d564892d3813a244107883a9a6d318ec4b1e0cad7f90158357

Branch pushed to git repo; I updated commit sha1. New commits:

13a2441Implementation of QuasiModularFormsElement class. Fixed some inconsistencies in the code. The default precision is now 6 (to be consistent with classical ModularForms)

comment:9 Changed 21 months ago by Vincent Delecroix

Description: modified (diff)
Keywords: quasimodular-forms added; graded quasimodular forms removed
Milestone: sage-wishlistsage-9.4

comment:10 Changed 18 months ago by git

Commit: 13a244107883a9a6d318ec4b1e0cad7f901583578433a5abbe46b1c3a6859795288955a2569b79cf

Branch pushed to git repo; I updated commit sha1. New commits:

0ef06e3Initial implementation of quasimodular forms
39642c2Fixed some typos and syntax in the documentation
33d0897Changed the name of the main class to QuasiModularForms. Added inheritance from Parent and UniqueRepresentation. Implemented category framework to the main class
f6d57bfImplementation of QuasiModularFormsElement class. Fixed some inconsistencies in the code. The default precision is now 6 (to be consistent with classical ModularForms)
8433a5aMerge branch 'u/gh-DavidAyotte/implementation_of_the_graded_quasimodular_forms_ring' of trac.sagemath.org:sage into t/31512/implementation_of_the_graded_quasimodular_forms_ring

comment:11 Changed 17 months ago by Matthias Köppe

Milestone: sage-9.4sage-9.5

comment:12 Changed 17 months ago by git

Commit: 8433a5abbe46b1c3a6859795288955a2569b79cff9217247dfd73752b1e7beeda1c6e1d1dc79dd0e

Branch pushed to git repo; I updated commit sha1. New commits:

f921724Merge branch 'develop' into t/31512/implementation_of_the_graded_quasimodular_forms_ring

comment:13 Changed 16 months ago by git

Commit: f9217247dfd73752b1e7beeda1c6e1d1dc79dd0e45f179173dc573a488a9dcc253cdd4f50f0ee006

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

c4595c1Merge branch 'gamma1_modform_conversion' into t/31559/make_modularformrings_manipulate_formal_objects
a6c745dsmall fixes
906b8abfixes: pyflakes, failing doctest in find_generators
523c7b0fix some doctring
7dbaf4efix indentation error
5887973fix docstring, changed some syntax, removed _rmul_, add negative weight checker for __getitem__, fix weight of zero element bug
7fdca22changed _repr_ method of ModularFormsRing, added TestSuite in doctests, added some_elements method, fixed conversion bug
1b9332emoved sage.modular.modform.find_generators.py in sage.rings, attempt at making decrecation work (without success)
4305360Merge branch 't/31559/make_modularformrings_manipulate_formal_objects' into t/31512/implementation_of_the_graded_quasimodular_forms_ring
45f1791Major changes: Implementation of _add_, _mul_, _lmul_, __neg__. Added Docstring. Implemented conversion. Added generators methods.

comment:14 Changed 16 months ago by David Ayotte

Dependencies: #31559

comment:15 Changed 16 months ago by git

Commit: 45f179173dc573a488a9dcc253cdd4f50f0ee006c36dafd0d3ff085ba2ab80eebdef29999add4882

Branch pushed to git repo; I updated commit sha1. New commits:

68509f9deprecation, added missing newline
2e78c45revert to commit 7fdca22
99f8ab5renamed find_generators.py to ring.py, added deprecation
62a9484docstring updates, fixed weights_list method for zero element
ed90b5afixed deprecation, added deprecation for find_generators and basis_for_modform_space
d489a1fmoved deprecation doctests inside find_generators, fixed docstrings
bf19eecadded example info for GradedModularFormElement class, moved some doctests inside the __init__ method (for coverage)
2e49907fix docbuild error
3afb0a1Merge branch 't/31559/make_modularformrings_manipulate_formal_objects' into t/31512/implementation_of_the_graded_quasimodular_forms_ring
c36dafdmoved QuasiModularFormsRing into ring.py, moved QuasiModularFormElement into element.py, fixed conversion error

comment:16 Changed 16 months ago by git

Commit: c36dafd0d3ff085ba2ab80eebdef29999add4882c59eb13023e00261eb86b638dd36891d567b198d

Branch pushed to git repo; I updated commit sha1. New commits:

c59eb13new methods: one, zero, some_elements, is_one, is_zero, __bool__

comment:17 Changed 16 months ago by git

Commit: c59eb13023e00261eb86b638dd36891d567b198d24ada0c219fde5609ba20a18bdf94ff180b361fd

Branch pushed to git repo; I updated commit sha1. New commits:

24ada0cadded docstring and tests, small fixes, added modular_forms_of_weight and quasimodular_forms_of_weight methods

comment:18 Changed 16 months ago by git

Commit: 24ada0c219fde5609ba20a18bdf94ff180b361fda53d988af11a1e3202beee36f3bc2918d5a3997d

Branch pushed to git repo; I updated commit sha1. New commits:

a53d988New methods: is_graded_modular_forms, is_modular_forms. Added doctests to _element_constructor_. Multiple small docstring fix (PEP8).

comment:19 Changed 16 months ago by git

Commit: a53d988af11a1e3202beee36f3bc2918d5a3997d9304a663232f0f0515856b886043dca14b663ff6

Branch pushed to git repo; I updated commit sha1. New commits:

dd6e659Initial commit
5bbc4f4initial implementation of the method from_polynomial
b2517ecupdated _generators_variables_dictionnary
461d5f6implementation of to_polynomial
1e6a262make polynomial_ring not private, assigned degrees to the variables
7d8b20afix docstring of to_polynomial
e4a974ffix docstring, removed _weights_of_gemerators, small code syntax changes
1038d68rename find_generator.py into ring.py
d991d19merge ticket 31559 'Make ModularFormRings manipulate formal objects' and fix conflicts
9304a66Merge ticket 32135 'Implement to_polynomial and from_polynomial methods for ModularFormsRing' into t/31512/implementation_of_the_graded_quasimodular_forms_ring

comment:20 Changed 16 months ago by David Ayotte

Dependencies: #31559#31559, #32135

comment:21 Changed 16 months ago by git

Commit: 9304a663232f0f0515856b886043dca14b663ff6526c8849f8186693d615ed579e2d0e91ab4b7546

Branch pushed to git repo; I updated commit sha1. New commits:

526c884fix constant polynomials bug

comment:22 Changed 16 months ago by git

Commit: 526c8849f8186693d615ed579e2d0e91ab4b75466ab4ca9a1332e7d34ca788134a42da29e1049dba

Branch pushed to git repo; I updated commit sha1. New commits:

6ab4ca9fix some docstring. small fix.

comment:23 Changed 16 months ago by David Ayotte

Status: newneeds_review

comment:24 Changed 16 months ago by git

Commit: 6ab4ca9a1332e7d34ca788134a42da29e1049dba6984a26e74439171831704266b8d47a1c8c0b8dd

Branch pushed to git repo; I updated commit sha1. New commits:

6984a26fix failing doctests, pyflakes, block, tiple colon

comment:25 Changed 16 months ago by Vincent Delecroix

Reviewers: Vincent Delecroix
Status: needs_reviewneeds_work

This

        if not self._polynomial.degree():
            return self._polynomial[0].is_modular_form()
        else:
            return False

is equivalent to

return not self._polynomial.degree() and self._polynomial[0].is_modular_form()

Why do you store base ring in the element (attribute __base_ring)? This would better be accessed through the parent. Note that ModuleElement has a default implementation of the method base_ring as

def base_ring(self):
    return self._parent.base_ring()

Also, since you inherit from Parent, there is already a slot dedicated to that. Namely _base. This is initialized inside the constructor

Parent.__init__(self, base=..., category=...)

So : remove __base_ring from both QuasiModularForms and QuasiModularFormsElement. (I believe the same could be done for modular forms. But leave that to another ticket)

comment:26 Changed 16 months ago by git

Commit: 6984a26e74439171831704266b8d47a1c8c0b8dd5a373a38666a69425f68ee716ddff1a7ca61e588

Branch pushed to git repo; I updated commit sha1. New commits:

5a373a3remove __base_ring attributes and method, changed some syntax

comment:27 Changed 16 months ago by David Ayotte

Status: needs_workneeds_review

Thanks a lot! I had forgotten about the base ring attribute after implementing the parent/element framework. I will open a ticket to fix this for the class ModularFormsRing.

comment:28 Changed 16 months ago by Vincent Delecroix

Why is it only implemented for SL(2,Z)? The isomorphism QM = M[E2] is valid in general.

comment:29 Changed 16 months ago by Vincent Delecroix

typo: def weigt_2_eisenstein_series(self): (missing a h)

comment:30 in reply to:  28 Changed 16 months ago by David Ayotte

Replying to vdelecroix:

Why is it only implemented for SL(2,Z)? The isomorphism QM = M[E2] is valid in general.

I will check if this doesn't break anything, but I mostly stick to the case of SL2Z because of comment:5. But thanks for reminding me this isomorphism, it should not be a problem.

comment:31 Changed 16 months ago by Vincent Delecroix

Better to switch DAVID AYOTTE -> David Ayotte

comment:32 Changed 16 months ago by Vincent Delecroix

Maybe we made a mistake, but the initialization from polynomial is confusing. The reason is that both E2 * E4 - 3 * E2^2 and -1/24 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 are polynomials.

comment:33 in reply to:  32 Changed 16 months ago by David Ayotte

Replying to vdelecroix:

Maybe we made a mistake, but the initialization from polynomial is confusing. The reason is that both E2 * E4 - 3 * E2^2 and -1/24 + q + 3*q^2 + 4*q^3 + 7*q^4 + 6*q^5 are polynomials.

This is in fact really important. To fix this confusion, my idea would be to give more examples and explanations in the doc. Do you have an other idea to fix this?

comment:34 Changed 16 months ago by Vincent Delecroix

In the case of ModularFormsRing._element_constructor_, when the input is a polynomial the code calls from_polynomial. This is very different from what is happening with the quasimodular forms.

comment:35 in reply to:  34 ; Changed 16 months ago by David Ayotte

Replying to vdelecroix:

In the case of ModularFormsRing._element_constructor_, when the input is a polynomial the code calls from_polynomial. This is very different from what is happening with the quasimodular forms.

Ok, so maybe the element constructor of ModularFormsRing should not call from_polynomial. What do you think?

comment:36 in reply to:  35 Changed 16 months ago by Vincent Delecroix

Replying to gh-DavidAyotte:

Replying to vdelecroix:

In the case of ModularFormsRing._element_constructor_, when the input is a polynomial the code calls from_polynomial. This is very different from what is happening with the quasimodular forms.

Ok, so maybe the element constructor of ModularFormsRing should not call from_polynomial. What do you think?

I think it would be fine to allow both. It just needs more parsing of the input

  • univariate polynomial ring with generator q -> q-expansion (raise a NotImplementedError for now)
  • multivariate polynomial ring with rational or finite field coefficients -> call from_polynomial as it is now.

comment:37 Changed 16 months ago by git

Commit: 5a373a38666a69425f68ee716ddff1a7ca61e5886884d6d2a6a1e5b5f498749d5a426f3927884c80

Branch pushed to git repo; I updated commit sha1. New commits:

600fdfffix typos
77e8a3dadd congruence subgroups support
6884d6dadd input parsing for q-expansions in _element_constructor_

comment:38 Changed 15 months ago by git

Commit: 6884d6d2a6a1e5b5f498749d5a426f3927884c8031432ae6112e7a31873906ddcf7fb49729de789e

Branch pushed to git repo; I updated commit sha1. New commits:

31432aefixed input parsing for q-expansion, added documentation to reference manual, added a bibliographical reference

comment:39 Changed 15 months ago by git

Commit: 31432ae6112e7a31873906ddcf7fb49729de789e377d88bbb7f7af348c2a63b20a9bb23a90c85dc7

Branch pushed to git repo; I updated commit sha1. New commits:

5ef7767Merge branch 't/31559/make_modularformrings_manipulate_formal_objects' into t/31512/implementation_of_the_graded_quasimodular_forms_ring
377d88bresolved merge conflicts

comment:40 Changed 15 months ago by git

Commit: 377d88bbb7f7af348c2a63b20a9bb23a90c85dc7100f0795427069860fe58475e2f8df6884f01577

Branch pushed to git repo; I updated commit sha1. New commits:

100f079added missing newline, fix capitalization of title

comment:41 Changed 15 months ago by Vincent Delecroix

Two small remarks:

In the element, why are you storing both the polynomial and its coefficients? The latter is only used in q_expansion for which you could have use equally the polynomial.

The methods is_modular_form and is_graded_modular_form are not quite right for the zero element as

sage: QQ['x'].zero().degree()
-1

comment:42 in reply to:  41 Changed 15 months ago by David Ayotte

Two small remarks:

In the element, why are you storing both the polynomial and its coefficients? The latter is only used in q_expansion for which you could have use equally the polynomial.

Since the coefficient attribute is used only once, I will drop it.


The methods is_modular_form and is_graded_modular_form are not quite right for the zero element as

sage: QQ['x'].zero().degree()
-1

Oops, thanks for finding this! I had forgotten that there was a special rule for the degree of the zero polynomial. I'll fix this.

comment:43 Changed 15 months ago by git

Commit: 100f0795427069860fe58475e2f8df6884f0157720e633e7622fbc3097458b6c860772f21fba19e0

Branch pushed to git repo; I updated commit sha1. New commits:

20e633eremoved _coefficients attribute, fix bug in is_graded_modular_form and is_modular_form, fix pyflakes

comment:44 Changed 15 months ago by Vincent Delecroix

Status: needs_reviewpositive_review

comment:45 Changed 14 months ago by Volker Braun

Branch: u/gh-DavidAyotte/implementation_of_the_graded_quasimodular_forms_ring20e633e7622fbc3097458b6c860772f21fba19e0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.