Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove some unused variables #38861

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/sage/algebras/down_up_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ def is_weight_vector(self):

P = self.parent()
R = P.base_ring()
weights = P._weights

def get_wt(n):
if not n:
Expand Down Expand Up @@ -853,9 +852,8 @@ def weight(self):
P = self.parent()
R = P.base_ring()
V = FreeModule(R, 2)
weights = P._weights
it = iter(self._monomial_coefficients)
n = next(it)
if not n:
return V([P._weights[0], R.zero()])
return V([P._weights[n], P._weights[n-1]])
return V([P._weights[n], P._weights[n - 1]])
5 changes: 1 addition & 4 deletions src/sage/algebras/lie_algebras/affine_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,9 @@ def _test_classical_subalgebra(self, **options):
tester = self._tester(**options)
B = self.basis()
roots = set(self._g._Q.roots())
ac = list(self._g._Q.simple_coroots())
from sage.misc.misc import some_tuples
for r, s in some_tuples(roots, 2, tester._max_runs):
ret = B[r,0].bracket(B[s,0])
ret = B[r, 0].bracket(B[s, 0])
if r + s in roots:
tester.assertEqual(list(ret.support()), [(r+s, 0)], f"obtained [{r}, {s}] == {ret}")
elif r == -s:
Expand Down Expand Up @@ -1125,7 +1124,6 @@ def __init__(self, cartan_type):
Q = finite_ct.relabel({n-i: i for i in range(n)}).root_system().root_lattice()
self._roots = tuple(Q.roots())
self._ac = tuple(Q.simple_coroots())
CP = cartesian_product([range(3)] * n)
if cartan_type.rank() == 2:
self._short_roots = self._roots + tuple(2*r for r in Q.roots())
else:
Expand Down Expand Up @@ -1200,7 +1198,6 @@ def __iter__(self):
finite_ct = finite_ct.relabel({n-i: i for i in range(n)})
else:
finite_ct = self._cartan_type.classical()
Q = finite_ct.root_system().root_lattice()
P = self._facade_for[0]
for i in ZZ:
if i % 2:
Expand Down
1 change: 0 additions & 1 deletion src/sage/algebras/lie_algebras/center_uea.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ def __iter__(self):
n = len(self._gen_degrees)
wts = sorted(self._gen_degrees.values(), reverse=True)
while True:
total = 0
for exps in intvecwt_iterator(deg, wts):
yield self.element_class(self, {n-1-i: e for i, e in enumerate(exps) if e})
deg += 1
Expand Down
1 change: 0 additions & 1 deletion src/sage/algebras/lie_algebras/classical_lie_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@
sage: g
Simple matrix Lie algebra of type ['E', 7] over Rational Field

sage: len(g.basis()) # long time

Check warning on line 944 in src/sage/algebras/lie_algebras/classical_lie_algebra.py

View workflow job for this annotation

GitHub Actions / test-new

Warning: slow doctest:

slow doctest:

Check warning on line 944 in src/sage/algebras/lie_algebras/classical_lie_algebra.py

View workflow job for this annotation

GitHub Actions / test-long (src/sage/[a-f]*)

Warning: slow doctest:

