[sage-support] Re: power series and strings for p-adics

2019-08-15 Thread Dominique Laurain
Hello Fernando,

I want just to say that I liked a lot your book "Introduction to p-adic 
numbers" when I bought and read it some years ago.
A very good fun "travel" in number theory. I appreciate the way it process 
by extending fields.
I tried to code something in Sage too (Hensel Lemma) but I am no clearly 
satisfied about it : ...some tendency by sagemath...to convert to "fixed 
field" (rational)..but too much difficult to explain by me.

Dominique.

-- 
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/fe1af5b4-a9ce-43d2-83b0-a3fdeb5640a1%40googlegroups.com.


[sage-support] Re: power series and strings for p-adics

2019-08-08 Thread Nils Bruin


On Thursday, August 8, 2019 at 7:16:21 AM UTC-7, Fernando Gouvea wrote:
>
> In certain contexts, I'd like to work in the power series mode up until 
> the end, but display my answer in digits mode. The only way I know how to 
> do this is to find the answer w and then use answer=Kd(w) to turn it into 
> digits. Is there an easier way? I expected something like print a.digits() 
> to work, but there's no such attribute.
>

The print-mode does not affect how the computations are done. So your work 
will be done the same way no matter what print-mode is selected

To access the p-adic digits, you can use "Qp(7)(1/42).list()"

You can give a mode to the "str" method that returns a string 
representation. e.g. Qp(7)(1/42).str(mode="bars") gives a presentation that 
makes the digits obvious. In principle Qp(7)(1/42).str(mode="digits") 
should work but it seems to miss some initialization. You could work around 
that by coercing into another p-adic ring with the desired print options 
set:

k1=Qp(7)
k2=Qp(7,print_mode="digits")
a=k1(2).sqrt()
print k2(a)

 

> 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   
>
> Deck us all with Boston Charlie,
> Walla Walla, Wash., an' Kalamazoo!
> Nora's freezin' on the trolley,
> Swaller dollar cauliflower, alleygaroo!
> Don't we know archaic barrel,
> Lullaby Lilla Boy, Louisville Lou.
> Trolley Molly don't love Harold,
> Boola boola Pensacoola hullabaloo!
>   --Walt Kelly
>
>
>

-- 
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/8fd20d0f-89c8-4f6b-a7c3-1ab4f4c6963c%40googlegroups.com.