Skip to content

Commit 9080ed5

Browse files
committed
a few details in Brandt modules
1 parent 54cd6fe commit 9080ed5

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/sage/modular/quatalg/brandt.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@
218218
from sage.rings.integer import Integer
219219
from sage.rings.integer_ring import ZZ
220220
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
221+
from sage.rings.power_series_ring import PowerSeriesRing
221222
from sage.rings.rational_field import QQ
222223
from sage.rings.ring import CommutativeRing
223224
from sage.structure.richcmp import richcmp, richcmp_method
@@ -490,7 +491,7 @@ def quaternion_order_with_given_level(A, level):
490491
level = abs(level)
491492
N = A.discriminant()
492493
N1 = gcd(level, N)
493-
M1 = level / N1
494+
M1 = level // N1
494495

495496
O = maximal_order(A)
496497
# if N1 != 1:
@@ -1034,7 +1035,7 @@ def hecke_matrix(self, n, algorithm='default', sparse=False, B=None):
10341035
"""
10351036
n = ZZ(n)
10361037
if n <= 0:
1037-
raise IndexError("n must be positive.")
1038+
raise IndexError("n must be positive")
10381039
if n not in self._hecke_matrices:
10391040
if algorithm == 'default':
10401041
try:
@@ -1055,7 +1056,7 @@ def hecke_matrix(self, n, algorithm='default', sparse=False, B=None):
10551056
elif algorithm == 'brandt':
10561057
T = self._compute_hecke_matrix_brandt(n, sparse=sparse)
10571058
else:
1058-
raise ValueError("unknown algorithm '%s'" % algorithm)
1059+
raise ValueError(f"unknown algorithm '{algorithm}'")
10591060
T.set_immutable()
10601061
self._hecke_matrices[n] = T
10611062
return self._hecke_matrices[n]
@@ -1517,7 +1518,7 @@ def brandt_series(self, prec, var='q'):
15171518
[ 1/6 + 2*t^2 + O(t^3) 1/6 + t + O(t^3)]
15181519
"""
15191520
A = self._brandt_series_vectors(prec)
1520-
R = QQ[[var]]
1521+
R = PowerSeriesRing(QQ, var)
15211522
n = len(A[0])
15221523
return matrix(R, n, n,
15231524
[[R(x.list()[:prec], prec) for x in Y] for Y in A])
@@ -1560,7 +1561,7 @@ def eisenstein_subspace(self):
15601561
V = A.kernel()
15611562
return V
15621563

1563-
def is_cuspidal(self):
1564+
def is_cuspidal(self) -> bool:
15641565
r"""
15651566
Return whether ``self`` is cuspidal, i.e. has no Eisenstein part.
15661567
@@ -1584,7 +1585,7 @@ def monodromy_weights(self):
15841585
fixed choice of basis. The weight of an ideal class `[I]` is
15851586
half the number of units of the right order `I`.
15861587
1587-
NOTE: The base ring must be `\QQ` or `\ZZ`.
1588+
.. NOTE:: The base ring must be `\QQ` or `\ZZ`.
15881589
15891590
EXAMPLES::
15901591
@@ -1619,9 +1620,9 @@ def monodromy_weights(self):
16191620
return tuple(a[1] / a[0] / 2 for a in thetas)
16201621

16211622

1622-
#############################################################################
1623-
# Benchmarking
1624-
#############################################################################
1623+
# ====================
1624+
# Benchmarking
1625+
# ====================
16251626
def benchmark_magma(levels, silent=False):
16261627
"""
16271628
INPUT:

0 commit comments

Comments
 (0)