Skip to content

Commit 157a645

Browse files
author
Release Manager
committed
gh-37072: some cleanup in overconvergent and quaternion Two different things: - cleaning the file `overconvergent/genus0`, adding a `TestSuite` and making it pass ; getting rid of non-sensical `gens_dict` there - making quaternion algebra return a tuple of generators ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. - [x] I have created tests covering the changes. URL: #37072 Reported by: Frédéric Chapoton Reviewer(s): David Coudert, Frédéric Chapoton
2 parents cae844b + d97717d commit 157a645

File tree

3 files changed

+65
-77
lines changed

3 files changed

+65
-77
lines changed

src/sage/algebras/quatalg/quaternion_algebra.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def ngens(self):
332332
sage: Q.ngens()
333333
3
334334
sage: Q.gens()
335-
[i, j, k]
335+
(i, j, k)
336336
"""
337337
return 3
338338

@@ -681,7 +681,7 @@ def __init__(self, base_ring, a, b, names='i,j,k'):
681681
else:
682682
self.Element = QuaternionAlgebraElement_generic
683683
self._populate_coercion_lists_(coerce_list=[base_ring])
684-
self._gens = [self([0, 1, 0, 0]), self([0, 0, 1, 0]), self([0, 0, 0, 1])]
684+
self._gens = (self([0, 1, 0, 0]), self([0, 0, 1, 0]), self([0, 0, 0, 1]))
685685

686686
@cached_method
687687
def maximal_order(self, take_shortcuts=True):
@@ -808,7 +808,7 @@ def maximal_order(self, take_shortcuts=True):
808808

809809
# The following code should always work (over QQ)
810810
# Start with <1,i,j,k>
811-
R = self.quaternion_order([1] + self.gens())
811+
R = self.quaternion_order((1,) + self.gens())
812812
d_R = R.discriminant()
813813

814814
e_new_gens = []
@@ -978,7 +978,7 @@ def gen(self, i=0):
978978
sage: Q.gen(2)
979979
kk
980980
sage: Q.gens()
981-
[ii, jj, kk]
981+
(ii, jj, kk)
982982
"""
983983
return self._gens[i]
984984

@@ -1496,7 +1496,7 @@ def one(self):
14961496

14971497
def gens(self):
14981498
"""
1499-
Return generators for self.
1499+
Return generators for ``self``.
15001500
15011501
EXAMPLES::
15021502

src/sage/modular/btquotients/btquotient.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3468,7 +3468,7 @@ def _init_order(self):
34683468
OBasis = Omagma.Basis()
34693469
self._A = QuaternionAlgebra((g[0] ** 2).sage(), (g[1] ** 2).sage())
34703470
i, j, k = self._A.gens()
3471-
v = [1] + self._A.gens()
3471+
v = [1] + list(self._A.gens())
34723472
self._B = [self._A(sum([OBasis[tt + 1][rr + 1].sage() * v[rr]
34733473
for rr in range(4)])) for tt in range(4)]
34743474
self._O = self._A.quaternion_order(self._B)
@@ -3478,7 +3478,7 @@ def _init_order(self):
34783478
# Note that we can't work with non-maximal orders in sage
34793479
assert self._Nplus == 1
34803480
self._A = QuaternionAlgebra(self._Nminus)
3481-
v = [1] + self._A.gens()
3481+
v = [1] + list(self._A.gens())
34823482
self._O = self._A.maximal_order()
34833483
self._OMax = self._O
34843484
OBasis = self._O.basis()
@@ -3623,8 +3623,8 @@ def _compute_quotient(self, check=True):
36233623
v0 = Vertex(p, num_verts, self._Mat_22([1, 0, 0, 1]),
36243624
determinant=1, valuation=0)
36253625
V = deque([v0])
3626-
S = Graph(0, multiedges=True, weighted=True)
3627-
Sfun = Graph(0)
3626+
S = Graph(0, multiedges=True, weighted=True) # noqa:F821
3627+
Sfun = Graph(0) # noqa:F821
36283628
edge_list = []
36293629
vertex_list = [v0]
36303630
num_edges = 0

0 commit comments

Comments
 (0)