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

Commit

Permalink
remove __base_ring attributes and method, changed some syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAyotte committed Aug 7, 2021
1 parent 6984a26 commit 5a373a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
8 changes: 2 additions & 6 deletions src/sage/modular/quasimodform/element.py
Expand Up @@ -96,7 +96,6 @@ def __init__(self, parent, polynomial):
raise ValueError("at least one coefficient is not a 'GradedModularFormElement'")
self._polynomial = polynomial
self._coefficients = polynomial.coefficients(sparse=False)
self.__base_ring = parent.base_ring()
ModuleElement.__init__(self, parent)

def q_expansion(self, prec=6):
Expand All @@ -114,7 +113,7 @@ def q_expansion(self, prec=6):
sage: E2.q_expansion(prec=10)
1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 - 288*q^6 - 192*q^7 - 360*q^8 - 312*q^9 + O(q^10)
"""
E2 = eisenstein_series_qexp(2, prec=prec, K=self.__base_ring, normalization='constant') #normalization -> to force integer coefficients
E2 = eisenstein_series_qexp(2, prec=prec, K=self.base_ring(), normalization='constant') #normalization -> to force integer coefficients
return sum(f.q_expansion(prec=prec)*E2**idx for idx, f in enumerate(self._coefficients))

qexp = q_expansion # alias
Expand Down Expand Up @@ -318,7 +317,4 @@ def is_modular_form(self):
sage: (QM.1 + QM.2).is_modular_form() # mixed weight components
False
"""
if not self._polynomial.degree():
return self._polynomial[0].is_modular_form()
else:
return False
return not self._polynomial.degree() and self._polynomial[0].is_modular_form()
16 changes: 0 additions & 16 deletions src/sage/modular/quasimodform/ring.py
Expand Up @@ -164,7 +164,6 @@ def __init__(self, group=1, base_ring=QQ, name='E2'):
raise NotImplementedError("base ring other than Q are not yet supported for quasimodular forms ring")

self.__group = group
self.__base_ring = base_ring
self.__modular_forms_subring = ModularFormsRing(group, base_ring)
self.__polynomial_subring = self.__modular_forms_subring[name]
Parent.__init__(self, base=base_ring, category=GradedAlgebras(base_ring))
Expand All @@ -191,21 +190,6 @@ def group(self):
"""
return self.__group

def base_ring(self):
r"""
Return the coefficient ring of this quasimodular forms ring.
EXAMPLES::
sage: QuasiModularForms(1).base_ring()
Rational Field
sage: QuasiModularForms(1, GF(5))
Traceback (most recent call last):
...
NotImplementedError: base ring other than Q are not yet supported for quasimodular forms ring
"""
return self.__base_ring

def modular_forms_subring(self):
r"""
Return the subring of modular forms of this ring of quasimodular forms.
Expand Down

0 comments on commit 5a373a3

Please sign in to comment.