Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
2

Getting the trace polynomial

asked 3 years ago

tungnt gravatar image

updated 3 years ago

Dear all,

I am using sagemath to get the trace polynomial from a given reciprocal polynomial of even degree. The process is described nicely on the documentation. I am not allowed to post a link. See below for a concrete example.

However, the algorithm returns a triple (Q,R,q). For further calculations, I need to take out just the polynomial Q. Here is an example

pol.<x> = PolynomialRing(Rationals()) sage: u = x^6 +1; u1=u.trace_polynomial()

The algorithm returns u1=(x33x,1,1) (in my examples, I know that R=q=1 always). How can I get the first component of u1?

Edit: Simply take u1[0] as suggested below by another user.

How can we resolve this problem? I am sorry if my question is too trivial. Thank you very much!

Best wishes, Tung

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 3 years ago

rburing gravatar image

There is a difference between u and u.trace_polynomial(); the former is a polynomial and the latter is a tuple.

It seems that what you want is just u.trace_polynomial()[0].

Preview: (hide)
link

Comments

You are right. I am so sorry for this trivial mistake. It works!

To the moderator: if you feel that my question is too trivial, please delete it. I am sorry about this.

tungnt gravatar imagetungnt ( 3 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: 3 years ago

Seen: 1,584 times

Last updated: Nov 16 '21