From 08cea167f4643251105113c169384db64c07f9a4 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Tue, 16 Apr 2024 22:25:49 -0400 Subject: [PATCH 1/7] src/sage/modular/modform/ring.py: fix the category of ModularFormsRing --- src/sage/modular/modform/ring.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index 365f9f2a504..637e4931ffa 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -243,7 +243,8 @@ def __init__(self, group, base_ring=QQ): self.__cached_gens = [] self.__cached_cusp_maxweight = ZZ(-1) self.__cached_cusp_gens = [] - Parent.__init__(self, base=base_ring, category=GradedAlgebras(base_ring)) + cat = GradedAlgebras(base_ring).Commutative() + Parent.__init__(self, base=base_ring, category=cat) def change_ring(self, base_ring): r""" From 996dcc81fd6a39dec8ebe569a24e54a694eeb2e0 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Tue, 16 Apr 2024 23:24:48 -0400 Subject: [PATCH 2/7] src/sage/modular/modform/ring.py: documentation cleanup in ModularFormsRing --- src/sage/modular/modform/ring.py | 122 ++++++++++++++++++------------- 1 file changed, 72 insertions(+), 50 deletions(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index 637e4931ffa..dcf6f3abcb8 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -248,13 +248,13 @@ def __init__(self, group, base_ring=QQ): def change_ring(self, base_ring): r""" - Return the ring of modular forms over the given base ring and the same - group as ``self``. + Return a ring of modular forms over a new base ring of the same + congruence subgroup. INPUT: - - ``base_ring`` -- a base ring, which should be `\QQ`, `\ZZ`, or the - integers mod `p` for some prime `p`. + - ``base_ring`` -- a base ring, which should be `\QQ`, `\ZZ`, or + the integers mod `p` for some prime `p`. EXAMPLES:: @@ -269,7 +269,7 @@ def change_ring(self, base_ring): def some_elements(self): r""" - Return a list of generators of ``self``. + Return some elements of this ring. EXAMPLES:: @@ -281,7 +281,7 @@ def some_elements(self): def group(self): r""" - Return the congruence subgroup for which this is the ring of modular forms. + Return the congruence subgroup of this ring of modular forms. EXAMPLES:: @@ -293,14 +293,15 @@ def group(self): def gen(self, i): r""" - Return the `i`-th generator of ``self``. + Return the `i`-th generator of this ring. INPUT: - - ``i`` (Integer) -- correspond to the `i`-th modular form generating - the ring of modular forms. + - ``i`` (Integer) -- correspond to the `i`-th modular form + generating the ring of modular forms. - OUTPUT: A ``GradedModularFormElement`` + OUTPUT: A generator this ring, which is an instance of + :class:`sage.modular.modform.GradedModularFormElement` EXAMPLES:: @@ -316,7 +317,7 @@ def gen(self, i): def ngens(self): r""" - Return the number of generators of ``self`` + Return the number of generators of this ring. EXAMPLES:: @@ -336,17 +337,22 @@ def ngens(self): def polynomial_ring(self, names, gens=None): r""" - Return a polynomial ring of which ``self`` is a quotient. + Return a polynomial ring of which this ring of modular forms is + a quotient. INPUT: - - ``names`` -- a list or tuple of names (strings), or a comma separated string - - ``gens`` (default: None) -- (list) a list of generator of ``self``. If ``gens`` is - ``None`` then the generators returned by :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` + - ``names`` -- a list or tuple of names (strings), or a comma + separated string + - ``gens`` (default: None) -- (list) a list of generator of + ``self``. If ``gens`` is ``None`` then the generators returned by + :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` is used instead. - OUTPUT: A multivariate polynomial ring in the variable ``names``. Each variable of the - polynomial ring correspond to a generator given in gens (following the ordering of the list). + OUTPUT: A multivariate polynomial ring in the variable + ``names``. Each variable of the polynomial ring correspond to a + generator given in the list ``gens`` (following the ordering of + the list). EXAMPLES:: @@ -359,7 +365,8 @@ def polynomial_ring(self, names, gens=None): sage: M.polynomial_ring('g', gens) Multivariate Polynomial Ring in g0, g1, g2 over Rational Field - The degrees of the variables are the weights of the corresponding forms:: + The degrees of the variables are the weights of the + corresponding forms:: sage: M = ModularFormsRing(1) sage: P. = M.polynomial_ring() @@ -373,12 +380,13 @@ def polynomial_ring(self, names, gens=None): if gens is None: gens = self.gen_forms() degs = [f.weight() for f in gens] - return PolynomialRing(self.base_ring(), len(gens), names, order=TermOrder('wdeglex', degs)) # Should we remove the deg lexicographic ordering here? + return PolynomialRing(self.base_ring(), len(gens), names, + order=TermOrder('wdeglex', degs)) def _generators_variables_dictionnary(self, poly_parent, gens): r""" - Utility function that returns a dictionary giving an association between - polynomial ring generators and generators of modular forms ring. + Return a dictionary giving an association between polynomial + ring generators and generators of modular forms ring. INPUT: @@ -404,18 +412,19 @@ def _generators_variables_dictionnary(self, poly_parent, gens): def from_polynomial(self, polynomial, gens=None): r""" - Convert the given polynomial to a graded form living in ``self``. If - ``gens`` is ``None`` then the list of generators given by the method - :meth:`gen_forms` will be used. Otherwise, ``gens`` should be a list of - generators. + Return a graded modular form constructed by evaluating a given + multivariate polynomial at a set of generators. INPUT: - - ``polynomial`` -- A multivariate polynomial. The variables names of - the polynomial should be different from ``'q'``. The number of - variable of this polynomial should equal the number of generators - - ``gens`` -- list (default: ``None``) of generators of the modular - forms ring + - ``polynomial`` -- A multivariate polynomial. The variables + names of the polynomial should be different from ``'q'``. The + number of variable of this polynomial should equal the number + of given generators. + - ``gens`` (default: ``None``) -- a list of generators of this + ring. If this parameter is ``None``, then the generators given + by the method :meth:`gen_forms` will be used. Note that we do + not check if the list is indeed a generating set. OUTPUT: A ``GradedModularFormElement`` given by the polynomial relation ``polynomial``. @@ -438,7 +447,8 @@ def from_polynomial(self, polynomial, gens=None): sage: M.from_polynomial(P(1/2)) 1/2 - Note that the number of variables must be equal to the number of generators:: + Note that the number of variables must be equal to the number of + generators:: sage: x, y = polygens(QQ, 'x, y') sage: M(x + y) @@ -471,7 +481,7 @@ def from_polynomial(self, polynomial, gens=None): def _element_constructor_(self, forms_datum): r""" - The call method of self. + Return the graded modular form corresponding to the given data. INPUT: @@ -578,7 +588,8 @@ def one(self): def _coerce_map_from_(self, M): r""" - Code to make ModularFormRing work well with coercion framework. + Return ``True`` if there is a coercion map from ``M`` to this + ring. TESTS:: @@ -624,7 +635,7 @@ def __richcmp__(self, other, op): def _repr_(self): r""" - String representation of self. + Return the string representation of self. EXAMPLES:: @@ -637,7 +648,8 @@ def _repr_(self): def modular_forms_of_weight(self, weight): """ - Return the space of modular forms on this group of the given weight. + Return the space of modular forms of the given weight and the + same congruence subgroup. EXAMPLES:: @@ -651,9 +663,15 @@ def modular_forms_of_weight(self, weight): def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): r""" - If `R` is the base ring of self, then this function calculates a set of - modular forms which generate the `R`-algebra of all modular forms of - weight up to ``maxweight`` with coefficients in `R`. + Return a list of generator of this ring as a list of pairs + `(k, f)` where `k` is an integer and `f` is a univariate power + series in `q` corresponding to the `q`-expansion of a modular + form of weight `k`. + + More precisely, if `R` is the base ring of self, then this + function calculates a set of modular forms which generate the + `R`-algebra of all modular forms of weight up to ``maxweight`` + with coefficients in `R`. INPUT: @@ -667,7 +685,8 @@ def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): triples `(k, f, F)`, where: - `k` is an integer, - - `f` is the `q`-expansion of a modular form of weight `k`, as a power series over the base ring of self, + - `f` is the `q`-expansion of a modular form of weight `k`, + as a power series over the base ring of self, - `F` (if provided) is a modular form object corresponding to F. If this list is nonempty, we find a minimal generating set containing @@ -681,8 +700,8 @@ def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): OUTPUT: - a list of pairs (k, f), where f is the q-expansion to precision - ``prec`` of a modular form of weight k. + a list of pairs `(k, f)`, where `f` is the `q`-expansion to precision + ``prec`` of a modular form of weight `k`. .. SEEALSO:: @@ -788,7 +807,8 @@ def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): for x in start_gens: if len(x) == 2: if x[1].prec() < prec: - raise ValueError("Requested precision cannot be higher than precision of approximate starting generators!") + raise ValueError("Requested precision cannot be higher" + " than precision of approximate starting generators!") sgs.append((x[0], x[1], None)) else: sgs.append(x) @@ -808,8 +828,8 @@ def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): def gen_forms(self, maxweight=8, start_gens=[], start_weight=2): r""" - Return a list of modular forms generating this ring (as an algebra over - the appropriate base ring). + Return a list of modular forms generating this ring (as an algebra + over the appropriate base ring). This method differs from :meth:`generators` only in that it returns graded modular form objects, rather than bare `q`-expansions. @@ -852,11 +872,13 @@ def gen_forms(self, maxweight=8, start_gens=[], start_weight=2): def _find_generators(self, maxweight, start_gens, start_weight): r""" - For internal use. This function is called by :meth:`generators` and - :meth:`gen_forms`: it returns a list of triples `(k, f, F)` where `F` + Returns a list of triples `(k, f, F)` where `F` is a modular form of weight `k` and `f` is its `q`-expansion coerced into the base ring of self. + For internal use. This function is called by :meth:`generators` and + :meth:`gen_forms`. + INPUT: - ``maxweight`` -- maximum weight to try @@ -977,7 +999,7 @@ def _find_generators(self, maxweight, start_gens, start_weight): @cached_method def q_expansion_basis(self, weight, prec=None, use_random=True): r""" - Calculate a basis of q-expansions for the space of modular forms of the + Return a basis of q-expansions for the space of modular forms of the given weight for this group, calculated using the ring generators given by ``find_generators``. @@ -1045,8 +1067,8 @@ def q_expansion_basis(self, weight, prec=None, use_random=True): def cuspidal_ideal_generators(self, maxweight=8, prec=None): r""" - Calculate generators for the ideal of cuspidal forms in this ring, as a - module over the whole ring. + Return a set of generators for the ideal of cuspidal forms in + this ring, as a module over the whole ring. EXAMPLES:: @@ -1127,7 +1149,7 @@ def cuspidal_ideal_generators(self, maxweight=8, prec=None): def cuspidal_submodule_q_expansion_basis(self, weight, prec=None): r""" - Calculate a basis of `q`-expansions for the space of cusp forms of + Return a basis of `q`-expansions for the space of cusp forms of weight ``weight`` for this group. INPUT: From 09258bf07a364a52d6294e1b0e487f3a7b552ac9 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Tue, 16 Apr 2024 23:36:21 -0400 Subject: [PATCH 3/7] src/sage/modular/modform/ring.py: some code style cleanup --- src/sage/modular/modform/ring.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index dcf6f3abcb8..ee5d3304515 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -407,7 +407,9 @@ def _generators_variables_dictionnary(self, poly_parent, gens): nb_var = poly_parent.ngens() nb_gens = self.ngens() if nb_var != nb_gens: - raise ValueError('the number of variables (%s) must be equal to the number of generators of the modular forms ring (%s)' % (nb_var, self.ngens())) + raise ValueError('the number of variables (%s) must be equal to' + ' the number of generators of the modular forms' + ' ring (%s)' % (nb_var, self.ngens())) return {poly_parent.gen(i): self(gens[i]) for i in range(0, nb_var)} def from_polynomial(self, polynomial, gens=None): @@ -535,7 +537,7 @@ def _element_constructor_(self, forms_datum): else: raise ValueError('the group (%s) and/or the base ring (%s) of the given modular form is not consistant with the base space: %s' % (forms_datum.group(), forms_datum.base_ring(), self)) elif forms_datum in self.base_ring(): - forms_dictionary = {0:forms_datum} + forms_dictionary = {0: forms_datum} elif isinstance(forms_datum, MPolynomial): return self.from_polynomial(forms_datum) elif isinstance(forms_datum, PowerSeries_poly): @@ -864,9 +866,9 @@ def gen_forms(self, maxweight=8, start_gens=[], start_weight=2): Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field """ - sgs = tuple( (F.weight(), None, F) for F in start_gens ) + sgs = tuple((F.weight(), None, F) for F in start_gens) G = self._find_generators(maxweight, sgs, start_weight) - return [F for k,f,F in G] + return [F for k, f, F in G] gens = gen_forms @@ -1089,7 +1091,7 @@ def cuspidal_ideal_generators(self, maxweight=8, prec=None): for j,f,F in self.__cached_cusp_gens: if f.prec() >= working_prec: f = F.qexp(working_prec).change_ring(self.base_ring()) - G.append( (j,f,F) ) + G.append((j, f, F)) else: k = 2 G = [] @@ -1140,10 +1142,10 @@ def cuspidal_ideal_generators(self, maxweight=8, prec=None): if prec is None: return G elif prec <= working_prec: - return [ (k, f.truncate_powerseries(prec), F) for k,f,F in G] + return [(k, f.truncate_powerseries(prec), F) for k,f,F in G] else: # user wants increased precision, so we may as well cache that - Gnew = [ (k, F.qexp(prec).change_ring(self.base_ring()), F) for k,f,F in G] + Gnew = [(k, F.qexp(prec).change_ring(self.base_ring()), F) for k, f, F in G] self.__cached_cusp_gens = Gnew return Gnew From 0f3a4838c3b96240e88b0a9bf787e58481df6187 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Wed, 17 Apr 2024 10:44:43 -0400 Subject: [PATCH 4/7] src/sage/modular/modform/ring.py: fix introduced typo --- src/sage/modular/modform/ring.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index ee5d3304515..64c8d44f2c4 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -300,8 +300,8 @@ def gen(self, i): - ``i`` (Integer) -- correspond to the `i`-th modular form generating the ring of modular forms. - OUTPUT: A generator this ring, which is an instance of - :class:`sage.modular.modform.GradedModularFormElement` + OUTPUT: A generator of this ring, which is an instance of + :class:`~sage.modular.modform.GradedModularFormElement` EXAMPLES:: From cd722395fcb6eac3320439278127197f882698c5 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Fri, 31 May 2024 21:47:44 -0400 Subject: [PATCH 5/7] src/sage/modular/modform/ring.py: apply reviewer comments (+ extras) --- src/sage/modular/modform/ring.py | 88 +++++++++++++++++--------------- 1 file changed, 47 insertions(+), 41 deletions(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index 1a292c28e99..625e48b4ae9 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -201,7 +201,7 @@ def __init__(self, group, base_ring=QQ): - ``group`` -- a congruence subgroup of `\SL_2(\ZZ)`, or a positive integer `N` (interpreted as `\Gamma_0(N)`) - - ``base_ring`` (ring, default: `\QQ`) -- a base ring, which should be + - ``base_ring`` -- (default: `\QQ`) a base ring, which should be `\QQ`, `\ZZ`, or the integers mod `p` for some prime `p` TESTS: @@ -296,8 +296,8 @@ def gen(self, i): INPUT: - - ``i`` (Integer) -- correspond to the `i`-th modular form - generating the ring of modular forms. + - ``i`` -- integer corresponding to the `i`-th generator of this + ring. OUTPUT: A generator of this ring, which is an instance of :class:`~sage.modular.modform.GradedModularFormElement` @@ -342,11 +342,14 @@ def polynomial_ring(self, names, gens=None): INPUT: - ``names`` -- a list or tuple of names (strings), or a comma - separated string - - ``gens`` (default: None) -- (list) a list of generator of - ``self``. If ``gens`` is ``None`` then the generators returned by + separated string; consists in the names of the polynomial + ring variables + - ``gens`` -- list of modular forms generating this ring + (default: None); if ``gens`` is ``None`` then the list of + generators returned by the method :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` - is used instead. + is used instead. Note that we do not check if the list is + indeed a generating set. OUTPUT: A multivariate polynomial ring in the variable ``names``. Each variable of the polynomial ring correspond to a @@ -422,10 +425,12 @@ def from_polynomial(self, polynomial, gens=None): names of the polynomial should be different from ``'q'``. The number of variable of this polynomial should equal the number of given generators. - - ``gens`` (default: ``None``) -- a list of generators of this - ring. If this parameter is ``None``, then the generators given - by the method :meth:`gen_forms` will be used. Note that we do - not check if the list is indeed a generating set. + - ``gens`` -- list of modular forms generating this ring + (default: None); if ``gens`` is ``None`` then the list of + generators returned by the method + :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` + is used instead. Note that we do not check if the list is + indeed a generating set. OUTPUT: A ``GradedModularFormElement`` given by the polynomial relation ``polynomial``. @@ -676,14 +681,14 @@ def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): INPUT: - - ``maxweight`` (integer, default: 8) -- check up to this weight for - generators + - ``maxweight`` -- integer (default: 8); check up to this weight + for generators - - ``prec`` (integer, default: 10) -- return `q`-expansions to this - precision + - ``prec`` -- integer (default: 10); return `q`-expansions to + this precision - - ``start_gens`` (list, default: ``[]``) -- list of pairs `(k, f)`, or - triples `(k, f, F)`, where: + - ``start_gens`` -- list (default: empty list); list of pairs + `(k, f)`, or triples `(k, f, F)`, where: - `k` is an integer, - `f` is the `q`-expansion of a modular form of weight `k`, @@ -696,7 +701,7 @@ def generators(self, maxweight=8, prec=10, start_gens=[], start_weight=2): the case); otherwise, more terms will be calculated from the modular form object `F`. - - ``start_weight`` (integer, default: 2) -- calculate the graded + - ``start_weight`` -- integer (default: 2); calculate the graded subalgebra of forms of weight at least ``start_weight``. OUTPUT: @@ -837,14 +842,14 @@ def gen_forms(self, maxweight=8, start_gens=[], start_weight=2): INPUT: - - ``maxweight`` (integer, default: 8) -- calculate forms generating all - forms up to this weight + - ``maxweight`` -- integer (default: 8); calculate forms + generating all forms up to this weight - - ``start_gens`` (list, default: ``[]``) -- a list of modular forms. If - this list is nonempty, we find a minimal generating set containing - these forms + - ``start_gens`` -- list (default: empty list); a list of + modular forms. If this list is nonempty, we find a minimal + generating set containing these forms - - ``start_weight`` (integer, default: 2) -- calculate the graded + - ``start_weight`` -- integer (default: 2); calculate the graded subalgebra of forms of weight at least ``start_weight`` .. NOTE:: @@ -873,12 +878,12 @@ def gen_forms(self, maxweight=8, start_gens=[], start_weight=2): def _find_generators(self, maxweight, start_gens, start_weight): r""" - Returns a list of triples `(k, f, F)` where `F` - is a modular form of weight `k` and `f` is its `q`-expansion coerced - into the base ring of self. + Returns a list of triples `(k, f, F)` where `F` is a modular + form of weight `k` and `f` is its `q`-expansion coerced into the + base ring of self. - For internal use. This function is called by :meth:`generators` and - :meth:`gen_forms`. + For internal use. This function is called by :meth:`generators` + and :meth:`gen_forms`. INPUT: @@ -1000,19 +1005,19 @@ def _find_generators(self, maxweight, start_gens, start_weight): @cached_method def q_expansion_basis(self, weight, prec=None, use_random=True): r""" - Return a basis of q-expansions for the space of modular forms of the - given weight for this group, calculated using the ring generators given - by ``find_generators``. + Return a basis of `q`-expansions for the space of modular forms + of the given weight for this group, calculated using the ring + generators given by ``find_generators``. INPUT: - - ``weight`` (integer) -- the weight - - ``prec`` (integer or ``None``, default: ``None``) -- power series - precision. If ``None``, the precision defaults to the Sturm bound for - the requested level and weight. - - ``use_random`` (boolean, default: True) -- whether or not to use a - randomized algorithm when building up the space of forms at the given - weight from known generators of small weight. + - ``weight`` -- the weight + - ``prec`` -- integer (default: ``None``); power series + precision. If ``None``, the precision defaults to the Sturm + bound for the requested level and weight. + - ``use_random`` -- boolean (default: True); whether or not to + use a randomized algorithm when building up the space of forms + at the given weight from known generators of small weight. EXAMPLES:: @@ -1155,8 +1160,9 @@ def cuspidal_submodule_q_expansion_basis(self, weight, prec=None): INPUT: - - ``weight`` (integer) -- the weight - - ``prec`` (integer or None) -- precision of `q`-expansions to return + - ``weight`` -- the weight + - ``prec`` -- integer (default: ``None``) precision of + `q`-expansions to return ALGORITHM: Uses the method :meth:`cuspidal_ideal_generators` to calculate generators of the ideal of cusp forms inside this ring. Then From 943554778cb50bcda4b0da7b01ce42bdb49e1581 Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Sat, 1 Jun 2024 08:08:51 -0400 Subject: [PATCH 6/7] src/sage/modular/modform/ring.py: add missing backticks --- src/sage/modular/modform/ring.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index 625e48b4ae9..8bae20d0c9e 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -345,7 +345,7 @@ def polynomial_ring(self, names, gens=None): separated string; consists in the names of the polynomial ring variables - ``gens`` -- list of modular forms generating this ring - (default: None); if ``gens`` is ``None`` then the list of + (default: ``None``); if ``gens`` is ``None`` then the list of generators returned by the method :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` is used instead. Note that we do not check if the list is @@ -426,7 +426,7 @@ def from_polynomial(self, polynomial, gens=None): number of variable of this polynomial should equal the number of given generators. - ``gens`` -- list of modular forms generating this ring - (default: None); if ``gens`` is ``None`` then the list of + (default: ``None``); if ``gens`` is ``None`` then the list of generators returned by the method :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` is used instead. Note that we do not check if the list is @@ -1015,7 +1015,7 @@ def q_expansion_basis(self, weight, prec=None, use_random=True): - ``prec`` -- integer (default: ``None``); power series precision. If ``None``, the precision defaults to the Sturm bound for the requested level and weight. - - ``use_random`` -- boolean (default: True); whether or not to + - ``use_random`` -- boolean (default: ``True``); whether or not to use a randomized algorithm when building up the space of forms at the given weight from known generators of small weight. From aeea2737db1f94965f52dd7f36213dd62cd4a74e Mon Sep 17 00:00:00 2001 From: DavidAyotte Date: Fri, 30 Aug 2024 12:21:28 -0400 Subject: [PATCH 7/7] src/sage/modular/modform/ring.py: added missing punctuations --- src/sage/modular/modform/ring.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index c7cfc04b5ae..bf4457d7748 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -347,7 +347,7 @@ def polynomial_ring(self, names, gens=None): generators returned by the method :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` is used instead. Note that we do not check if the list is - indeed a generating set + indeed a generating set. OUTPUT: a multivariate polynomial ring in the variable ``names``. Each variable of the polynomial ring correspond to a @@ -422,13 +422,13 @@ def from_polynomial(self, polynomial, gens=None): - ``polynomial`` -- a multivariate polynomial. The variables names of the polynomial should be different from ``'q'``. The number of variable of this polynomial should equal the number - of given generators + of given generators. - ``gens`` -- list of modular forms generating this ring (default: ``None``); if ``gens`` is ``None`` then the list of generators returned by the method :meth:`~sage.modular.modform.find_generator.ModularFormsRing.gen_forms` is used instead. Note that we do not check if the list is - indeed a generating set + indeed a generating set. OUTPUT: a ``GradedModularFormElement`` given by the polynomial relation ``polynomial`` @@ -845,7 +845,7 @@ def gen_forms(self, maxweight=8, start_gens=[], start_weight=2): - ``start_gens`` -- list (default: ``[]``); a list of modular forms. If this list is nonempty, we find a minimal - generating set containing these forms + generating set containing these forms. - ``start_weight`` -- integer (default: 2); calculate the graded subalgebra of forms of weight at least ``start_weight``