Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,9 @@ def _frobenius_charpoly_gekeler(self):
# The system is solved over K, but the coefficients should all
# be in Fq We project back into Fq here.
sol_Fq = [K(x).vector()[0] for x in sol]
char_poly = []
for i in range(r):
char_poly.append([sol_Fq[block_shifts[i] + j]
for j in range(shifts[i])])
char_poly = [[sol_Fq[block_shifts[i] + j]
for j in range(shifts[i])]
for i in range(r)]
return PolynomialRing(A, name='X')(char_poly + [1])

def _frobenius_charpoly_motive(self):
Expand All @@ -651,8 +650,9 @@ def _frobenius_charpoly_motive(self):
Instead, use :meth:`frobenius_charpoly` with the option
`algorithm='motive'`.

OUTPUT: a univariate polynomial with coefficients in the
function ring
OUTPUT:

a univariate polynomial with coefficients in the function ring

EXAMPLES::

Expand Down
10 changes: 5 additions & 5 deletions src/sage/rings/function_field/ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ def gens_reduced(self):
gens = self.gens()
if len(gens) == 1:
return gens
candidate_gensets = []
for genset in powerset(gens):
if self.parent()(genset) == self:
candidate_gensets.append(genset)
candidate_gensets.sort(key=lambda item: (len(item), len(repr(item)), item))
candidate_gensets = [genset for genset in powerset(gens)
if self.parent()(genset) == self]
candidate_gensets.sort(key=lambda item: (len(item),
len(repr(item)),
item))
return candidate_gensets[0]

def ring(self):
Expand Down
5 changes: 2 additions & 3 deletions src/sage/rings/function_field/ideal_polymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,9 +1251,8 @@ def _gens_two(self) -> tuple:

R = hnf.base_ring()

basis = []
for row in hnf:
basis.append(sum([c1 * c2 for c1, c2 in zip(row, O.basis())]))
basis = [sum(c1 * c2 for c1, c2 in zip(row, O.basis()))
for row in hnf]

n = len(basis)
alpha = None
Expand Down
2 changes: 1 addition & 1 deletion src/sage/rings/function_field/jacobian_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def order(self, algorithm='numeric'):

return sum(bs)

def get_points(self, n):
def get_points(self, n) -> list:
"""
Return `n` points of the Jacobian group.

Expand Down
7 changes: 3 additions & 4 deletions src/sage/rings/function_field/place_polymod.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,13 +510,12 @@ def to_V(e):
v = O._coordinate_vector(e)
vec = []
for i in reversed(range(n)):
q,r = v[i].quo_rem(M[i,i])
q, r = v[i].quo_rem(M[i, i])
v -= q * M[i]
for j in range(degs[i]):
vec.append(r[j])
vec.extend(r[j] for j in range(degs[i]))
return vector(vec)

def fr_V(vec): # to_O
def fr_V(vec): # to_O
vec = vec.list()
pos = 0
e = F(0)
Expand Down
6 changes: 2 additions & 4 deletions src/sage/rings/padics/witt_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,7 @@ def _add_(self, other):
G = []
for n in range(self._prec):
G_n = [self[n], other[n]]
for i in range(n):
G_n.append(P._eta_bar(G[i], n - i))
G_n.extend(P._eta_bar(G[i], n - i) for i in range(n))
G.append(G_n)
sum_vec = tuple(sum(G[i]) for i in range(self._prec))

Expand Down Expand Up @@ -753,8 +752,7 @@ def _mul_(self, other):
G_n.extend(fast_char_p_power(self[i], p**(n - i))
* fast_char_p_power(other[n - i], p**i)
for i in range(1, n))
for i in range(n):
G_n.append(P._eta_bar(G[i], n - i))
G_n.extend(P._eta_bar(G[i], n - i) for i in range(n))
G.append(G_n)
prod_vec = tuple(sum(G[i]) for i in range(self._prec))

Expand Down
17 changes: 7 additions & 10 deletions src/sage/rings/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,13 +488,10 @@ def __call__(self, *args):
initial=0))

# gens from self
gens = []
for gen in G.gens():
newgen = []
for cyc in gen.cycle_tuples():
for k in range(1, sum(Mlist[cyc[0] - 1].grade()) + 1):
newgen.append(tuple([k + starts[i - 1] for i in cyc]))
gens.append(newgen)
gens = [[tuple([k + starts[i - 1] for i in cyc])
for cyc in gen.cycle_tuples()
for k in range(1, sum(Mlist[cyc[0] - 1].grade()) + 1)]
for gen in G.gens()]

# gens from M_i and dompart
P = args[0].parent()
Expand All @@ -503,9 +500,9 @@ def __call__(self, *args):
K, K_dompart = M.permutation_group()
for i, v in enumerate(K_dompart):
pi[i].extend([start + k for k in v])
for gen in K.gens():
gens.append([tuple([start + k for k in cyc])
for cyc in gen.cycle_tuples()])
gens.extend([tuple([start + k for k in cyc])
for cyc in gen.cycle_tuples()]
for gen in K.gens())

H = PermutationGroup(gens, domain=range(1, starts[-1] + 1))
return P._indices(H, pi, check=False)
Expand Down
Loading