Skip to content

Commit a737aad

Browse files
committed
minor details in modular/
1 parent 931cc5e commit a737aad

File tree

5 files changed

+12
-19
lines changed

5 files changed

+12
-19
lines changed

src/sage/modular/abvar/abvar.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4452,19 +4452,17 @@ def decomposition(self, simple=True, bound=None):
44524452
D = []
44534453
for N in reversed(divisors(M)):
44544454
if N > 1:
4455-
isogeny_number = 0
44564455
A = amb.modular_symbols_of_level(N).cuspidal_subspace().new_subspace()
44574456
if bound is None:
44584457
X = factor_new_space(A)
44594458
else:
44604459
X = A.decomposition(bound=bound)
4461-
for B in X:
4460+
for isogeny_number, B in enumerate(X):
44624461
D.extend(ModularAbelianVariety_modsym(B.degeneracy_map(M, t).image(),
44634462
is_simple=True, newform_level=(N, G),
44644463
isogeny_number=isogeny_number,
44654464
number=(t, M))
44664465
for t in divisors(M // N))
4467-
isogeny_number += 1
44684466
elif A == amb.cuspidal_submodule():
44694467
D = [ModularAbelianVariety_modsym(B)
44704468
for B in A.decomposition(bound=bound)]

src/sage/modular/btquotients/btquotient.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2916,29 +2916,28 @@ def _get_hecke_data(self, l):
29162916
if prod([self._character(ZZ((v * Matrix(ZZ, 4, 1, g))[0, 0]))
29172917
/ self._character(p ** (nninc // 2))
29182918
for v in self.get_extra_embedding_matrices()]) == 1]
2919-
n_iters = 0
29202919

29212920
def enumerate_words(v, n=None):
29222921
if n is None:
29232922
n = []
29242923
while True:
29252924
add_new = True
2926-
for jj in range(len(n)):
2927-
n[jj] += 1
2928-
if n[jj] != len(v):
2925+
for j in range(len(n)):
2926+
n[j] += 1
2927+
if n[j] != len(v):
29292928
add_new = False
29302929
break
29312930
else:
2932-
n[jj] = 0
2931+
n[j] = 0
29332932
if add_new:
29342933
n.append(0)
29352934
yield [v[x] for x in n]
29362935

2937-
for wd in enumerate_words([self._conv(x) for x in letters]):
2936+
conv_list = [self._conv(x) for x in letters]
2937+
for n_iters, wd in enumerate(enumerate_words(conv_list)):
29382938
if len(T) == l + 1:
29392939
break
29402940
v = prod(wd)
2941-
n_iters += 1
29422941
v0 = v * alpha0
29432942
vinv = self.get_quaternion_algebra()(v0 ** (-1))
29442943
new = True

src/sage/modular/modform/element.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3808,8 +3808,8 @@ def _mul_(self, other):
38083808
f_other = other._forms_dictionary
38093809
f_mul = defaultdict(int)
38103810

3811-
for k_self in f_self.keys():
3812-
for k_other in f_other.keys():
3811+
for k_self in f_self:
3812+
for k_other in f_other:
38133813
f_mul[k_self + k_other] += f_self[k_self] * f_other[k_other]
38143814

38153815
return GM(self.parent(), f_mul)

src/sage/modular/modsym/ambient.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -980,16 +980,14 @@ def _compute_hecke_matrix_prime(self, p, rows=None):
980980
K = self.base_ring()
981981
W = R.new_matrix(nrows=len(B), ncols=R.nrows())
982982
syms = self.manin_symbols()
983-
j = 0
984-
for i in B:
983+
for j, i in enumerate(B):
985984
for h in H:
986985
entries = syms.apply(i, h)
987986
for k, x in entries:
988987
f, s = mod2term[k]
989988
if s:
990989
# W[j,f] = W[j,f] + s*K(x)
991990
W.add_to_entry(j, f, s * K(x))
992-
j += 1
993991
tm = verbose("start matrix multiply", tm)
994992
if hasattr(W, '_matrix_times_matrix_dense'):
995993
Tp = W._matrix_times_matrix_dense(R)
@@ -2937,9 +2935,8 @@ def _compute_hecke_matrix_prime(self, p, rows=None):
29372935
mod2term = self._mod2term
29382936
R = self.manin_gens_to_basis()
29392937
W = R.new_matrix(nrows=len(B), ncols=R.nrows()) # the 0 with given number of rows and cols.
2940-
j = 0
29412938
tm = verbose("Matrix non-reduced", tm)
2942-
for i in B:
2939+
for j, i in enumerate(B):
29432940
# The following step is where most of the time is spent.
29442941
c, d = P1[i]
29452942
v = H.apply(c, d, N)
@@ -2960,7 +2957,6 @@ def _compute_hecke_matrix_prime(self, p, rows=None):
29602957
f, s = mod2term[k]
29612958
if s != 0:
29622959
W[j, f] = W[j, f] + s*m
2963-
j += 1
29642960
tm = verbose("done making non-reduced matrix", tm)
29652961
verbose("start matrix-matrix (%s x %s) times (%s x %s) multiply to get Tp" % (W.nrows(), W.ncols(),
29662962
R.nrows(), R.ncols()))

src/sage/modular/quasimodform/element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def homogeneous_components(self):
617617
for i, c in enumerate(self._polynomial.coefficients(sparse=False)):
618618
if c:
619619
forms = c._forms_dictionary
620-
for k in forms.keys():
620+
for k in forms:
621621
try:
622622
components[ZZ(k + 2*i)] += QM(forms[k]*(E2**i))
623623
except KeyError:

0 commit comments

Comments
 (0)