This PR aims to implement q-expansion of modular forms as Lazy power series as suggested by @mantepse in PR #36269. In short we want to make the following code work:
sage: M = ModularForms(1, 12)
sage: f = M.0
sage: fqexp = f.q_expansion(oo)
sage: fqexp
q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 + O(q^7)
sage: fqexp.parent()
Lazy Taylor Series Ring in q over Rational Field
sage: fqexp[1000]
-30328412970240000
I'm marking this as a draft right now, but the initial commit does implement the desired functionality. Note that I also plan to implement this for quasimodular forms and graded modular forms (elements of modular forms ring).
Quick facts about modular forms (if you don't know about them)
Modular forms are holomorphic functions $f:\mathcal{H} \rightarrow \mathbb{C}$, where $\mathcal{H}$ is the complex upper half plane, satisfying two conditions:
an invariance condition under the action of $\mathrm{SL}_2(\mathbb{Z})$ on $\mathcal{H}$ (given by linear fractional transformations)
it admits a $q$-expansion of the form: $f = \sum_{n \geq 0} a_n q^n$
The "weight" of a modular form is an integer related with the first condition. Lastly, an important fact about spaces of modular forms of fixed weight is that they are finite dimensional vector spaces (over $\mathbb{C}$). We can furthermore compute a basis such that its elements have $q$-expansion with algebraic (even rational in some case) coefficients.
In this PR, we want to implement the $q$-expansion of any modular forms $f$ as a Lazy power series.
CC: @mantepse @tscrim I'm tagging you because you both are involved with Lazy power series and I'm hoping that you bring valuable input (I'm not an expert of Lazy power series).
:memo: Checklist
[x] The title is concise and informative.
[x] The description explains in detail what this PR is about.
[x] I have linked a relevant issue or discussion.
[ ] I have created tests covering the changes.
[ ] I have updated the documentation and checked the documentation preview.
Documentation preview for this PR (built with commit 4f69fb756a65a30363fc497706d4dfd5f4a160da; changes) is ready! :tada:
This preview will update shortly after each push to this PR.
This PR aims to implement q-expansion of modular forms as Lazy power series as suggested by @mantepse in PR #36269. In short we want to make the following code work:
I'm marking this as a draft right now, but the initial commit does implement the desired functionality. Note that I also plan to implement this for quasimodular forms and graded modular forms (elements of modular forms ring).
Quick facts about modular forms (if you don't know about them)
Modular forms are holomorphic functions $f:\mathcal{H} \rightarrow \mathbb{C}$, where $\mathcal{H}$ is the complex upper half plane, satisfying two conditions:
The "weight" of a modular form is an integer related with the first condition. Lastly, an important fact about spaces of modular forms of fixed weight is that they are finite dimensional vector spaces (over $\mathbb{C}$). We can furthermore compute a basis such that its elements have $q$-expansion with algebraic (even rational in some case) coefficients.
In this PR, we want to implement the $q$-expansion of any modular forms $f$ as a Lazy power series.
CC: @mantepse @tscrim I'm tagging you because you both are involved with Lazy power series and I'm hoping that you bring valuable input (I'm not an expert of Lazy power series).
:memo: Checklist
:hourglass: Dependencies