passagemath-schemes 10.5.48__cp312-cp312-musllinux_1_2_aarch64.whl → 10.6.47__cp312-cp312-musllinux_1_2_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of passagemath-schemes might be problematic. Click here for more details.

Files changed (165) hide show
  1. passagemath_schemes/__init__.py +3 -0
  2. {passagemath_schemes-10.5.48.dist-info → passagemath_schemes-10.6.47.dist-info}/METADATA +42 -42
  3. {passagemath_schemes-10.5.48.dist-info → passagemath_schemes-10.6.47.dist-info}/METADATA.bak +43 -43
  4. {passagemath_schemes-10.5.48.dist-info → passagemath_schemes-10.6.47.dist-info}/RECORD +159 -140
  5. passagemath_schemes-10.6.47.dist-info/top_level.txt +3 -0
  6. passagemath_schemes.libs/{libflint-7dd7ad94.so.19.0.0 → libflint-edf7fb90.so.22.0.0} +0 -0
  7. passagemath_schemes.libs/{libgcc_s-69c45f16.so.1 → libgcc_s-2d945d6c.so.1} +0 -0
  8. passagemath_schemes.libs/{libgmp-8e78bd9b.so.10.5.0 → libgmp-28992bcb.so.10.5.0} +0 -0
  9. passagemath_schemes.libs/{libgmpxx-e6de26f1.so.4.7.0 → libgmpxx-fecb01a9.so.4.7.0} +0 -0
  10. passagemath_schemes.libs/{libmpfr-5ff10580.so.6.2.1 → libmpfr-1fc8ea36.so.6.2.2} +0 -0
  11. passagemath_schemes.libs/{libstdc++-1f1a71be.so.6.0.33 → libstdc++-85f2cd6d.so.6.0.33} +0 -0
  12. sage/all__sagemath_schemes.py +3 -2
  13. sage/databases/all__sagemath_schemes.py +0 -10
  14. sage/dynamics/arithmetic_dynamics/berkovich_ds.py +4 -4
  15. sage/dynamics/arithmetic_dynamics/generic_ds.py +3 -3
  16. sage/dynamics/arithmetic_dynamics/projective_ds.py +6 -6
  17. sage/dynamics/arithmetic_dynamics/projective_ds_helper.cpython-312-aarch64-linux-musl.so +0 -0
  18. sage/dynamics/arithmetic_dynamics/wehlerK3.py +18 -18
  19. sage/lfunctions/zero_sums.cpython-312-aarch64-linux-musl.so +0 -0
  20. sage/modular/abvar/abvar.py +12 -11
  21. sage/modular/abvar/constructor.py +3 -3
  22. sage/modular/abvar/cuspidal_subgroup.py +5 -6
  23. sage/modular/abvar/finite_subgroup.py +20 -18
  24. sage/modular/abvar/homology.py +1 -2
  25. sage/modular/abvar/homspace.py +1 -1
  26. sage/modular/abvar/lseries.py +3 -3
  27. sage/modular/abvar/morphism.py +1 -1
  28. sage/modular/abvar/torsion_point.py +1 -1
  29. sage/modular/abvar/torsion_subgroup.py +1 -1
  30. sage/modular/arithgroup/arithgroup_element.cpython-312-aarch64-linux-musl.so +0 -0
  31. sage/modular/arithgroup/arithgroup_perm.py +16 -16
  32. sage/modular/arithgroup/congroup.cpython-312-aarch64-linux-musl.so +0 -0
  33. sage/modular/arithgroup/congroup_gamma0.py +2 -2
  34. sage/modular/arithgroup/congroup_gamma1.py +4 -4
  35. sage/modular/arithgroup/congroup_gammaH.py +2 -2
  36. sage/modular/arithgroup/congroup_generic.py +2 -3
  37. sage/modular/arithgroup/congroup_sl2z.py +3 -3
  38. sage/modular/arithgroup/farey_symbol.cpython-312-aarch64-linux-musl.so +0 -0
  39. sage/modular/arithgroup/farey_symbol.pyx +1 -2
  40. sage/modular/btquotients/btquotient.py +4 -5
  41. sage/modular/btquotients/pautomorphicform.py +2 -2
  42. sage/modular/cusps.py +6 -4
  43. sage/modular/cusps_nf.py +7 -8
  44. sage/modular/dirichlet.py +34 -43
  45. sage/modular/drinfeld_modform/element.py +4 -4
  46. sage/modular/drinfeld_modform/ring.py +12 -12
  47. sage/modular/drinfeld_modform/tutorial.py +1 -1
  48. sage/modular/hecke/algebra.py +7 -5
  49. sage/modular/hecke/ambient_module.py +2 -2
  50. sage/modular/hecke/element.py +7 -2
  51. sage/modular/hecke/module.py +9 -9
  52. sage/modular/hecke/submodule.py +6 -8
  53. sage/modular/hypergeometric_misc.cpython-312-aarch64-linux-musl.so +0 -0
  54. sage/modular/hypergeometric_misc.pyx +3 -2
  55. sage/modular/hypergeometric_motive.py +2 -2
  56. sage/modular/local_comp/local_comp.py +19 -11
  57. sage/modular/local_comp/type_space.py +10 -8
  58. sage/modular/modform/ambient.py +4 -3
  59. sage/modular/modform/cuspidal_submodule.py +2 -2
  60. sage/modular/modform/element.py +72 -72
  61. sage/modular/modform/half_integral.py +1 -1
  62. sage/modular/modform/l_series_gross_zagier.py +3 -0
  63. sage/modular/modform/l_series_gross_zagier_coeffs.cpython-312-aarch64-linux-musl.so +0 -0
  64. sage/modular/modform/l_series_gross_zagier_coeffs.pyx +5 -2
  65. sage/modular/modform/ring.py +10 -12
  66. sage/modular/modform/space.py +18 -21
  67. sage/modular/modform/weight1.py +1 -2
  68. sage/modular/modform_hecketriangle/abstract_ring.py +7 -14
  69. sage/modular/modform_hecketriangle/abstract_space.py +63 -66
  70. sage/modular/modform_hecketriangle/graded_ring_element.py +11 -12
  71. sage/modular/modform_hecketriangle/hecke_triangle_group_element.py +82 -84
  72. sage/modular/modform_hecketriangle/hecke_triangle_groups.py +2 -2
  73. sage/modular/modform_hecketriangle/readme.py +9 -11
  74. sage/modular/modform_hecketriangle/series_constructor.py +10 -18
  75. sage/modular/modform_hecketriangle/space.py +29 -30
  76. sage/modular/modform_hecketriangle/subspace.py +9 -7
  77. sage/modular/modsym/all.py +2 -2
  78. sage/modular/modsym/ambient.py +13 -20
  79. sage/modular/modsym/boundary.py +2 -2
  80. sage/modular/modsym/manin_symbol.cpython-312-aarch64-linux-musl.so +0 -0
  81. sage/modular/modsym/manin_symbol_list.py +3 -7
  82. sage/modular/modsym/relation_matrix_pyx.cpython-312-aarch64-linux-musl.so +0 -0
  83. sage/modular/modsym/space.py +10 -22
  84. sage/modular/modsym/subspace.py +5 -7
  85. sage/modular/multiple_zeta.py +11 -13
  86. sage/modular/multiple_zeta_F_algebra.py +4 -6
  87. sage/modular/overconvergent/genus0.py +5 -4
  88. sage/modular/overconvergent/hecke_series.py +2 -2
  89. sage/modular/pollack_stevens/distributions.py +2 -2
  90. sage/modular/pollack_stevens/fund_domain.py +26 -29
  91. sage/modular/pollack_stevens/manin_map.py +15 -10
  92. sage/modular/pollack_stevens/modsym.py +18 -18
  93. sage/modular/quasimodform/element.py +10 -10
  94. sage/modular/quasimodform/ring.py +22 -22
  95. sage/modular/ssmod/ssmod.py +5 -12
  96. sage/rings/polynomial/binary_form_reduce.py +1 -1
  97. sage/schemes/curves/affine_curve.py +4 -4
  98. sage/schemes/curves/plane_curve_arrangement.py +28 -24
  99. sage/schemes/elliptic_curves/BSD.py +1 -1
  100. sage/schemes/elliptic_curves/addition_formulas_ring.py +4 -0
  101. sage/schemes/elliptic_curves/cm.py +1 -1
  102. sage/schemes/elliptic_curves/constructor.py +3 -3
  103. sage/schemes/elliptic_curves/ell_egros.py +1 -1
  104. sage/schemes/elliptic_curves/ell_field.py +57 -46
  105. sage/schemes/elliptic_curves/ell_finite_field.py +138 -26
  106. sage/schemes/elliptic_curves/ell_local_data.py +9 -9
  107. sage/schemes/elliptic_curves/ell_number_field.py +25 -24
  108. sage/schemes/elliptic_curves/ell_point.py +21 -22
  109. sage/schemes/elliptic_curves/ell_rational_field.py +38 -28
  110. sage/schemes/elliptic_curves/formal_group.py +1 -1
  111. sage/schemes/elliptic_curves/heegner.py +11 -8
  112. sage/schemes/elliptic_curves/height.py +26 -23
  113. sage/schemes/elliptic_curves/hom.py +2 -1
  114. sage/schemes/elliptic_curves/hom_composite.py +11 -11
  115. sage/schemes/elliptic_curves/hom_frobenius.py +8 -8
  116. sage/schemes/elliptic_curves/hom_sum.py +7 -1
  117. sage/schemes/elliptic_curves/hom_velusqrt.py +13 -7
  118. sage/schemes/elliptic_curves/homset.py +2 -2
  119. sage/schemes/elliptic_curves/isogeny_small_degree.py +1 -1
  120. sage/schemes/elliptic_curves/mod_poly.py +12 -5
  121. sage/schemes/elliptic_curves/mod_sym_num.cpython-312-aarch64-linux-musl.so +0 -0
  122. sage/schemes/elliptic_curves/padic_lseries.py +25 -13
  123. sage/schemes/elliptic_curves/padics.py +71 -62
  124. sage/schemes/elliptic_curves/period_lattice.py +78 -27
  125. sage/schemes/elliptic_curves/period_lattice_region.cpython-312-aarch64-linux-musl.so +0 -0
  126. sage/schemes/elliptic_curves/sha_tate.py +1 -1
  127. sage/schemes/elliptic_curves/weierstrass_morphism.py +2 -2
  128. sage/schemes/hyperelliptic_curves/hyperelliptic_generic.py +1 -1
  129. sage/schemes/hyperelliptic_curves/jacobian_endomorphism_utils.py +1 -1
  130. sage/schemes/hyperelliptic_curves/monsky_washnitzer.py +10 -20
  131. sage/schemes/jacobians/abstract_jacobian.py +1 -1
  132. sage/schemes/plane_conics/con_field.py +42 -42
  133. sage/schemes/plane_conics/con_rational_field.py +1 -1
  134. sage/schemes/riemann_surfaces/riemann_surface.py +8 -8
  135. sage_wheels/share/cremona/cremona_mini.db +0 -0
  136. sage_wheels/share/ellcurves/rank0 +30427 -0
  137. sage_wheels/share/ellcurves/rank1 +31871 -0
  138. sage_wheels/share/ellcurves/rank10 +6 -0
  139. sage_wheels/share/ellcurves/rank11 +6 -0
  140. sage_wheels/share/ellcurves/rank12 +1 -0
  141. sage_wheels/share/ellcurves/rank14 +1 -0
  142. sage_wheels/share/ellcurves/rank15 +1 -0
  143. sage_wheels/share/ellcurves/rank17 +1 -0
  144. sage_wheels/share/ellcurves/rank19 +1 -0
  145. sage_wheels/share/ellcurves/rank2 +2388 -0
  146. sage_wheels/share/ellcurves/rank20 +1 -0
  147. sage_wheels/share/ellcurves/rank21 +1 -0
  148. sage_wheels/share/ellcurves/rank22 +1 -0
  149. sage_wheels/share/ellcurves/rank23 +1 -0
  150. sage_wheels/share/ellcurves/rank24 +1 -0
  151. sage_wheels/share/ellcurves/rank28 +1 -0
  152. sage_wheels/share/ellcurves/rank3 +836 -0
  153. sage_wheels/share/ellcurves/rank4 +10 -0
  154. sage_wheels/share/ellcurves/rank5 +5 -0
  155. sage_wheels/share/ellcurves/rank6 +5 -0
  156. sage_wheels/share/ellcurves/rank7 +5 -0
  157. sage_wheels/share/ellcurves/rank8 +6 -0
  158. sage_wheels/share/ellcurves/rank9 +7 -0
  159. passagemath_schemes-10.5.48.dist-info/top_level.txt +0 -2
  160. sage/databases/db_modular_polynomials.py +0 -250
  161. sage/databases/stein_watkins.py +0 -363
  162. sage/modular/modsym/p1list.cpython-312-aarch64-linux-musl.so +0 -0
  163. sage/modular/modsym/p1list.pxd +0 -29
  164. sage/modular/modsym/p1list.pyx +0 -1372
  165. {passagemath_schemes-10.5.48.dist-info → passagemath_schemes-10.6.47.dist-info}/WHEEL +0 -0
