Skip to content
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

implement the depth of a quasimodular form #35517

Merged
merged 8 commits into from
Mar 25, 2024
39 changes: 39 additions & 0 deletions src/sage/modular/quasimodform/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,45 @@ def __bool__(self):
"""
return bool(self._polynomial)

def depth(self):
r"""
Return the depth of the given quasimodular form.
DavidAyotte marked this conversation as resolved.
Show resolved Hide resolved

Note that the quasimodular form must be homogeneous of weight
`k`. Recall that the *depth* is the integer `p` such that
DavidAyotte marked this conversation as resolved.
Show resolved Hide resolved

.. MATH::

f = f_0 + f_1 E_2 + \cdots + f_p E_2^p,

where `f_i` is a modular form of weight `k - 2i` and `f_p` is
nonzero.

EXAMPLES::

sage: QM = QuasiModularForms(1)
sage: E2, E4, E6 = QM.gens()
sage: E2.depth()
1
sage: F = E4^2 + E6*E2 + E4*E2^2 + E2^4
sage: F.depth()
4
sage: QM(7/11).depth()
0

TESTS::
DavidAyotte marked this conversation as resolved.
Show resolved Hide resolved

sage: QM = QuasiModularForms(1)
sage: (QM.0 + QM.1).depth()
Traceback (most recent call last):
...
ValueError: the given graded quasiform is not an homogeneous element
"""
if not self.is_homogeneous():
raise ValueError("the given graded quasiform is not an "
"homogeneous element")
DavidAyotte marked this conversation as resolved.
Show resolved Hide resolved
return self._polynomial.degree()

def is_zero(self):
r"""
Return whether the given quasimodular form is zero.
Expand Down