Processing math: 100%
Ask Your Question
2

Extension field over p-adics: how to write an element in the standard basis?

asked 4 years ago

caelanritter gravatar image

Suppose we have an extension field Q2(w), where w is a root of f(x)=x3+4x2+2. By default, Sage represents w3 as w3+O(wd), where d is the precision. How do I get Sage to print w3 out as a linear combination of the standard basis, i.e., as 4w22 (with -4 and -2 written as they would be in Q2)?

Preview: (hide)

Comments

Welcome to Ask Sage! Thank you for your question.

slelievre gravatar imageslelievre ( 4 years ago )

Please provide code to reproduce the observed behaviour.

slelievre gravatar imageslelievre ( 4 years ago )

2 Answers

Sort by » oldest newest most voted
2

answered 4 years ago

roed gravatar image

Here are some ways to do it:

sage: K.<a> = Qp(2).extension(x^3 +4*x^2 + 2, print_mode="terse")
sage: a^3
2097150 + 2097148*a^2 + O(a^63)
sage: K.<a> = Qp(2, print_mode='digits').extension(x^3 +4*x^2 + 2)                                                                                                                                                                       
sage: (a^3).polynomial()                                                                                                                                                                                                                 
...111111111111111111100*x^2 + ...000000000000000000000*x + ...111111111111111111110
sage: V, from_V, to_V = K.vector_space()                                                                                                                                                                                                 
sage: to_V(a^3)                                                                                                                                                                                                                          
(...111111111111111111110, ...000000000000000000000, ...111111111111111111100)

The print modes available are "series" (default), "val-unit", "terse", "digits" and "bars". When p > 2 you can also use the print_pos keyword to print using the range -(p-1)/2 .. (p-1)/2 instead of 0 .. p-1.

Preview: (hide)
link
2

answered 4 years ago

saraedum gravatar image

It seems you are looking for the terse printing mode:

sage: K = Qp(2, print_mode='terse')
sage: R.<x> = K[]
sage: L.<w> = K.extension(x^3 + 4*x^2 + 2)
sage: w^3
2097150 + 2097148*w^2 + O(w^63)

There's a section PRINTING in the reference manual which has more details.

Preview: (hide)
link

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: 4 years ago

Seen: 327 times

Last updated: Mar 03 '21