diff --git a/src/sage/modular/abvar/abvar.py b/src/sage/modular/abvar/abvar.py index 818e7cf1a85..4f23ab768fd 100644 --- a/src/sage/modular/abvar/abvar.py +++ b/src/sage/modular/abvar/abvar.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Base class for modular abelian varieties @@ -317,7 +317,7 @@ def base_extend(self, K): sage: A = J0(37); A Abelian variety J0(37) of dimension 2 - sage: A.base_extend(QQbar) + sage: A.base_extend(QQbar) # needs sage.rings.number_field Abelian variety J0(37) over Algebraic Field of dimension 2 sage: A.base_extend(GF(7)) Abelian variety J0(37) over Finite Field of size 7 of dimension 2 diff --git a/src/sage/modular/abvar/abvar_newform.py b/src/sage/modular/abvar/abvar_newform.py index 67c478511f3..5d4976d5d54 100644 --- a/src/sage/modular/abvar/abvar_newform.py +++ b/src/sage/modular/abvar/abvar_newform.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari """ Abelian varieties attached to newforms diff --git a/src/sage/modular/abvar/finite_subgroup.py b/src/sage/modular/abvar/finite_subgroup.py index 74f7dd6389b..2725e11a387 100644 --- a/src/sage/modular/abvar/finite_subgroup.py +++ b/src/sage/modular/abvar/finite_subgroup.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Finite subgroups of modular abelian varieties @@ -178,7 +179,8 @@ def lattice(self): EXAMPLES:: sage: J = J0(33); C = J[0].cuspidal_subgroup(); C - Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) + Finite subgroup with invariants [5] over QQ of + Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: C.lattice() Free module of degree 6 and rank 2 over Integer Ring Echelon basis matrix: @@ -197,7 +199,8 @@ def _relative_basis_matrix(self): sage: A = J0(43)[1]; A Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43) sage: C = A.cuspidal_subgroup(); C - Finite subgroup with invariants [7] over QQ of Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43) + Finite subgroup with invariants [7] over QQ of + Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43) sage: C._relative_basis_matrix() [ 1 0 0 0] [ 0 1/7 6/7 5/7] @@ -262,7 +265,7 @@ def __richcmp__(self, other, op): def is_subgroup(self, other): """ - Return True exactly if self is a subgroup of other, and both are + Return ``True`` exactly if ``self`` is a subgroup of ``other``, and both are defined as subgroups of the same ambient abelian variety. EXAMPLES:: @@ -302,8 +305,9 @@ def __add__(self, other): An example where the parent abelian varieties are different:: - A = J0(48); A[0].cuspidal_subgroup() + A[1].cuspidal_subgroup() - Finite subgroup with invariants [2, 4, 4] over QQ of Abelian subvariety of dimension 2 of J0(48) + sage: A = J0(48); A[0].cuspidal_subgroup() + A[1].cuspidal_subgroup() + Finite subgroup with invariants [2, 4, 4] over QQ of + Abelian subvariety of dimension 2 of J0(48) """ if not isinstance(other, FiniteSubgroup): raise TypeError("only addition of two finite subgroups is defined") @@ -330,7 +334,8 @@ def exponent(self): sage: t = J0(33).hecke_operator(7) sage: G = t.kernel()[0]; G - Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of Abelian variety J0(33) of dimension 3 + Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of + Abelian variety J0(33) of dimension 3 sage: G.exponent() 4 """ @@ -343,7 +348,7 @@ def exponent(self): def intersection(self, other): """ - Return the intersection of the finite subgroups self and other. + Return the intersection of the finite subgroups ``self`` and ``other``. INPUT: @@ -358,12 +363,15 @@ def intersection(self, other): sage: E11a0, E11a1, B = J0(33) sage: G = E11a0.torsion_subgroup(6); H = E11a0.torsion_subgroup(9) sage: G.intersection(H) - Finite subgroup with invariants [3, 3] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) + Finite subgroup with invariants [3, 3] over QQ of + Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: W = E11a1.torsion_subgroup(15) sage: G.intersection(W) - Finite subgroup with invariants [] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) + Finite subgroup with invariants [] over QQ of + Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: E11a0.intersection(E11a1)[0] - Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) + Finite subgroup with invariants [5] over QQ of + Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) We intersect subgroups of different abelian varieties. @@ -372,27 +380,35 @@ def intersection(self, other): sage: E11a0, E11a1, B = J0(33) sage: G = E11a0.torsion_subgroup(5); H = E11a1.torsion_subgroup(5) sage: G.intersection(H) - Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) + Finite subgroup with invariants [5] over QQ of + Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) sage: E11a0.intersection(E11a1)[0] - Finite subgroup with invariants [5] over QQ of Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) + Finite subgroup with invariants [5] over QQ of + Simple abelian subvariety 11a(1,33) of dimension 1 of J0(33) We intersect abelian varieties with subgroups:: sage: t = J0(33).hecke_operator(7) sage: G = t.kernel()[0]; G - Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of Abelian variety J0(33) of dimension 3 + Finite subgroup with invariants [2, 2, 2, 2, 4, 4] over QQ of + Abelian variety J0(33) of dimension 3 sage: A = J0(33).old_subvariety() sage: A.intersection(G) - Finite subgroup with invariants [2, 2, 2, 2] over QQ of Abelian subvariety of dimension 2 of J0(33) + Finite subgroup with invariants [2, 2, 2, 2] over QQ of + Abelian subvariety of dimension 2 of J0(33) sage: A.hecke_operator(7).kernel()[0] - Finite subgroup with invariants [2, 2, 2, 2] over QQ of Abelian subvariety of dimension 2 of J0(33) + Finite subgroup with invariants [2, 2, 2, 2] over QQ of + Abelian subvariety of dimension 2 of J0(33) sage: B = J0(33).new_subvariety() sage: B.intersection(G) - Finite subgroup with invariants [4, 4] over QQ of Abelian subvariety of dimension 1 of J0(33) + Finite subgroup with invariants [4, 4] over QQ of + Abelian subvariety of dimension 1 of J0(33) sage: B.hecke_operator(7).kernel()[0] - Finite subgroup with invariants [4, 4] over QQ of Abelian subvariety of dimension 1 of J0(33) + Finite subgroup with invariants [4, 4] over QQ of + Abelian subvariety of dimension 1 of J0(33) sage: A.intersection(B)[0] - Finite subgroup with invariants [3, 3] over QQ of Abelian subvariety of dimension 2 of J0(33) + Finite subgroup with invariants [3, 3] over QQ of + Abelian subvariety of dimension 2 of J0(33) """ from .abvar import is_ModularAbelianVariety A = self.abelian_variety() @@ -736,13 +752,15 @@ def subgroup(self, gens): sage: J = J0(23) sage: G = J.torsion_subgroup(11); G - Finite subgroup with invariants [11, 11, 11, 11] over QQ of Abelian variety J0(23) of dimension 2 + Finite subgroup with invariants [11, 11, 11, 11] over QQ of + Abelian variety J0(23) of dimension 2 We create the subgroup of the 11-torsion subgroup of `J_0(23)` generated by the first `11`-torsion point:: sage: H = G.subgroup([G.0]); H - Finite subgroup with invariants [11] over QQbar of Abelian variety J0(23) of dimension 2 + Finite subgroup with invariants [11] over QQbar of + Abelian variety J0(23) of dimension 2 sage: H.invariants() [11] @@ -773,7 +791,8 @@ def invariants(self): sage: J = J0(38) sage: C = J.cuspidal_subgroup(); C - Finite subgroup with invariants [3, 45] over QQ of Abelian variety J0(38) of dimension 4 + Finite subgroup with invariants [3, 45] over QQ of + Abelian variety J0(38) of dimension 4 sage: v = C.invariants(); v [3, 45] sage: v[0] = 5 @@ -786,12 +805,14 @@ def invariants(self): :: sage: C * 3 - Finite subgroup with invariants [15] over QQ of Abelian variety J0(38) of dimension 4 + Finite subgroup with invariants [15] over QQ of + Abelian variety J0(38) of dimension 4 An example involving another cuspidal subgroup:: sage: C = J0(22).cuspidal_subgroup(); C - Finite subgroup with invariants [5, 5] over QQ of Abelian variety J0(22) of dimension 2 + Finite subgroup with invariants [5, 5] over QQ of + Abelian variety J0(22) of dimension 2 sage: C.lattice() Free module of degree 4 and rank 4 over Integer Ring Echelon basis matrix: @@ -843,7 +864,8 @@ def __init__(self, abvar, lattice, field_of_definition=None, check=True): sage: J = J0(11) sage: G = J.finite_subgroup([[1/3,0], [0,1/5]]); G - Finite subgroup with invariants [15] over QQbar of Abelian variety J0(11) of dimension 1 + Finite subgroup with invariants [15] over QQbar of + Abelian variety J0(11) of dimension 1 """ if field_of_definition is None: from sage.rings.qqbar import QQbar as field_of_definition @@ -868,7 +890,8 @@ def lattice(self): sage: J = J0(11) sage: G = J.finite_subgroup([[1/3,0], [0,1/5]]); G - Finite subgroup with invariants [15] over QQbar of Abelian variety J0(11) of dimension 1 + Finite subgroup with invariants [15] over QQbar of + Abelian variety J0(11) of dimension 1 sage: G.lattice() Free module of degree 2 and rank 2 over Integer Ring Echelon basis matrix: diff --git a/src/sage/modular/abvar/homology.py b/src/sage/modular/abvar/homology.py index 735bb48fb7f..59cc17a77e7 100644 --- a/src/sage/modular/abvar/homology.py +++ b/src/sage/modular/abvar/homology.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari r""" Homology of modular abelian varieties @@ -37,7 +38,8 @@ [-4 0] [ 0 -4] sage: a.T(7) - Hecke operator T_7 on Submodule of rank 2 of Integral Homology of Abelian variety J0(43) of dimension 3 + Hecke operator T_7 on + Submodule of rank 2 of Integral Homology of Abelian variety J0(43) of dimension 3 """ # **************************************************************************** @@ -272,7 +274,8 @@ def hecke_matrix(self, n): sage: J = J0(23) sage: J.homology(QQ[I]).hecke_matrix(3).parent() - Full MatrixSpace of 4 by 4 dense matrices over Number Field in I with defining polynomial x^2 + 1 with I = 1*I + Full MatrixSpace of 4 by 4 dense matrices over + Number Field in I with defining polynomial x^2 + 1 with I = 1*I """ raise NotImplementedError @@ -694,16 +697,19 @@ def hecke_bound(self): def hecke_matrix(self, n): """ - Return the matrix of the n-th Hecke operator acting on this + Return the matrix of the `n`-th Hecke operator acting on this homology group. EXAMPLES:: sage: d = J0(125).homology(GF(17)).decomposition(2); d [ - Submodule of rank 4 of Homology with coefficients in Finite Field of size 17 of Abelian variety J0(125) of dimension 8, - Submodule of rank 4 of Homology with coefficients in Finite Field of size 17 of Abelian variety J0(125) of dimension 8, - Submodule of rank 8 of Homology with coefficients in Finite Field of size 17 of Abelian variety J0(125) of dimension 8 + Submodule of rank 4 of Homology with coefficients in Finite Field of size 17 + of Abelian variety J0(125) of dimension 8, + Submodule of rank 4 of Homology with coefficients in Finite Field of size 17 + of Abelian variety J0(125) of dimension 8, + Submodule of rank 8 of Homology with coefficients in Finite Field of size 17 + of Abelian variety J0(125) of dimension 8 ] sage: t = d[0].hecke_matrix(17); t [16 15 15 0] diff --git a/src/sage/modular/abvar/homspace.py b/src/sage/modular/abvar/homspace.py index 06ec268e2ec..964df397a93 100644 --- a/src/sage/modular/abvar/homspace.py +++ b/src/sage/modular/abvar/homspace.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Spaces of homomorphisms between modular abelian varieties @@ -16,7 +17,8 @@ Simple abelian subvariety 37b(1,37) of dimension 1 of J0(37) ] sage: D[0].intersection(D[1]) - (Finite subgroup with invariants [2, 2] over QQ of Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37), + (Finite subgroup with invariants [2, 2] over QQ of + Simple abelian subvariety 37a(1,37) of dimension 1 of J0(37), Simple abelian subvariety of dimension 0 of J0(37)) As an abstract product, since these newforms are distinct, the @@ -218,7 +220,8 @@ def __init__(self, domain, codomain, cat): EXAMPLES:: sage: H = Hom(J0(11), J0(22)); H - Space of homomorphisms from Abelian variety J0(11) of dimension 1 to Abelian variety J0(22) of dimension 2 + Space of homomorphisms from Abelian variety J0(11) of dimension 1 + to Abelian variety J0(22) of dimension 2 sage: Hom(J0(11), J0(11)) Endomorphism ring of Abelian variety J0(11) of dimension 1 sage: type(H) diff --git a/src/sage/modular/abvar/lseries.py b/src/sage/modular/abvar/lseries.py index 84823684f03..4d67f7b2dfd 100644 --- a/src/sage/modular/abvar/lseries.py +++ b/src/sage/modular/abvar/lseries.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ `L`-series of modular abelian varieties @@ -99,29 +100,29 @@ def __call__(self, s, prec=53): EXAMPLES:: sage: L = J0(23).lseries() - sage: L(1) + sage: L(1) # needs sage.symbolic 0.248431866590600 - sage: L(1, prec=100) + sage: L(1, prec=100) # needs sage.symbolic 0.24843186659059968120725033931 sage: L = J0(389)[0].lseries() - sage: L(1) # long time (2s) abstol 1e-10 + sage: L(1) # abstol 1e-10 # long time (2s), needs sage.symbolic -1.33139759782370e-19 - sage: L(1, prec=100) # long time (2s) abstol 1e-20 + sage: L(1, prec=100) # abstol 1e-20 # long time (2s), needs sage.symbolic 6.0129758648142797032650287762e-39 sage: L.rational_part() 0 sage: L = J1(23)[0].lseries() - sage: L(1) + sage: L(1) # needs sage.symbolic 0.248431866590600 sage: J = J0(11) * J1(11) - sage: J.lseries()(1) + sage: J.lseries()(1) # needs sage.symbolic 0.0644356903227915 sage: L = JH(17,[2]).lseries() - sage: L(1) + sage: L(1) # needs sage.symbolic 0.386769938387780 """ diff --git a/src/sage/modular/abvar/morphism.py b/src/sage/modular/abvar/morphism.py index f0f3c065577..cc7e5a22ab2 100644 --- a/src/sage/modular/abvar/morphism.py +++ b/src/sage/modular/abvar/morphism.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint r""" Hecke operators and morphisms between modular abelian varieties diff --git a/src/sage/modular/abvar/torsion_point.py b/src/sage/modular/abvar/torsion_point.py index a7cdd54ff3a..6702a231cbb 100644 --- a/src/sage/modular/abvar/torsion_point.py +++ b/src/sage/modular/abvar/torsion_point.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.rings.number_field """ Torsion points on modular abelian varieties @@ -30,10 +31,10 @@ class TorsionPoint(ModuleElement): - ``parent`` -- a finite subgroup of a modular abelian variety - ``element`` -- a `\QQ`-vector space element that represents - this element in terms of the ambient rational homology + this element in terms of the ambient rational homology - ``check`` -- bool (default: ``True``): whether to check that - element is in the appropriate vector space + element is in the appropriate vector space EXAMPLES: @@ -78,7 +79,8 @@ def element(self): sage: J = J0(11) sage: G = J.finite_subgroup([[1/3,0], [0,1/5]]); G - Finite subgroup with invariants [15] over QQbar of Abelian variety J0(11) of dimension 1 + Finite subgroup with invariants [15] over QQbar of + Abelian variety J0(11) of dimension 1 sage: G.0.element() (1/3, 0) @@ -194,7 +196,7 @@ def _richcmp_(self, right, op): INPUT: - ``self, right`` -- elements of the same finite abelian - variety subgroup. + variety subgroup. - ``op`` -- comparison operator (see :mod:`sage.structure.richcmp`) @@ -255,10 +257,12 @@ def _relative_element(self): EXAMPLES:: + sage: # needs sage.libs.flint sage: A = J0(43)[1]; A Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43) sage: C = A.cuspidal_subgroup(); C - Finite subgroup with invariants [7] over QQ of Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43) + Finite subgroup with invariants [7] over QQ of + Simple abelian subvariety 43b(1,43) of dimension 2 of J0(43) sage: x = C.0; x [(0, 1/7, 0, 6/7, 0, 5/7)] sage: x._relative_element() diff --git a/src/sage/modular/abvar/torsion_subgroup.py b/src/sage/modular/abvar/torsion_subgroup.py index 14a52ba0284..5993a611355 100644 --- a/src/sage/modular/abvar/torsion_subgroup.py +++ b/src/sage/modular/abvar/torsion_subgroup.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Torsion subgroups of modular abelian varieties @@ -176,11 +177,11 @@ def order(self, proof=True): subgroup. The computation of the rational torsion order of J1(p) is conjectural - and will only be used if proof=False. See Section 6.2.3 of [CES2003]_. + and will only be used if ``proof=False``. See Section 6.2.3 of [CES2003]_. INPUT: - - ``proof`` -- a boolean (default: True) + - ``proof`` -- a boolean (default: ``True``) OUTPUT: @@ -202,13 +203,14 @@ def order(self, proof=True): sage: J.rational_torsion_subgroup().order() 19 - Sometimes the order can only be computed with proof=False. :: + Sometimes the order can only be computed with ``proof=False``. :: sage: J = J1(23) sage: J.rational_torsion_subgroup().order() Traceback (most recent call last): ... - RuntimeError: Unable to compute order of torsion subgroup (it is in [408991, 9406793]) + RuntimeError: Unable to compute order of torsion subgroup + (it is in [408991, 9406793]) sage: J.rational_torsion_subgroup().order(proof=False) 408991 @@ -249,7 +251,8 @@ def lattice(self): sage: T.lattice() Traceback (most recent call last): ... - NotImplementedError: unable to compute the rational torsion subgroup in this case (there is no known general algorithm yet) + NotImplementedError: unable to compute the rational torsion subgroup + in this case (there is no known general algorithm yet) The problem is that the multiple of the order obtained by counting points over finite fields is twice the divisor of the order got @@ -278,14 +281,14 @@ def possible_orders(self, proof=True): INPUT: - - ``proof`` -- a boolean (default: True) + - ``proof`` -- a boolean (default: ``True``) OUTPUT: - an array of positive integers The computation of the rational torsion order of J1(p) is conjectural - and will only be used if proof=False. See Section 6.2.3 of [CES2003]_. + and will only be used if ``proof=False``. See Section 6.2.3 of [CES2003]_. EXAMPLES:: @@ -431,7 +434,7 @@ def multiple_of_order(self, maxp=None, proof=True): performance. :: sage: J = J1(23) - sage: J.rational_torsion_subgroup().multiple_of_order() # long time (2s) + sage: J.rational_torsion_subgroup().multiple_of_order() # long time (2s) 9406793 sage: J.rational_torsion_subgroup().multiple_of_order(proof=False) 408991 @@ -680,7 +683,7 @@ def __init__(self, abvar): EXAMPLES:: sage: A = J0(23) - sage: A.qbar_torsion_subgroup() + sage: A.qbar_torsion_subgroup() # needs sage.rings.number_field Group of all torsion points in QQbar on Abelian variety J0(23) of dimension 2 """ self.__abvar = abvar @@ -694,7 +697,7 @@ def _repr_(self): EXAMPLES:: - sage: J0(23).qbar_torsion_subgroup()._repr_() + sage: J0(23).qbar_torsion_subgroup()._repr_() # needs sage.rings.number_field 'Group of all torsion points in QQbar on Abelian variety J0(23) of dimension 2' """ return 'Group of all torsion points in QQbar on %s' % self.__abvar @@ -709,7 +712,7 @@ def field_of_definition(self): EXAMPLES:: - sage: J0(23).qbar_torsion_subgroup().field_of_definition() + sage: J0(23).qbar_torsion_subgroup().field_of_definition() # needs sage.rings.number_field Rational Field """ return self.__abvar.base_field() @@ -726,9 +729,9 @@ def _element_constructor_(self, x): EXAMPLES:: - sage: P = J0(23).qbar_torsion_subgroup()([1,1/2,3/4,2]); P + sage: P = J0(23).qbar_torsion_subgroup()([1,1/2,3/4,2]); P # needs sage.rings.number_field [(1, 1/2, 3/4, 2)] - sage: P.order() + sage: P.order() # needs sage.rings.number_field 4 """ v = self.__abvar.vector_space()(x) @@ -743,7 +746,7 @@ def abelian_variety(self): EXAMPLES:: - sage: J0(23).qbar_torsion_subgroup().abelian_variety() + sage: J0(23).qbar_torsion_subgroup().abelian_variety() # needs sage.rings.number_field Abelian variety J0(23) of dimension 2 """ return self.__abvar diff --git a/src/sage/modular/arithgroup/arithgroup_element.pyx b/src/sage/modular/arithgroup/arithgroup_element.pyx index 41b268ea4ef..86f2e550d18 100644 --- a/src/sage/modular/arithgroup/arithgroup_element.pyx +++ b/src/sage/modular/arithgroup/arithgroup_element.pyx @@ -334,12 +334,13 @@ cdef class ArithmeticSubgroupElement(MultiplicativeGroupElement): An example of g acting on a symbolic variable:: - sage: z = var('z') - sage: g.acton(z) + sage: z = var('z') # needs sage.symbolic + sage: g.acton(z) # needs sage.symbolic (z + 2)/(15*z + 31) An example involving the Gaussian numbers:: + sage: # needs sage.rings.number_field sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^2 + 1) sage: g.acton(i) diff --git a/src/sage/modular/arithgroup/arithgroup_generic.py b/src/sage/modular/arithgroup/arithgroup_generic.py index 093541b9b06..0547901b1f1 100644 --- a/src/sage/modular/arithgroup/arithgroup_generic.py +++ b/src/sage/modular/arithgroup/arithgroup_generic.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Arithmetic subgroups, finite index subgroups of `\SL_2(\ZZ)` """ @@ -683,24 +684,24 @@ def reduce_cusp(self, c): def cusps(self, algorithm='default'): r""" - Return a sorted list of inequivalent cusps for self, i.e. a set of + Return a sorted list of inequivalent cusps for ``self``, i.e. a set of representatives for the orbits of self on `\mathbb{P}^1(\QQ)`. These should be returned in a reduced form where this makes sense. INPUT: - - ``algorithm`` -- which algorithm to use to compute the cusps of self. + - ``algorithm`` -- which algorithm to use to compute the cusps of ``self``. ``'default'`` finds representatives for a known complete set of cusps. ``'modsym'`` computes the boundary map on the space of weight - two modular symbols associated to self, which finds the cusps for - self in the process. + two modular symbols associated to ``self``, which finds the cusps for + ``self`` in the process. EXAMPLES:: sage: Gamma0(36).cusps() [0, 1/18, 1/12, 1/9, 1/6, 1/4, 1/3, 5/12, 1/2, 2/3, 5/6, Infinity] - sage: Gamma0(36).cusps(algorithm='modsym') == Gamma0(36).cusps() + sage: Gamma0(36).cusps(algorithm='modsym') == Gamma0(36).cusps() # needs sage.libs.flint True sage: GammaH(36, [19,29]).cusps() == Gamma0(36).cusps() True @@ -898,8 +899,8 @@ def generalised_level(self): sage: Gamma0(18).generalised_level() 18 - sage: from sage.modular.arithgroup.arithgroup_perm import HsuExample18 - sage: HsuExample18().generalised_level() + sage: from sage.modular.arithgroup.arithgroup_perm import HsuExample18 # needs sage.groups + sage: HsuExample18().generalised_level() # needs sage.groups 24 In the following example, the actual level is twice the generalised @@ -1256,7 +1257,7 @@ def dimension_eis(self, k=2): def as_permutation_group(self): r""" - Return self as an arithmetic subgroup defined in terms of the + Return ``self`` as an arithmetic subgroup defined in terms of the permutation action of `SL(2,\ZZ)` on its right cosets. This method uses Todd-Coxeter enumeration (via the method @@ -1265,6 +1266,7 @@ def as_permutation_group(self): EXAMPLES:: + sage: # needs sage.groups sage: G = Gamma(3) sage: P = G.as_permutation_group(); P Arithmetic subgroup of index 24 diff --git a/src/sage/modular/arithgroup/arithgroup_perm.py b/src/sage/modular/arithgroup/arithgroup_perm.py index 9f7371c1702..eb0e645559a 100644 --- a/src/sage/modular/arithgroup/arithgroup_perm.py +++ b/src/sage/modular/arithgroup/arithgroup_perm.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.groups r""" Arithmetic subgroups defined by permutations of cosets diff --git a/src/sage/modular/arithgroup/congroup_gamma.py b/src/sage/modular/arithgroup/congroup_gamma.py index a9eeb2a5769..47d5390b8f4 100644 --- a/src/sage/modular/arithgroup/congroup_gamma.py +++ b/src/sage/modular/arithgroup/congroup_gamma.py @@ -105,7 +105,7 @@ def __richcmp__(self, other, op): EXAMPLES:: - sage: Gamma(3) == SymmetricGroup(8) + sage: Gamma(3) == SymmetricGroup(8) # needs sage.groups False sage: Gamma(3) == Gamma1(3) False @@ -113,7 +113,7 @@ def __richcmp__(self, other, op): True sage: Gamma(5) == Gamma(5) True - sage: Gamma(3) == Gamma(3).as_permutation_group() + sage: Gamma(3) == Gamma(3).as_permutation_group() # needs sage.groups True """ if is_Gamma(other): diff --git a/src/sage/modular/arithgroup/congroup_gamma0.py b/src/sage/modular/arithgroup/congroup_gamma0.py index 70d263ebc45..5c57f12a511 100644 --- a/src/sage/modular/arithgroup/congroup_gamma0.py +++ b/src/sage/modular/arithgroup/congroup_gamma0.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Congruence subgroup `\Gamma_0(N)` """ @@ -99,9 +100,11 @@ class Gamma0_class(GammaH_class): Independently compute the dimension 5 above:: - sage: m = ModularSymbols(100, 2,sign=1).cuspidal_subspace() + sage: m = ModularSymbols(100, 2, sign=1).cuspidal_subspace() sage: m.new_subspace(5) - Modular Symbols subspace of dimension 5 of Modular Symbols space of dimension 18 for Gamma_0(100) of weight 2 with sign 1 over Rational Field + Modular Symbols subspace of dimension 5 of + Modular Symbols space of dimension 18 for Gamma_0(100) + of weight 2 with sign 1 over Rational Field """ @@ -225,13 +228,13 @@ def divisor_subgroups(self): sage: Gamma0(24).divisor_subgroups() [Modular Group SL(2,Z), - Congruence Subgroup Gamma0(2), - Congruence Subgroup Gamma0(3), - Congruence Subgroup Gamma0(4), - Congruence Subgroup Gamma0(6), - Congruence Subgroup Gamma0(8), - Congruence Subgroup Gamma0(12), - Congruence Subgroup Gamma0(24)] + Congruence Subgroup Gamma0(2), + Congruence Subgroup Gamma0(3), + Congruence Subgroup Gamma0(4), + Congruence Subgroup Gamma0(6), + Congruence Subgroup Gamma0(8), + Congruence Subgroup Gamma0(12), + Congruence Subgroup Gamma0(24)] """ return [Gamma0_constructor(M) for M in self.level().divisors()] @@ -329,8 +332,8 @@ def generators(self, algorithm="farey"): INPUT: - - ``algorithm`` (string): either ``farey`` (default) or - ``todd-coxeter``. + - ``algorithm`` (string): either ``"farey"`` (default) or + ``"todd-coxeter"``. If ``algorithm`` is set to ``"farey"``, then the generators will be calculated using Farey symbols, which will always return a *minimal* @@ -388,10 +391,17 @@ def gamma_h_subgroups(self): sage: G = Gamma0(11) sage: G.gamma_h_subgroups() - [Congruence Subgroup Gamma0(11), Congruence Subgroup Gamma_H(11) with H generated by [3], Congruence Subgroup Gamma_H(11) with H generated by [10], Congruence Subgroup Gamma1(11)] + [Congruence Subgroup Gamma0(11), + Congruence Subgroup Gamma_H(11) with H generated by [3], + Congruence Subgroup Gamma_H(11) with H generated by [10], + Congruence Subgroup Gamma1(11)] sage: G = Gamma0(12) sage: G.gamma_h_subgroups() - [Congruence Subgroup Gamma0(12), Congruence Subgroup Gamma_H(12) with H generated by [7], Congruence Subgroup Gamma_H(12) with H generated by [11], Congruence Subgroup Gamma_H(12) with H generated by [5], Congruence Subgroup Gamma1(12)] + [Congruence Subgroup Gamma0(12), + Congruence Subgroup Gamma_H(12) with H generated by [7], + Congruence Subgroup Gamma_H(12) with H generated by [11], + Congruence Subgroup Gamma_H(12) with H generated by [5], + Congruence Subgroup Gamma1(12)] """ from .all import GammaH N = self.level() diff --git a/src/sage/modular/arithgroup/congroup_gamma1.py b/src/sage/modular/arithgroup/congroup_gamma1.py index 00dc9e8c0a5..c8bc6fb0320 100644 --- a/src/sage/modular/arithgroup/congroup_gamma1.py +++ b/src/sage/modular/arithgroup/congroup_gamma1.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari r""" Congruence subgroup `\Gamma_1(N)` """ @@ -357,10 +357,10 @@ def dimension_modular_forms(self, k=2, eps=None, algorithm="CohenOesterle"): EXAMPLES:: + sage: # needs sage.rings.number_field sage: K = CyclotomicField(3) sage: eps = DirichletGroup(7*43,K).0^2 sage: G = Gamma1(7*43) - sage: G.dimension_modular_forms(2, eps) 32 sage: G.dimension_modular_forms(2, eps, algorithm="Quer") @@ -370,6 +370,7 @@ def dimension_modular_forms(self, k=2, eps=None, algorithm="CohenOesterle"): Check that :trac:`18436` is fixed:: + sage: # needs sage.rings.number_field sage: x = polygen(ZZ, 'x') sage: K. = NumberField(x^2 + x + 1) sage: G = DirichletGroup(13, base_ring=K) @@ -386,7 +387,7 @@ def dimension_modular_forms(self, k=2, eps=None, algorithm="CohenOesterle"): def dimension_cusp_forms(self, k=2, eps=None, algorithm="CohenOesterle"): r""" - Return the dimension of the space of cusp forms for self, or the + Return the dimension of the space of cusp forms for ``self``, or the dimension of the subspace corresponding to the given character if one is supplied. @@ -409,18 +410,19 @@ def dimension_cusp_forms(self, k=2, eps=None, algorithm="CohenOesterle"): We compute the same dimension in two different ways :: + sage: # needs sage.rings.number_field sage: K = CyclotomicField(3) sage: eps = DirichletGroup(7*43,K).0^2 sage: G = Gamma1(7*43) Via Cohen--Oesterle:: - sage: Gamma1(7*43).dimension_cusp_forms(2, eps) + sage: Gamma1(7*43).dimension_cusp_forms(2, eps) # needs sage.rings.number_field 28 Via Quer's method:: - sage: Gamma1(7*43).dimension_cusp_forms(2, eps, algorithm="Quer") + sage: Gamma1(7*43).dimension_cusp_forms(2, eps, algorithm="Quer") # needs sage.rings.number_field 28 Some more examples:: diff --git a/src/sage/modular/arithgroup/congroup_gammaH.py b/src/sage/modular/arithgroup/congroup_gammaH.py index 20da4f05b3e..c9e53fdf3a8 100644 --- a/src/sage/modular/arithgroup/congroup_gammaH.py +++ b/src/sage/modular/arithgroup/congroup_gammaH.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari r""" Congruence subgroup `\Gamma_H(N)` diff --git a/src/sage/modular/arithgroup/congroup_generic.py b/src/sage/modular/arithgroup/congroup_generic.py index edf056784e6..3fd60c06165 100644 --- a/src/sage/modular/arithgroup/congroup_generic.py +++ b/src/sage/modular/arithgroup/congroup_generic.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.gap sage.libs.pari r""" Congruence arithmetic subgroups of `\SL_2(\ZZ)` diff --git a/src/sage/modular/arithgroup/farey_symbol.pyx b/src/sage/modular/arithgroup/farey_symbol.pyx index cd80cb32f3e..7a106543dda 100644 --- a/src/sage/modular/arithgroup/farey_symbol.pyx +++ b/src/sage/modular/arithgroup/farey_symbol.pyx @@ -1,5 +1,5 @@ # distutils: sources = sage/modular/arithgroup/sl2z.cpp sage/modular/arithgroup/farey.cpp - +# sage.doctest: needs sage.libs.pari r""" Farey symbol for arithmetic subgroups of `\PSL_2(\ZZ)` @@ -731,6 +731,7 @@ cdef class Farey: The unique index 2 even subgroup and index 4 odd subgroup each get handled correctly:: + sage: # needs sage.groups sage: FareySymbol(ArithmeticSubgroup_Permutation(S2="(1,2)", S3="()")).generators() [ [ 0 1] [-1 1] @@ -876,6 +877,7 @@ cdef class Farey: Reduce 11/17 to a cusp of for HsuExample10():: + sage: # needs sage.groups sage: from sage.modular.arithgroup.arithgroup_perm import HsuExample10 sage: f = FareySymbol(HsuExample10()) sage: f.reduce_to_cusp(11/17) @@ -932,7 +934,7 @@ cdef class Farey: For example, to plot the fundamental domain of `\Gamma_0(11)` with pairings use the following command:: - sage: FareySymbol(Gamma0(11)).fundamental_domain() + sage: FareySymbol(Gamma0(11)).fundamental_domain() # needs sage.plot sage.symbolic Graphics object consisting of 54 graphics primitives indicating that side 1 is paired with side 3 and side 2 is @@ -941,18 +943,20 @@ cdef class Farey: To plot the fundamental domain of `\Gamma(3)` without pairings use the following command:: - sage: FareySymbol(Gamma(3)).fundamental_domain(show_pairing=False) + sage: FareySymbol(Gamma(3)).fundamental_domain(show_pairing=False) # needs sage.plot sage.symbolic Graphics object consisting of 48 graphics primitives Plot the fundamental domain of `\Gamma_0(23)` showing the left coset representatives:: - sage: FareySymbol(Gamma0(23)).fundamental_domain(tesselation='coset') + sage: FareySymbol(Gamma0(23)).fundamental_domain(tesselation='coset') # needs sage.plot sage.symbolic Graphics object consisting of 58 graphics primitives The same as above but with a custom linestyle:: - sage: FareySymbol(Gamma0(23)).fundamental_domain(tesselation='coset', linestyle=':', thickness='2') + sage: FareySymbol(Gamma0(23)).fundamental_domain(tesselation='coset', # needs sage.plot sage.symbolic + ....: linestyle=':', + ....: thickness='2') Graphics object consisting of 58 graphics primitives """ from sage.plot.all import Graphics diff --git a/src/sage/modular/arithgroup/tests.py b/src/sage/modular/arithgroup/tests.py index be49c7d41d2..d30ead3ac4c 100644 --- a/src/sage/modular/arithgroup/tests.py +++ b/src/sage/modular/arithgroup/tests.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.groups r""" Testing arithmetic subgroup """ diff --git a/src/sage/modular/btquotients/btquotient.py b/src/sage/modular/btquotients/btquotient.py index 1bf60ecbefb..3c7bceb0aa3 100644 --- a/src/sage/modular/btquotients/btquotient.py +++ b/src/sage/modular/btquotients/btquotient.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari r""" Quotients of the Bruhat-Tits tree @@ -539,8 +539,8 @@ def lift(a): EXAMPLES:: - sage: x = Zp(3)(-17) - sage: lift(x) + sage: x = Zp(3)(-17) # needs sage.rings.padics + sage: lift(x) # needs sage.rings.padics 3486784384 """ try: @@ -600,6 +600,7 @@ def vertex(self, M): EXAMPLES:: + sage: # needs sage.rings.padics sage: from sage.modular.btquotients.btquotient import BruhatTitsTree sage: p = 5 sage: T = BruhatTitsTree(p) @@ -961,6 +962,7 @@ def find_containing_affinoid(self, z): EXAMPLES:: + sage: # needs sage.rings.padics sage: from sage.modular.btquotients.btquotient import BruhatTitsTree sage: T = BruhatTitsTree(5) sage: K. = Qq(5^2,20) @@ -976,9 +978,9 @@ def find_containing_affinoid(self, z): affinoid. That is, it is a `p`-adic unit and its reduction modulo `p` is not in `\GF{p}`:: - sage: gz = (v[0,0]*z+v[0,1])/(v[1,0]*z+v[1,1]); gz + sage: gz = (v[0,0]*z+v[0,1])/(v[1,0]*z+v[1,1]); gz # needs sage.rings.padics (a + 1) + O(5^19) - sage: gz.valuation() == 0 + sage: gz.valuation() == 0 # needs sage.rings.padics True """ # Assume z belongs to some extension of QQp. @@ -1062,6 +1064,7 @@ def find_covering(self, z1, z2, level=0): EXAMPLES:: + sage: # needs sage.rings.padics sage: from sage.modular.btquotients.btquotient import BruhatTitsTree sage: p = 3 sage: K. = Qq(p^2) @@ -2127,7 +2130,7 @@ def plot(self, *args, **kwargs): EXAMPLES:: sage: X = BruhatTitsQuotient(7,23) - sage: X.plot() + sage: X.plot() # needs sage.plot Graphics object consisting of 17 graphics primitives """ S = self.get_graph() @@ -2160,7 +2163,7 @@ def plot_fundom(self, *args, **kwargs): EXAMPLES:: sage: X = BruhatTitsQuotient(7,23) - sage: X.plot_fundom() + sage: X.plot_fundom() # needs sage.plot Graphics object consisting of 88 graphics primitives """ S = self.get_fundom_graph() diff --git a/src/sage/modular/btquotients/pautomorphicform.py b/src/sage/modular/btquotients/pautomorphicform.py index 6428c7357da..656c1f42d89 100644 --- a/src/sage/modular/btquotients/pautomorphicform.py +++ b/src/sage/modular/btquotients/pautomorphicform.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari ######################################################################### # Copyright (C) 2011 Cameron Franc and Marc Masdeu # @@ -20,23 +20,23 @@ Create a quotient of the Bruhat-Tits tree:: - sage: X = BruhatTitsQuotient(13,11) + sage: X = BruhatTitsQuotient(13, 11) Declare the corresponding space of harmonic cocycles:: - sage: H = X.harmonic_cocycles(2,prec=5) + sage: H = X.harmonic_cocycles(2, prec=5) And the space of `p`-adic automorphic forms:: - sage: A = X.padic_automorphic_forms(2,prec=5,overconvergent=True) + sage: A = X.padic_automorphic_forms(2, prec=5, overconvergent=True) # needs sage.rings.padics Harmonic cocycles, unlike `p`-adic automorphic forms, can be used to compute a basis:: - sage: a = H.gen(0) + sage: a = H.gen(0) # needs sage.rings.padics This can then be lifted to an overconvergent `p`-adic modular form:: - sage: A.lift(a) # long time + sage: A.lift(a) # long time # needs sage.rings.padics p-adic automorphic form of cohomological weight 0 """ @@ -135,9 +135,9 @@ def eval_dist_at_powseries(phi, f): sage: R. = PowerSeriesRing(ZZ,10) sage: f = (1 - 7*X)^(-1) - sage: D = OverconvergentDistributions(0,7,10) - sage: phi = D(list(range(1,11))) - sage: eval_dist_at_powseries(phi,f) + sage: D = OverconvergentDistributions(0,7,10) # needs sage.rings.padics + sage: phi = D(list(range(1,11))) # needs sage.rings.padics + sage: eval_dist_at_powseries(phi,f) # needs sage.rings.padics 1 + 2*7 + 3*7^2 + 4*7^3 + 5*7^4 + 6*7^5 + 2*7^7 + 3*7^8 + 4*7^9 + O(7^10) """ nmoments = phi.parent().precision_cap() diff --git a/src/sage/modular/buzzard.py b/src/sage/modular/buzzard.py index 99ee6673d2a..72e72e745cc 100644 --- a/src/sage/modular/buzzard.py +++ b/src/sage/modular/buzzard.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari """ Conjectural slopes of Hecke polynomials diff --git a/src/sage/modular/cusps.py b/src/sage/modular/cusps.py index 098c7e52a24..fd8a6d7bc58 100644 --- a/src/sage/modular/cusps.py +++ b/src/sage/modular/cusps.py @@ -742,6 +742,7 @@ def is_gamma_h_equiv(self, other, G): EXAMPLES:: + sage: # needs sage.libs.pari sage: x = Cusp(2,3) sage: y = Cusp(4,5) sage: x.is_gamma_h_equiv(y,GammaH(13,[2])) @@ -758,8 +759,10 @@ def is_gamma_h_equiv(self, other, G): :: - sage: G = GammaH(25,[6]) ; M = G.modular_symbols() ; M - Modular Symbols space of dimension 11 for Congruence Subgroup Gamma_H(25) with H generated by [6] of weight 2 with sign 0 over Rational Field + sage: # needs sage.libs.pari + sage: G = GammaH(25,[6]); M = G.modular_symbols(); M + Modular Symbols space of dimension 11 for Congruence Subgroup Gamma_H(25) + with H generated by [6] of weight 2 with sign 0 over Rational Field sage: M.cusps() [8/25, 1/3, 6/25, 1/4, 1/15, -7/15, 7/15, 4/15, 1/20, 3/20, 7/20, 9/20] sage: len(M.cusps()) @@ -770,10 +773,13 @@ def is_gamma_h_equiv(self, other, G): :: + sage: # needs sage.libs.pari sage: G.dimension_eis(2) 11 sage: M.cuspidal_subspace() - Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 11 for Congruence Subgroup Gamma_H(25) with H generated by [6] of weight 2 with sign 0 over Rational Field + Modular Symbols subspace of dimension 0 of + Modular Symbols space of dimension 11 for Congruence Subgroup Gamma_H(25) + with H generated by [6] of weight 2 with sign 0 over Rational Field sage: G.dimension_cusp_forms(2) 0 """ @@ -934,6 +940,7 @@ def galois_action(self, t, N): Here we check that the Galois action is indeed a permutation on the cusps of Gamma1(48) and check that :trac:`13253` is fixed. :: + sage: # needs sage.libs.pari sage: G = Gamma1(48) sage: C = G.cusps() sage: for i in Integers(48).unit_gens(): @@ -943,6 +950,7 @@ def galois_action(self, t, N): We test that Gamma1(19) has 9 rational cusps and check that :trac:`8998` is fixed. :: + sage: # needs sage.libs.pari sage: G = Gamma1(19) sage: [c for c in G.cusps() if c.galois_action(2,19).is_gamma1_equiv(c,19)[0]] [2/19, 3/19, 4/19, 5/19, 6/19, 7/19, 8/19, 9/19, Infinity] @@ -1003,9 +1011,9 @@ def __pari__(self): EXAMPLES:: - sage: Cusp(1, 0).__pari__() + sage: Cusp(1, 0).__pari__() # needs sage.libs.pari +oo - sage: pari(Cusp(3, 2)) + sage: pari(Cusp(3, 2)) # needs sage.libs.pari 3/2 """ b = self.__b diff --git a/src/sage/modular/dims.py b/src/sage/modular/dims.py index f2f63b3433c..ab1f9cbc268 100644 --- a/src/sage/modular/dims.py +++ b/src/sage/modular/dims.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari r""" Dimensions of spaces of modular forms @@ -227,6 +227,7 @@ def _lambda(r, s, p): :: + sage: # needs sage.rings.number_field sage: K = CyclotomicField(3) sage: eps = DirichletGroup(7*43, K).0^2 sage: sage.modular.dims.CohenOesterle(eps, 2) diff --git a/src/sage/modular/dirichlet.py b/src/sage/modular/dirichlet.py index 9785c18963f..e752cc36b59 100644 --- a/src/sage/modular/dirichlet.py +++ b/src/sage/modular/dirichlet.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari r""" Dirichlet characters @@ -400,6 +400,7 @@ def _richcmp_(self, other, op): EXAMPLES:: + sage: # needs sage.rings.number_field sage: e = DirichletGroup(16)([-1, 1]) sage: f = e.restrict(8) sage: e == e @@ -420,6 +421,7 @@ def __hash__(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: e = DirichletGroup(16)([-1, 1]) sage: hash(e) == hash((-1,1)) True @@ -560,6 +562,7 @@ def _latex_(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: G. = DirichletGroup(16) sage: latex(b) # indirect doctest \hbox{Dirichlet character modulo } 16 \hbox{ of conductor } 16 \hbox{ mapping } 15 \mapsto 1,\ 5 \mapsto \zeta_{4} @@ -1124,6 +1127,7 @@ def _pari_init_(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: chi4 = DirichletGroup(4).gen() sage: pari(chi4) [[[4, [0]], [2, [2], [3]], [[2]~, Vecsmall([2])], @@ -1178,6 +1182,7 @@ def conrey_number(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: chi4 = DirichletGroup(4).gen() sage: chi4.conrey_number() 3 @@ -1218,6 +1223,7 @@ def lmfdb_page(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: E = DirichletGroup(4).gen() sage: E.lmfdb_page() # optional -- webbrowser """ @@ -2106,6 +2112,7 @@ def values_on_gens(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: e = DirichletGroup(16)([-1, 1]) sage: e.values_on_gens () (-1, 1) @@ -2162,6 +2169,7 @@ def __setstate__(self, state): TESTS:: + sage: # needs sage.rings.number_field sage: e = DirichletGroup(16)([-1, 1]) sage: loads(dumps(e)) == e True @@ -2361,13 +2369,15 @@ class DirichletGroupFactory(UniqueFactory): If the order of ``zeta`` cannot be determined automatically, we can specify it using ``zeta_order``:: - sage: DirichletGroup(7, CC, zeta=exp(2*pi*I/6)) + sage: DirichletGroup(7, CC, zeta=exp(2*pi*I/6)) # needs sage.symbolic Traceback (most recent call last): ... NotImplementedError: order of element not known - sage: DirichletGroup(7, CC, zeta=exp(2*pi*I/6), zeta_order=6) - Group of Dirichlet characters modulo 7 with values in the group of order 6 generated by 0.500000000000000 + 0.866025403784439*I in Complex Field with 53 bits of precision + sage: DirichletGroup(7, CC, zeta=exp(2*pi*I/6), zeta_order=6) # needs sage.symbolic + Group of Dirichlet characters modulo 7 with values in the group of order 6 + generated by 0.500000000000000 + 0.866025403784439*I + in Complex Field with 53 bits of precision If the base ring is not a domain (in which case the group of roots of unity is not necessarily cyclic), some operations still work, @@ -2495,9 +2505,11 @@ def create_object(self, version, key, **extra_args): TESTS:: + sage: # needs sage.rings.number_field sage: K = CyclotomicField(4) sage: DirichletGroup.create_object(None, (K, 60, K.gen(), 4)) - Group of Dirichlet characters modulo 60 with values in the group of order 4 generated by zeta4 in Cyclotomic Field of order 4 and degree 2 + Group of Dirichlet characters modulo 60 with values in the group of order 4 + generated by zeta4 in Cyclotomic Field of order 4 and degree 2 """ base_ring, modulus, zeta, zeta_order = key @@ -2656,18 +2668,21 @@ def change_ring(self, R, zeta=None, zeta_order=None): sage: G = DirichletGroup(7,QQ); G Group of Dirichlet characters modulo 7 with values in Rational Field - sage: G.change_ring(CyclotomicField(6)) - Group of Dirichlet characters modulo 7 with values in Cyclotomic Field of order 6 and degree 2 + sage: G.change_ring(CyclotomicField(6)) # needs sage.rings.number_field + Group of Dirichlet characters modulo 7 with values in + Cyclotomic Field of order 6 and degree 2 TESTS: We test the case where `R` is a map (:trac:`18072`):: + sage: # needs sage.rings.number_field sage: K. = QuadraticField(-1) sage: f = K.complex_embeddings()[0] sage: D = DirichletGroup(5, K) sage: D.change_ring(f) - Group of Dirichlet characters modulo 5 with values in Complex Field with 53 bits of precision + Group of Dirichlet characters modulo 5 with values in + Complex Field with 53 bits of precision """ if zeta is None and self._zeta is not None: diff --git a/src/sage/modular/hecke/algebra.py b/src/sage/modular/hecke/algebra.py index 0f6f5536a70..4ccc6d0b1bf 100644 --- a/src/sage/modular/hecke/algebra.py +++ b/src/sage/modular/hecke/algebra.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Hecke algebras diff --git a/src/sage/modular/hecke/ambient_module.py b/src/sage/modular/hecke/ambient_module.py index e5ed6158cb5..4d0b4c583ea 100644 --- a/src/sage/modular/hecke/ambient_module.py +++ b/src/sage/modular/hecke/ambient_module.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Ambient Hecke modules """ diff --git a/src/sage/modular/hecke/degenmap.py b/src/sage/modular/hecke/degenmap.py index fad128c0c3c..887506e7559 100644 --- a/src/sage/modular/hecke/degenmap.py +++ b/src/sage/modular/hecke/degenmap.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Degeneracy maps """ @@ -32,7 +33,8 @@ class DegeneracyMap(morphism.HeckeModuleMorphism_matrix): sage: M = ModularSymbols(33) sage: d = M.degeneracy_map(11) sage: d - Hecke module morphism degeneracy map corresponding to f(q) |--> f(q) defined by the matrix + Hecke module morphism degeneracy map corresponding to f(q) |--> f(q) + defined by the matrix [ 1 0 0] [ 0 0 1] [ 0 0 -1] @@ -55,12 +57,14 @@ class DegeneracyMap(morphism.HeckeModuleMorphism_matrix): sage: d = M.degeneracy_map(11,2) Traceback (most recent call last): ... - ValueError: the level of self (=33) must be a divisor or multiple of level (=11) and t (=2) must be a divisor of the quotient + ValueError: the level of self (=33) must be a divisor or multiple + of level (=11) and t (=2) must be a divisor of the quotient Degeneracy maps can also go from lower level to higher level:: sage: M.degeneracy_map(66,2) - Hecke module morphism degeneracy map corresponding to f(q) |--> f(q^2) defined by the matrix + Hecke module morphism degeneracy map corresponding to f(q) |--> f(q^2) + defined by the matrix [ 2 0 0 0 0 0 1 0 0 0 1 -1 0 0 0 -1 1 0 0 0 0 0 0 0 -1] [ 0 0 1 -1 0 -1 1 0 -1 2 0 0 0 -1 0 0 -1 1 2 -2 0 0 0 -1 1] [ 0 0 1 0 0 0 0 0 1 0 0 0 1 0 0 0 -1 1 0 0 -1 1 0 0 0] diff --git a/src/sage/modular/hecke/element.py b/src/sage/modular/hecke/element.py index b91d33b6b8d..d4ecd4b380a 100644 --- a/src/sage/modular/hecke/element.py +++ b/src/sage/modular/hecke/element.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Elements of Hecke modules diff --git a/src/sage/modular/hecke/hecke_operator.py b/src/sage/modular/hecke/hecke_operator.py index e0401936daa..a6b3faf2ffc 100644 --- a/src/sage/modular/hecke/hecke_operator.py +++ b/src/sage/modular/hecke/hecke_operator.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Hecke operators """ diff --git a/src/sage/modular/hecke/homspace.py b/src/sage/modular/hecke/homspace.py index 2245067bf99..1e6f55e0838 100644 --- a/src/sage/modular/hecke/homspace.py +++ b/src/sage/modular/hecke/homspace.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Hom spaces between Hecke modules """ @@ -181,6 +182,7 @@ def _an_element_(self): EXAMPLES:: + sage: # needs sage.libs.flint sage: M = ModularSymbols(Gamma0(2), weight=12, sign=1) sage: S = M.cuspidal_subspace() sage: S.Hom(S).an_element() diff --git a/src/sage/modular/hecke/module.py b/src/sage/modular/hecke/module.py index 8e1b699658c..d0d8d5e49d7 100644 --- a/src/sage/modular/hecke/module.py +++ b/src/sage/modular/hecke/module.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Hecke modules """ diff --git a/src/sage/modular/hecke/morphism.py b/src/sage/modular/hecke/morphism.py index 373d2b67298..ac9cfbf4e84 100644 --- a/src/sage/modular/hecke/morphism.py +++ b/src/sage/modular/hecke/morphism.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Morphisms of Hecke modules diff --git a/src/sage/modular/hecke/submodule.py b/src/sage/modular/hecke/submodule.py index c1112d685b6..379daa00f7a 100644 --- a/src/sage/modular/hecke/submodule.py +++ b/src/sage/modular/hecke/submodule.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Submodules of Hecke modules """ diff --git a/src/sage/modular/local_comp/local_comp.py b/src/sage/modular/local_comp/local_comp.py index 765ce805ed9..8c693ea6f7b 100644 --- a/src/sage/modular/local_comp/local_comp.py +++ b/src/sage/modular/local_comp/local_comp.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Local components of modular forms @@ -81,8 +82,10 @@ def LocalComponent(f, p, twist_factor=None): 'Supercuspidal' sage: Pi.characters() [ - Character of unramified extension Q_7(s)* (s^2 + 6*s + 3 = 0), of level 1, mapping s |--> -d, 7 |--> 1, - Character of unramified extension Q_7(s)* (s^2 + 6*s + 3 = 0), of level 1, mapping s |--> d, 7 |--> 1 + Character of unramified extension Q_7(s)* (s^2 + 6*s + 3 = 0), + of level 1, mapping s |--> -d, 7 |--> 1, + Character of unramified extension Q_7(s)* (s^2 + 6*s + 3 = 0), + of level 1, mapping s |--> d, 7 |--> 1 ] """ p = ZZ(p) @@ -643,8 +646,10 @@ def characters(self): sage: Pi = LocalComponent(f, 5) sage: chars = Pi.characters(); chars [ - Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> -d - 1, 5 |--> 1, - Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> d, 5 |--> 1 + Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), + of level 1, mapping s |--> -d - 1, 5 |--> 1, + Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), + of level 1, mapping s |--> d, 5 |--> 1 ] sage: chars[0].base_ring() Number Field in d with defining polynomial x^2 + x + 1 @@ -661,8 +666,10 @@ def characters(self): sage: Pi = LocalComponent(f, 5) sage: Pi.characters() [ - Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> 1/3*j0^2*d - 1/3*j0^3, 5 |--> 5, - Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), of level 1, mapping s |--> -1/3*j0^2*d, 5 |--> 5 + Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), + of level 1, mapping s |--> 1/3*j0^2*d - 1/3*j0^3, 5 |--> 5, + Character of unramified extension Q_5(s)* (s^2 + 4*s + 2 = 0), + of level 1, mapping s |--> -1/3*j0^2*d, 5 |--> 5 ] sage: Pi.characters()[0].base_ring() Number Field in d with defining polynomial x^2 - j0*x + 1/3*j0^2 over its base field @@ -680,21 +687,27 @@ def characters(self): q + j0*q^2 + q^4 - j0*q^5 + O(q^6) sage: LocalComponent(f, 3).characters() # long time (12s on sage.math, 2012) [ - Character of unramified extension Q_3(s)* (s^2 + 2*s + 2 = 0), of level 2, mapping -2*s |--> -2*d + j0, 4 |--> 1, 3*s + 1 |--> -j0*d + 1, 3 |--> 1, - Character of unramified extension Q_3(s)* (s^2 + 2*s + 2 = 0), of level 2, mapping -2*s |--> 2*d - j0, 4 |--> 1, 3*s + 1 |--> j0*d - 2, 3 |--> 1 + Character of unramified extension Q_3(s)* (s^2 + 2*s + 2 = 0), + of level 2, mapping -2*s |--> -2*d + j0, 4 |--> 1, 3*s + 1 |--> -j0*d + 1, 3 |--> 1, + Character of unramified extension Q_3(s)* (s^2 + 2*s + 2 = 0), + of level 2, mapping -2*s |--> 2*d - j0, 4 |--> 1, 3*s + 1 |--> j0*d - 2, 3 |--> 1 ] Some ramified examples:: sage: Newform('27a').local_component(3).characters() [ - Character of ramified extension Q_3(s)* (s^2 - 6 = 0), of level 2, mapping 2 |--> 1, s + 1 |--> -d, s |--> -1, - Character of ramified extension Q_3(s)* (s^2 - 6 = 0), of level 2, mapping 2 |--> 1, s + 1 |--> d - 1, s |--> -1 + Character of ramified extension Q_3(s)* (s^2 - 6 = 0), + of level 2, mapping 2 |--> 1, s + 1 |--> -d, s |--> -1, + Character of ramified extension Q_3(s)* (s^2 - 6 = 0), + of level 2, mapping 2 |--> 1, s + 1 |--> d - 1, s |--> -1 ] sage: LocalComponent(Newform('54a'), 3, twist_factor=4).characters() [ - Character of ramified extension Q_3(s)* (s^2 - 3 = 0), of level 2, mapping 2 |--> 1, s + 1 |--> -1/9*d, s |--> -9, - Character of ramified extension Q_3(s)* (s^2 - 3 = 0), of level 2, mapping 2 |--> 1, s + 1 |--> 1/9*d - 1, s |--> -9 + Character of ramified extension Q_3(s)* (s^2 - 3 = 0), + of level 2, mapping 2 |--> 1, s + 1 |--> -1/9*d, s |--> -9, + Character of ramified extension Q_3(s)* (s^2 - 3 = 0), + of level 2, mapping 2 |--> 1, s + 1 |--> 1/9*d - 1, s |--> -9 ] A 2-adic non-example:: @@ -709,13 +722,17 @@ def characters(self): sage: Newforms(DirichletGroup(64, QQ).1, 2, names='a')[0].local_component(2).characters() # long time, random [ - Character of unramified extension Q_2(s)* (s^2 + s + 1 = 0), of level 3, mapping s |--> 1, 2*s + 1 |--> 1/2*a0, 4*s + 1 |--> 1, -1 |--> 1, 2 |--> 1, - Character of unramified extension Q_2(s)* (s^2 + s + 1 = 0), of level 3, mapping s |--> 1, 2*s + 1 |--> 1/2*a0, 4*s + 1 |--> -1, -1 |--> 1, 2 |--> 1 + Character of unramified extension Q_2(s)* (s^2 + s + 1 = 0), of level 3, + mapping s |--> 1, 2*s + 1 |--> 1/2*a0, 4*s + 1 |--> 1, -1 |--> 1, 2 |--> 1, + Character of unramified extension Q_2(s)* (s^2 + s + 1 = 0), of level 3, + mapping s |--> 1, 2*s + 1 |--> 1/2*a0, 4*s + 1 |--> -1, -1 |--> 1, 2 |--> 1 ] sage: Newform('243a',names='a').local_component(3).characters() # long time [ - Character of ramified extension Q_3(s)* (s^2 - 6 = 0), of level 4, mapping -2*s - 1 |--> -d - 1, 4 |--> 1, 3*s + 1 |--> -d - 1, s |--> 1, - Character of ramified extension Q_3(s)* (s^2 - 6 = 0), of level 4, mapping -2*s - 1 |--> d, 4 |--> 1, 3*s + 1 |--> d, s |--> 1 + Character of ramified extension Q_3(s)* (s^2 - 6 = 0), of level 4, + mapping -2*s - 1 |--> -d - 1, 4 |--> 1, 3*s + 1 |--> -d - 1, s |--> 1, + Character of ramified extension Q_3(s)* (s^2 - 6 = 0), of level 4, + mapping -2*s - 1 |--> d, 4 |--> 1, 3*s + 1 |--> d, s |--> 1 ] """ T = self.type_space() diff --git a/src/sage/modular/local_comp/smoothchar.py b/src/sage/modular/local_comp/smoothchar.py index c81677589a9..62d80dc560a 100644 --- a/src/sage/modular/local_comp/smoothchar.py +++ b/src/sage/modular/local_comp/smoothchar.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari sage.rings.number_field r""" Smooth characters of `p`-adic fields diff --git a/src/sage/modular/local_comp/type_space.py b/src/sage/modular/local_comp/type_space.py index e27e4b27137..e3bf9c3bf1b 100644 --- a/src/sage/modular/local_comp/type_space.py +++ b/src/sage/modular/local_comp/type_space.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Type spaces of newforms diff --git a/src/sage/modular/modform/ambient.py b/src/sage/modular/modform/ambient.py index b7a963f354d..825b572688d 100644 --- a/src/sage/modular/modform/ambient.py +++ b/src/sage/modular/modform/ambient.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari r""" Ambient spaces of modular forms diff --git a/src/sage/modular/modform/ambient_R.py b/src/sage/modular/modform/ambient_R.py index 95c69eea5be..64188bb3892 100644 --- a/src/sage/modular/modform/ambient_R.py +++ b/src/sage/modular/modform/ambient_R.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari """ Modular forms over a non-minimal base ring """ @@ -24,7 +25,8 @@ def __init__(self, M, base_ring): sage: M = ModularForms(23,2,base_ring=GF(7)) # indirect doctest sage: M - Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(23) of weight 2 over Finite Field of size 7 + Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(23) + of weight 2 over Finite Field of size 7 sage: M == loads(dumps(M)) True """ @@ -42,6 +44,7 @@ def modular_symbols(self,sign=0): TESTS:: + sage: # needs sage.rings.number_field sage: K. = QuadraticField(-1) sage: chi = DirichletGroup(5, base_ring = K).0 sage: L. = K.extension(x^2 - 402*i) @@ -65,6 +68,7 @@ def _repr_(self): sage: M._repr_() 'Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(23) of weight 2 over Finite Field of size 7' + sage: # needs sage.rings.number_field sage: chi = DirichletGroup(109).0 ** 36 sage: ModularForms(chi, 2, base_ring = chi.base_ring()) Modular Forms space of dimension 9, character [zeta3] and weight 2 over Cyclotomic Field of order 108 and degree 36 @@ -84,8 +88,8 @@ def _compute_q_expansion_basis(self, prec=None): sage: M = ModularForms(23,2,base_ring=GF(7)) sage: M._compute_q_expansion_basis(10) [q + 6*q^3 + 6*q^4 + 5*q^6 + 2*q^7 + 6*q^8 + 2*q^9 + O(q^10), - q^2 + 5*q^3 + 6*q^4 + 2*q^5 + q^6 + 2*q^7 + 5*q^8 + O(q^10), - 1 + 5*q^3 + 5*q^4 + 5*q^6 + 3*q^8 + 5*q^9 + O(q^10)] + q^2 + 5*q^3 + 6*q^4 + 2*q^5 + q^6 + 2*q^7 + 5*q^8 + O(q^10), + 1 + 5*q^3 + 5*q^4 + 5*q^6 + 3*q^8 + 5*q^9 + O(q^10)] TESTS: @@ -141,7 +145,8 @@ def cuspidal_submodule(self): EXAMPLES:: - sage: C = CuspForms(7, 4, base_ring=CyclotomicField(5)) # indirect doctest + sage: # needs sage.rings.number_field + sage: C = CuspForms(7, 4, base_ring=CyclotomicField(5)) # indirect doctest sage: type(C) """ @@ -153,10 +158,12 @@ def change_ring(self, R): EXAMPLES:: + sage: # needs sage.rings.number_field sage: chi = DirichletGroup(109, CyclotomicField(3)).0 sage: M9 = ModularForms(chi, 2, base_ring = CyclotomicField(9)) sage: M9.change_ring(CyclotomicField(15)) - Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 15 and degree 8 + Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 + over Cyclotomic Field of order 15 and degree 8 sage: M9.change_ring(QQ) Traceback (most recent call last): ... diff --git a/src/sage/modular/modform/ambient_eps.py b/src/sage/modular/modform/ambient_eps.py index 71502963bb8..57bad5752eb 100644 --- a/src/sage/modular/modform/ambient_eps.py +++ b/src/sage/modular/modform/ambient_eps.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari sage.rings.number_field r""" Modular forms with character @@ -6,12 +6,16 @@ sage: eps = DirichletGroup(13).0 sage: M = ModularForms(eps^2, 2); M - Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 + Modular Forms space of dimension 3, character [zeta6] and weight 2 over + Cyclotomic Field of order 6 and degree 2 sage: S = M.cuspidal_submodule(); S - Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 + Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3, + character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 sage: S.modular_symbols() - Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols subspace of dimension 2 of + Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], + sign 0, over Cyclotomic Field of order 6 and degree 2 We create a spaces associated to Dirichlet characters of modulus 225:: @@ -53,10 +57,12 @@ sage: M.eisenstein_submodule() Eisenstein subspace of dimension 8 of Modular Forms space of - dimension 484, character [1, zeta20] and weight 17 over Cyclotomic Field of order 20 and degree 8 + dimension 484, character [1, zeta20] and weight 17 over + Cyclotomic Field of order 20 and degree 8 sage: M.cuspidal_submodule() - Cuspidal subspace of dimension 476 of Modular Forms space of dimension 484, character [1, zeta20] and weight 17 over Cyclotomic Field of order 20 and degree 8 + Cuspidal subspace of dimension 476 of Modular Forms space of dimension 484, + character [1, zeta20] and weight 17 over Cyclotomic Field of order 20 and degree 8 TESTS:: @@ -113,7 +119,8 @@ def __init__(self, character, weight=2, base_ring=None, eis_only=False): EXAMPLES:: sage: m = ModularForms(DirichletGroup(11).0,3); m - Modular Forms space of dimension 3, character [zeta10] and weight 3 over Cyclotomic Field of order 10 and degree 4 + Modular Forms space of dimension 3, character [zeta10] and weight 3 over + Cyclotomic Field of order 10 and degree 4 sage: type(m) """ @@ -167,9 +174,11 @@ def cuspidal_submodule(self): sage: eps = DirichletGroup(4).0 sage: M = ModularForms(eps, 5); M - Modular Forms space of dimension 3, character [-1] and weight 5 over Rational Field + Modular Forms space of dimension 3, character [-1] and weight 5 + over Rational Field sage: M.cuspidal_submodule() - Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3, character [-1] and weight 5 over Rational Field + Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3, + character [-1] and weight 5 over Rational Field """ if self.weight() > 1: return cuspidal_submodule.CuspidalSubmodule_eps(self) @@ -185,9 +194,11 @@ def change_ring(self, base_ring): EXAMPLES:: sage: m = ModularForms(DirichletGroup(13).0^2,2); m - Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 + Modular Forms space of dimension 3, character [zeta6] and weight 2 over + Cyclotomic Field of order 6 and degree 2 sage: m.change_ring(CyclotomicField(12)) - Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 12 and degree 4 + Modular Forms space of dimension 3, character [zeta6] and weight 2 over + Cyclotomic Field of order 12 and degree 4 It must be possible to change the ring of the underlying Dirichlet character:: @@ -210,11 +221,14 @@ def modular_symbols(self, sign=0): sage: eps = DirichletGroup(13).0 sage: M = ModularForms(eps^2, 2) sage: M.modular_symbols() - Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols space of dimension 4 and level 13, weight 2, + character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 sage: M.modular_symbols(1) - Modular Symbols space of dimension 3 and level 13, weight 2, character [zeta6], sign 1, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols space of dimension 3 and level 13, weight 2, + character [zeta6], sign 1, over Cyclotomic Field of order 6 and degree 2 sage: M.modular_symbols(-1) - Modular Symbols space of dimension 1 and level 13, weight 2, character [zeta6], sign -1, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols space of dimension 1 and level 13, weight 2, + character [zeta6], sign -1, over Cyclotomic Field of order 6 and degree 2 sage: M.modular_symbols(2) Traceback (most recent call last): ... @@ -236,9 +250,11 @@ def eisenstein_submodule(self): EXAMPLES:: sage: m = ModularForms(DirichletGroup(13).0^2,2); m - Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 + Modular Forms space of dimension 3, character [zeta6] and weight 2 over + Cyclotomic Field of order 6 and degree 2 sage: m.eisenstein_submodule() - Eisenstein subspace of dimension 2 of Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 + Eisenstein subspace of dimension 2 of Modular Forms space of dimension 3, + character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 """ return eisenstein_submodule.EisensteinSubmodule_eps(self) @@ -254,13 +270,15 @@ def hecke_module_of_level(self, N): sage: M = ModularForms(DirichletGroup(15).0, 3); M.character().conductor() 3 sage: M.hecke_module_of_level(3) - Modular Forms space of dimension 2, character [-1] and weight 3 over Rational Field + Modular Forms space of dimension 2, character [-1] and weight 3 + over Rational Field sage: M.hecke_module_of_level(5) Traceback (most recent call last): ... ValueError: conductor(=3) must divide M(=5) sage: M.hecke_module_of_level(30) - Modular Forms space of dimension 16, character [-1, 1] and weight 3 over Rational Field + Modular Forms space of dimension 16, character [-1, 1] and weight 3 + over Rational Field """ from . import constructor if N % self.level() == 0: diff --git a/src/sage/modular/modform/ambient_g0.py b/src/sage/modular/modform/ambient_g0.py index 114718b68b9..0b2ffb8fb83 100644 --- a/src/sage/modular/modform/ambient_g0.py +++ b/src/sage/modular/modform/ambient_g0.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Modular forms for `\Gamma_0(N)` over `\QQ` @@ -39,7 +40,8 @@ def __init__(self, level, weight): EXAMPLES:: sage: m = ModularForms(Gamma0(11),4); m - Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) of weight 4 over Rational Field + Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) + of weight 4 over Rational Field sage: type(m) """ @@ -73,7 +75,8 @@ def cuspidal_submodule(self): sage: m = ModularForms(Gamma0(33),4) sage: s = m.cuspidal_submodule(); s - Cuspidal subspace of dimension 10 of Modular Forms space of dimension 14 for Congruence Subgroup Gamma0(33) of weight 4 over Rational Field + Cuspidal subspace of dimension 10 of Modular Forms space of dimension 14 + for Congruence Subgroup Gamma0(33) of weight 4 over Rational Field sage: type(s) """ @@ -92,7 +95,8 @@ def eisenstein_submodule(self): sage: m = ModularForms(Gamma0(389),6) sage: m.eisenstein_submodule() - Eisenstein subspace of dimension 2 of Modular Forms space of dimension 163 for Congruence Subgroup Gamma0(389) of weight 6 over Rational Field + Eisenstein subspace of dimension 2 of Modular Forms space of dimension 163 + for Congruence Subgroup Gamma0(389) of weight 6 over Rational Field """ return eisenstein_submodule.EisensteinSubmodule_g0_Q(self) diff --git a/src/sage/modular/modform/constructor.py b/src/sage/modular/modform/constructor.py index b632f6d398c..2adde8bafc3 100644 --- a/src/sage/modular/modform/constructor.py +++ b/src/sage/modular/modform/constructor.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari """ Creating spaces of modular forms @@ -6,7 +6,8 @@ sage: m = ModularForms(Gamma1(4),11) sage: m - Modular Forms space of dimension 6 for Congruence Subgroup Gamma1(4) of weight 11 over Rational Field + Modular Forms space of dimension 6 for + Congruence Subgroup Gamma1(4) of weight 11 over Rational Field sage: m.basis() [ q - 134*q^5 + O(q^6), @@ -195,14 +196,16 @@ def ModularForms(group=1, sage: ModularForms(1,12).dimension() 2 sage: ModularForms(11,4) - Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) of weight 4 over Rational Field + Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) + of weight 4 over Rational Field We create some spaces for `\Gamma_1(N)`. :: sage: ModularForms(Gamma1(13),2) - Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field + Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) + of weight 2 over Rational Field sage: ModularForms(Gamma1(13),2).dimension() 13 sage: [ModularForms(Gamma1(7),k).dimension() for k in [2,3,4,5]] @@ -212,11 +215,13 @@ def ModularForms(group=1, We create a space with character:: + sage: # needs sage.rings.number_field sage: e = (DirichletGroup(13).0)^2 sage: e.order() 6 sage: M = ModularForms(e, 2); M - Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 + Modular Forms space of dimension 3, character [zeta6] and weight 2 + over Cyclotomic Field of order 6 and degree 2 sage: f = M.T(2).charpoly('x'); f x^3 + (-2*zeta6 - 2)*x^2 - 2*zeta6*x + 14*zeta6 - 7 sage: f.factor() @@ -227,7 +232,8 @@ def ModularForms(group=1, sage: G = GammaH(30, [11]) sage: M = ModularForms(G, 2); M - Modular Forms space of dimension 20 for Congruence Subgroup Gamma_H(30) with H generated by [11] of weight 2 over Rational Field + Modular Forms space of dimension 20 for Congruence Subgroup Gamma_H(30) + with H generated by [11] of weight 2 over Rational Field sage: M.T(7).charpoly().factor() # long time (7s on sage.math, 2011) (x + 4) * x^2 * (x - 6)^4 * (x + 6)^4 * (x - 8)^7 * (x^2 + 4) @@ -237,7 +243,8 @@ def ModularForms(group=1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1 sage: m = ModularForms(e, 2); m - Modular Forms space of dimension 2, character [-1] and weight 2 over Rational Field + Modular Forms space of dimension 2, character [-1] and weight 2 + over Rational Field sage: m == loads(dumps(m)) True sage: m.T(2).charpoly('x') @@ -250,20 +257,23 @@ def ModularForms(group=1, This came up in a subtle bug (:trac:`5923`):: sage: ModularForms(gp(1), gap(12)) - Modular Forms space of dimension 2 for Modular Group SL(2,Z) of weight 12 over Rational Field + Modular Forms space of dimension 2 for Modular Group SL(2,Z) + of weight 12 over Rational Field This came up in another bug (related to :trac:`8630`):: sage: chi = DirichletGroup(109, CyclotomicField(3)).0 sage: ModularForms(chi, 2, base_ring = CyclotomicField(15)) - Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 15 and degree 8 + Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 + over Cyclotomic Field of order 15 and degree 8 We create some weight 1 spaces. Here modular symbol algorithms do not work. In some small examples we can prove using Riemann--Roch that there are no cusp forms anyway, so the entire space is Eisenstein:: sage: M = ModularForms(Gamma1(11), 1); M - Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(11) of weight 1 over Rational Field + Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(11) + of weight 1 over Rational Field sage: M.basis() [ 1 + 22*q^5 + O(q^6), @@ -281,9 +291,10 @@ def ModularForms(group=1, When this does not work (which happens as soon as the level is more than about 30), we use the Hecke stability algorithm of George Schaeffer:: - sage: M = ModularForms(Gamma1(57), 1); M # long time - Modular Forms space of dimension 38 for Congruence Subgroup Gamma1(57) of weight 1 over Rational Field - sage: M.cuspidal_submodule().basis() # long time + sage: M = ModularForms(Gamma1(57), 1); M # long time + Modular Forms space of dimension 38 for Congruence Subgroup Gamma1(57) + of weight 1 over Rational Field + sage: M.cuspidal_submodule().basis() # long time [ q - q^4 + O(q^6), q^3 - q^4 + O(q^6) @@ -292,8 +303,9 @@ def ModularForms(group=1, The Eisenstein subspace in weight 1 can be computed quickly, without triggering the expensive computation of the cuspidal part:: - sage: E = EisensteinForms(Gamma1(59), 1); E # indirect doctest - Eisenstein subspace of dimension 29 of Modular Forms space for Congruence Subgroup Gamma1(59) of weight 1 over Rational Field + sage: E = EisensteinForms(Gamma1(59), 1); E # indirect doctest + Eisenstein subspace of dimension 29 of Modular Forms space for + Congruence Subgroup Gamma1(59) of weight 1 over Rational Field sage: (E.0 + E.2).q_expansion(40) 1 + q^2 + 196*q^29 - 197*q^30 - q^31 + q^33 + q^34 + q^37 + q^38 - q^39 + O(q^40) @@ -378,7 +390,8 @@ def CuspForms(group=1, EXAMPLES:: sage: CuspForms(11,2) - Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field + Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 + for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field """ return ModularForms(group, weight, base_ring, use_cache=use_cache, prec=prec).cuspidal_submodule() @@ -398,7 +411,8 @@ def EisensteinForms(group=1, EXAMPLES:: sage: EisensteinForms(11,2) - Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field + Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 + for Congruence Subgroup Gamma0(11) of weight 2 over Rational Field """ if weight == 1: return ModularForms(group, weight, base_ring, @@ -458,7 +472,8 @@ def Newforms(group, weight=2, base_ring=None, names=None): sage: chi = DirichletGroup(109, CyclotomicField(3)).0 sage: CuspForms(chi, 2, base_ring = CyclotomicField(9)) - Cuspidal subspace of dimension 8 of Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 9 and degree 6 + Cuspidal subspace of dimension 8 of Modular Forms space of dimension 10, + character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 9 and degree 6 Check that :trac:`15486` is fixed (this used to take over a day):: diff --git a/src/sage/modular/modform/cuspidal_submodule.py b/src/sage/modular/modform/cuspidal_submodule.py index 954542073dc..19cb7c65d9d 100644 --- a/src/sage/modular/modform/cuspidal_submodule.py +++ b/src/sage/modular/modform/cuspidal_submodule.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari """ The cuspidal subspace @@ -161,17 +162,21 @@ def modular_symbols(self, sign=0): Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 3 for Gamma_0(1) of weight 12 with sign 0 over Rational Field + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(13).0 sage: S = CuspForms(eps^2, 2) - sage: S.modular_symbols(sign=0) - Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 - + Modular Symbols subspace of dimension 2 of Modular Symbols space + of dimension 4 and level 13, weight 2, character [zeta6], sign 0, + over Cyclotomic Field of order 6 and degree 2 sage: S.modular_symbols(sign=1) - Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 and level 13, weight 2, character [zeta6], sign 1, over Cyclotomic Field of order 6 and degree 2 - + Modular Symbols subspace of dimension 1 of Modular Symbols space + of dimension 3 and level 13, weight 2, character [zeta6], sign 1, + over Cyclotomic Field of order 6 and degree 2 sage: S.modular_symbols(sign=-1) - Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 1 and level 13, weight 2, character [zeta6], sign -1, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols subspace of dimension 1 of Modular Symbols space + of dimension 1 and level 13, weight 2, character [zeta6], sign -1, + over Cyclotomic Field of order 6 and degree 2 """ A = self.ambient_module() return A.modular_symbols(sign).cuspidal_submodule() @@ -189,11 +194,16 @@ def change_ring(self, R): EXAMPLES:: + sage: # needs sage.rings.number_field sage: chi = DirichletGroup(109, CyclotomicField(3)).0 sage: S9 = CuspForms(chi, 2, base_ring = CyclotomicField(9)); S9 - Cuspidal subspace of dimension 8 of Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 9 and degree 6 + Cuspidal subspace of dimension 8 of + Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 + over Cyclotomic Field of order 9 and degree 6 sage: S9.change_ring(CyclotomicField(3)) - Cuspidal subspace of dimension 8 of Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 3 and degree 2 + Cuspidal subspace of dimension 8 of + Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 + over Cyclotomic Field of order 3 and degree 2 sage: S9.change_ring(QQ) Traceback (most recent call last): ... @@ -209,6 +219,7 @@ def _compute_q_expansion_basis(self, prec): r""" EXAMPLES:: + sage: # needs sage.rings.number_field sage: CuspForms(Gamma1(13), 2, base_ring=QuadraticField(-7, 'a')).q_expansion_basis() # indirect doctest [ q - 4*q^3 - q^4 + 3*q^5 + O(q^6), @@ -268,12 +279,14 @@ def hecke_polynomial(self, n, var='x'): EXAMPLES:: sage: CuspForms(105, 2).hecke_polynomial(2, 'y') - y^13 + 5*y^12 - 4*y^11 - 52*y^10 - 34*y^9 + 174*y^8 + 212*y^7 - 196*y^6 - 375*y^5 - 11*y^4 + 200*y^3 + 80*y^2 + y^13 + 5*y^12 - 4*y^11 - 52*y^10 - 34*y^9 + 174*y^8 + 212*y^7 + - 196*y^6 - 375*y^5 - 11*y^4 + 200*y^3 + 80*y^2 Check that this gives the same answer as computing the Hecke matrix:: sage: CuspForms(105, 2).hecke_matrix(2).charpoly(var='y') - y^13 + 5*y^12 - 4*y^11 - 52*y^10 - 34*y^9 + 174*y^8 + 212*y^7 - 196*y^6 - 375*y^5 - 11*y^4 + 200*y^3 + 80*y^2 + y^13 + 5*y^12 - 4*y^11 - 52*y^10 - 34*y^9 + 174*y^8 + 212*y^7 + - 196*y^6 - 375*y^5 - 11*y^4 + 200*y^3 + 80*y^2 Check that :trac:`21546` is fixed (this example used to take about 5 hours):: @@ -290,7 +303,9 @@ def new_submodule(self, p=None): EXAMPLES:: sage: CuspForms(55).new_submodule() - Modular Forms subspace of dimension 3 of Modular Forms space of dimension 8 for Congruence Subgroup Gamma0(55) of weight 2 over Rational Field + Modular Forms subspace of dimension 3 of + Modular Forms space of dimension 8 for + Congruence Subgroup Gamma0(55) of weight 2 over Rational Field """ symbs = self.modular_symbols(sign=1).new_subspace(p) bas = [] @@ -347,7 +362,7 @@ def _compute_q_expansion_basis(self, prec=None): EXAMPLES:: - sage: CuspForms(DirichletGroup(23, QQ).0, 1).q_echelon_basis() # indirect doctest + sage: CuspForms(DirichletGroup(23, QQ).0, 1).q_echelon_basis() # indirect doctest [ q - q^2 - q^3 + O(q^6) ] @@ -372,7 +387,7 @@ def _compute_q_expansion_basis(self, prec=None): EXAMPLES:: - sage: CuspForms(GammaH(31, [7]), 1).q_expansion_basis() # indirect doctest + sage: CuspForms(GammaH(31, [7]), 1).q_expansion_basis() # indirect doctest [ q - q^2 - q^5 + O(q^6) ] @@ -447,7 +462,7 @@ def _transformation_matrix(self): sage: CuspForms(GammaH(31, [7]), 1)._transformation_matrix() [1] - sage: CuspForms(GammaH(124, [33]), 1)._transformation_matrix() # long time + sage: CuspForms(GammaH(124, [33]), 1)._transformation_matrix() # long time [ 1 1 0 0 0 0 1] [ 0 0 0 0 0 1 0] [ 1 0 1 1 -1 -1 1] @@ -504,8 +519,10 @@ def _compute_hecke_matrix(self, n): sage: CuspForms(GammaH(31, [7]), 1).hecke_matrix(7) [-1] - sage: C = CuspForms(GammaH(124, [33]), 1) # long time - sage: C.hecke_matrix(2) # long time + + sage: # long time + sage: C = CuspForms(GammaH(124, [33]), 1) + sage: C.hecke_matrix(2) [ 0 0 -1 -1 0 1 0] [ 1 0 0 -1 -1 -1 0] [ 0 0 0 -1 1 1 -1] @@ -513,7 +530,7 @@ def _compute_hecke_matrix(self, n): [ 0 0 -1 0 0 1 1] [ 0 0 0 -1 0 0 -1] [ 0 0 0 0 0 1 0] - sage: C.hecke_matrix(7) # long time + sage: C.hecke_matrix(7) [ 0 1 0 -1 0 0 1] [ 0 -1 0 0 0 0 0] [ 0 1 -1 0 0 0 1] @@ -521,7 +538,7 @@ def _compute_hecke_matrix(self, n): [ 0 1 1 0 0 -1 0] [ 1 0 -1 -1 -1 0 1] [ 0 1 0 0 1 0 0] - sage: C.hecke_matrix(23) == 0 # long time + sage: C.hecke_matrix(23) == 0 True """ @@ -597,7 +614,7 @@ def _compute_diamond_matrix(self, d): r""" EXAMPLES:: - sage: CuspForms(Gamma1(5), 6).diamond_bracket_matrix(3) # indirect doctest + sage: CuspForms(Gamma1(5), 6).diamond_bracket_matrix(3) # indirect doctest [ -1 0 0] [ 3 5 -12] [ 1 2 -5] @@ -622,7 +639,8 @@ class CuspidalSubmodule_eps(CuspidalSubmodule_modsym_qexp): EXAMPLES:: sage: S = CuspForms(DirichletGroup(5).0,5); S - Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3, character [zeta4] and weight 5 over Cyclotomic Field of order 4 and degree 2 + Cuspidal subspace of dimension 1 of Modular Forms space of dimension 3, + character [zeta4] and weight 5 over Cyclotomic Field of order 4 and degree 2 sage: S.basis() [ @@ -658,7 +676,7 @@ def _convert_matrix_from_modsyms(symbs, T): EXAMPLES:: - sage: CuspForms(Gamma1(5), 6).diamond_bracket_matrix(3) # indirect doctest + sage: CuspForms(Gamma1(5), 6).diamond_bracket_matrix(3) # indirect doctest [ -1 0 0] [ 3 5 -12] [ 1 2 -5] diff --git a/src/sage/modular/modform/eis_series.py b/src/sage/modular/modform/eis_series.py index 39d78cdc0ea..19bf574dec8 100644 --- a/src/sage/modular/modform/eis_series.py +++ b/src/sage/modular/modform/eis_series.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Eisenstein series """ @@ -177,14 +177,16 @@ def __common_minimal_basering(chi, psi): EXAMPLES:: + sage: # needs sage.rings.number_field sage: sage.modular.modform.eis_series.__common_minimal_basering(DirichletGroup(1)[0], DirichletGroup(1)[0]) - (Dirichlet character modulo 1 of conductor 1, Dirichlet character modulo 1 of conductor 1) - + (Dirichlet character modulo 1 of conductor 1, + Dirichlet character modulo 1 of conductor 1) sage: sage.modular.modform.eis_series.__common_minimal_basering(DirichletGroup(3).0, DirichletGroup(5).0) - (Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4) - + (Dirichlet character modulo 3 of conductor 3 mapping 2 |--> -1, + Dirichlet character modulo 5 of conductor 5 mapping 2 |--> zeta4) sage: sage.modular.modform.eis_series.__common_minimal_basering(DirichletGroup(12).0, DirichletGroup(36).0) - (Dirichlet character modulo 12 of conductor 4 mapping 7 |--> -1, 5 |--> 1, Dirichlet character modulo 36 of conductor 4 mapping 19 |--> -1, 29 |--> 1) + (Dirichlet character modulo 12 of conductor 4 mapping 7 |--> -1, 5 |--> 1, + Dirichlet character modulo 36 of conductor 4 mapping 19 |--> -1, 29 |--> 1) """ chi = chi.minimize_base_ring() psi = psi.minimize_base_ring() diff --git a/src/sage/modular/modform/eisenstein_submodule.py b/src/sage/modular/modform/eisenstein_submodule.py index 90370ecf78d..66e3dcca72f 100644 --- a/src/sage/modular/modform/eisenstein_submodule.py +++ b/src/sage/modular/modform/eisenstein_submodule.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari """ The Eisenstein subspace """ @@ -29,7 +29,7 @@ def __init__(self, ambient_space): EXAMPLES:: - sage: E = ModularForms(23,4).eisenstein_subspace() # indirect doctest + sage: E = ModularForms(23,4).eisenstein_subspace() # indirect doctest sage: E Eisenstein subspace of dimension 2 of Modular Forms space of dimension 7 for Congruence Subgroup Gamma0(23) of weight 4 over Rational Field diff --git a/src/sage/modular/modform/element.py b/src/sage/modular/modform/element.py index e71c014569f..2c8c1c79616 100644 --- a/src/sage/modular/modform/element.py +++ b/src/sage/modular/modform/element.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Elements of modular forms spaces @@ -3237,7 +3237,7 @@ def __init__(self, parent, forms_datum): Traceback (most recent call last): ... TypeError: no canonical coercion from Modular Forms space of dimension 1 for Modular Group SL(2,Z) of weight 4 over Rational Field to Rational Field - sage: M([E4, x]) + sage: M([E4, x]) # needs sage.symbolic Traceback (most recent call last): ... TypeError: no canonical coercion from Symbolic Ring to Rational Field diff --git a/src/sage/modular/modform/find_generators.py b/src/sage/modular/modform/find_generators.py index 63b4397e3cd..72080237d56 100644 --- a/src/sage/modular/modform/find_generators.py +++ b/src/sage/modular/modform/find_generators.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint r""" This module is now called ``ring.py`` (see :trac:`31559`). Do not import from here as it will generate a deprecation warning. diff --git a/src/sage/modular/modform/hecke_operator_on_qexp.py b/src/sage/modular/modform/hecke_operator_on_qexp.py index 48590ba7d23..52de2f5c54b 100644 --- a/src/sage/modular/modform/hecke_operator_on_qexp.py +++ b/src/sage/modular/modform/hecke_operator_on_qexp.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Hecke operators on `q`-expansions """ @@ -40,14 +41,18 @@ def hecke_operator_on_qexp(f, n, k, eps=None, sage: hecke_operator_on_qexp(M.basis()[0], 1, 12, prec=7) q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 + O(q^7) sage: hecke_operator_on_qexp(M.basis()[0], 1, 12) - q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 - 113643*q^9 - 115920*q^10 + 534612*q^11 - 370944*q^12 - 577738*q^13 + O(q^14) + q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 + - 113643*q^9 - 115920*q^10 + 534612*q^11 - 370944*q^12 - 577738*q^13 + O(q^14) sage: M.prec(20) 20 sage: hecke_operator_on_qexp(M.basis()[0], 3, 12) 252*q - 6048*q^2 + 63504*q^3 - 370944*q^4 + 1217160*q^5 - 1524096*q^6 + O(q^7) sage: hecke_operator_on_qexp(M.basis()[0], 1, 12) - q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 - 113643*q^9 - 115920*q^10 + 534612*q^11 - 370944*q^12 - 577738*q^13 + 401856*q^14 + 1217160*q^15 + 987136*q^16 - 6905934*q^17 + 2727432*q^18 + 10661420*q^19 - 7109760*q^20 + O(q^21) + q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 - 6048*q^6 - 16744*q^7 + 84480*q^8 + - 113643*q^9 - 115920*q^10 + 534612*q^11 - 370944*q^12 - 577738*q^13 + + 401856*q^14 + 1217160*q^15 + 987136*q^16 - 6905934*q^17 + 2727432*q^18 + + 10661420*q^19 - 7109760*q^20 + O(q^21) sage: (hecke_operator_on_qexp(M.basis()[0], 1, 12)*252).add_bigoh(7) 252*q - 6048*q^2 + 63504*q^3 - 370944*q^4 + 1217160*q^5 - 1524096*q^6 + O(q^7) @@ -183,7 +188,8 @@ def hecke_operator_on_basis(B, n, k, eps=None, already_echelonized=False): sage: ModularForms(1,12).q_expansion_basis() [ q - 24*q^2 + 252*q^3 - 1472*q^4 + 4830*q^5 + O(q^6), - 1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + 274945048560/691*q^4 + 3199218815520/691*q^5 + O(q^6) + 1 + 65520/691*q + 134250480/691*q^2 + 11606736960/691*q^3 + + 274945048560/691*q^4 + 3199218815520/691*q^5 + O(q^6) ] sage: hecke_operator_on_basis(ModularForms(1,12).q_expansion_basis(), 3, 12) Traceback (most recent call last): @@ -205,6 +211,7 @@ def hecke_operator_on_basis(B, n, k, eps=None, already_echelonized=False): This shows that empty input is handled sensibly (:trac:`12202`):: + sage: # needs sage.rings.number_field sage: x = hecke_operator_on_basis([], 3, 12); x [] sage: x.parent() diff --git a/src/sage/modular/modform/j_invariant.py b/src/sage/modular/modform/j_invariant.py index 9d53d44d909..48b7c91fcb0 100644 --- a/src/sage/modular/modform/j_invariant.py +++ b/src/sage/modular/modform/j_invariant.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint r""" `q`-expansion of `j`-invariant """ diff --git a/src/sage/modular/modform/numerical.py b/src/sage/modular/modform/numerical.py index f811939ca5f..e5444b25c22 100644 --- a/src/sage/modular/modform/numerical.py +++ b/src/sage/modular/modform/numerical.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Numerical computation of newforms """ diff --git a/src/sage/modular/modform/ring.py b/src/sage/modular/modform/ring.py index 2e98067413e..d7008429b5f 100644 --- a/src/sage/modular/modform/ring.py +++ b/src/sage/modular/modform/ring.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Graded rings of modular forms diff --git a/src/sage/modular/modform/space.py b/src/sage/modular/modform/space.py index 36daef1d17b..de2b0e74cda 100644 --- a/src/sage/modular/modform/space.py +++ b/src/sage/modular/modform/space.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Generic spaces of modular forms @@ -732,6 +733,7 @@ def _compute_q_expansion_basis(self, prec): """ EXAMPLES:: + sage: # needs sage.rings.number_field sage: sage.modular.modform.space.ModularFormsSpace(Gamma0(11), 2, DirichletGroup(1)[0], QQ)._compute_q_expansion_basis(5) Traceback (most recent call last): ... @@ -1617,10 +1619,11 @@ def new_submodule(self, p=None): EXAMPLES:: - sage: M = sage.modular.modform.space.ModularFormsSpace(Gamma0(11), 2, DirichletGroup(1)[0], base_ring=QQ); M.new_submodule() - Traceback (most recent call last): - ... - NotImplementedError: computation of new submodule not yet implemented + sage: # needs sage.rings.number_field + sage: M = sage.modular.modform.space.ModularFormsSpace(Gamma0(11), 2, DirichletGroup(1)[0], base_ring=QQ); M.new_submodule() + Traceback (most recent call last): + ... + NotImplementedError: computation of new submodule not yet implemented """ raise NotImplementedError("computation of new submodule not yet implemented") @@ -1630,6 +1633,7 @@ def new_subspace(self, p=None): EXAMPLES:: + sage: # needs sage.rings.number_field sage: M = sage.modular.modform.space.ModularFormsSpace(Gamma0(11), 2, DirichletGroup(1)[0], base_ring=QQ); M.new_subspace() Traceback (most recent call last): ... @@ -1647,6 +1651,7 @@ def eisenstein_series(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: M = sage.modular.modform.space.ModularFormsSpace(Gamma0(11), 2, DirichletGroup(1)[0], base_ring=QQ); M.eisenstein_series() Traceback (most recent call last): ... @@ -1833,6 +1838,7 @@ def modular_symbols(self, sign=0): EXAMPLES:: + sage: # needs sage.rings.number_field sage: M = sage.modular.modform.space.ModularFormsSpace(Gamma0(11), 2, DirichletGroup(1)[0], base_ring=QQ); M.modular_symbols() Traceback (most recent call last): ... diff --git a/src/sage/modular/modform/submodule.py b/src/sage/modular/modform/submodule.py index 441f6d9dd05..f2bc33f5782 100644 --- a/src/sage/modular/modform/submodule.py +++ b/src/sage/modular/modform/submodule.py @@ -1,16 +1,20 @@ +# sage.doctest: needs sage.libs.pari """ Submodules of spaces of modular forms EXAMPLES:: sage: M = ModularForms(Gamma1(13),2); M - Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field + Modular Forms space of dimension 13 for + Congruence Subgroup Gamma1(13) of weight 2 over Rational Field sage: M.eisenstein_subspace() - Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field + Eisenstein subspace of dimension 11 of Modular Forms space of dimension 13 for + Congruence Subgroup Gamma1(13) of weight 2 over Rational Field sage: M == loads(dumps(M)) True sage: M.cuspidal_subspace() - Cuspidal subspace of dimension 2 of Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field + Cuspidal subspace of dimension 2 of Modular Forms space of dimension 13 for + Congruence Subgroup Gamma1(13) of weight 2 over Rational Field """ ######################################################################### diff --git a/src/sage/modular/modform/tests.py b/src/sage/modular/modform/tests.py index 87dcf84d1a7..ec831dcc84e 100644 --- a/src/sage/modular/modform/tests.py +++ b/src/sage/modular/modform/tests.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari """ TESTS: diff --git a/src/sage/modular/modform/vm_basis.py b/src/sage/modular/modform/vm_basis.py index f83c6bbcc1f..e79408d6f93 100644 --- a/src/sage/modular/modform/vm_basis.py +++ b/src/sage/modular/modform/vm_basis.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint r""" The Victor Miller basis diff --git a/src/sage/modular/modform/weight1.py b/src/sage/modular/modform/weight1.py index 4cb34df7513..c2ce006decb 100644 --- a/src/sage/modular/modform/weight1.py +++ b/src/sage/modular/modform/weight1.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" Weight 1 modular forms diff --git a/src/sage/modular/modform_hecketriangle/abstract_space.py b/src/sage/modular/modform_hecketriangle/abstract_space.py index d1e23066aff..e0c4506122d 100644 --- a/src/sage/modular/modform_hecketriangle/abstract_space.py +++ b/src/sage/modular/modform_hecketriangle/abstract_space.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Modular forms for Hecke triangle groups diff --git a/src/sage/modular/modform_hecketriangle/analytic_type.py b/src/sage/modular/modform_hecketriangle/analytic_type.py index 0c809b3328c..bdbc34a778a 100644 --- a/src/sage/modular/modform_hecketriangle/analytic_type.py +++ b/src/sage/modular/modform_hecketriangle/analytic_type.py @@ -326,9 +326,9 @@ class AnalyticType(FiniteLatticePoset): EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: el = QuasiModularForms(n=3, k=6, ep=-1)(y-z^3) - sage: el.analytic_type() + sage: x,y,z,d = var("x,y,z,d") # needs sage.symbolic + sage: el = QuasiModularForms(n=3, k=6, ep=-1)(y-z^3) # needs sage.symbolic + sage: el.analytic_type() # needs sage.symbolic quasi modular Similarly the type of the ring element ``el2 = E4/Delta - E6/Delta`` is @@ -336,9 +336,9 @@ class AnalyticType(FiniteLatticePoset): a function which is holomorphic at infinity:: sage: from sage.modular.modform_hecketriangle.graded_ring import WeakModularFormsRing - sage: x,y,z,d = var("x,y,z,d") - sage: el2 = WeakModularFormsRing(n=3)(x/(x^3-y^2)-y/(x^3-y^2)) - sage: el2.analytic_type() + sage: x,y,z,d = var("x,y,z,d") # needs sage.symbolic + sage: el2 = WeakModularFormsRing(n=3)(x/(x^3-y^2)-y/(x^3-y^2)) # needs sage.symbolic + sage: el2.analytic_type() # needs sage.symbolic weakly holomorphic modular """ diff --git a/src/sage/modular/modform_hecketriangle/constructor.py b/src/sage/modular/modform_hecketriangle/constructor.py index 845098fe862..3a9e21fa852 100644 --- a/src/sage/modular/modform_hecketriangle/constructor.py +++ b/src/sage/modular/modform_hecketriangle/constructor.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Constructor for spaces of modular forms for Hecke triangle groups based on a type @@ -42,33 +43,30 @@ def rational_type(f, n=ZZ(3), base_ring=ZZ): INPUT: - - ``f`` -- A rational function in ``x,y,z,d`` over ``base_ring``. + - ``f`` -- A rational function in ``x,y,z,d`` over ``base_ring``. - - ``n`` -- An integer greater or equal to `3` corresponding - to the ``HeckeTriangleGroup`` with that parameter - (default: `3`). + - ``n`` -- An integer greater or equal to `3` corresponding + to the ``HeckeTriangleGroup`` with that parameter (default: `3`). - - ``base_ring`` -- The base ring of the corresponding forms ring, resp. - polynomial ring (default: ``ZZ``). + - ``base_ring`` -- The base ring of the corresponding forms ring, resp. + polynomial ring (default: ``ZZ``). OUTPUT: A tuple ``(elem, homo, k, ep, analytic_type)`` describing the basic analytic properties of `f` (with the interpretation indicated above). - - ``elem`` -- ``True`` if `f` has a homogeneous denominator. + - ``elem`` -- ``True`` if `f` has a homogeneous denominator. - - ``homo`` -- ``True`` if `f` also has a homogeneous numerator. + - ``homo`` -- ``True`` if `f` also has a homogeneous numerator. - - ``k`` -- ``None`` if `f` is not homogeneous, otherwise - the weight of `f` (which is the first component - of its degree). + - ``k`` -- ``None`` if `f` is not homogeneous, otherwise + the weight of `f` (which is the first component of its degree). - - ``ep`` -- ``None`` if `f` is not homogeneous, otherwise - the multiplier of `f` (which is the second component - of its degree) + - ``ep`` -- ``None`` if `f` is not homogeneous, otherwise + the multiplier of `f` (which is the second component of its degree) - - ``analytic_type`` -- The ``AnalyticType`` of `f`. + - ``analytic_type`` -- The :class:`AnalyticType` of `f`. For the zero function the degree `(0, 1)` is choosen. @@ -79,44 +77,34 @@ def rational_type(f, n=ZZ(3), base_ring=ZZ): EXAMPLES:: sage: from sage.modular.modform_hecketriangle.constructor import rational_type - sage: (x,y,z,d) = var("x,y,z,d") sage: rational_type(0, n=4) (True, True, 0, 1, zero) - sage: rational_type(1, n=12) (True, True, 0, 1, modular) + sage: # needs sage.symbolic + sage: (x,y,z,d) = var("x,y,z,d") sage: rational_type(x^3 - y^2) (True, True, 12, 1, cuspidal) - sage: rational_type(x * z, n=7) (True, True, 14/5, -1, quasi modular) - sage: rational_type(1/(x^3 - y^2) + z/d) (True, False, None, None, quasi weakly holomorphic modular) - sage: rational_type(x^3/(x^3 - y^2)) (True, True, 0, 1, weakly holomorphic modular) - sage: rational_type(1/(x + z)) (False, False, None, None, None) - sage: rational_type(1/x + 1/z) (True, False, None, None, quasi meromorphic modular) - sage: rational_type(d/x, n=10) (True, True, -1/2, 1, meromorphic modular) - sage: rational_type(1.1 * z * (x^8-y^2), n=8, base_ring=CC) (True, True, 22/3, -1, quasi cuspidal) - sage: rational_type(x-y^2, n=infinity) (True, True, 4, 1, modular) - sage: rational_type(x*(x-y^2), n=infinity) (True, True, 8, 1, cuspidal) - sage: rational_type(1/x, n=infinity) (True, True, -4, 1, weakly holomorphic modular) """ @@ -222,21 +210,17 @@ def FormsSpace(analytic_type, group=3, base_ring=ZZ, k=QQ(0), ep=None): INPUT: - - ``analytic_type`` -- An element of ``AnalyticType()`` describing - the analytic type of the space. + - ``analytic_type`` -- An element of ``AnalyticType()`` describing + the analytic type of the space. - - ``group`` -- The index of the (Hecke triangle) group of the - space (default: `3`). + - ``group`` -- The index of the (Hecke triangle) group of the space (default: `3`). - - ``base_ring`` -- The base ring of the space - (default: ``ZZ``). + - ``base_ring`` -- The base ring of the space (default: ``ZZ``). - - ``k`` -- The weight of the space, a rational number - (default: ``0``). + - ``k`` -- The weight of the space, a rational number (default: ``0``). - - ``ep`` -- The multiplier of the space, `1`, `-1` - or ``None`` (in case ``ep`` should be - determined from ``k``). Default: ``None``. + - ``ep`` -- The multiplier of the space, `1`, `-1` or ``None`` + (in which case ``ep`` should be determined from ``k``). Default: ``None``. For the variables ``group``, ``base_ring``, ``k``, ``ep`` the same arguments as for the class ``FormsSpace_abstract`` can be used. @@ -340,20 +324,19 @@ def FormsRing(analytic_type, group=3, base_ring=ZZ, red_hom=False): INPUT: - - ``analytic_type`` -- An element of ``AnalyticType()`` describing - the analytic type of the space. + - ``analytic_type`` -- An element of ``AnalyticType()`` describing + the analytic type of the space. - - ``group`` -- The index of the (Hecke triangle) group of the space - (default: 3`). + - ``group`` -- The index of the (Hecke triangle) group of the space + (default: 3`). - - ``base_ring`` -- The base ring of the space - (default: ``ZZ``). + - ``base_ring`` -- The base ring of the space (default: ``ZZ``). - - ``red_hom`` -- The (boolean= variable ``red_hom`` of the space - (default: ``False``). + - ``red_hom`` -- The (boolean) variable ``red_hom`` of the space + (default: ``False``). For the variables ``group``, ``base_ring``, ``red_hom`` - the same arguments as for the class ``FormsRing_abstract`` can be used. + the same arguments as for the class :class:`FormsRing_abstract` can be used. The variables will then be put in canonical form. OUTPUT: diff --git a/src/sage/modular/modform_hecketriangle/element.py b/src/sage/modular/modform_hecketriangle/element.py index 9cb02cb7cde..b8cac1e9f52 100644 --- a/src/sage/modular/modform_hecketriangle/element.py +++ b/src/sage/modular/modform_hecketriangle/element.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Elements of Hecke modular forms spaces @@ -30,10 +31,10 @@ def __init__(self, parent, rat): INPUT: - - ``parent`` -- a modular form space + - ``parent`` -- a modular form space - - ``rat`` -- a rational function which corresponds to a - modular form in the modular form space + - ``rat`` -- a rational function which corresponds to a + modular form in the modular form space OUTPUT: @@ -188,14 +189,14 @@ def lseries(self, num_prec=None, max_imaginary_part=0, max_asymp_coeffs=40): INPUT: - - ``num_prec`` -- An integer denoting the to-be-used numerical precision. - If integer ``num_prec=None`` (default) the default - numerical precision of the parent of ``self`` is used. + - ``num_prec`` -- An integer denoting the to-be-used numerical precision. + If integer ``num_prec=None`` (default) the default + numerical precision of the parent of ``self`` is used. - ``max_imaginary_part`` -- A real number (default: 0), indicating up to which - imaginary part the L-series is going to be studied. + imaginary part the L-series is going to be studied. - - ``max_asymp_coeffs`` -- An integer (default: 40). + - ``max_asymp_coeffs`` -- An integer (default: 40). OUTPUT: @@ -260,16 +261,17 @@ def lseries(self, num_prec=None, max_imaginary_part=0, max_asymp_coeffs=40): sage: L(10).n(53) -13.0290184579... - sage: f = (ModularForms(n=17, k=24).Delta()^2) # long time - sage: L = f.lseries() # long time - sage: L.check_functional_equation() < 2^(-50) # long time + sage: # long time + sage: f = (ModularForms(n=17, k=24).Delta()^2) + sage: L = f.lseries() + sage: L.check_functional_equation() < 2^(-50) True - sage: L.taylor_series(12, 3) # long time + sage: L.taylor_series(12, 3) 0.000683924755280... - 0.000875942285963...*z + 0.000647618966023...*z^2 + O(z^3) - sage: coeffs = f.q_expansion_vector(min_exp=0, max_exp=20, fix_d=True) # long time - sage: sum([coeffs[k]*k^(-30) for k in range(1,len(coeffs))]).n(53) # long time + sage: coeffs = f.q_expansion_vector(min_exp=0, max_exp=20, fix_d=True) + sage: sum([coeffs[k]*k^(-30) for k in range(1,len(coeffs))]).n(53) 9.31562890589...e-10 - sage: L(30).n(53) # long time + sage: L(30).n(53) 9.31562890589...e-10 sage: f = ModularForms(n=infinity, k=2, ep=-1).f_i() diff --git a/src/sage/modular/modform_hecketriangle/functors.py b/src/sage/modular/modform_hecketriangle/functors.py index f06615c823f..3ba9c865231 100644 --- a/src/sage/modular/modform_hecketriangle/functors.py +++ b/src/sage/modular/modform_hecketriangle/functors.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Functor construction for all spaces diff --git a/src/sage/modular/modform_hecketriangle/graded_ring.py b/src/sage/modular/modform_hecketriangle/graded_ring.py index f7153493aac..624341c8dc7 100644 --- a/src/sage/modular/modform_hecketriangle/graded_ring.py +++ b/src/sage/modular/modform_hecketriangle/graded_ring.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Graded rings of modular forms for Hecke triangle groups diff --git a/src/sage/modular/modform_hecketriangle/graded_ring_element.py b/src/sage/modular/modform_hecketriangle/graded_ring_element.py index a2ef2a03b04..0de1562677b 100644 --- a/src/sage/modular/modform_hecketriangle/graded_ring_element.py +++ b/src/sage/modular/modform_hecketriangle/graded_ring_element.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Elements of graded rings of modular forms for Hecke triangle groups @@ -57,9 +58,10 @@ def __classcall__(cls, parent, rat): EXAMPLES:: + sage: # needs sage.symbolic sage: from sage.modular.modform_hecketriangle.graded_ring_element import FormsRingElement sage: from sage.modular.modform_hecketriangle.graded_ring import ModularFormsRing - sage: (x,d) = var("x","d") + sage: x, d = var("x","d") sage: el = FormsRingElement(ModularFormsRing(), x*d) sage: el.rat() x*d @@ -100,11 +102,11 @@ def __init__(self, parent, rat): EXAMPLES:: + sage: # needs sage.symbolic sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing - sage: (x,y,z,d)=var("x,y,z,d") + sage: x, y, z, d = var("x,y,z,d") sage: MR = QuasiModularFormsRing(n=5) - sage: el = MR(x^3*d + y*z) - sage: el + sage: el = MR(x^3*d + y*z); el f_rho^3*d + f_i*E2 sage: el.rat() x^3*d + y*z @@ -112,10 +114,8 @@ def __init__(self, parent, rat): QuasiModularFormsRing(n=5) over Integer Ring sage: el.rat().parent() Fraction Field of Multivariate Polynomial Ring in x, y, z, d over Integer Ring - sage: MR = QuasiModularFormsRing(n=infinity) - sage: el = MR(d*x*(x-y^2)) - sage: el + sage: el = MR(d*x*(x-y^2)); el -E4*f_i^2*d + E4^2*d sage: el.rat() -x*y^2*d + x^2*d @@ -172,11 +172,11 @@ def _repr_(self): EXAMPLES:: sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing - sage: (x,y,z,d)=var("x,y,z,d") - sage: QuasiModularFormsRing(n=5)(x^3*z-d*y) + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing(n=5)(x^3*z - d*y) # needs sage.symbolic f_rho^3*E2 - f_i*d - sage: QuasiModularFormsRing(n=infinity)(x) + sage: QuasiModularFormsRing(n=infinity)(x) # needs sage.symbolic E4 """ @@ -189,11 +189,11 @@ def _rat_repr(self): EXAMPLES:: sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms - sage: (x,y,z,d)=var("x,y,z,d") - sage: QuasiModularForms(n=5, k=6, ep=-1)(x^3*z)._rat_repr() + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularForms(n=5, k=6, ep=-1)(x^3*z)._rat_repr() # needs sage.symbolic 'f_rho^3*E2' - sage: QuasiModularForms(n=infinity, k=10)(x*(x-y^2)*z)._rat_repr() + sage: QuasiModularForms(n=infinity, k=10)(x*(x-y^2)*z)._rat_repr() # needs sage.symbolic '-E4*f_i^2*E2 + E4^2*E2' """ if self.hecke_n() == infinity: @@ -212,13 +212,13 @@ def _qexp_repr(self): EXAMPLES:: sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing - sage: (x,y,z,d)=var("x,y,z,d") + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic sage: MR = QuasiModularFormsRing(n=5) sage: MR.disp_prec(3) - sage: MR(x^3*z-d*y)._qexp_repr() + sage: MR(x^3*z-d*y)._qexp_repr() # needs sage.symbolic '-d + 1 + ((65*d + 33)/(200*d))*q + ((1755*d + 1437)/(320000*d^2))*q^2 + O(q^3)' - sage: QuasiModularFormsRing(n=infinity)(x*(x-y^2)*z)._qexp_repr() + sage: QuasiModularFormsRing(n=infinity)(x*(x-y^2)*z)._qexp_repr() # needs sage.symbolic '64*q - 3840*q^3 - 16384*q^4 + O(q^5)' """ @@ -235,15 +235,15 @@ def _latex_(self): EXAMPLES:: sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing - sage: (x,y,z,d)=var("x,y,z,d") - sage: latex(QuasiModularFormsRing(n=5)(x^3*z-d*y)) + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: latex(QuasiModularFormsRing(n=5)(x^3*z - d*y)) # needs sage.symbolic f_{\rho}^{3} E_{2} - f_{i} d sage: from sage.modular.modform_hecketriangle.space import CuspForms - sage: latex(CuspForms(k=12)(x^3-y^2)) + sage: latex(CuspForms(k=12)(x^3 - y^2)) # needs sage.symbolic f_{\rho}^{3} - f_{i}^{2} - sage: latex(QuasiModularFormsRing(n=infinity)(x*(x-y^2)*z)) + sage: latex(QuasiModularFormsRing(n=infinity)(x*(x-y^2)*z)) # needs sage.symbolic -E_{4} f_{i}^{2} E_{2} + E_{4}^{2} E_{2} """ @@ -361,11 +361,11 @@ def is_homogeneous(self): True sage: QuasiModularFormsRing(n=12).Delta().parent().is_homogeneous() False - sage: x,y,z,d=var("x,y,z,d") - sage: QuasiModularFormsRing(n=12)(x^3+y^2+z+d).is_homogeneous() + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing(n=12)(x^3+y^2+z+d).is_homogeneous() # needs sage.symbolic False - sage: QuasiModularFormsRing(n=infinity)(x*(x-y^2)+y^4).is_homogeneous() + sage: QuasiModularFormsRing(n=infinity)(x*(x-y^2)+y^4).is_homogeneous() # needs sage.symbolic True """ @@ -379,8 +379,8 @@ def weight(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing sage: from sage.modular.modform_hecketriangle.space import ModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: QuasiModularFormsRing()(x+y).weight() is None + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing()(x+y).weight() is None # needs sage.symbolic True sage: ModularForms(n=18).f_i().weight() 9/4 @@ -398,8 +398,8 @@ def ep(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing sage: from sage.modular.modform_hecketriangle.space import ModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: QuasiModularFormsRing()(x+y).ep() is None + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing()(x+y).ep() is None # needs sage.symbolic True sage: ModularForms(n=18).f_i().ep() -1 @@ -419,8 +419,8 @@ def degree(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing sage: from sage.modular.modform_hecketriangle.space import ModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: QuasiModularFormsRing()(x+y).degree() == (None, None) + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing()(x+y).degree() == (None, None) # needs sage.symbolic True sage: ModularForms(n=18).f_i().degree() (9/4, -1) @@ -438,10 +438,10 @@ def is_modular(self) -> bool: sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: QuasiModularFormsRing(n=5)(x^2+y-d).is_modular() + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing(n=5)(x^2+y-d).is_modular() # needs sage.symbolic True - sage: QuasiModularFormsRing(n=5)(x^2+y-d+z).is_modular() + sage: QuasiModularFormsRing(n=5)(x^2+y-d+z).is_modular() # needs sage.symbolic False sage: QuasiModularForms(n=18).f_i().is_modular() True @@ -460,9 +460,10 @@ def is_weakly_holomorphic(self): EXAMPLES:: + sage: # needs sage.symbolic sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiMeromorphicModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiMeromorphicModularForms - sage: x,y,z,d = var("x,y,z,d") + sage: x, y, z, d = var("x,y,z,d") sage: QuasiMeromorphicModularFormsRing(n=5)(x/(x^5-y^2)+z).is_weakly_holomorphic() True sage: QuasiMeromorphicModularFormsRing(n=5)(x^2+y/x-d).is_weakly_holomorphic() @@ -487,10 +488,10 @@ def is_holomorphic(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiMeromorphicModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiMeromorphicModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: QuasiMeromorphicModularFormsRing(n=5)((y^3-z^5)/(x^5-y^2)+y-d).is_holomorphic() + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiMeromorphicModularFormsRing(n=5)((y^3-z^5)/(x^5-y^2)+y-d).is_holomorphic() # needs sage.symbolic False - sage: QuasiMeromorphicModularFormsRing(n=5)(x^2+y-d+z).is_holomorphic() + sage: QuasiMeromorphicModularFormsRing(n=5)(x^2+y-d+z).is_holomorphic() # needs sage.symbolic True sage: QuasiMeromorphicModularForms(n=18).J_inv().is_holomorphic() False @@ -512,10 +513,10 @@ def is_cuspidal(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms - sage: x,y,z,d = var("x,y,z,d") - sage: QuasiModularFormsRing(n=5)(y^3-z^5).is_cuspidal() + sage: x, y, z, d = var("x,y,z,d") # needs sage.symbolic + sage: QuasiModularFormsRing(n=5)(y^3-z^5).is_cuspidal() # needs sage.symbolic False - sage: QuasiModularFormsRing(n=5)(z*x^5-z*y^2).is_cuspidal() + sage: QuasiModularFormsRing(n=5)(z*x^5-z*y^2).is_cuspidal() # needs sage.symbolic True sage: QuasiModularForms(n=18).Delta().is_cuspidal() True @@ -536,7 +537,6 @@ def is_zero(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiModularForms - sage: x,y,z,d = var("x,y,z,d") sage: QuasiModularFormsRing(n=5)(1).is_zero() False sage: QuasiModularFormsRing(n=5)(0).is_zero() @@ -558,13 +558,16 @@ def analytic_type(self): sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiMeromorphicModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiMeromorphicModularForms - sage: x,y,z,d = var("x,y,z,d") + + sage: # needs sage.symbolic + sage: x, y, z, d = var("x,y,z,d") sage: QuasiMeromorphicModularFormsRing(n=5)(x/z+d).analytic_type() quasi meromorphic modular sage: QuasiMeromorphicModularFormsRing(n=5)((y^3-z^5)/(x^5-y^2)+y-d).analytic_type() quasi weakly holomorphic modular sage: QuasiMeromorphicModularFormsRing(n=5)(x^2+y-d).analytic_type() modular + sage: QuasiMeromorphicModularForms(n=18).J_inv().analytic_type() weakly holomorphic modular sage: QuasiMeromorphicModularForms(n=18).f_inf().analytic_type() @@ -585,9 +588,10 @@ def numerator(self): EXAMPLES:: + sage: # needs sage.symbolic sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiMeromorphicModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiMeromorphicModularForms - sage: x,y,z,d = var("x,y,z,d") + sage: x, y, z, d = var("x,y,z,d") sage: QuasiMeromorphicModularFormsRing(n=5)((y^3-z^5)/(x^5-y^2)+y-d).numerator() f_rho^5*f_i - f_rho^5*d - E2^5 + f_i^2*d sage: QuasiMeromorphicModularFormsRing(n=5)((y^3-z^5)/(x^5-y^2)+y-d).numerator().parent() @@ -617,9 +621,10 @@ def denominator(self): EXAMPLES:: + sage: # needs sage.symbolic sage: from sage.modular.modform_hecketriangle.graded_ring import QuasiMeromorphicModularFormsRing sage: from sage.modular.modform_hecketriangle.space import QuasiMeromorphicModularForms - sage: x,y,z,d = var("x,y,z,d") + sage: x, y, z, d = var("x,y,z,d") sage: QuasiMeromorphicModularFormsRing(n=5).Delta().full_reduce().denominator() 1 + O(q^5) sage: QuasiMeromorphicModularFormsRing(n=5)((y^3-z^5)/(x^5-y^2)+y-d).denominator() @@ -1010,22 +1015,21 @@ def diff_op(self, op, new_parent=None): INPUT: - - ``op`` -- An element of ``self.parent().diff_alg()``. - I.e. an element of the algebra over ``QQ`` - of differential operators generated - by ``X, Y, Z, dX, dY, DZ``, where e.g. ``X`` - corresponds to the multiplication by ``x`` - (resp. ``f_rho``) and ``dX`` corresponds to ``d/dx``. + - ``op`` -- An element of ``self.parent().diff_alg()``. + I.e. an element of the algebra over ``QQ`` + of differential operators generated + by ``X, Y, Z, dX, dY, DZ``, where e.g. ``X`` + corresponds to the multiplication by ``x`` + (resp. ``f_rho``) and ``dX`` corresponds to ``d/dx``. - To expect a homogeneous result after applying - the operator to a homogeneous element it should - should be homogeneous operator (with respect - to the usual, special grading). + To expect a homogeneous result after applying + the operator to a homogeneous element it should + should be homogeneous operator (with respect + to the usual, special grading). - ``new_parent`` -- Try to convert the result to the specified - ``new_parent``. If ``new_parent == None`` (default) - then the parent is extended to a - "quasi meromorphic" ring. + ``new_parent``. If ``new_parent == None`` (default) + then the parent is extended to a "quasi meromorphic" ring. OUTPUT: @@ -1323,10 +1327,10 @@ def order_at(self, tau=infinity): sage: (1/MR.f_inf()^2).order_at(-1) 0 - sage: p = HyperbolicPlane().PD().get_point(I) - sage: MR((x-y)^10).order_at(p) + sage: p = HyperbolicPlane().PD().get_point(I) # needs sage.symbolic + sage: MR((x-y)^10).order_at(p) # needs sage.symbolic 10 - sage: MR.zero().order_at(p) + sage: MR.zero().order_at(p) # needs sage.symbolic +Infinity """ @@ -1586,31 +1590,31 @@ def _q_expansion_cached(self, prec, fix_d, subs_d, d_num_prec, fix_prec=False): def q_expansion(self, prec=None, fix_d=False, d_num_prec=None, fix_prec=False): """ - Returns the Fourier expansion of self. + Return the Fourier expansion of ``self``. INPUT: - - ``prec`` -- An integer, the desired output precision O(q^prec). - Default: ``None`` in which case the default precision - of ``self.parent()`` is used. + - ``prec`` -- An integer, the desired output precision O(q^prec). + Default: ``None`` in which case the default precision + of ``self.parent()`` is used. - - ``fix_d`` -- If ``False`` (default) a formal parameter is used for ``d``. - If ``True`` then the numerical value of ``d`` is used - (resp. an exact value if the group is arithmetic). - Otherwise the given value is used for ``d``. + - ``fix_d`` -- If ``False`` (default) a formal parameter is used for ``d``. + If ``True`` then the numerical value of ``d`` is used + (resp. an exact value if the group is arithmetic). + Otherwise the given value is used for ``d``. - ``d_num_prec`` -- The precision to be used if a numerical value for ``d`` is substituted. - Default: ``None`` in which case the default - numerical precision of ``self.parent()`` is used. + Default: ``None`` in which case the default + numerical precision of ``self.parent()`` is used. - - ``fix_prec`` -- If ``fix_prec`` is not ``False`` (default) - then the precision of the ``MFSeriesConstructor`` is - increased such that the output has exactly the specified - precision O(q^prec). + - ``fix_prec`` -- If ``fix_prec`` is not ``False`` (default) + then the precision of the ``MFSeriesConstructor`` is + increased such that the output has exactly the specified + precision O(q^prec). OUTPUT: - The Fourier expansion of self as a ``FormalPowerSeries`` or ``FormalLaurentSeries``. + The Fourier expansion of ``self`` as a ``FormalPowerSeries`` or ``FormalLaurentSeries``. EXAMPLES:: @@ -1690,24 +1694,24 @@ def q_expansion(self, prec=None, fix_d=False, d_num_prec=None, fix_prec=False): def q_expansion_fixed_d(self, prec=None, d_num_prec=None, fix_prec=False): """ - Returns the Fourier expansion of self. + Return the Fourier expansion of ``self``. + The numerical (or exact) value for ``d`` is substituted. INPUT: - - ``prec`` -- An integer, the desired output precision O(q^prec). - Default: ``None`` in which case the default precision - of ``self.parent()`` is used. + - ``prec`` -- An integer, the desired output precision O(q^prec). + Default: ``None`` in which case the default precision of ``self.parent()`` is used. - ``d_num_prec`` -- The precision to be used if a numerical value for ``d`` is substituted. - Default: ``None`` in which case the default - numerical precision of ``self.parent()`` is used. + Default: ``None`` in which case the default + numerical precision of ``self.parent()`` is used. - - ``fix_prec`` -- If ``fix_prec`` is not ``False`` (default) - then the precision of the ``MFSeriesConstructor`` is - increased such that the output has exactly the specified - precision O(q^prec). + - ``fix_prec`` -- If ``fix_prec`` is not ``False`` (default) + then the precision of the ``MFSeriesConstructor`` is + increased such that the output has exactly the specified + precision O(q^prec). OUTPUT: @@ -1757,20 +1761,19 @@ def q_expansion_vector(self, min_exp=None, max_exp=None, prec=None, **kwargs): INPUT: - ``min_exp`` -- An integer, specifying the first coefficient to be - used for the vector. Default: ``None``, meaning that - the first non-trivial coefficient is used. + used for the vector. Default: ``None``, meaning that + the first non-trivial coefficient is used. - - ``max_exp`` -- An integer, specifying the last coefficient to be - used for the vector. Default: ``None``, meaning that - the default precision + 1 is used. + - ``max_exp`` -- An integer, specifying the last coefficient to be + used for the vector. Default: ``None``, meaning that + the default precision + 1 is used. - - ``prec`` -- An integer, specifying the precision of the underlying - Laurent series. Default: ``None``, meaning that - ``max_exp + 1`` is used. + - ``prec`` -- An integer, specifying the precision of the underlying + Laurent series. Default: ``None``, meaning that ``max_exp + 1`` is used. OUTPUT: - A vector of size ``max_exp - min_exp`` over the coefficient ring of self, + A vector of size ``max_exp - min_exp`` over the coefficient ring of ``self``, determined by the corresponding Laurent series coefficients. EXAMPLES:: @@ -1840,22 +1843,21 @@ def evaluate(self, tau, prec=None, num_prec=None, check=False): INPUT: - - ``tau`` -- ``infinity`` or an element of the upper - half plane. E.g. with parent ``AA`` or ``CC``. + - ``tau`` -- ``infinity`` or an element of the upper + half plane. E.g. with parent ``AA`` or ``CC``. - - ``prec`` -- An integer, namely the precision used for the - Fourier expansion. If ``prec == None`` (default) - then the default precision of ``self.parent()`` - is used. + - ``prec`` -- An integer, namely the precision used for the + Fourier expansion. If ``prec == None`` (default) + then the default precision of ``self.parent()`` is used. - - ``num_prec`` -- An integer, namely the minimal numerical precision - used for ``tau`` and ``d``. If ``num_prec == None`` - (default) then the default numerical precision of - ``self.parent()`` is used. + - ``num_prec`` -- An integer, namely the minimal numerical precision + used for ``tau`` and ``d``. If ``num_prec == None`` + (default) then the default numerical precision of + ``self.parent()`` is used. - - ``check`` -- If ``True`` then the order of ``tau`` is checked. - Otherwise the order is only considered for - ``tau = infinity, i, rho, -1/rho``. Default: ``False``. + - ``check`` -- If ``True`` then the order of ``tau`` is checked. + Otherwise the order is only considered for + ``tau = infinity, i, rho, -1/rho``. Default: ``False``. OUTPUT: @@ -2123,6 +2125,7 @@ def evaluate(self, tau, prec=None, num_prec=None, check=False): It is possible to evaluate at points of ``HyperbolicPlane()``:: + sage: # needs sage.symbolic sage: p = HyperbolicPlane().PD().get_point(-I/2) sage: bool(p.to_model('UHP').coordinates() == I/3) True diff --git a/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py b/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py index b0241196107..7fa7b698d14 100644 --- a/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +++ b/src/sage/modular/modform_hecketriangle/hecke_triangle_group_element.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.gap r""" Hecke triangle group elements @@ -40,12 +41,14 @@ def coerce_AA(p): EXAMPLES:: + sage: # needs sage.rings.number_field sage.symbolic sage: from sage.modular.modform_hecketriangle.hecke_triangle_group_element import coerce_AA sage: p = (791264*AA(2*cos(pi/8))^2 - 463492).sqrt() sage: AA(p)._exact_field() Number Field in a with defining polynomial y^8 ... with a in ... sage: coerce_AA(p)._exact_field() - Number Field in a with defining polynomial y^4 - 1910*y^2 - 3924*y + 681058 with a in ...? + Number Field in a with defining polynomial y^4 - 1910*y^2 - 3924*y + 681058 + with a in ...? """ el = AA(p) el.simplify() @@ -103,17 +106,18 @@ def __init__(self, parent, M, check=True, **kwargs): - ``parent`` -- A ``HeckeTriangleGroup``. - - ``M`` -- A matrix which coerces into the matrix space - of ``parent``. For example with entries in a - polynomial ring over ``ZZ`` with parameter ``lam``. + - ``M`` -- A matrix which coerces into the matrix space + of ``parent``. For example with entries in a + polynomial ring over ``ZZ`` with parameter ``lam``. - ``check`` -- ``True`` (default) or ``False``. If ``True`` - then a (possibly long) check is performed - to see whether ``M`` really corresponds to a - group element of ``parent``. + then a (possibly long) check is performed + to see whether ``M`` really corresponds to a + group element of ``parent``. EXAMPLES:: + sage: sage: from sage.modular.modform_hecketriangle.hecke_triangle_groups import HeckeTriangleGroup, HeckeTriangleGroupElement sage: lam = PolynomialRing(ZZ, 'lam').gen() sage: M = matrix([[-1, 0], [-lam^4 + 5*lam^2 + lam - 5, -1]]) @@ -121,7 +125,8 @@ def __init__(self, parent, M, check=True, **kwargs): sage: G(M) Traceback (most recent call last): ... - TypeError: The matrix is not an element of Hecke triangle group for n = 4, up to equivalence it identifies two nonequivalent points. + TypeError: The matrix is not an element of Hecke triangle group for n = 4, + up to equivalence it identifies two nonequivalent points. sage: G = HeckeTriangleGroup(10) sage: el = G(M) @@ -139,13 +144,16 @@ def __init__(self, parent, M, check=True, **kwargs): [ -1 0] [lam -1] sage: el.matrix().parent() - Full MatrixSpace of 2 by 2 dense matrices over Maximal Order in Number Field in lam with defining polynomial x^4 - 5*x^2 + 5 with lam = 1.902113032590308? + Full MatrixSpace of 2 by 2 dense matrices over + Maximal Order in Number Field in lam with defining polynomial x^4 - 5*x^2 + 5 + with lam = 1.902113032590308? sage: M = matrix([[-1, lam], [0, 1]]) sage: G(M) Traceback (most recent call last): ... - TypeError: The matrix is not an element of Hecke triangle group for n = 10, it has determinant -1 != 1. + TypeError: The matrix is not an element of Hecke triangle group for n = 10, + it has determinant -1 != 1. sage: G.T().inverse() [ 1 -lam] @@ -339,19 +347,21 @@ def string_repr(self, method="default"): INPUT: - - ``method`` -- ``default``: Use the usual representation method for matrix group elements. + - ``method`` -- one of - ``basic``: The representation is given as a word in ``S`` and powers of ``T``. - Note: If ``S, T`` are defined accordingly the output can - be used/evaluated directly to recover ``self``. + - ``default``: Use the usual representation method for matrix group elements. - ``conj``: The conjugacy representative of the element is represented - as a word in powers of the basic blocks, together with - an unspecified conjugation matrix. + - ``basic``: The representation is given as a word in ``S`` and powers of ``T``. + Note: If ``S, T`` are defined accordingly the output can + be used/evaluated directly to recover ``self``. - ``block``: Same as ``conj`` but the conjugation matrix is specified as well. - Note: Assuming ``S, T, U, V`` are defined accordingly the output - can directly be used/evaluated to recover ``self``. + - ``conj``: The conjugacy representative of the element is represented + as a word in powers of the basic blocks, together with + an unspecified conjugation matrix. + + - ``block``: Same as ``conj`` but the conjugation matrix is specified as well. + Note: Assuming ``S, T, U, V`` are defined accordingly the output + can directly be used/evaluated to recover ``self``. Warning: For ``n=infinity`` the methods ``conj`` and ``block`` are not verified at all and are probably wrong! @@ -893,19 +903,19 @@ def primitive_representative(self, method="block"): INPUT: - ``method`` -- ``block`` (default) or ``cf``. The method - used to determine ``P`` and ``R``. If - ``self`` is elliptic this parameter is - ignored and if ``self`` is +- the identity - then the ``block`` method is used. + used to determine ``P`` and ``R``. If + ``self`` is elliptic, this parameter is + ignored, and if ``self`` is +- the identity + then the ``block`` method is used. - With ``block`` the decomposition described - in :meth:`_primitive_block_decomposition_data` is used. + With ``block`` the decomposition described + in :meth:`_primitive_block_decomposition_data` is used. - With ``cf`` a reduced representative from - the lambda-CF of ``self`` is used (see - :meth:`continued_fraction`). In that case - ``P`` corresponds to the period and ``R`` - to the preperiod. + With ``cf`` a reduced representative from + the lambda-CF of ``self`` is used (see + :meth:`continued_fraction`). In that case + ``P`` corresponds to the period and ``R`` + to the preperiod. OUTPUT: @@ -1079,11 +1089,11 @@ def primitive_part(self, method="cf"): INPUT: - ``method`` -- The method used to determine the primitive - part (see :meth:`primitive_representative`), - default: "cf". The parameter is ignored - for elliptic elements or +- the identity. + part (see :meth:`primitive_representative`), + default: "cf". The parameter is ignored + for elliptic elements or +- the identity. - The result should not depend on the method. + The result should not depend on the method. OUTPUT: @@ -1166,7 +1176,7 @@ def reduce(self, primitive=True): INPUT: - ``primitive`` -- If ``True`` (default) then a primitive - representative for ``self`` is returned. + representative for ``self`` is returned. EXAMPLES:: @@ -1278,9 +1288,9 @@ def primitive_power(self, method="cf"): INPUT: - ``method`` -- The method used to determine the primitive - power (see :meth:`primitive_representative`), - default: "cf". The parameter is ignored - for elliptic elements or +- the identity. + power (see :meth:`primitive_representative`), + default: "cf". The parameter is ignored + for elliptic elements or +- the identity. OUTPUT: @@ -1416,8 +1426,8 @@ def block_length(self, primitive=False): INPUT: - ``primitive`` -- If ``True`` then the conjugacy - representative of the primitive part is - used instead, default: ``False``. + representative of the primitive part is + used instead, default: ``False``. OUTPUT: @@ -1778,11 +1788,11 @@ def conjugacy_type(self, ignore_sign=True, primitive=False): INPUT: - ``ignore_sign`` -- If ``True`` (default) then the conjugacy - classes are only considered up to a sign. + classes are only considered up to a sign. - - ``primitive`` -- If ``True`` then the conjugacy class of - the primitive part is considered instead - and the sign is ignored, default: ``False``. + - ``primitive`` -- If ``True`` then the conjugacy class of + the primitive part is considered instead + and the sign is ignored, default: ``False``. OUTPUT: @@ -2379,10 +2389,10 @@ def is_reduced(self, require_primitive=True, require_hyperbolic=True): INPUT: - ``require_primitive`` -- If ``True`` (default) then non-primitive elements - are not considered reduced. + are not considered reduced. - ``require_hyperbolic`` -- If ``True`` (default) then non-hyperbolic elements - are not considered reduced. + are not considered reduced. EXAMPLES:: @@ -2721,7 +2731,8 @@ def linking_number(self): ....: t_const = (2*pi*i/G.lam()).n(num_prec) ....: d = MF.get_d(fix_d=True, d_num_prec=num_prec) ....: q = exp(t_const * z) - ....: return t_const*z + sum([(int_series.coefficients()[m]).subs(d=d) * q**int_series.exponents()[m] for m in range(len(int_series.coefficients()))]) + ....: return t_const*z + sum((int_series.coefficients()[m]).subs(d=d) * q**int_series.exponents()[m] + ....: for m in range(len(int_series.coefficients()))) sage: def M(gamma, z, num_prec=53): ....: a = ComplexField(num_prec)(gamma.a()) @@ -2738,7 +2749,9 @@ def linking_number(self): sage: def num_linking_number(A, z, n=3, prec=10, num_prec=53): ....: z = z.n(num_prec) ....: k = 4 * n / (n - 2) - ....: return (n-2) / (2*pi*i).n(num_prec) * (E2_primitive(A.acton(z), n=n, prec=prec, num_prec=num_prec) - E2_primitive(z, n=n, prec=prec, num_prec=num_prec) - k*M(A, z, num_prec=num_prec)) + ....: return (n-2) / (2*pi*i).n(num_prec) * (E2_primitive(A.acton(z), n=n, prec=prec, num_prec=num_prec) + ....: - E2_primitive(z, n=n, prec=prec, num_prec=num_prec) + ....: - k*M(A, z, num_prec=num_prec)) sage: G = HeckeTriangleGroup(8) sage: z = i diff --git a/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py b/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py index 917ebb0cf02..6c73cc50d40 100644 --- a/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py +++ b/src/sage/modular/modform_hecketriangle/hecke_triangle_groups.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.gap r""" Hecke triangle groups diff --git a/src/sage/modular/modform_hecketriangle/readme.py b/src/sage/modular/modform_hecketriangle/readme.py index b0059725904..ff8a725c15c 100644 --- a/src/sage/modular/modform_hecketriangle/readme.py +++ b/src/sage/modular/modform_hecketriangle/readme.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.gap r""" Overview of Hecke triangle groups and modular forms for Hecke triangle groups diff --git a/src/sage/modular/modform_hecketriangle/series_constructor.py b/src/sage/modular/modform_hecketriangle/series_constructor.py index dc2cd792a6b..b44f41a09a0 100644 --- a/src/sage/modular/modform_hecketriangle/series_constructor.py +++ b/src/sage/modular/modform_hecketriangle/series_constructor.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.gap r""" Series constructor for modular forms for Hecke triangle groups diff --git a/src/sage/modular/modform_hecketriangle/space.py b/src/sage/modular/modform_hecketriangle/space.py index 662f1035794..9df1e2d60ba 100644 --- a/src/sage/modular/modform_hecketriangle/space.py +++ b/src/sage/modular/modform_hecketriangle/space.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Modular forms for Hecke triangle groups diff --git a/src/sage/modular/modform_hecketriangle/subspace.py b/src/sage/modular/modform_hecketriangle/subspace.py index f89d42affd8..4475f71530a 100644 --- a/src/sage/modular/modform_hecketriangle/subspace.py +++ b/src/sage/modular/modform_hecketriangle/subspace.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.combinat sage.graphs r""" Subspaces of modular forms for Hecke triangle groups diff --git a/src/sage/modular/modsym/ambient.py b/src/sage/modular/modsym/ambient.py index 9c1876493f1..a0e40c27785 100644 --- a/src/sage/modular/modsym/ambient.py +++ b/src/sage/modular/modsym/ambient.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari r""" Ambient spaces of modular symbols diff --git a/src/sage/modular/modsym/boundary.py b/src/sage/modular/modsym/boundary.py index 208371b9deb..e90a5d165f6 100644 --- a/src/sage/modular/modsym/boundary.py +++ b/src/sage/modular/modsym/boundary.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari r""" Space of boundary modular symbols diff --git a/src/sage/modular/modsym/element.py b/src/sage/modular/modsym/element.py index df08763459d..80ccb3c4242 100644 --- a/src/sage/modular/modsym/element.py +++ b/src/sage/modular/modsym/element.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ A single element of an ambient space of modular symbols """ diff --git a/src/sage/modular/modsym/ghlist.py b/src/sage/modular/modsym/ghlist.py index bd15cc505b5..5df29f52af9 100644 --- a/src/sage/modular/modsym/ghlist.py +++ b/src/sage/modular/modsym/ghlist.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari r""" List of coset representatives for `\Gamma_H(N)` in `\SL_2(\ZZ)` """ diff --git a/src/sage/modular/modsym/hecke_operator.py b/src/sage/modular/modsym/hecke_operator.py index 6d416eca8e3..43e34b57a49 100644 --- a/src/sage/modular/modsym/hecke_operator.py +++ b/src/sage/modular/modsym/hecke_operator.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Sparse action of Hecke operators """ diff --git a/src/sage/modular/modsym/manin_symbol.pyx b/src/sage/modular/modsym/manin_symbol.pyx index 52026160b38..a71533e1b73 100644 --- a/src/sage/modular/modsym/manin_symbol.pyx +++ b/src/sage/modular/modsym/manin_symbol.pyx @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint r""" Manin symbols diff --git a/src/sage/modular/modsym/manin_symbol_list.py b/src/sage/modular/modsym/manin_symbol_list.py index 858fa4a9feb..93fa3f1365b 100644 --- a/src/sage/modular/modsym/manin_symbol_list.py +++ b/src/sage/modular/modsym/manin_symbol_list.py @@ -901,6 +901,7 @@ class ManinSymbolList_character(ManinSymbolList): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -922,6 +923,7 @@ def __init__(self, character, weight): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -955,6 +957,7 @@ def __repr__(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -975,6 +978,7 @@ def level(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: ManinSymbolList_character(eps,4).level() @@ -1005,6 +1009,7 @@ def apply(self, j, m): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,4) @@ -1041,6 +1046,7 @@ def apply_S(self, j): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -1065,6 +1071,7 @@ def _apply_S_only_0pm1(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: ManinSymbolList_character(eps,2)._apply_S_only_0pm1() @@ -1090,6 +1097,7 @@ def apply_I(self, j): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -1123,6 +1131,7 @@ def apply_T(self, j): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -1165,6 +1174,7 @@ def apply_TT(self, j): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -1200,6 +1210,7 @@ def character(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,2); m @@ -1229,6 +1240,7 @@ def index(self, x): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,4); m @@ -1267,6 +1279,7 @@ def normalize(self, x): EXAMPLES:: + sage: # needs sage.rings.number_field sage: eps = DirichletGroup(4).gen(0) sage: from sage.modular.modsym.manin_symbol_list import ManinSymbolList_character sage: m = ManinSymbolList_character(eps,4); m diff --git a/src/sage/modular/modsym/modsym.py b/src/sage/modular/modsym/modsym.py index d33f61cd928..962e3c168ed 100644 --- a/src/sage/modular/modsym/modsym.py +++ b/src/sage/modular/modsym/modsym.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari r""" Creation of modular symbols spaces @@ -20,25 +20,34 @@ :: - sage: M = ModularSymbols(23,2,base_ring=QQ) + sage: M = ModularSymbols(23,2, base_ring=QQ) sage: M.T(2).charpoly('x').factor() (x - 3) * (x^2 + x - 1)^2 sage: M.decomposition(2) [ - Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field, - Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Rational Field + Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 + for Gamma_0(23) of weight 2 with sign 0 over Rational Field, + Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 + for Gamma_0(23) of weight 2 with sign 0 over Rational Field ] :: - sage: M = ModularSymbols(23,2,base_ring=QuadraticField(5, 'sqrt5')) + sage: # needs sage.rings.number_field + sage: M = ModularSymbols(23,2, base_ring=QuadraticField(5, 'sqrt5')) sage: M.T(2).charpoly('x').factor() (x - 3) * (x - 1/2*sqrt5 + 1/2)^2 * (x + 1/2*sqrt5 + 1/2)^2 sage: M.decomposition(2) [ - Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?, - Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?, - Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5 with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790? + Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 5 + for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5 + with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?, + Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 + for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5 + with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790?, + Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 + for Gamma_0(23) of weight 2 with sign 0 over Number Field in sqrt5 + with defining polynomial x^2 - 5 with sqrt5 = 2.236067977499790? ] We compute some Hecke operators and do a consistency check:: @@ -52,23 +61,30 @@ sage: G = GammaH(36, [13, 19]) sage: G.modular_symbols() - Modular Symbols space of dimension 13 for Congruence Subgroup Gamma_H(36) with H generated by [13, 19] of weight 2 with sign 0 over Rational Field + Modular Symbols space of dimension 13 for Congruence Subgroup Gamma_H(36) + with H generated by [13, 19] of weight 2 with sign 0 over Rational Field sage: G.modular_symbols().cuspidal_subspace() - Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 13 for Congruence Subgroup Gamma_H(36) with H generated by [13, 19] of weight 2 with sign 0 over Rational Field + Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 13 for + Congruence Subgroup Gamma_H(36) with H generated by [13, 19] of weight 2 with sign 0 + over Rational Field This test catches a tricky corner case for spaces with character:: sage: ModularSymbols(DirichletGroup(20).1**3, weight=3, sign=1).cuspidal_subspace() - Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 6 and level 20, weight 3, character [1, -zeta4], sign 1, over Cyclotomic Field of order 4 and degree 2 + Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 6 + and level 20, weight 3, character [1, -zeta4], sign 1, + over Cyclotomic Field of order 4 and degree 2 This tests the bugs reported in :trac:`20932`:: sage: chi = kronecker_character(3*34603) - sage: ModularSymbols(chi, 2, sign=1, base_ring=GF(3)) # not tested # long time (600 seconds) - Modular Symbols space of dimension 11535 and level 103809, weight 2, character [2, 2], sign 1, over Finite Field of size 3 + sage: ModularSymbols(chi, 2, sign=1, base_ring=GF(3)) # not tested # long time (600 seconds) + Modular Symbols space of dimension 11535 and level 103809, weight 2, + character [2, 2], sign 1, over Finite Field of size 3 sage: chi = kronecker_character(3*61379) - sage: ModularSymbols(chi, 2, sign=1, base_ring=GF(3)) # not tested # long time (1800 seconds) - Modular Symbols space of dimension 20460 and level 184137, weight 2, character [2, 2], sign 1, over Finite Field of size 3 + sage: ModularSymbols(chi, 2, sign=1, base_ring=GF(3)) # not tested # long time (1800 seconds) + Modular Symbols space of dimension 20460 and level 184137, weight 2, + character [2, 2], sign 1, over Finite Field of size 3 """ # **************************************************************************** @@ -175,7 +191,8 @@ def ModularSymbols_clear_cache(): sage: ModularSymbols_clear_cache() sage: gc.collect() # random 3422 - sage: a = [x for x in gc.get_objects() if isinstance(x,sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1)] + sage: a = [x for x in gc.get_objects() + ....: if isinstance(x,sage.modular.modsym.ambient.ModularSymbolsAmbient_wtk_g1)] sage: a [] """ @@ -221,14 +238,16 @@ def ModularSymbols(group=1, sage: ModularSymbols(1,12,-1).dimension() 1 sage: ModularSymbols(11,4, sign=1) - Modular Symbols space of dimension 4 for Gamma_0(11) of weight 4 with sign 1 over Rational Field + Modular Symbols space of dimension 4 for Gamma_0(11) of weight 4 + with sign 1 over Rational Field We create some spaces for `\Gamma_1(N)`. :: sage: ModularSymbols(Gamma1(13),2) - Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2 with sign 0 over Rational Field + Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2 + with sign 0 over Rational Field sage: ModularSymbols(Gamma1(13),2, sign=1).dimension() 13 sage: ModularSymbols(Gamma1(13),2, sign=-1).dimension() @@ -244,8 +263,12 @@ def ModularSymbols(group=1, sage: M = ModularSymbols(G,2) sage: M.decomposition() [ - Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 for Congruence Subgroup Gamma_H(15) with H generated by [4, 7] of weight 2 with sign 0 over Rational Field, - Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 5 for Congruence Subgroup Gamma_H(15) with H generated by [4, 7] of weight 2 with sign 0 over Rational Field + Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 + for Congruence Subgroup Gamma_H(15) with H generated by [4, 7] + of weight 2 with sign 0 over Rational Field, + Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 5 + for Congruence Subgroup Gamma_H(15) with H generated by [4, 7] + of weight 2 with sign 0 over Rational Field ] We create a space with character:: @@ -254,7 +277,8 @@ def ModularSymbols(group=1, sage: e.order() 6 sage: M = ModularSymbols(e, 2); M - Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], sign 0, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta6], + sign 0, over Cyclotomic Field of order 6 and degree 2 sage: f = M.T(2).charpoly('x'); f x^4 + (-zeta6 - 1)*x^3 - 8*zeta6*x^2 + (10*zeta6 - 5)*x + 21*zeta6 - 21 sage: f.factor() @@ -262,8 +286,10 @@ def ModularSymbols(group=1, We create a space with character over a larger base ring than the values of the character:: - sage: ModularSymbols(e, 2, base_ring = CyclotomicField(24)) - Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta24^4], sign 0, over Cyclotomic Field of order 24 and degree 8 + sage: # needs sage.rings.number_field + sage: ModularSymbols(e, 2, base_ring=CyclotomicField(24)) + Modular Symbols space of dimension 4 and level 13, weight 2, character [zeta24^4], + sign 0, over Cyclotomic Field of order 24 and degree 8 More examples of spaces with character:: @@ -271,7 +297,8 @@ def ModularSymbols(group=1, Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1 sage: m = ModularSymbols(e, 2); m - Modular Symbols space of dimension 2 and level 5, weight 2, character [-1], sign 0, over Rational Field + Modular Symbols space of dimension 2 and level 5, weight 2, character [-1], + sign 0, over Rational Field :: @@ -287,14 +314,18 @@ def ModularSymbols(group=1, :: - sage: G = DirichletGroup(13,GF(4,'a')); G - Group of Dirichlet characters modulo 13 with values in Finite Field in a of size 2^2 + sage: # needs sage.rings.finite_rings + sage: G = DirichletGroup(13, GF(4,'a')); G + Group of Dirichlet characters modulo 13 + with values in Finite Field in a of size 2^2 sage: e = G.list()[2]; e Dirichlet character modulo 13 of conductor 13 mapping 2 |--> a + 1 sage: M = ModularSymbols(e,4); M - Modular Symbols space of dimension 8 and level 13, weight 4, character [a + 1], sign 0, over Finite Field in a of size 2^2 + Modular Symbols space of dimension 8 and level 13, weight 4, + character [a + 1], sign 0, over Finite Field in a of size 2^2 sage: M.basis() - ([X*Y,(1,0)], [X*Y,(1,5)], [X*Y,(1,10)], [X*Y,(1,11)], [X^2,(0,1)], [X^2,(1,10)], [X^2,(1,11)], [X^2,(1,12)]) + ([X*Y,(1,0)], [X*Y,(1,5)], [X*Y,(1,10)], [X*Y,(1,11)], + [X^2,(0,1)], [X^2,(1,10)], [X^2,(1,11)], [X^2,(1,12)]) sage: M.T(2).matrix() [ 0 0 0 0 0 0 1 1] [ 0 0 0 0 0 0 0 0] diff --git a/src/sage/modular/modsym/modular_symbols.py b/src/sage/modular/modsym/modular_symbols.py index e76694d54e2..57dc8f23a2b 100644 --- a/src/sage/modular/modsym/modular_symbols.py +++ b/src/sage/modular/modsym/modular_symbols.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint r""" Modular symbols `\{\alpha`, `\beta\}` diff --git a/src/sage/modular/modsym/p1list_nf.py b/src/sage/modular/modsym/p1list_nf.py index 69986c1b8c8..25c68137e0c 100644 --- a/src/sage/modular/modsym/p1list_nf.py +++ b/src/sage/modular/modsym/p1list_nf.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.rings.number_field r""" Lists of Manin symbols over number fields, elements of `\mathbb{P}^1(R/N)` diff --git a/src/sage/modular/modsym/relation_matrix.py b/src/sage/modular/modsym/relation_matrix.py index 99b3ebfd7b6..5885812d36c 100644 --- a/src/sage/modular/modsym/relation_matrix.py +++ b/src/sage/modular/modsym/relation_matrix.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Relation matrices for ambient modular symbols spaces diff --git a/src/sage/modular/modsym/space.py b/src/sage/modular/modsym/space.py index 9cf4bf0796f..b8b7197bced 100644 --- a/src/sage/modular/modsym/space.py +++ b/src/sage/modular/modsym/space.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Base class of the space of modular symbols diff --git a/src/sage/modular/modsym/subspace.py b/src/sage/modular/modsym/subspace.py index d1d2a393127..fdc69b18b9a 100644 --- a/src/sage/modular/modsym/subspace.py +++ b/src/sage/modular/modsym/subspace.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Subspace of ambient spaces of modular symbols """ @@ -53,7 +54,8 @@ def __init__(self, ambient_hecke_module, submodule, sage: M = ModularSymbols(15,4) ; S = M.cuspidal_submodule() # indirect doctest sage: S - Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension 12 for Gamma_0(15) of weight 4 with sign 0 over Rational Field + Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension 12 + for Gamma_0(15) of weight 4 with sign 0 over Rational Field sage: S == loads(dumps(S)) True sage: M = ModularSymbols(1,24) @@ -61,7 +63,8 @@ def __init__(self, ambient_hecke_module, submodule, sage: B = A.submodule([ x.element() for x in M.cuspidal_submodule().gens() ]) sage: S = sage.modular.modsym.subspace.ModularSymbolsSubspace(A, B.free_module()) sage: S - Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 for Gamma_0(1) of weight 24 with sign 0 over Rational Field + Modular Symbols subspace of dimension 4 of Modular Symbols space of dimension 5 + for Gamma_0(1) of weight 24 with sign 0 over Rational Field sage: S == loads(dumps(S)) True """ @@ -96,7 +99,8 @@ def boundary_map(self): EXAMPLES:: sage: M = ModularSymbols(1, 24, sign=1) ; M - Modular Symbols space of dimension 3 for Gamma_0(1) of weight 24 with sign 1 over Rational Field + Modular Symbols space of dimension 3 for Gamma_0(1) of weight 24 + with sign 1 over Rational Field sage: M.basis() ([X^18*Y^4,(0,0)], [X^20*Y^2,(0,0)], [X^22,(0,0)]) sage: M.cuspidal_submodule().basis() @@ -137,11 +141,13 @@ def cuspidal_submodule(self): EXAMPLES:: sage: S = ModularSymbols(42,4).cuspidal_submodule() ; S - Modular Symbols subspace of dimension 40 of Modular Symbols space of dimension 48 for Gamma_0(42) of weight 4 with sign 0 over Rational Field + Modular Symbols subspace of dimension 40 of Modular Symbols space of dimension 48 + for Gamma_0(42) of weight 4 with sign 0 over Rational Field sage: S.is_cuspidal() True sage: S.cuspidal_submodule() - Modular Symbols subspace of dimension 40 of Modular Symbols space of dimension 48 for Gamma_0(42) of weight 4 with sign 0 over Rational Field + Modular Symbols subspace of dimension 40 of Modular Symbols space of dimension 48 + for Gamma_0(42) of weight 4 with sign 0 over Rational Field The cuspidal submodule of the cuspidal submodule is just itself:: @@ -156,7 +162,8 @@ def cuspidal_submodule(self): sage: S = M.eisenstein_submodule() sage: S._set_is_cuspidal(True) sage: S.cuspidal_submodule() - Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 65 for Gamma_0(389) of weight 2 with sign 0 over Rational Field + Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 65 + for Gamma_0(389) of weight 2 with sign 0 over Rational Field """ try: return self.__cuspidal_submodule @@ -205,9 +212,11 @@ def eisenstein_subspace(self): EXAMPLES:: sage: ModularSymbols(24,4).eisenstein_subspace() - Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension 24 for Gamma_0(24) of weight 4 with sign 0 over Rational Field + Modular Symbols subspace of dimension 8 of Modular Symbols space of dimension 24 + for Gamma_0(24) of weight 4 with sign 0 over Rational Field sage: ModularSymbols(20,2).cuspidal_subspace().eisenstein_subspace() - Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 7 for Gamma_0(20) of weight 2 with sign 0 over Rational Field + Modular Symbols subspace of dimension 0 of Modular Symbols space of dimension 7 + for Gamma_0(20) of weight 2 with sign 0 over Rational Field """ try: return self.__eisenstein_subspace @@ -238,9 +247,12 @@ def factorization(self): sage: M = ModularSymbols(11) sage: D = M.factorization(); D - (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field) * - (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field) * - (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over Rational Field) + (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 + for Gamma_0(11) of weight 2 with sign 0 over Rational Field) * + (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 + for Gamma_0(11) of weight 2 with sign 0 over Rational Field) * + (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 3 + for Gamma_0(11) of weight 2 with sign 0 over Rational Field) sage: [A.T(2).matrix() for A, _ in D] [[-2], [3], [-2]] sage: [A.star_eigenvalues() for A, _ in D] @@ -253,14 +265,16 @@ def factorization(self): sage: M = ModularSymbols(22,sign=1) sage: S = M.cuspidal_submodule() sage: S.factorization() - (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 2 for Gamma_0(11) of weight 2 with sign 1 over Rational Field)^2 + (Modular Symbols subspace of dimension 1 of Modular Symbols space of dimension 2 + for Gamma_0(11) of weight 2 with sign 1 over Rational Field)^2 :: sage: M = ModularSymbols(Gamma0(22), 2, sign=1) sage: M1 = M.decomposition()[1] sage: M1.factorization() - Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 5 for Gamma_0(22) of weight 2 with sign 1 over Rational Field + Modular Symbols subspace of dimension 3 of Modular Symbols space of dimension 5 + for Gamma_0(22) of weight 2 with sign 1 over Rational Field """ try: return self._factorization @@ -404,7 +418,8 @@ def star_involution(self): sage: M = ModularSymbols(1,24) sage: M.star_involution() - Hecke module morphism Star involution on Modular Symbols space of dimension 5 for Gamma_0(1) of weight 24 with sign 0 over Rational Field defined by the matrix + Hecke module morphism Star involution on Modular Symbols space of dimension 5 + for Gamma_0(1) of weight 24 with sign 0 over Rational Field defined by the matrix [ 1 0 0 0 0] [ 0 -1 0 0 0] [ 0 0 1 0 0] diff --git a/src/sage/modular/modsym/tests.py b/src/sage/modular/modsym/tests.py index 737bb66ba62..3af2ffb1d87 100644 --- a/src/sage/modular/modsym/tests.py +++ b/src/sage/modular/modsym/tests.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari """ Testing modular symbols spaces @@ -187,10 +188,13 @@ def _modular_symbols_space_character(self): EXAMPLES:: + sage: # needs sage.rings.number_field sage: from sage.modular.modsym.tests import Test sage: Test()._modular_symbols_space_character() # random level = 18, weight = 3, sign = 0 - Modular Symbols space of dimension 0 and level 18, weight 3, character [1, zeta6 - 1], sign 0, over Cyclotomic Field of order 6 and degree 2 + Modular Symbols space of dimension 0 + and level 18, weight 3, character [1, zeta6 - 1], sign 0, + over Cyclotomic Field of order 6 and degree 2 """ level, weight, sign = self._level_weight_sign() G = dirichlet.DirichletGroup(level) @@ -270,7 +274,8 @@ def test_cs_dimension(self): sage: Test().test_cs_dimension() # random gamma0 level = 16, weight = 3, sign = -1 - Modular Symbols space of dimension 0 for Gamma_0(16) of weight 3 with sign -1 over Rational Field + Modular Symbols space of dimension 0 for Gamma_0(16) of weight 3 + with sign -1 over Rational Field """ self._modular_symbols_space().cuspidal_submodule() @@ -285,7 +290,8 @@ def test_csnew_dimension(self): sage: Test().test_csnew_dimension() # random gamma0 level = 3, weight = 3, sign = 1 - Modular Symbols space of dimension 0 for Gamma_0(3) of weight 3 with sign 1 over Rational Field + Modular Symbols space of dimension 0 for Gamma_0(3) of weight 3 + with sign 1 over Rational Field """ M = self._modular_symbols_space() V = M.cuspidal_submodule().new_submodule() diff --git a/src/sage/modular/multiple_zeta.py b/src/sage/modular/multiple_zeta.py index 22cabe23344..494d183e805 100644 --- a/src/sage/modular/multiple_zeta.py +++ b/src/sage/modular/multiple_zeta.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.combinat r""" Algebra of motivic multiple zeta values diff --git a/src/sage/modular/multiple_zeta_F_algebra.py b/src/sage/modular/multiple_zeta_F_algebra.py index f8875d4bc51..251310de6b8 100644 --- a/src/sage/modular/multiple_zeta_F_algebra.py +++ b/src/sage/modular/multiple_zeta_F_algebra.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.combinat r""" F-algebra for motivic multiple zeta values. diff --git a/src/sage/modular/overconvergent/genus0.py b/src/sage/modular/overconvergent/genus0.py index 62d189e49d5..9cfbcb3a39b 100644 --- a/src/sage/modular/overconvergent/genus0.py +++ b/src/sage/modular/overconvergent/genus0.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.libs.pari sage.rings.padics r""" Overconvergent `p`-adic modular forms for small primes @@ -1657,7 +1657,7 @@ def valuation_plot(self, rmax=None): sage: o = OverconvergentModularForms(3, 0, 1/2) sage: f = o.eigenfunctions(4)[1] - sage: f.valuation_plot() + sage: f.valuation_plot() # needs sage.plot Graphics object consisting of 1 graphics primitive """ from sage.plot.plot import plot diff --git a/src/sage/modular/overconvergent/hecke_series.py b/src/sage/modular/overconvergent/hecke_series.py index 5183106e458..1e10c6386a9 100644 --- a/src/sage/modular/overconvergent/hecke_series.py +++ b/src/sage/modular/overconvergent/hecke_series.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint sage.libs.pari r""" Atkin/Hecke series for overconvergent modular forms diff --git a/src/sage/modular/pollack_stevens/distributions.py b/src/sage/modular/pollack_stevens/distributions.py index 7aaad3c6f0e..a83121db4fa 100644 --- a/src/sage/modular/pollack_stevens/distributions.py +++ b/src/sage/modular/pollack_stevens/distributions.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.rings.padics r""" Spaces of distributions for Pollack-Stevens modular symbols diff --git a/src/sage/modular/pollack_stevens/manin_map.py b/src/sage/modular/pollack_stevens/manin_map.py index 4acbecf038b..06aa3496e10 100644 --- a/src/sage/modular/pollack_stevens/manin_map.py +++ b/src/sage/modular/pollack_stevens/manin_map.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.rings.padics r""" Manin map diff --git a/src/sage/modular/pollack_stevens/space.py b/src/sage/modular/pollack_stevens/space.py index 88b7be6d2cd..6fe7c12b95b 100644 --- a/src/sage/modular/pollack_stevens/space.py +++ b/src/sage/modular/pollack_stevens/space.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# sage.doctest: needs sage.rings.padics r""" Pollack-Stevens' modular symbols spaces diff --git a/src/sage/modular/quasimodform/element.py b/src/sage/modular/quasimodform/element.py index b92c31722ac..c096973fadc 100644 --- a/src/sage/modular/quasimodform/element.py +++ b/src/sage/modular/quasimodform/element.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.flint """ Elements of quasimodular forms rings @@ -605,7 +606,7 @@ def __getitem__(self, weight): TESTS:: - sage: F[x] + sage: F[x] # needs sage.symbolic Traceback (most recent call last): ... KeyError: 'the weight must be an integer' diff --git a/src/sage/modular/ssmod/ssmod.py b/src/sage/modular/ssmod/ssmod.py index a23320cecb0..13b6d11fbb6 100644 --- a/src/sage/modular/ssmod/ssmod.py +++ b/src/sage/modular/ssmod/ssmod.py @@ -1,3 +1,4 @@ +# sage.doctest: needs sage.libs.pari """ Module of supersingular points