PAdicInteger precision

9 views
Skip to first unread message

Grégory Vanuxem

unread,
Apr 3, 2025, 2:31:21 PM4/3/25
to fricas...@googlegroups.com
Hello here,

I am struggling with PAdicInteger for comparisons before implementing a Q-adic number interface implementation (FLINT based).

I wonder why, and more importantly for me where the "precision" is implemented in FriCAS (Clifton J. Williamson). Apparently 11 is used, but where this is implemented is cryptic to me. Here is a simple example:

(6) -> 19::PAdicInteger(7)

   (6)  5 + 2 7
                                                                                         Type: PAdicInteger(7)
                                                                                    Time: 0.01 (OT) = 0.02 sec
(7) -> %^7

                     3      4      5      6    8    9      10      11
   (7)  5 + 2 7 + 3 7  + 3 7  + 5 7  + 2 7  + 7  + 7  + 3 7   + O(7  )
                                                                                         Type: PAdicInteger(7)
                                                                                                   Time: 0 sec

So, my principal concern is to know where it is implemented. I looked at  padic.spad, stream.spad without finding where I can understand and eventually temporary modify this parameter. I would be happy if you have some informations.

By the way padic.spad contains several doublons in the different domains description for the keyword "Keywords" with sometimes no description, sometimes using "completion" and sometimes complementations. Example:

)abbrev domain PADICRAT PAdicRational
++ Author: Clifton J. Williamson
++ Date Created: 15 May 1990
++ Keywords: p-adic, complementation
++ Basic Operations:
++ Related Domains:
++ Also See:
++ AMS Classifications:
++ Keywords: p-adic, completion
++ Examples:

Greg

Grégory Vanuxem

unread,
Apr 3, 2025, 2:37:28 PM4/3/25
to fricas...@googlegroups.com
Sorry for the non ASCII mail but the exponents are badly written and in fact completely deleted for the big-oh.

Ralf Hemmecke

unread,
Apr 3, 2025, 3:08:51 PM4/3/25
to fricas...@googlegroups.com
Hi Greg,

I bet, the "precision" is infinite.

You can see this from its representation.

https://github.com/fricas/fricas/blob/master/src/algebra/padic.spad#L77

It is a Stream for the coefficients. And that is an potentially infinite
object. (OK, it is a finite stream of coefficients for i^7. But -i looks
pretty infiniite to me.

Use ")set stream calculate n" to determine how many "digits" are
printed. That system command will, however, not change the "precision.
It's still infinite.

Hope that helps
Ralf


%%% (2) -> i:=19::PAdicInteger(7)

(2) 5 + 2 7
Type: PAdicInteger(7)
%%% (3) -> i^7

3 4 5 6 8 9 10 11
(3) 5 + 2 7 + 3 7 + 3 7 + 5 7 + 2 7 + 7 + 7 + 3 7 + O(7 )
Type: PAdicInteger(7)
%%% (4) -> )set stream calc 4

%%% (4) -> i^7

3 4 5
(4) 5 + 2 7 + 3 7 + 3 7 + O(7 )
Type: PAdicInteger(7)
%%% (5) -> )set stream calc 40

%%% (5) -> i^7

3 4 5 6 8 9 10
(5) 5 + 2 7 + 3 7 + 3 7 + 5 7 + 2 7 + 7 + 7 + 3 7
Type: PAdicInteger(7)
%%% (7) -> -i

(7)
2 3 4 5 6 7 8 9
10
2 + 4 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7
+
11 12 13 14 15 16 17 18 19
6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7
+
20 21 22 23 24 25 26 27 28
6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7
+
29 30 31 32 33 34 35 36 37
6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7 + 6 7
+
38 39 40 41
6 7 + 6 7 + 6 7 + O(7 )
Type: PAdicInteger(7)

Grégory Vanuxem

unread,
Apr 3, 2025, 3:39:40 PM4/3/25
to fricas...@googlegroups.com
Oh thanks. I know it is based on "infinite" stream (lazy aggregate), but how to modify its limits was cryptic to me.
Many thanks Ralf, I think this is what I was looking for.

Greg

PS: that helps a lot ;)

--
You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/2c428ba8-cb39-4cec-99a2-1ea8d99d90f4%40hemmecke.org.
Reply all
Reply to author
Forward
0 new messages