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
49 changes: 46 additions & 3 deletions src/sage/modular/quasimodform/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@

class QuasiModularFormsElement(ModuleElement):
r"""
A quasimodular forms ring element. Such an element is describbed by SageMath
as a polynomial
A quasimodular forms ring element. Such an element is described by
SageMath as a polynomial

.. MATH::

f_0 + f_1 E_2 + f_2 E_2^2 + \cdots + f_m E_2^m
F = f_0 + f_1 E_2 + f_2 E_2^2 + \cdots + f_m E_2^m

where each `f_i` a graded modular form element
(see :class:`~sage.modular.modform.element.GradedModularFormElement`)

For an integer `k`, we say that `F` is homogeneous of weight `k` if
it lies in an homogeneous component of degree `k` of the graded ring
of quasimodular forms.

EXAMPLES::

sage: QM = QuasiModularForms(1)
Expand Down Expand Up @@ -295,6 +299,45 @@ def __bool__(self):
"""
return bool(self._polynomial)

def depth(self):
r"""
Return the depth of this quasimodular form.

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
Loading