Ask Your Question
1

Vector over a polynomial ring

asked 2014-10-08 11:23:52 +0100

gabplr gravatar image

In Sage 6.3 (both command line and notebook), I tried to define a vector over Q[X] as follows

R = PolynomialRing(QQ,'x')
X = polygen(R)
a, b = X^4-1, X-1
vec =  vector(R,[a, b])

This produces an error

TypeError: not a constant polynomial

By contrast, the following works:

sage: vec =  vector(R,[[a],[b]])
sage: vec
(x^4 - 1, x - 1)

Is this a bug or could someone explain me why?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-10-08 11:59:08 +0100

tmonteil gravatar image

updated 2014-10-08 12:15:23 +0100

Some hints:

Look at the documentation of polygen:

sage: X = polygen?

Look at the parent of X (and a):

sage: X.parent()
sage: a.parent()
sage: a.parent() == R
sage: X.base_ring()

In your example, replace

sage: X = polygen(R)

by

sage: X = R.gen()

And redo ever test to understand where your previous X was living and why. Do not hesitate to ask if you need more details.

edit flag offensive delete link more

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: 2014-10-08 11:23:52 +0100

Seen: 445 times

Last updated: Oct 08 '14