slow doctest:
133
sage: TestSuite(g).run() # long time
"""
Expand Down Expand Up @@ -2359,7 +2359,6 @@
for ii, ca in r._monomial_coefficients.items()
for jj, cb in s._monomial_coefficients.items())
s_coeffs[r, s] = {r+s: coeff}
ht = sum(r.coefficients()) + sum(s.coefficients())
s_coeffs[-r, -s] = {-r-s: -coeff}
if r - s in p_roots_set or s - r in p_roots_set:
coeff = R.prod((-1)**(ca*cb) if (ii, jj) in self._epsilon or ii == jj else 1
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/filtered_modules_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,6 @@ def hilbert_series(self, prec=None):
from collections import defaultdict
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
R = self.base_ring()
PR = PolynomialRing(ZZ, 't')
dims = defaultdict(ZZ)
for b in self.basis():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ def root_fcn(s, x):
s = 1
n = self.dimension()
B = [b.on_left_matrix() for b in self.basis()]
I = B[0].parent().one()
while s <= n:
# we use that p_{AB}(x) = p_{BA}(x) here
data = [[None]*(len(B)+1) for _ in B]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,13 @@ def normalizer_basis(self, S):
sc[k[1], k[0]] = -v
X = self.basis().keys()
d = len(X)
ret = []
t = m.nrows()
c_mat = matrix(self.base_ring(),
[[sum(m[i,j] * sc[x,xp][k] for j, xp in enumerate(X)
if (x, xp) in sc)
[[sum(m[i, j] * sc[x, xp][k]
for j, xp in enumerate(X) if (x, xp) in sc)
for x in X]
+ [0]*(i*t) + [-m[j,k] for j in range(t)] + [0]*((t-i-1)*t)
+ [0]*(i*t) + [-m[j, k] for j in range(t)]
+ [0]*((t-i-1)*t)
for i in range(t) for k in range(d)])
C = c_mat.right_kernel().basis_matrix()
return [self.from_vector(c[:d]) for c in C]
Expand Down
3 changes: 0 additions & 3 deletions src/sage/categories/simplicial_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,6 @@ def covering_map(self, character):
for g in G:
cell = AbstractSimplex(d, name="({}, {})".format(s, g))
cells_dict[(s, g)] = cell
fd = []
faces = self.faces(s)
f0 = faces[0]
for h in G:
Expand Down Expand Up @@ -612,7 +611,6 @@ def _canonical_twisting_operator(self):
Quotient of Univariate Laurent Polynomial Ring in F1 over Integer Ring by the ideal (-1 + F1^2)
"""
G, d = self._universal_cover_dict()
phi = G.abelianization_map()
abelG, R, I, images = G.abelianization_to_algebra(ZZ)
QRP = R.quotient_ring(I)
res = {}
Expand Down Expand Up @@ -908,7 +906,6 @@ def twisted_homology(self, n, reduced=False):
singred = singular_function("reduce")
singlift = singular_function("lift")
G, d = self._universal_cover_dict()
phi = G.abelianization_map()
abelG, R, I, images = G.abelianization_to_algebra(ZZ)
CC = self.twisted_chain_complex()
M1 = CC.differential(n).T
Expand Down
1 change: 0 additions & 1 deletion src/sage/categories/triangular_kac_moody_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ def _transpose_basis_mapping(self):
alphacheck[1]: alphacheck[1],
alphacheck[2]: alphacheck[2]}
"""
Q = self.cartan_type().root_system().root_lattice()
K = self.basis().keys()
deg_map = {}
ret = {}
Expand Down
1 change: 0 additions & 1 deletion src/sage/geometry/lattice_polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,6 @@ def _sage_input_(self, sib, coerced):
"""
if self._ambient is not self:
raise NotImplementedError
data = self._vertices
return sib.name('LatticePolytope')(sib(self._vertices), compute_vertices=False)

def __contains__(self, point):
Expand Down
3 changes: 1 addition & 2 deletions src/sage/homology/homology_vector_space_with_basis.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,9 @@ def _acted_upon_(self, a, self_on_left):
if m <= n:
return self.parent().zero()

if not self_on_left: # i.e., module element on left
if not self_on_left: # i.e., module element on left
a = a.antipode()
P = self.parent()
B = list(P.basis(m-n))
return P._from_dict({x.support()[0]: self.eval(a * x)
for x in sorted(self.parent().dual().basis(m-n))})