@@ -421,7 +421,7 @@ class MultizetaValues(Singleton):
421
421
  sage: parent(M((2,3,4,5), prec=128))
422
422
  Real Field with 128 bits of precision
423
423
  """
424
- def __init__(self):
424
+ def __init__(self) -> None:
425
425
  """
426
426
  When first called, pre-compute up to weight 8 at precision 1024.
427
427
 
@@ -444,7 +444,7 @@ class MultizetaValues(Singleton):
444
444
  """
445
445
  return f"Cached multiple zeta values at precision {self.prec} up to weight {self.max_weight}"
446
446
 
447
- def reset(self, max_weight=8, prec=1024):
447
+ def reset(self, max_weight=8, prec=1024) -> None:
448
448
  r"""
449
449
  Reset the cache to its default values or to given arguments.
450
450
 
@@ -465,7 +465,7 @@ class MultizetaValues(Singleton):
465
465
  self.max_weight = int(max_weight)
466
466
  self._data = pari.zetamultall(self.max_weight, precision=self.prec)
467
467
 
468
- def update(self, max_weight, prec):
468
+ def update(self, max_weight, prec) -> None:
469
469
  """
470
470
  Compute and store more values if needed.
471
471
 
@@ -551,7 +551,7 @@ class MultizetaValues(Singleton):
551
551
  Values = MultizetaValues()
552
552
 
553
553
 
554
- def extend_multiplicative_basis(B, n) -> Iterator:
554
+ def extend_multiplicative_basis(B, n) -> Iterator[tuple]:
555
555
  """
