Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To get the coefficients, you need to view f as a polynomial in y, using f.polynomial(). Then list gives you the list of all coefficients, while coefficients gives you the list of nonzero coefficients:

sage: p = 104711
sage: r = 101
sage: K = GF(p)
sage: L.<y> = K.extension(cyclotomic_polynomial(r))
sage: f = (y+1)^10
sage: f.polynomial().list()
[1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1]
sage: f.polynomial().coefficients() # no difference since all coefficients are nonzero
[1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1]
sage: f = (y+1)^100
sage: len(f.polynomial().list())
100
sage: len(f.polynomial().coefficients()) # one zero coefficient
99