Skip to content

Commit d90340e

Browse files
DavidAyottexcaruso
andauthored
Update src/sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py
Co-authored-by: Xavier Caruso <[email protected]>
1 parent 771688f commit d90340e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -368,9 +368,13 @@ def _compute_goss_polynomial(self, n, q, poly_ring, X):
368368
if n % q == 0:
369369
return self.goss_polynomial(n // q)**q
370370
# General case
371-
pol = sum(self._compute_coefficient_exp(i+1)
372-
*self._compute_goss_polynomial(n - q**(i+1), q, poly_ring, X)
373-
for i in range(0, (n.log(q).n()).floor()))
371+
pol = poly_ring.zero()
372+
m = q
373+
i = 1
374+
while m < n:
375+
pol += self._compute_coefficient_exp(i) * self._compute_goss_polynomial(n - m, q, poly_ring, X)
376+
m *= q
377+
i += 1
374378
return X*(self._compute_goss_polynomial(n - 1, q, poly_ring, X) + pol)
375379

376380
def goss_polynomial(self, n, var='X'):

0 commit comments

Comments
 (0)