Ask Your Question
1

Artin decomposition for p-adic numbers

asked 11 years ago

Klaus Scheicher gravatar image

How can I decompose a p-adic number

... d_2 d_1 d_0. d_{-1} ... d_{-k}

into its integer part

d_2 d_1 d_0.

and fractional part

. d_{-1} ... d_{-k} ?

The does not seem to exist a kind of floor function.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 11 years ago

tmonteil gravatar image

You can use the .slice() method. For the frac function, you may have to decide wether you want to keep the precision of your adic number or if you want to reset it to 1:

sage: floor_adic = lambda a : a.slice(0, a.precision_absolute())
sage: frac_adic = lambda a : a - a.slice(0, a.precision_absolute())
sage: frac_adic_noprec = lambda a : a.slice(a.valuation(), 0)

sage: K = Qp(11); K
11-adic Field with capped relative precision 20
sage: b = K(3211/11^2); b
10*11^-2 + 5*11^-1 + 4 + 2*11 + O(11^18)

sage: floor_adic(b)
4 + 2*11 + O(11^18)
sage: frac_adic(b)
10*11^-2 + 5*11^-1 + O(11^18)
sage: frac_adic_noprec(b)
10*11^-2 + 5*11^-1 + O(11^0)
Preview: (hide)
link
0

answered 11 years ago

Klaus Scheicher gravatar image

Thank you very much!

Preview: (hide)
link

Comments

If this helped you, please click the accept button in the answer! Then others will know that this question has a correct answer when they search.

kcrisman gravatar imagekcrisman ( 11 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 11 years ago

Seen: 436 times

Last updated: Oct 27 '13