diff --git a/src/sage/modular/modform_hecketriangle/abstract_ring.py b/src/sage/modular/modform_hecketriangle/abstract_ring.py index f28917578af..3b68a6e505c 100644 --- a/src/sage/modular/modform_hecketriangle/abstract_ring.py +++ b/src/sage/modular/modform_hecketriangle/abstract_ring.py @@ -17,6 +17,7 @@ # **************************************************************************** from sage.algebras.free_algebra import FreeAlgebra + from sage.misc.cachefunc import cached_method from sage.rings.fraction_field import FractionField from sage.rings.infinity import infinity @@ -30,7 +31,6 @@ from .series_constructor import MFSeriesConstructor -# Maybe replace Parent by just SageObject? class FormsRing_abstract(Parent): r""" Abstract (Hecke) forms ring. @@ -80,20 +80,20 @@ def __init__(self, group, base_ring, red_hom, n): """ # from graded_ring import canonical_parameters - # (group, base_ring, red_hom, n) = canonical_parameters(group, base_ring, red_hom, n) + # group, base_ring, red_hom, n = canonical_parameters(group, base_ring, red_hom, n) - # if (not group.is_arithmetic() and base_ring.characteristic()>0): + # if not group.is_arithmetic() and base_ring.characteristic()>0: # raise NotImplementedError - # if (base_ring.characteristic().divides(2*group.n()*(group.n()-2))): + # if base_ring.characteristic().divides(2*group.n()*(group.n()-2)): # raise NotImplementedError - if (base_ring.characteristic() > 0): + if base_ring.characteristic() > 0: raise NotImplementedError("only characteristic 0 is supported") self._group = group self._red_hom = red_hom self._base_ring = base_ring - self._coeff_ring = FractionField(PolynomialRing(base_ring,'d')) - self._pol_ring = PolynomialRing(base_ring,'x,y,z,d') + self._coeff_ring = FractionField(PolynomialRing(base_ring, 'd')) + self._pol_ring = PolynomialRing(base_ring, 'x,y,z,d') self._rat_field = FractionField(self._pol_ring) # default values @@ -105,8 +105,6 @@ def __init__(self, group, base_ring, red_hom, n): self.disp_prec(5) self.default_num_prec(53) - # super().__init__(self.coeff_ring()) - def _repr_(self): r""" Return the string representation of ``self``. @@ -142,7 +140,7 @@ def _element_constructor_(self, el): sage: from sage.modular.modform_hecketriangle.graded_ring import ModularFormsRing sage: MR = ModularFormsRing() - sage: (x,y,z,d) = MR.pol_ring().gens() + sage: x,y,z,d = MR.pol_ring().gens() sage: MR(x^3) f_rho^3 @@ -167,14 +165,18 @@ def _element_constructor_(self, el): from .graded_ring_element import FormsRingElement if isinstance(el, FormsRingElement): - if (self.hecke_n() == infinity and el.hecke_n() == ZZ(3)): + if self.hecke_n() == infinity and el.hecke_n() == ZZ(3): el_f = el._reduce_d()._rat - (x,y,z,d) = self.pol_ring().gens() + x, y, z, d = self.pol_ring().gens() - num_sub = el_f.numerator().subs( x=(y**2 + 3*x)/ZZ(4), y=(9*x*y - y**3)/ZZ(8), z=(3*z - y)/ZZ(2)) - denom_sub = el_f.denominator().subs( x=(y**2 + 3*x)/ZZ(4), y=(9*x*y - y**3)/ZZ(8), z=(3*z - y)/ZZ(2)) - new_num = num_sub.numerator()*denom_sub.denominator() - new_denom = denom_sub.numerator()*num_sub.denominator() + num_sub = el_f.numerator().subs(x=(y**2 + 3*x)/ZZ(4), + y=(9*x*y - y**3)/ZZ(8), + z=(3*z - y)/ZZ(2)) + denom_sub = el_f.denominator().subs(x=(y**2 + 3*x)/ZZ(4), + y=(9*x*y - y**3)/ZZ(8), + z=(3*z - y)/ZZ(2)) + new_num = num_sub.numerator() * denom_sub.denominator() + new_denom = denom_sub.numerator() * num_sub.denominator() el = self._rat_field(new_num) / self._rat_field(new_denom) elif self.group() == el.group(): @@ -225,18 +227,16 @@ def _coerce_map_from_(self, S): from .space import FormsSpace_abstract from .functors import _common_subgroup if (isinstance(S, FormsRing_abstract) - and self._group == _common_subgroup(self._group, S._group) - and self._analytic_type >= S._analytic_type - and self.base_ring().has_coerce_map_from(S.base_ring())): - return True + and self._group == _common_subgroup(self._group, S._group) + and self._analytic_type >= S._analytic_type + and self.base_ring().has_coerce_map_from(S.base_ring())): + return True if isinstance(S, FormsRing_abstract): return False if isinstance(S, FormsSpace_abstract): raise RuntimeError("this case should not occur") # return self._coerce_map_from_(S.graded_ring()) - if (self.AT("holo") <= self._analytic_type) and (self.coeff_ring().has_coerce_map_from(S)): - return True - return False + return self.AT("holo") <= self._analytic_type and self.coeff_ring().has_coerce_map_from(S) def _an_element_(self): r""" @@ -289,8 +289,7 @@ def default_prec(self, prec=None): sage: MF.default_prec() 2 """ - - if (prec is not None): + if prec is not None: self._prec = ZZ(prec) else: return self._prec @@ -359,8 +358,7 @@ def default_num_prec(self, prec=None): sage: f_rho.q_expansion_fixed_d(prec=2)[1] 9.92593243510795915276017782... """ - - if (prec is not None): + if prec is not None: self._num_prec = ZZ(prec) else: return self._num_prec @@ -444,7 +442,7 @@ def extend_type(self, analytic_type=None, ring=False): else: analytic_type = self._analytic_type.extend_by(analytic_type) - if (ring or not self.is_homogeneous()): + if ring or not self.is_homogeneous(): return FormsRing(analytic_type, group=self.group(), base_ring=self.base_ring(), red_hom=self.has_reduce_hom()) else: return FormsSpace(analytic_type, group=self.group(), base_ring=self.base_ring(), k=self.weight(), ep=self.ep()) @@ -491,13 +489,13 @@ def reduce_type(self, analytic_type=None, degree=None): else: analytic_type = self._analytic_type.reduce_to(analytic_type) - if (degree is None and not self.is_homogeneous()): + if degree is None and not self.is_homogeneous(): return FormsRing(analytic_type, group=self.group(), base_ring=self.base_ring(), red_hom=self.has_reduce_hom()) - elif (degree is None): + elif degree is None: return FormsSpace(analytic_type, group=self.group(), base_ring=self.base_ring(), k=self.weight(), ep=self.ep()) else: - (weight, ep) = degree - if (self.is_homogeneous() and (weight != self.weight() or ep != self.ep())): + weight, ep = degree + if self.is_homogeneous() and (weight != self.weight() or ep != self.ep()): analytic_type = self._analytic_type.reduce_to([]) return FormsSpace(analytic_type, group=self.group(), base_ring=self.base_ring(), k=weight, ep=ep) @@ -696,19 +694,18 @@ def get_d(self, fix_d=False, d_num_prec=None): sage: ModularFormsRing(n=5).get_d(fix_d=1).parent() Integer Ring """ - if d_num_prec is None: d_num_prec = self.default_num_prec() else: d_num_prec = ZZ(d_num_prec) - if (fix_d is True): + if fix_d is True: d = self._group.dvalue() - if (self._group.is_arithmetic()): - d = 1 / self.base_ring()(1/d) + if self._group.is_arithmetic(): + d = ~self.base_ring()(~d) else: d = self.group().dvalue().n(d_num_prec) - elif (fix_d is False): + elif fix_d is False: d = FractionField(PolynomialRing(self.base_ring(), "d")).gen() else: d = fix_d @@ -760,9 +757,8 @@ def get_q(self, prec=None, fix_d=False, d_num_prec=None): sage: ModularFormsRing(n=5).get_q(fix_d=1).parent() Power Series Ring in q over Rational Field """ - d = self.get_d(fix_d, d_num_prec) - if (prec is None): + if prec is None: prec = self.default_prec() base_ring = d.parent() @@ -812,17 +808,15 @@ def _derivative_op(self): sage: ModularFormsRing(n=infinity)._derivative_op() -X*Y*dX + X*Z*dX + 1/2*Y*Z*dY + 1/4*Z^2*dZ - 1/2*X*dY - 1/4*X*dZ """ + X, Y, Z, dX, dY, dZ = self.diff_alg().gens() - (X,Y,Z,dX,dY,dZ) = self.diff_alg().gens() + if self.hecke_n() == infinity: + return (X*Z-X*Y) * dX + ZZ(1) / 2 * (Y*Z-X) * dY \ + + ZZ(1) / 4 * (Z**2-X) * dZ - if (self.hecke_n() == infinity): - return (X*Z-X*Y) * dX\ - + ZZ(1)/ZZ(2) * (Y*Z-X) * dY\ - + ZZ(1)/ZZ(4) * (Z**2-X) * dZ - else: - return 1/self._group.n() * (X*Z-Y) * dX\ - + ZZ(1)/ZZ(2) * (Y*Z-X**(self._group.n()-1)) * dY\ - + (self._group.n()-2) / (4*self._group.n()) * (Z**2-X**(self._group.n()-2)) * dZ + return 1/self._group.n() * (X*Z-Y) * dX \ + + ZZ(1) / 2 * (Y*Z-X**(self._group.n()-1)) * dY \ + + (self._group.n()-2) / (4*self._group.n()) * (Z**2-X**(self._group.n()-2)) * dZ @cached_method def _serre_derivative_op(self): @@ -839,17 +833,15 @@ def _serre_derivative_op(self): sage: ModularFormsRing(n=infinity)._serre_derivative_op() -X*Y*dX - 1/4*Z^2*dZ - 1/2*X*dY - 1/4*X*dZ """ + X, Y, Z, dX, dY, dZ = self.diff_alg().gens() - (X,Y,Z,dX,dY,dZ) = self.diff_alg().gens() + if self.hecke_n() == infinity: + return - X * Y * dX - ZZ(1) / 2 * X * dY \ + - ZZ(1) / 4 * (Z**2+X) * dZ - if (self.hecke_n() == infinity): - return - X * Y * dX\ - - ZZ(1)/ZZ(2) * X * dY\ - - ZZ(1)/ZZ(4) * (Z**2+X) * dZ - else: - return - 1/self._group.n() * Y*dX\ - - ZZ(1)/ZZ(2) * X**(self._group.n()-1) * dY\ - - (self._group.n()-2) / (4*self._group.n()) * (Z**2+X**(self._group.n()-2)) * dZ + return - 1/self._group.n() * Y*dX \ + - ZZ(1) / 2 * X**(self._group.n()-1) * dY \ + - (self._group.n()-2) / (4*self._group.n()) * (Z**2+X**(self._group.n()-2)) * dZ @cached_method def has_reduce_hom(self): @@ -1038,8 +1030,7 @@ def homogeneous_part(self, k, ep): sage: QuasiMeromorphicModularFormsRing(n=7).homogeneous_part(k=2, ep=-1) QuasiMeromorphicModularForms(n=7, k=2, ep=-1) over Integer Ring """ - - return self.reduce_type(degree=(k,ep)) + return self.reduce_type(degree=(k, ep)) @cached_method def J_inv(self): @@ -1098,10 +1089,9 @@ def J_inv(self): sage: WeakModularForms().J_inv() 1/1728*q^-1 + 31/72 + 1823/16*q + 335840/27*q^2 + 16005555/32*q^3 + 11716352*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("weak", ring=True)(x/(x-y**2)).reduce() else: return self.extend_type("weak", ring=True)(x**self._group.n()/(x**self._group.n()-y**2)).reduce() @@ -1150,13 +1140,11 @@ def j_inv(self): sage: WeakModularForms().j_inv() q^-1 + 744 + 196884*q + 21493760*q^2 + 864299970*q^3 + 20245856256*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("weak", ring=True)(1/d*x/(x-y**2)).reduce() - else: - return self.extend_type("weak", ring=True)(1/d*x**self._group.n()/(x**self._group.n()-y**2)).reduce() + return self.extend_type("weak", ring=True)(1/d*x**self._group.n()/(x**self._group.n()-y**2)).reduce() @cached_method def f_rho(self): @@ -1227,13 +1215,11 @@ def f_rho(self): sage: ModularForms(k=4).f_rho() 1 + 240*q + 2160*q^2 + 6720*q^3 + 17520*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("holo", ring=True)(1).reduce() - else: - return self.extend_type("holo", ring=True)(x).reduce() + return self.extend_type("holo", ring=True)(x).reduce() @cached_method def f_i(self): @@ -1295,8 +1281,7 @@ def f_i(self): sage: ModularForms(k=6).f_i() 1 - 504*q - 16632*q^2 - 122976*q^3 - 532728*q^4 + O(q^5) """ - - (x,y,z,d) = self._pol_ring.gens() + x, y, z, d = self._pol_ring.gens() return self.extend_type("holo", ring=True)(y).reduce() @@ -1365,13 +1350,11 @@ def f_inf(self): sage: CuspForms(k=12).f_inf() q - 24*q^2 + 252*q^3 - 1472*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("holo", ring=True)(d*(x-y**2)).reduce() - else: - return self.extend_type("cusp", ring=True)(d*(x**self._group.n()-y**2)).reduce() + return self.extend_type("cusp", ring=True)(d*(x**self._group.n()-y**2)).reduce() @cached_method def G_inv(self): @@ -1443,12 +1426,11 @@ def G_inv(self): ... ArithmeticError: G_inv doesn't exist for odd n(=9). """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: raise ArithmeticError("G_inv doesn't exist for n={} (it is not meromorphic at -1).".format(self._group.n())) - elif (ZZ(2).divides(self._group.n())): + elif ZZ(2).divides(self._group.n()): return self.extend_type("weak", ring=True)(d*y*x**(self._group.n()/ZZ(2))/(x**self._group.n()-y**2)).reduce() else: raise ArithmeticError("G_inv doesn't exist for odd n(={}).".format(self._group.n())) @@ -1516,11 +1498,10 @@ def g_inv(self): ... ArithmeticError: g_inv doesn't exist for odd n(=9). """ - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: raise ArithmeticError("g_inv doesn't exist for n={} (it is not meromorphic at -1).".format(self._group.n())) - if (ZZ(2).divides(self._group.n())): - (x,y,z,d) = self._pol_ring.gens() + if ZZ(2).divides(self._group.n()): + x, y, z, d = self._pol_ring.gens() return self.extend_type("weak", ring=True)(1/d*y*x**(self._group.n()/ZZ(2))/(x**self._group.n()-y**2)).reduce() else: raise ArithmeticError("g_inv doesn't exist for odd n(={}).".format(self._group.n())) @@ -1592,13 +1573,11 @@ def E4(self): sage: ModularForms(k=4).E4() 1 + 240*q + 2160*q^2 + 6720*q^3 + 17520*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("holo", ring=True)(x).reduce() - else: - return self.extend_type("holo", ring=True)(x**(self._group.n()-2)).reduce() + return self.extend_type("holo", ring=True)(x**(self._group.n()-2)).reduce() @cached_method def E6(self): @@ -1659,13 +1638,11 @@ def E6(self): sage: ModularForms(k=6).E6() 1 - 504*q - 16632*q^2 - 122976*q^3 - 532728*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("holo", ring=True)(x*y).reduce() - else: - return self.extend_type("holo", ring=True)(x**(self._group.n()-3)*y).reduce() + return self.extend_type("holo", ring=True)(x**(self._group.n()-3)*y).reduce() @cached_method def Delta(self): @@ -1732,13 +1709,11 @@ def Delta(self): sage: CuspForms(k=12).Delta() q - 24*q^2 + 252*q^3 - 1472*q^4 + O(q^5) """ + x, y, z, d = self._pol_ring.gens() - (x,y,z,d) = self._pol_ring.gens() - - if (self.hecke_n() == infinity): + if self.hecke_n() == infinity: return self.extend_type("cusp", ring=True)(d*x**2*(x-y**2)).reduce() - else: - return self.extend_type("cusp", ring=True)(d*x**(2*self._group.n()-6)*(x**self._group.n()-y**2)).reduce() + return self.extend_type("cusp", ring=True)(d*x**(2*self._group.n()-6)*(x**self._group.n()-y**2)).reduce() @cached_method def E2(self): @@ -1803,9 +1778,7 @@ def E2(self): sage: QuasiModularForms(k=2).E2() 1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 + O(q^5) """ - - (x,y,z,d) = self._pol_ring.gens() - + x, y, z, d = self._pol_ring.gens() return self.extend_type(["holo", "quasi"], ring=True)(z).reduce() @cached_method @@ -1946,8 +1919,8 @@ def EisensteinSeries(self, k=None): # reduced_self is a classical ModularForms space reduced_self = extended_self.reduce_type(["holo"], degree=(QQ(k), ep)) - if (n == infinity): - l2 = ZZ(0) + if n == infinity: + l2 = ZZ.zero() l1 = ZZ((k-(1-ep)) / ZZ(4)) else: num = ZZ((k-(1-ep)*n/(n-2)) * (n-2) / ZZ(4)) @@ -1961,7 +1934,7 @@ def EisensteinSeries(self, k=None): # The non-arithmetic remaining cases (incomplete, very hard in general) # TODO: the n = infinity case(s) (doable) # TODO: the n = 5 case (hard) - if (not self.group().is_arithmetic() or n == infinity): + if not self.group().is_arithmetic() or n == infinity: raise NotImplementedError("Eisenstein series are only supported in the finite arithmetic cases") # The arithmetic cases diff --git a/src/sage/modular/modform_hecketriangle/graded_ring.py b/src/sage/modular/modform_hecketriangle/graded_ring.py index 624341c8dc7..877f6562235 100644 --- a/src/sage/modular/modform_hecketriangle/graded_ring.py +++ b/src/sage/modular/modform_hecketriangle/graded_ring.py @@ -19,8 +19,8 @@ from sage.rings.integer_ring import ZZ from sage.rings.infinity import infinity -from sage.rings.ring import CommutativeAlgebra -from sage.categories.commutative_algebras import CommutativeAlgebras +from sage.structure.parent import Parent +from sage.categories.algebras import Algebras from sage.structure.unique_representation import UniqueRepresentation from .hecke_triangle_groups import HeckeTriangleGroup @@ -39,11 +39,10 @@ def canonical_parameters(group, base_ring, red_hom, n=None): sage: canonical_parameters(infinity, RR, 0) (Hecke triangle group for n = +Infinity, Real Field with 53 bits of precision, False, +Infinity) """ - - if not (n is None): + if n is not None: group = n - if (group == infinity): + if group == infinity: group = HeckeTriangleGroup(infinity) else: try: @@ -57,7 +56,7 @@ def canonical_parameters(group, base_ring, red_hom, n=None): return (group, base_ring, red_hom, n) -class QuasiMeromorphicModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class QuasiMeromorphicModularFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) quasi meromorphic modular forms for the given group and base ring. @@ -114,13 +113,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: QuasiMeromorphicModularFormsRing(n=infinity) QuasiMeromorphicModularFormsRing(n=+Infinity) over Integer Ring """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["quasi", "mero"]) -class QuasiWeakModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class QuasiWeakModularFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) quasi weakly holomorphic modular forms for the given group and base ring. @@ -174,13 +173,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: MR in MR.category() True """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["quasi", "weak"]) -class QuasiModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class QuasiModularFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) quasi modular forms for the given group and base ring @@ -234,13 +233,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: MR in MR.category() True """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["quasi", "holo"]) -class QuasiCuspFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class QuasiCuspFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) quasi cusp forms for the given group and base ring. @@ -294,13 +293,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: MR in MR.category() True """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["quasi", "cusp"]) -class MeromorphicModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class MeromorphicModularFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) meromorphic modular forms for the given group and base ring @@ -354,13 +353,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: MR in MR.category() True """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["mero"]) -class WeakModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class WeakModularFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) weakly holomorphic modular forms for the given group and base ring @@ -414,13 +413,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: MR in MR.category() True """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["weak"]) -class ModularFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class ModularFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) modular forms for the given group and base ring @@ -473,13 +472,13 @@ def __init__(self, group, base_ring, red_hom, n): sage: MR in MR.category() True """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["holo"]) -class CuspFormsRing(FormsRing_abstract, CommutativeAlgebra, UniqueRepresentation): +class CuspFormsRing(FormsRing_abstract, UniqueRepresentation): r""" Graded ring of (Hecke) cusp forms for the given group and base ring @@ -536,7 +535,7 @@ def __init__(self, group, base_ring, red_hom, n): sage: CuspFormsRing(n=infinity, base_ring=CC, red_hom=True) CuspFormsRing(n=+Infinity) over Complex Field with 53 bits of precision """ - FormsRing_abstract.__init__(self, group=group, base_ring=base_ring, red_hom=red_hom, n=n) - CommutativeAlgebra.__init__(self, base_ring=base_ring, category=CommutativeAlgebras(base_ring)) + cat = Algebras(base_ring).Commutative() + Parent.__init__(self, category=cat) self._analytic_type = self.AT(["cusp"])