sagemath / sage

Main repository of SageMath. Now open for Issues and Pull Requests.
https://www.sagemath.org
Other
1.08k stars 394 forks source link

Lazy q-expansions for modular forms #37842

Open DavidAyotte opened 3 weeks ago

DavidAyotte commented 3 weeks ago

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:

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

github-actions[bot] commented 3 weeks ago

Documentation preview for this PR (built with commit 4f69fb756a65a30363fc497706d4dfd5f4a160da; changes) is ready! :tada: This preview will update shortly after each push to this PR.