218
218
from sage .rings .integer import Integer
219
219
from sage .rings .integer_ring import ZZ
220
220
from sage .rings .polynomial .polynomial_ring_constructor import PolynomialRing
221
+ from sage .rings .power_series_ring import PowerSeriesRing
221
222
from sage .rings .rational_field import QQ
222
223
from sage .rings .ring import CommutativeRing
223
224
from sage .structure .richcmp import richcmp , richcmp_method
@@ -490,7 +491,7 @@ def quaternion_order_with_given_level(A, level):
490
491
level = abs (level )
491
492
N = A .discriminant ()
492
493
N1 = gcd (level , N )
493
- M1 = level / N1
494
+ M1 = level // N1
494
495
495
496
O = maximal_order (A )
496
497
# if N1 != 1:
@@ -1034,7 +1035,7 @@ def hecke_matrix(self, n, algorithm='default', sparse=False, B=None):
1034
1035
"""
1035
1036
n = ZZ (n )
1036
1037
if n <= 0 :
1037
- raise IndexError ("n must be positive. " )
1038
+ raise IndexError ("n must be positive" )
1038
1039
if n not in self ._hecke_matrices :
1039
1040
if algorithm == 'default' :
1040
1041
try :
@@ -1055,7 +1056,7 @@ def hecke_matrix(self, n, algorithm='default', sparse=False, B=None):
1055
1056
elif algorithm == 'brandt' :
1056
1057
T = self ._compute_hecke_matrix_brandt (n , sparse = sparse )
1057
1058
else :
1058
- raise ValueError ("unknown algorithm '%s'" % algorithm )
1059
+ raise ValueError (f "unknown algorithm '{ algorithm } '" )
1059
1060
T .set_immutable ()
1060
1061
self ._hecke_matrices [n ] = T
1061
1062
return self ._hecke_matrices [n ]
@@ -1517,7 +1518,7 @@ def brandt_series(self, prec, var='q'):
1517
1518
[ 1/6 + 2*t^2 + O(t^3) 1/6 + t + O(t^3)]
1518
1519
"""
1519
1520
A = self ._brandt_series_vectors (prec )
1520
- R = QQ [[ var ]]
1521
+ R = PowerSeriesRing ( QQ , var )
1521
1522
n = len (A [0 ])
1522
1523
return matrix (R , n , n ,
1523
1524
[[R (x .list ()[:prec ], prec ) for x in Y ] for Y in A ])
@@ -1560,7 +1561,7 @@ def eisenstein_subspace(self):
1560
1561
V = A .kernel ()
1561
1562
return V
1562
1563
1563
- def is_cuspidal (self ):
1564
+ def is_cuspidal (self ) -> bool :
1564
1565
r"""
1565
1566
Return whether ``self`` is cuspidal, i.e. has no Eisenstein part.
1566
1567
@@ -1584,7 +1585,7 @@ def monodromy_weights(self):
1584
1585
fixed choice of basis. The weight of an ideal class `[I]` is
1585
1586
half the number of units of the right order `I`.
1586
1587
1587
- NOTE: The base ring must be `\QQ` or `\ZZ`.
1588
+ .. NOTE: : The base ring must be `\QQ` or `\ZZ`.
1588
1589
1589
1590
EXAMPLES::
1590
1591
@@ -1619,9 +1620,9 @@ def monodromy_weights(self):
1619
1620
return tuple (a [1 ] / a [0 ] / 2 for a in thetas )
1620
1621
1621
1622
1622
- #############################################################################
1623
- # Benchmarking
1624
- #############################################################################
1623
+ # ====================
1624
+ # Benchmarking
1625
+ # ====================
1625
1626
def benchmark_magma (levels , silent = False ):
1626
1627
"""
1627
1628
INPUT:
0 commit comments