556
556
  Extend a multiplicative basis into a basis.
557
557
 
@@ -648,7 +648,7 @@ class Multizetas(CombinatorialFreeModule):
648
648
  sage: z
649
649
  ζ(1,2,3)
650
650
  """
651
- def __init__(self, R):
651
+ def __init__(self, R) -> None:
652
652
  """
653
653
  TESTS::
654
654
 
@@ -727,7 +727,7 @@ class Multizetas(CombinatorialFreeModule):
727
727
  """
728
728
  return self([]), self([2]), self([3]), self([4]), self((1, 2))
729
729
 
730
- def an_element(self):
730
+ def _an_element_(self):
731
731
  r"""
732
732
  Return an element of the algebra.
733
733
 
@@ -1254,7 +1254,7 @@ class Multizetas(CombinatorialFreeModule):
1254
1254
  raise TypeError('invalid comparison for multizetas')
1255
1255
  return self.iterated()._richcmp_(other.iterated(), op)
1256
1256
 
1257
- def __hash__(self):
1257
+ def __hash__(self) -> int:
1258
1258
  """
1259
1259
  Return the hash of ``self``.
1260
1260
 
@@ -1405,7 +1405,7 @@ class Multizetas_iterated(CombinatorialFreeModule):
1405
1405
  sage: M((1,0))*M((1,0,0))
1406
1406
  6*I(11000) + 3*I(10100) + I(10010)
1407
1407
  """
