Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fix some docstring. small fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAyotte committed Aug 5, 2021
1 parent 526c884 commit 6ab4ca9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 46 deletions.
7 changes: 5 additions & 2 deletions src/sage/modular/quasimodform/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class QuasiModularFormsElement(ModuleElement):
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 :meth:``)
where each `f_i` a graded modular form element
(see :class:`~sage.modular.modform.element.GradedModularFormElement`)
EXAMPLES::
Expand All @@ -53,9 +54,11 @@ class QuasiModularFormsElement(ModuleElement):
sage: QM.0 == QM.1
False
Quasimodular forms ring element can be created via a polynomial in `E2`::
Quasimodular forms ring element can be created via a polynomial in `E2` over the ring of modular forms::
sage: E2 = QM.polygen()
sage: E2.parent()
Univariate Polynomial Ring in E2 over Ring of Modular Forms for Modular Group SL(2,Z) over Rational Field
sage: QM(E2)
1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 + O(q^6)
sage: M = QM.modular_forms_subring()
Expand Down
61 changes: 17 additions & 44 deletions src/sage/modular/quasimodform/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
.. NOTE:
Only the ring of quasimodular forms for the full modular group have been
- Only the ring of quasimodular forms for the full modular group have been
implemented.
- Currently, the only supported base ring is the Rational Field.
AUTHORS:
Expand Down Expand Up @@ -99,6 +100,17 @@ class QuasiModularForms(Parent, UniqueRepresentation):
sage: QM.weigt_2_eisenstein_series()
1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 + O(q^6)
The current implementation of quasimodular forms is only for the full modular group and for the ring of rationnal numbers::
sage: QuasiModularForms(Gamma0(2))
Traceback (most recent call last):
...
NotImplementedError: space of quasimodular forms are only implemented for the full modular group
sage: QuasiModularForms(1, GF(5))
Traceback (most recent call last):
...
NotImplementedError: base ring other than Q are not yet supported for quasimodular forms ring
"""
Element = QuasiModularFormsElement
def __init__(self, group=1, base_ring=QQ, name='E2'):
Expand Down Expand Up @@ -151,12 +163,11 @@ def __init__(self, group=1, base_ring=QQ, name='E2'):
elif not is_CongruenceSubgroup(group):
raise ValueError("Group (=%s) should be a congruence subgroup" % group)
elif group is not Gamma0(1):
raise NotImplementedError("space of quasimodular forms are implemented for the full modular group")
raise NotImplementedError("space of quasimodular forms are only implemented for the full modular group")

#Check if the base ring is a field
#For some reasons, there is a problem when computing a basis of ModularForms
if not base_ring.is_field():
raise ValueError("The base ring must be a field")
#Check if the base ring is the rationnal field
if not base_ring != QQ:
raise NotImplementedError("base ring other than Q are not yet supported for quasimodular forms ring")

self.__group = group
self.__base_ring = base_ring
Expand Down Expand Up @@ -457,41 +468,3 @@ def polygen(self):
Univariate Polynomial Ring in E2 over Ring of Modular Forms for Modular Group SL(2,Z) over Rational Field
"""
return self.__polynomial_subring.gen()

def differentiation_operator(self, f):
r"""
Compute the formal derivative `q\frac{d}{dq}` of the q-expansion of a
quasimodular form `f`
INPUT:
- ``f`` -- a power serie in corresponding to the q-expansion of a
quasimodular form.
OUTPUT:
The power series `q\frac{d}{dq}(f)`
EXAMPLES::
sage: M = QuasiModularForms()
sage: D = M.differentiation_operator
sage: B = M.gens()
sage: P = B[0]; Q = B[1]; R = B[2]
sage: D(P)
-24*q - 144*q^2 - 288*q^3 - 672*q^4 - 720*q^5 + O(q^6)
sage: (P.q_expansion()^2 - Q.q_expansion())/12
-24*q - 144*q^2 - 288*q^3 - 672*q^4 - 720*q^5 + O(q^6)
sage: D(Q)
240*q + 4320*q^2 + 20160*q^3 + 70080*q^4 + 151200*q^5 + O(q^6)
sage: (P.q_expansion()*Q.q_expansion() - R.q_expansion())/3
240*q + 4320*q^2 + 20160*q^3 + 70080*q^4 + 151200*q^5 + O(q^6)
sage: D(R)
-504*q - 33264*q^2 - 368928*q^3 - 2130912*q^4 - 7877520*q^5 + O(q^6)
sage: (P.q_expansion()*R.q_expansion() - Q.q_expansion()^2)/2
-504*q - 33264*q^2 - 368928*q^3 - 2130912*q^4 - 7877520*q^5 + O(q^6)
TODO:: This method need some work. It should return a QuasiModularFormsElement (not a power series in q)
"""
q = f.q_expansion().parent().gen()
return q*f.q_expansion().derivative()

0 comments on commit 6ab4ca9

Please sign in to comment.