Ask Your Question

Vector over a polynomial ring

asked 2014-10-08 04:23:52 -0600

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

answered 2014-10-08 04:59:08 -0600

tmonteil gravatar image

updated 2014-10-08 05:15:23 -0600

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)


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



Asked: 2014-10-08 04:23:52 -0600

Seen: 58 times

Last updated: Oct 08 '14