1408
- def __init__(self, R):
1408
+ def __init__(self, R) -> None:
1409
1409
  """
1410
1410
  TESTS::
1411
1411
 
@@ -1804,16 +1804,14 @@ class Multizetas_iterated(CombinatorialFreeModule):
1804
1804
  compo = tuple(iterated_to_composition(w))
1805
1805
  if compo in B_data[N]:
1806
1806
  # do not forget the sign
1807
- result_QQ = (-1)**len(compo) * phi_on_multiplicative_basis(compo)
1808
- return result_QQ
1807
+ return (-1)**len(compo) * phi_on_multiplicative_basis(compo)
1809
1808
  u = compute_u_on_basis(w)
1810
1809
  rho_inverse_u = rho_inverse(u)
1811
1810
  xi = self.composition_on_basis(w, QQ)
1812
1811
  c_xi = (xi - rho_inverse_u)._numerical_approx_pari()
1813
1812
  c_xi /= Multizeta(N)._numerical_approx_pari()
1814
1813
  c_xi = c_xi.bestappr().sage() # in QQ
1815
- result_QQ = u + c_xi * f(N)
1816
- return result_QQ
1814
+ return u + c_xi * f(N)
1817
1815
 
1818
1816
  @lazy_attribute
1819
1817
  def phi(self):
@@ -2068,7 +2066,7 @@ class All_iterated(CombinatorialFreeModule):
2068
2066
  sage: x.regularise()
2069
2067
  -I(10)
2070
2068
  """
2071
- def __init__(self, R):
2069
+ def __init__(self, R) -> None:
2072
2070
  """
2073
2071
  TESTS::
2074
2072
 
@@ -234,9 +234,7 @@ def morphism_constructor(data: dict, start=3):
234
234
  v = codomain.half_product(data[letter], v)
235
235
  return v
236
236
 
237
- morphism = domain._module_morphism(morphism_on_basis, codomain=codomain)
238
-
239
- return morphism
237
+ return domain._module_morphism(morphism_on_basis, codomain=codomain)
240
238
 
241
239
 
242
240
  class F_algebra(CombinatorialFreeModule):
@@ -267,7 +265,7 @@ class F_algebra(CombinatorialFreeModule):
267
265
  sage: s = f2*f3+f5; s
268
266
  f5 + f2*f3
269
267
  """
270
- def __init__(self, R, start=3):
268
+ def __init__(self, R, start=3) -> None:
271
269
  r"""
272
270
  Initialize ``self``.
273
271
 
@@ -461,7 +459,7 @@ class F_algebra(CombinatorialFreeModule):
461
459
  B *= ZZ(2)**(3 * i - 1) * ZZ(3)**i / ZZ(2 * i).factorial()
462
460
  return B * f2**i
463
461
 
464
- def an_element(self):
462
+ def _an_element_(self):
465
463
  """
466
464
  Return a typical element.
467
465
 
@@ -474,7 +472,7 @@ class F_algebra(CombinatorialFreeModule):
474
472
  """
475
473
  return self("253") + 3 * self("235")
476
474
 
477
- def some_elements(self):
475
+ def some_elements(self) -> list:
478
476
  """
479
477
  Return some typical elements.
480
478
 
@@ -195,6 +195,7 @@ classical) does not apply.
195
195
  # Distributed under the terms of the GNU General Public License (GPL)
196
196
  # https://www.gnu.org/licenses/
197
197
  # ****************************************************************************
198
+ from typing import Iterator
198
199
 
199
200
  import weakref
200
201
 
@@ -429,7 +430,7 @@ class OverconvergentModularFormsSpace(Module):
429
430
  # Boring functions that access internal data #
430
431
  ##############################################
431
432
 
432
- def is_exact(self):
433
+ def is_exact(self) -> bool:
433
434
  r"""
434
435
  Return ``True`` if elements of this space are represented exactly.
435
436
 
@@ -694,7 +695,7 @@ class OverconvergentModularFormsSpace(Module):
694
695
  """
695
696
  return self._radius
696
697
 
697
- def gens(self):
698
+ def gens(self) -> Iterator:
698
699
  r"""
699
700
  Return a generator object that iterates over the (infinite) set of
700
701
  basis vectors of ``self``.
@@ -1501,7 +1502,7 @@ class OverconvergentModularFormElement(ModuleElement):
1501
1502
  """
1502
1503
  return self.gexp().prec()
1503
1504
 
1504
- def is_eigenform(self):
1505
+ def is_eigenform(self) -> bool:
1505
1506
  r"""
1506
1507
  Return ``True`` if this is an eigenform.
1507
1508
 
@@ -1668,7 +1669,7 @@ class OverconvergentModularFormElement(ModuleElement):
1668
1669
  self._eigenvalue = eigenvalue
1669
1670
  self._slope = eigenvalue.normalized_valuation()
1670
1671
 
1671
- def is_integral(self):
1672
+ def is_integral(self) -> bool:
1672
1673
  r"""
