Skip to content

Commit

Permalink
fix pari polcoeff to polcoef
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jun 7, 2021
1 parent 24dca9d commit d3b2b34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/sage/rings/number_field/class_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@ def ray_class_field(self, subgroup=None, names=None, algorithm='stark'):
nf = F.pari_nf()
f = nf.rnfpolredbest(f)
d = f.poldegree()
cs = [F(f.polcoeff(i)) for i in range(d+1)]
cs = [F(f.polcoef(i)) for i in range(d + 1)]
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
f = PolynomialRing(F, 'x')(cs)
return F.extension(f, names=names)
Expand All @@ -1347,7 +1347,7 @@ def _ray_class_field_kummer(self, subgroup=None, names=None):
pass

def _ideal_log(self, ideal):
return tuple(ZZ(c) for c in self._bnr.bnrisprincipal(ideal, flag = 0))
return tuple(ZZ(c) for c in self._bnr.bnrisprincipal(ideal, flag=0))

def ideal_reduce(self, ideal):
from cypari2.handle_error import PariError
Expand Down
9 changes: 6 additions & 3 deletions src/sage/rings/number_field/number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -3684,13 +3684,16 @@ def _pari_real_places_to_sage(self):
except AttributeError:
pass
pari_conv = self._pari_absolute_structure()[1].lift()
pari_conv = [pari_conv.polcoeff(i).sage() for i in range(pari_conv.poldegree() + 1)]
pari_conv = [pari_conv.polcoef(i).sage()
for i in range(pari_conv.poldegree() + 1)]
R = self.defining_polynomial().parent()
pari_conv = R(pari_conv)
pari_roots = [pari_conv(r.sage()) for r in self.pari_nf()[5][:self.signature()[0]]]
pari_roots = [pari_conv(r.sage())
for r in self.pari_nf()[5][:self.signature()[0]]]
pari_roots_sorted = list(pari_roots)
pari_roots_sorted.sort()
self._pari_real_places = tuple(pari_roots_sorted.index(r) for r in pari_roots)
self._pari_real_places = tuple(pari_roots_sorted.index(r)
for r in pari_roots)
return self._pari_real_places

def modulus(self, finite, infinite=None):
Expand Down

0 comments on commit d3b2b34

Please sign in to comment.