Skip to content

Commit 4ec03a8

Browse files
author
Release Manager
committed
gh-35517: implement the depth of a quasimodular form <!-- Please provide a concise, informative and self-explanatory title. --> <!-- Don't put issue numbers in the title. Put it in the Description below. --> <!-- For example, instead of "Fixes #12345", use "Add a new method to multiply two integers" --> ### 📚 Description <!-- Describe your changes here in detail. --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes #12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> This PR implements the depth of a quasimodular form. Recall that the depth of a quasimodular form $f$ of weight $k$ is the integer $p$ such that: $$ f = f_0 + f_1 E_2 + \cdots + f_p E_2^p $$ where $f_i$ is of weight $k - 2*i$ and $f_p\neq 0$. CC: @videlec ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. It should be `[x]` not `[x ]`. --> - [ x] The title is concise, informative, and self-explanatory. - [x ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. (not applicable) - [x ] I have created tests covering the changes. - [x ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - #12345: short description why this is a dependency - #34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: #35517 Reported by: David Ayotte Reviewer(s): David Ayotte, grhkm21
2 parents 0c873c6 + 97286da commit 4ec03a8

File tree

1 file changed

+46
-3
lines changed

1 file changed

+46
-3
lines changed

src/sage/modular/quasimodform/element.py

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,20 @@
3131

3232
class QuasiModularFormsElement(ModuleElement):
3333
r"""
34-
A quasimodular forms ring element. Such an element is describbed by SageMath
35-
as a polynomial
34+
A quasimodular forms ring element. Such an element is described by
35+
SageMath as a polynomial
3636
3737
.. MATH::
3838
39-
f_0 + f_1 E_2 + f_2 E_2^2 + \cdots + f_m E_2^m
39+
F = f_0 + f_1 E_2 + f_2 E_2^2 + \cdots + f_m E_2^m
4040
4141
where each `f_i` a graded modular form element
4242
(see :class:`~sage.modular.modform.element.GradedModularFormElement`)
4343
44+
For an integer `k`, we say that `F` is homogeneous of weight `k` if
45+
it lies in an homogeneous component of degree `k` of the graded ring
46+
of quasimodular forms.
47+
4448
EXAMPLES::
4549
4650
sage: QM = QuasiModularForms(1)
@@ -295,6 +299,45 @@ def __bool__(self):
295299
"""
296300
return bool(self._polynomial)
297301

302+
def depth(self):
303+
r"""
304+
Return the depth of this quasimodular form.
305+
306+
Note that the quasimodular form must be homogeneous of weight
307+
`k`. Recall that the *depth* is the integer `p` such that
308+
309+
.. MATH::
310+
311+
f = f_0 + f_1 E_2 + \cdots + f_p E_2^p,
312+
313+
where `f_i` is a modular form of weight `k - 2i` and `f_p` is
314+
nonzero.
315+
316+
EXAMPLES::
317+
318+
sage: QM = QuasiModularForms(1)
319+
sage: E2, E4, E6 = QM.gens()
320+
sage: E2.depth()
321+
1
322+
sage: F = E4^2 + E6*E2 + E4*E2^2 + E2^4
323+
sage: F.depth()
324+
4
325+
sage: QM(7/11).depth()
326+
0
327+
328+
TESTS::
329+
330+
sage: QM = QuasiModularForms(1)
331+
sage: (QM.0 + QM.1).depth()
332+
Traceback (most recent call last):
333+
...
334+
ValueError: the given graded quasiform is not an homogeneous element
335+
"""
336+
if not self.is_homogeneous():
337+
raise ValueError("the given graded quasiform is not an "
338+
"homogeneous element")
339+
return self._polynomial.degree()
340+
298341
def is_zero(self):
299342
r"""
300343
Return whether the given quasimodular form is zero.

0 commit comments

Comments
 (0)