1673
1674
  Test whether this element has `q`-expansion coefficients that are `p`-adically integral.
1674
1675
 
@@ -1050,7 +1050,7 @@ def level1_UpGj(p, klist, m, extra_data=False):
1050
1050
  # *** CODE FOR GENERAL LEVEL ***
1051
1051
 
1052
1052
 
1053
- def is_valid_weight_list(klist, p):
1053
+ def is_valid_weight_list(klist, p) -> None:
1054
1054
  r"""
1055
1055
  This function checks that ``klist`` is a nonempty list of integers all of
1056
1056
  which are congruent modulo `(p-1)`. Otherwise, it will raise a
@@ -1078,7 +1078,7 @@ def is_valid_weight_list(klist, p):
1078
1078
  if len(klist) == 0:
1079
1079
  raise ValueError("List of weights must be non-empty")
1080
1080
  k0 = klist[0] % (p - 1)
1081
- for i in range(1,len(klist)):
1081
+ for i in range(1, len(klist)):
1082
1082
  if (klist[i] % (p-1)) != k0:
1083
1083
  raise ValueError("List of weights must be all congruent modulo p-1 = %s, but given list contains %s and %s which are not congruent" % (p - 1, klist[0], klist[i]))
1084
1084
 
@@ -703,7 +703,7 @@ class Symk_class(OverconvergentDistributions_abstract):
703
703
  s += " twisted by %s" % self._character
704
704
  return s
705
705
 
706
- def is_symk(self):
706
+ def is_symk(self) -> bool:
707
707
  """
708
708
  Whether or not this distributions space is `Sym^k(R)` for some ring `R`.
709
709
 
@@ -803,7 +803,7 @@ class OverconvergentDistributions_class(OverconvergentDistributions_abstract):
803
803
  s += " twistted by " + " * ".join(twiststuff)
804
804
  return s
805
805
 
806
- def is_symk(self):
806
+ def is_symk(self) -> bool:
807
807
  """
808
808
  Whether or not this distributions space is `Sym^k(R)` for some ring `R`.
809
809
 
@@ -130,20 +130,16 @@ class PollackStevensModularDomain(SageObject):
130
130
  self._reps = reps
131
131
 
132
132
  self._indices = sorted(indices)
133
- self._gens = [M2Z(reps[i]) for i in self._indices]
133
+ self._gens = tuple(M2Z(reps[i]) for i in self._indices)
134
134
  self._ngens = len(indices)
135
135
 
136
136
  if len(rels) != len(reps):
137
137
  raise ValueError("length of reps and length of rels must be equal")
138
138
  self._rels = rels
139
- self._rel_dict = {}
140
- for j, L in enumerate(rels):
141
- self._rel_dict[reps[j]] = L
139
+ self._rel_dict = {reps[j]: L for j, L in enumerate(rels)}
142
140
 
143
141
  self._equiv_ind = equiv_ind
144
- self._equiv_rep = {}
145
- for ky in equiv_ind:
146
- self._equiv_rep[ky] = reps[equiv_ind[ky]]
142
+ self._equiv_rep = {ky: reps[vy] for ky, vy in equiv_ind.items()}
147
143
 
148
144
  def _repr_(self):
149
145
  r"""
@@ -204,19 +200,19 @@ class PollackStevensModularDomain(SageObject):
204
200
  """
205
201
  return iter(self._reps)
206
202
 
207
- def gens(self):
203
+ def gens(self) -> tuple:
208
204
  r"""
209
- Return the list of coset representatives chosen as generators.
205
+ Return the tuple of coset representatives chosen as generators.
210
206
 
211
207
  EXAMPLES::
212
208
 
213
209
  sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
214
210
  sage: A = ManinRelations(11)
215
211
  sage: A.gens()
