Processing math: 100%
Ask Your Question
0

How to evaluate polynomial in a polynomial ring at a particular value

asked 5 years ago

anonymous user

Anonymous

Apologies in advance if this question is too simple. I have the following situation: I have a vector space over a polynomial ring, and at some point in my program I need to sub in a value for the indeterminate t, and evaluate the polynomial. The set up is as follows:

P.<x> = QQ[]
R.<t> = QuotientRing(P, P.ideal(x^2 - 2))
v = VectorSpace(R,4)

Then for example I have the vector:

(2*t, 3, 2, 0)

I simply want to evaluate 2t at t=sqrt(2) as a function from R to R.

What is the easiest way to go about this?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 5 years ago

rburing gravatar image

Note R is not a polynomial ring but a quotient of one.

Let's name the vector

w = v([2*t, 3, 2, 0])

One thing you can do is lift all the elements to be polynomials in x again and do a substitution:

w.apply_map(lambda z: z.lift().subs({x : sqrt(2)}))

This lands in the vector space over the symbolic ring, because sqrt(2) is symbolic.

You can also replace sqrt(2) by things like sqrt(RR(2)) or sqrt(AA(2)).


More appropriate in this situation is to recognize that you are working in an abstract number field K=Q(t)=Q[x]/(x22), and you want to use an embedding:

sage: K.<t> = NumberField(x^2 - 2)
sage: V = VectorSpace(K,4)
sage: w = V([2*t, 3, 2, 0])
sage: w.apply_map(K.embeddings(AA)[1])
(2.828427124746190?, 3, 2, 0)

Here K.embeddings(AA)[1] is the embedding of K into R that sends t2.

The other embedding K.embeddings(AA)[0] is the one that sends t2:

sage: w.apply_map(K.embeddings(AA)[0])
(-2.828427124746190?, 3, 2, 0)

Again here you can replace the algebraic reals AA by other fields like QQbar, RR and CC.

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

2 followers

Stats

Asked: 5 years ago

Seen: 479 times

Last updated: Sep 08 '19