First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If a lives in a polynomial ring rather than in the symbolic ring, then a[k] extracts the coefficient of x^4 of a, regardless of the degree of a.

Example:

sage: x = polygen(ZZ)
sage: a = 2 + 3*x
sage: [a[k] for k in range(4)]
[2, 3, 0, 0]
click to hide/show revision 2
No.2 Revision

If a lives in a polynomial ring rather than in the symbolic ring, then a[k] extracts the coefficient of x^4x^k of a, regardless of the degree of a.

Example:

sage: x = polygen(ZZ)
sage: a = 2 + 3*x
sage: [a[k] for k in range(4)]
[2, 3, 0, 0]