216
- [
212
+ (
217
213
  [1 0] [ 0 -1] [-1 -1]
218
214
  [0 1], [ 1 3], [ 3 2]
219
- ]
215
+ )
220
216
  """
221
217
  return self._gens
222
218
 
@@ -1148,7 +1144,7 @@ class ManinRelations(PollackStevensModularDomain):
1148
1144
 
1149
1145
  # Initialize some lists
1150
1146
 
1151
- C = [QQ(-1), "?", QQ(0)]
1147
+ C = [QQ(-1), "?", QQ.zero()]
1152
1148
 
1153
1149
  # Initialize the list of cusps at the bottom of the fund. domain.
1154
1150
  # The ? denotes that it has not yet been checked if more cusps need
@@ -1156,12 +1152,12 @@ class ManinRelations(PollackStevensModularDomain):
1156
1152
 
1157
1153
  full_domain = False # Says that we are not done yet!
1158
1154
 
1159
- v = [False for r in range(sP)]
1155
+ v = [False] * sP
1160
1156
  # This initializes a list indexed by P^1(Z/NZ) which keeps track of
1161
1157
  # which right coset representatives we've found for Gamma_0(N)/SL_2(Z)
1162
1158
  # thru the construction of a fundamental domain
1163
1159
 
1164
- # Includeds the coset repns formed by the original ideal triangle
1160
+ # Includes the coset repns formed by the original ideal triangle
1165
1161
  # (with corners at -1, 0, infty)
1166
1162
 
1167
1163
  v[P.index(0, 1)] = True
@@ -1176,8 +1172,8 @@ class ManinRelations(PollackStevensModularDomain):
1176
1172
  # This loop runs through the current set of cusps
1177
1173
  # and checks to see if more cusps should be added
1178
1174
  # -----------------------------------------------
1179
- for s in range(1, len(C), 2): # range over odd indices in the
1180
- # final list C
1175
+ for s in range(1, len(C), 2):
1176
+ # range over odd indices in the final list C
1181
1177
  if C[s] == "?":
1182
1178
 
1183
1179
  # Single out our two cusps (path from cusp2 to cusp1)
@@ -1193,9 +1189,9 @@ class ManinRelations(PollackStevensModularDomain):
1193
1189
  # This is the point where it is determined whether
1194
1190
  # or not the adjacent triangle should be added
1195
1191
  # ------------------------------------------------
1196
- pos = P.index(b2, b1) # The Sage index of the bottom
1197
- # row of our unimodular
1198
- # transformation gam
1192
+ pos = P.index(b2, b1)
1193
+ # The Sage index of the bottom row of our
1194
+ # unimodular transformation gam
1199
1195
 
1200
1196
  # Check if we need to flip (since this P1 element has not
1201
1197
  # yet been accounted for!)
@@ -1219,16 +1215,18 @@ class ManinRelations(PollackStevensModularDomain):
1219
1215
  # where gam is the matrix corresponding to the
1220
1216
  # unimodular path connecting cusp1 to cusp2
1221
1217
 
1222
- C[s] = "i" # The '?' is changed to an 'i'
1223
- # indicating that a new cusp needs to
1224
- # be inserted here
1218
+ C[s] = "i"
1219
+ # The '?' is changed to an 'i' indicating
1220
+ # that a new cusp needs to be inserted here
1225
1221
  full_domain = False
1226
1222
  else:
1227
- C[s] = "x" # The '?' is changed to an 'x' and no
1228
- # more checking below is needed! =)
1223
+ C[s] = "x"
1224
+ # The '?' is changed to an 'x' and no
1225
+ # more checking below is needed! =)
1229
1226
  else:
1230
- C[s] = "x" # The '?' is changed to an 'x' and no more
1231
- # checking below is needed! =)
1227
+ C[s] = "x"
1228
+ # The '?' is changed to an 'x' and no more
1229
+ # checking below is needed! =)
1232
1230
 
1233
1231
  # Now insert the missing cusps (where there is an 'i' in
1234
1232
  # the final list)
@@ -1260,10 +1258,9 @@ class ManinRelations(PollackStevensModularDomain):
1260
1258
 
1261
1259
  # Remove the (now superfluous) extra string characters that appear
1262
1260
  # in the odd list entries
1263
- C = [QQ(C[ss]) for ss in range(0, len(C), 2)]
1264
- return C
1261
+ return [QQ(C[ss]) for ss in range(0, len(C), 2)]
1265
1262
 
1266
- def is_unimodular_path(self, r1, r2):
1263
+ def is_unimodular_path(self, r1, r2) -> bool:
1267
1264
  r"""
1268
1265
  Determine whether two (non-infinite) cusps are connected by a
1269
1266
  unimodular path.
@@ -45,13 +45,19 @@ EXAMPLES::
45
45
  # https://www.gnu.org/licenses/
46
46
  # ****************************************************************************
47
47
 
48
- from sage.rings.continued_fraction import convergents
49
- from .sigma0 import Sigma0
50
- from .fund_domain import t00, t10, t01, t11, M2Z
48
+ try:
49
+ from typing import Self # type: ignore (Python >= 3.11)
50
+ except ImportError:
51
+ from typing_extensions import Self # type: ignore (Python 3.10)
52
+
51
53
  from sage.matrix.matrix_space import MatrixSpace
54
+ from sage.rings.continued_fraction import convergents
52
55
  from sage.rings.integer_ring import ZZ
53
56
  from sage.structure.element import coercion_model
54
57
 
58
+ from .fund_domain import M2Z, t00, t01, t10, t11
59
+ from .sigma0 import Sigma0
60
+
55
61
 
56
62
  def unimod_matrices_to_infty(r, s):
