Thanks to both Vincent and Nils!

Sage seems to include lots of ways to do things... Let me see if I understand. Vincent suggested

R = PolynomialRing(Qp(7), 'x')
x = R.gen()
p = x^2 - 2
pari.padicappr(p, 4 + O(7^10))

Which works, but relies on using the built-in pari support; on the cell server, one might as well switch to GP mode.

Nils suggested (essentially)

K=pAdicField(7)
g=K[x](x^2-2)
g.hensel_lift(4)

And that also works, returning (line break added)

4 + 5*7 + 4*7^2 + 5*7^4 + 4*7^5 + 5*7^6 + 4*7^7 + 2*7^8 + 4*7^11 + 5*7^12 +
5*7^13 + 6*7^14 + 4*7^15 + 5*7^16 + 5*7^17 + 2*7^18 + O(7^20)

Meaning 20 is the default precision.

I guess hensel_lift is the function I was looking for. And writing K[x](x^2-2) tells Sage that the polynomial is to be considered as having coefficients in Qp

Questions:

Do Qp(7) and pAdicField(7) do the same thing?

K[x] and K['x'] seem to do the same thing as well. Is that right? But if I use y or 'y' it doesn't work unless I define y in advance. (Which I'll have to figure out how to do... )

Thanks,

Fernando

--
=============================================================
Fernando Q. Gouvea         http://www.colby.edu/~fqgouvea
Carter Professor of Mathematics
Dept. of Mathematics and Statistics
Colby College
5836 Mayflower Hill
Waterville, ME 04901

[Nuclear war] ... may not be desirable.
  -- Edwin Meese III

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/c9ec78cc-4e69-60e5-da19-dc6ddb872690%40colby.edu.

Reply via email to