Skip to content

Commit 563b666

Browse files
committed
initial implementation
1 parent 44406e3 commit 563b666

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/sage/modular/quasimodform/element.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,45 @@ def __bool__(self):
294294
"""
295295
return bool(self._polynomial)
296296

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

0 commit comments

Comments
 (0)