57
63
  r"""
@@ -317,13 +323,13 @@ class ManinMap:
317
323
  sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
318
324
  sage: S = Symk(0,QQ)
319
325
  sage: MR = ManinRelations(37); MR.gens()
320
- [
326
+ (
321
327
  [1 0] [ 0 -1] [-1 -1] [-1 -2] [-2 -3] [-3 -1] [-1 -4] [-4 -3]
322
328
  [0 1], [ 1 4], [ 4 3], [ 3 5], [ 5 7], [ 7 2], [ 2 7], [ 7 5],
323
329
  <BLANKLINE>
324
330
  [-2 -3]
325
331
  [ 3 4]
326
- ]
332
+ )
327
333
 
328
334
  sage: data = {M2Z([-2,-3,5,7]): S(0), M2Z([1,0,0,1]): S(0), M2Z([-1,-2,3,5]): S(0), M2Z([-1,-4,2,7]): S(1), M2Z([0,-1,1,4]): S(1), M2Z([-3,-1,7,2]): S(-1), M2Z([-2,-3,3,4]): S(0), M2Z([-4,-3,7,5]): S(0), M2Z([-1,-1,4,3]): S(0)}
329
335
  sage: D = OverconvergentDistributions(2, 37, 40)
@@ -356,13 +362,13 @@ class ManinMap:
356
362
  sage: from sage.modular.pollack_stevens.fund_domain import ManinRelations
357
363
  sage: S = Symk(0,QQ)
358
364
  sage: MR = ManinRelations(37); MR.gens()
359
- [
365
+ (
360
366
  [1 0] [ 0 -1] [-1 -1] [-1 -2] [-2 -3] [-3 -1] [-1 -4] [-4 -3]
361
367
  [0 1], [ 1 4], [ 4 3], [ 3 5], [ 5 7], [ 7 2], [ 2 7], [ 7 5],
362
368
  <BLANKLINE>
363
369
  [-2 -3]
364
370
  [ 3 4]
365
- ]
371
+ )
366
372
 
367
373
  sage: data = {M2Z([-2,-3,5,7]): S(0), M2Z([1,0,0,1]): S(0), M2Z([-1,-2,3,5]): S(0), M2Z([-1,-4,2,7]): S(1), M2Z([0,-1,1,4]): S(1), M2Z([-3,-1,7,2]): S(-1), M2Z([-2,-3,3,4]): S(0), M2Z([-4,-3,7,5]): S(0), M2Z([-1,-1,4,3]): S(0)}
368
374
  sage: f = ManinMap(S,MR,data)
@@ -692,7 +698,7 @@ class ManinMap:
692
698
  D[ky] = self(gamma * ky) * gamma
693
699
  return self.__class__(self._codomain, self._manin, D, check=False)
694
700
 
695
- def normalize(self):
701
+ def normalize(self) -> Self:
696
702
  r"""
697
703
  Normalize every value of ``self`` -- e.g., reduce each value's
698
704
  `j`-th moment modulo `p^{N-j}`.
@@ -850,5 +856,4 @@ class ManinMap:
850
856
  # construction functor in order to scale by something
851
857
  # outside the base ring.
852
858
  D[g] = W(self._eval_sl2(g) - (self(pmat * g) * pmat).scale(scalar))
853
- ans = self.__class__(W, manin, D, check=False)
854
- return ans
859
+ return self.__class__(W, manin, D, check=False)
@@ -38,8 +38,12 @@ EXAMPLES::
38
38
  # *****************************************************************************
39
39
 
40
40
  import operator
41
+ try:
42
+ from typing import Self # type: ignore (Python >= 3.11)
43
+ except ImportError:
44
+ from typing_extensions import Self # type: ignore (Python 3.10)
41
45
 
42
- from sage.arith.misc import next_prime, gcd, kronecker
46
+ from sage.arith.misc import gcd, kronecker, next_prime
43
47
  from sage.categories.action import Action
44
48
  from sage.misc.cachefunc import cached_method
45
49
  from sage.misc.lazy_import import lazy_import
@@ -54,10 +58,9 @@ from sage.structure.richcmp import op_EQ, op_NE
54
58
  lazy_import('sage.rings.padics.factory', 'Qp')
55
59
  lazy_import('sage.rings.padics.padic_generic', 'pAdicGeneric')
56
60
 
61
+ from .fund_domain import M2Z
57
62
  from .manin_map import ManinMap
58
63
  from .sigma0 import Sigma0
59
- from .fund_domain import M2Z
60
-
61
64
 
62
65
  minusproj = [1, 0, 0, -1]
63
66
 
@@ -108,13 +111,12 @@ def _iterate_Up(Phi, p, M, ap, q, aq, check):
108
111
  verbose("Iterating U_p", level=2)
109
112
  Psi = apinv * Phi.hecke(p)
110
113
 
111
- for attempts in range(M-1):
114
+ for attempts in range(M - 1):
112
115
  verbose("%s attempt (val = %s/%s)" % (attempts + 1,(Phi-Psi).valuation(),M), level=2)
113
116
  Phi = Psi
114
117
  Psi = apinv * Phi.hecke(p)
115
118
  Psi._normalize()
116
- Phi = ~(q ** (k + 1) + 1 - aq) * Phi
117
- return Phi
119
+ return ~(q ** (k + 1) + 1 - aq) * Phi
118
120
 
119
121
 
120
122
  class PSModSymAction(Action):
@@ -234,7 +236,7 @@ class PSModularSymbolElement(ModuleElement):
234
236
  """
235
237
  return [self._map[g] for g in self.parent().source().gens()]
236
238
 
237
- def _normalize(self, **kwds):
239
+ def _normalize(self, **kwds) -> Self:
238
240
  """
239
241
  Normalize all of the values of the symbol ``self``.
240
242
 
@@ -681,15 +683,15 @@ class PSModularSymbolElement(ModuleElement):
681
683
  # aq.add_bigoh(M)
682
684
  return aq
683
685
 
