Ask Your Question

Revision history [back]

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]

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]