-
-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-36664: ruff auto-fix for C4 in modular
this was scripted using ``` ruff check --select=C4 --fix src/sage/modular/ ``` and is about simplifying list,set,dict comprehensions ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36664 Reported by: Frédéric Chapoton Reviewer(s): David Ayotte
- Loading branch information
Showing
24 changed files
with
61 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tarball=configure-VERSION.tar.gz | ||
sha1=c769dfca6414cc453b22e64863aee153c4041e6f | ||
md5=b098e551614a15569894e0b99b4909ff | ||
cksum=2514200459 | ||
sha1=09ed008d1bdba4837fdb078f8f50a67cac9a9d7f | ||
md5=eeed6bf17634e46f99f44c1f8dcd010a | ||
cksum=1753047461 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
b2813506039143e6f0abe859ab67a343abf72c2e | ||
c3f06e4734ef325db812d73dcdb2bf846b590104 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,15 +168,15 @@ | |
- Craig Citro, Robert Bradshaw (2008-03): Rewrote with modabvar overhaul | ||
""" | ||
|
||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2007 William Stein <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 2 of the License, or | ||
# (at your option) any later version. | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
|
||
|
||
from copy import copy | ||
|
@@ -188,7 +188,6 @@ | |
|
||
from . import morphism | ||
|
||
import sage.rings.integer_ring | ||
from sage.rings.infinity import Infinity | ||
|
||
from sage.rings.ring import Ring | ||
|
@@ -276,7 +275,7 @@ def _matrix_space(self): | |
sage: Hom(J0(11), J0(22))._matrix_space | ||
Full MatrixSpace of 2 by 4 dense matrices over Integer Ring | ||
""" | ||
return MatrixSpace(ZZ,2*self.domain().dimension(), 2*self.codomain().dimension()) | ||
return MatrixSpace(ZZ, 2*self.domain().dimension(), 2*self.codomain().dimension()) | ||
|
||
def _element_constructor_from_element_class(self, *args, **keywords): | ||
""" | ||
|
@@ -479,7 +478,7 @@ def free_module(self): | |
""" | ||
self.calculate_generators() | ||
V = ZZ**(4*self.domain().dimension() * self.codomain().dimension()) | ||
return V.submodule([ V(m.matrix().list()) for m in self.gens() ]) | ||
return V.submodule([V(m.matrix().list()) for m in self.gens()]) | ||
|
||
def gen(self, i=0): | ||
""" | ||
|
@@ -570,7 +569,7 @@ def calculate_generators(self): | |
return | ||
|
||
if (self.domain() == self.codomain()) and (self.domain().dimension() == 1): | ||
self._gens = tuple([ identity_matrix(ZZ,2) ]) | ||
self._gens = (identity_matrix(ZZ, 2),) | ||
return | ||
|
||
phi = self.domain()._isogeny_to_product_of_powers() | ||
|
@@ -583,9 +582,9 @@ def calculate_generators(self): | |
Mt = psi.complementary_isogeny().matrix() | ||
|
||
R = ZZ**(4*self.domain().dimension()*self.codomain().dimension()) | ||
gens = R.submodule([ (M*self._get_matrix(g)*Mt).list() | ||
for g in im_gens ]).saturation().basis() | ||
self._gens = tuple([ self._get_matrix(g) for g in gens ]) | ||
gens = R.submodule([(M*self._get_matrix(g)*Mt).list() | ||
for g in im_gens]).saturation().basis() | ||
self._gens = tuple([self._get_matrix(g) for g in gens]) | ||
|
||
def _calculate_product_gens(self): | ||
""" | ||
|
@@ -746,7 +745,8 @@ def _calculate_simple_gens(self): | |
Mf = f.matrix() | ||
Mg = g.matrix() | ||
|
||
return [ Mf * self._get_matrix(e) * Mg for e in ls ] | ||
return [Mf * self._get_matrix(e) * Mg for e in ls] | ||
|
||
|
||
# NOTE/WARNING/TODO: Below in the __init__, etc. we do *not* check | ||
# that the input gens are give something that spans a sub*ring*, as apposed | ||
|
@@ -820,7 +820,7 @@ def __init__(self, A, gens=None, category=None): | |
if gens is None: | ||
self._gens = None | ||
else: | ||
self._gens = tuple([ self._get_matrix(g) for g in gens ]) | ||
self._gens = tuple([self._get_matrix(g) for g in gens]) | ||
self._is_full_ring = gens is None | ||
|
||
def _repr_(self): | ||
|
@@ -903,7 +903,7 @@ def index_in_saturation(self): | |
A = self.abelian_variety() | ||
d = A.dimension() | ||
M = ZZ**(4*d**2) | ||
gens = [ x.matrix().list() for x in self.gens() ] | ||
gens = [x.matrix().list() for x in self.gens()] | ||
R = M.submodule(gens) | ||
return R.index_in_saturation() | ||
|
||
|
@@ -934,8 +934,8 @@ def discriminant(self): | |
2 | ||
""" | ||
g = self.gens() | ||
M = Matrix(ZZ,len(g), [ (g[i]*g[j]).trace() | ||
for i in range(len(g)) for j in range(len(g)) ]) | ||
M = Matrix(ZZ, len(g), [(g[i]*g[j]).trace() | ||
for i in range(len(g)) for j in range(len(g))]) | ||
return M.determinant() | ||
|
||
def image_of_hecke_algebra(self, check_every=1): | ||
|
@@ -1002,18 +1002,18 @@ def image_of_hecke_algebra(self, check_every=1): | |
EndVecZ = ZZ**(4*d**2) | ||
|
||
if d == 1: | ||
self.__hecke_algebra_image = EndomorphismSubring(A, [[1,0,0,1]]) | ||
self.__hecke_algebra_image = EndomorphismSubring(A, [[1, 0, 0, 1]]) | ||
return self.__hecke_algebra_image | ||
|
||
V = EndVecZ.submodule([A.hecke_operator(1).matrix().list()]) | ||
|
||
for n in range(2,M.sturm_bound()+1): | ||
for n in range(2, M.sturm_bound()+1): | ||
if (check_every > 0 and | ||
n % check_every == 0 and | ||
V.dimension() == d and | ||
V.index_in_saturation() == 1): | ||
break | ||
V += EndVecZ.submodule([ A.hecke_operator(n).matrix().list() ]) | ||
V += EndVecZ.submodule([A.hecke_operator(n).matrix().list()]) | ||
|
||
self.__hecke_algebra_image = EndomorphismSubring(A, V.basis()) | ||
return self.__hecke_algebra_image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.