684
- def is_ordinary(self, p=None, P=None):
686
+ def is_ordinary(self, p=None, P=None) -> bool:
685
687
  r"""
686
- Return true if the `p`-th eigenvalue is a `p`-adic unit.
688
+ Return ``True`` if the `p`-th eigenvalue is a `p`-adic unit.
687
689
 
688
690
  INPUT:
689
691
 
690
- - ``p`` -- a positive integral prime, or None (default: ``None``)
691
- - ``P`` -- a prime of the base ring above `p`, or None. This is ignored
692
- unless the base ring is a number field
692
+ - ``p`` -- a positive integral prime, or ``None`` (default: ``None``)
693
+ - ``P`` -- a prime of the base ring above `p`, or ``None``.
694
+ This is ignored unless the base ring is a number field
693
695
 
694
696
  OUTPUT: boolean
695
697
 
@@ -827,11 +829,10 @@ class PSModularSymbolElement(ModuleElement):
827
829
  if not (g in MR.reps_with_two_torsion()
828
830
  or g in MR.reps_with_three_torsion()):
829
831
  t += f[g] * MR.gammas[g] - f[g]
832
+ elif g in MR.reps_with_two_torsion():
833
+ t -= f[g]
830
834
  else:
831
- if g in MR.reps_with_two_torsion():
832
- t -= f[g]
833
- else:
834
- t -= f[g] # what ?? same thing ??
835
+ t -= f[g] # what ?? same thing ??
835
836
 
836
837
  id = MR.gens()[0]
837
838
  if f[id] * MR.gammas[id] - f[id] != -t:
@@ -1102,8 +1103,7 @@ class PSModularSymbolElement_symk(PSModularSymbolElement):
1102
1103
  Dist = V.coefficient_module()
1103
1104
  psi = K.hom([K.gen()], L)
1104
1105
  embedded_sym = self.parent().element_class(self._map.apply(psi, codomain=Dist, to_moments=True), V, construct=True)
1105
- ans = [embedded_sym, psi]
1106
- return ans
1106
+ return [embedded_sym, psi]
1107
1107
  else:
1108
1108
  roots = [r[0] for r in v]
1109
1109
  ans = []
@@ -53,9 +53,9 @@ class QuasiModularFormsElement(ModuleElement):
53
53
 
54
54
  sage: QM = QuasiModularForms(1)
55
55
  sage: QM.gens()
56
- [1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 + O(q^6),
56
+ (1 - 24*q - 72*q^2 - 96*q^3 - 168*q^4 - 144*q^5 + O(q^6),
57
57
  1 + 240*q + 2160*q^2 + 6720*q^3 + 17520*q^4 + 30240*q^5 + O(q^6),
58
- 1 - 504*q - 16632*q^2 - 122976*q^3 - 532728*q^4 - 1575504*q^5 + O(q^6)]
58
+ 1 - 504*q - 16632*q^2 - 122976*q^3 - 532728*q^4 - 1575504*q^5 + O(q^6))
59
59
  sage: QM.0 + QM.1
60
60
  2 + 216*q + 2088*q^2 + 6624*q^3 + 17352*q^4 + 30096*q^5 + O(q^6)
61
61
  sage: QM.0 * QM.1
@@ -340,7 +340,7 @@ class QuasiModularFormsElement(ModuleElement):
340
340
  "homogeneous element")
341
341
  return self._polynomial.degree()
342
342
 
343
- def is_zero(self):
343
+ def is_zero(self) -> bool:
344
344
  r"""
345
345
  Return whether the given quasimodular form is zero.
346
346
 
@@ -361,7 +361,7 @@ class QuasiModularFormsElement(ModuleElement):
361
361
  """
362
362
  return not self
363
363
 
364
- def is_one(self):
364
+ def is_one(self) -> bool:
365
365
  r"""
366
366
  Return whether the given quasimodular form is 1, i.e. the
367
367
  multiplicative identity.
@@ -381,7 +381,7 @@ class QuasiModularFormsElement(ModuleElement):
381
381
  """
382
382
  return self._polynomial.is_one()
383
383
 
384
- def is_graded_modular_form(self):
384
+ def is_graded_modular_form(self) -> bool:
385
385
  r"""
386
386
  Return whether the given quasimodular form is a
387
387
  graded modular form element
@@ -421,7 +421,7 @@ class QuasiModularFormsElement(ModuleElement):
421
421
  """
422
422
  return self._polynomial.degree() <= 0
423
423
 
424
- def is_modular_form(self):
424
+ def is_modular_form(self) -> bool:
425
425
  r"""
426
426
  Return whether the given quasimodular form is a modular form.
427
427
 
@@ -483,10 +483,10 @@ class QuasiModularFormsElement(ModuleElement):
483
483
  E2 = poly_gens[0]
484
484
  poly_gens = poly_gens[1:]
485
485
  modform_poly_gens = self.parent().modular_forms_subring().polynomial_ring(names='x').gens()
486
- subs_dictionnary = {}
486
+ subs_dictionary = {}
487
487
  for idx, g in enumerate(modform_poly_gens):
488
- subs_dictionnary[g] = poly_gens[idx]
489
- return sum(f.to_polynomial().subs(subs_dictionnary) * E2 ** exp for exp, f in enumerate(self._polynomial.coefficients(sparse=False)))
488
+ subs_dictionary[g] = poly_gens[idx]
489
+ return sum(f.to_polynomial().subs(subs_dictionary) * E2 ** exp for exp, f in enumerate(self._polynomial.coefficients(sparse=False)))
490
490
 
491
491
  to_polynomial = polynomial # alias
492
492
 
@@ -512,7 +512,7 @@ class QuasiModularFormsElement(ModuleElement):
512
512
  """
513
513
  return sorted(self.homogeneous_components().keys())
514
514
 
515
- def is_homogeneous(self):
515
+ def is_homogeneous(self) -> bool:
516
516
  r"""
517
517
  Return whether the graded quasimodular form is a homogeneous element,
518
518
  that is, it lives in a unique graded components of the parent of