Expand Down
1 change: 0 additions & 1 deletion src/sage/knots/knotinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,6 @@ def cosmetic_crossing_conjecture_verified(self):
return True
if not cosmetic_crossing or cosmetic_crossing == 'Unknown':
return False
verified = not knotinfo_bool(cosmetic_crossing)
if not knotinfo_bool(cosmetic_crossing):
return True
raise AssertionError(f'{self} is a counterexample to the cosmetic crossing conjecture')
Expand Down
2 changes: 1 addition & 1 deletion src/sage/libs/gap/test_long.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_loop_1():
"""
libgap.collect()
for i in range(10000):
G = libgap.CyclicGroup(2)
_ = libgap.CyclicGroup(2)


def test_loop_2():
Expand Down
1 change: 0 additions & 1 deletion src/sage/matroids/matroids_plot_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,6 @@ def geomrep(M1, B1=None, lineorders1=None, pd=None, sp=False):
pl = [list(x) for x in pts2.values()]
lims = tracklims([None, None, None, None], [pt[0] for pt in pl],
[pt[1] for pt in pl])
j = 0
for ll in trilines:
if len(ll) >= 3:
ptsx, ptsy, x_i, y_i = createline(pts2, ll, lineorders1)
Expand Down
2 changes: 0 additions & 2 deletions src/sage/modular/drinfeld_modform/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,8 +581,6 @@ def coefficient_forms(self, a=None):
...
TypeError: unable to convert a to an element in Fq[T]
"""
K = self._base_ring
T = K.gen()
if a is None:
return [self._generator_coefficient_form(i)
for i in range(1, self.rank() + 1)]
Expand Down
5 changes: 2 additions & 3 deletions src/sage/modules/with_basis/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,8 +685,8 @@
5
"""
if not is_closed and gens:
R = self.base_ring()
repr_mats = [self.representation_matrix(g) for g in self._semigroup.gens()]
repr_mats = [self.representation_matrix(g)
for g in self._semigroup.gens()]
amb_dim = self.dimension()
SM = matrix([v._vector_() for v in gens])
SM.echelonize()
Expand Down Expand Up @@ -2771,7 +2771,7 @@
24 [2, 0, -1]

sage: # long time
sage: S211V = V.schur_functor([2, 1, 1])

Check warning on line 2774 in src/sage/modules/with_basis/representation.py

View workflow job for this annotation

GitHub Actions / test-new

Warning: slow doctest:

slow doctest:
sage: S211V.dimension()
105
sage: SemistandardTableaux([2, 1, 1], max_entry=V.dimension()).cardinality()
Expand Down Expand Up @@ -2892,7 +2892,6 @@
keys = list(V.basis().keys())

ambient = tensor([V]*d)
I = ambient.indices()
cla = SymmetricGroupAlgebra(R, SymmetricGroup(d)).young_symmetrizer(shape)
mc = cla.monomial_coefficients(copy=False)
gens = [ambient.sum_of_terms((tuple([k[i-1] for i in p.tuple()]), coeff)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ def logarithm(self, name='z'):
True
"""
L = LazyPowerSeriesRing(self._base, name)
zero = self._base.zero()
q = self._Fq.cardinality()

def coeff_log(k):
Expand Down
1 change: 0 additions & 1 deletion src/sage/rings/lazy_series_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -2612,7 +2612,6 @@ def taylor(self, f):
BR = R.base_ring()
args = f.arguments()
subs = {str(va): ZZ.zero() for va in args}
gens = R.gens()
ell = len(subs)
from sage.combinat.integer_vector import integer_vectors_nk_fast_iter
from sage.arith.misc import factorial
Expand Down
1 change: 0 additions & 1 deletion src/sage/schemes/curves/projective_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@
sage: set_verbose(-1)
sage: P.<x,y,z> = ProjectiveSpace(QQ, 2)
sage: C = Curve([(x^2 + y^2 - y*z - 2*z^2)*(y*z - x^2 + 2*z^2)*z + y^5], P)
sage: C.ordinary_model() # long time (5 seconds)

Check warning on line 1403 in src/sage/schemes/curves/projective_curve.py

View workflow job for this annotation

GitHub Actions / test-new

Warning: slow doctest:

slow doctest:
Scheme morphism:
From: Projective Plane Curve over Number Field in a
with defining polynomial y^2 - 2 defined
Expand Down Expand Up @@ -2521,7 +2521,6 @@
sage: C.function(C._map_from_function_field(f)) == f
True
"""
F = self._function_field
S = self.ambient_space().coordinate_ring()
phi = self._open_affine._nonsingular_model[2]
i = self._open_affine_index
Expand Down
Loading