Ask Your Question

# Vector over a polynomial ring

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 close merge delete

## 1 Answer

Sort by » oldest newest most voted

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.

more

## Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

## Stats

Asked: 2014-10-08 11:23:52 +0200

Seen: 198 times

Last updated: Oct 08 '14