[sage-support] Sage equivalent for GP's "padicappr"?

2019-08-01 Thread Fernando Gouvea
Hi, everyone. I'm an old user of GP and a very raw beginner when it comes to Sage, so please forgive the naiveté! For a new edition of my book on the p-adics I am trying to add pointers to how to do things on a computer with p-adic numbers. Everything in the book is very elementary, so I'

Re: [sage-support] Sage equivalent for GP's "padicappr"?

2019-08-01 Thread Vincent Delecroix
Dear Fernando, PARI/GP is included in Sage so that you can at least do sage: R = PolynomialRing(ZZ, 'x') sage: x = R.gen() sage: p = x^2 - 2 sage: pari.padicappr(p, pari('4 + O(7)')) [4 + O(7)]~ There might be some more convenient functions using the Sage native implementations of p-adic number

[sage-support] Re: Sage equivalent for GP's "padicappr"?

2019-08-01 Thread Nils Bruin
Is this what you're looking for? sage: Qp=pAdicField(7) sage: g=Qp['x'](x^2-2) sage: g.hensel_lift(4) You can use pari rather directly; relying on sage converting its data types to appropriate pari types: pari(g).padicappr(Qp(4)) -- You received this message because you are subscribed to the