Ask Your Question

Revision history [back]

Calling vector(...) on a ring element should work:

sage: S.<x> = QQ[]
sage: I = S.ideal(x**20)
sage: R = S.quotient(I)
sage: R.inject_variables()
Defining xbar
sage: f1 = xbar**2 + 3*xbar
sage: f2 = xbar**3 - xbar + 2
sage: vector(f1)
(0, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
sage: vector(f2)
(2, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)

Now you can use any Sage tools from linear algebra to examine those vectors.