I'm having some trouble getting coefficients of a large polynomial:
------------------------------------------------------------------------------------------------------------
var("C_1_0 C_2_0 C_3_0 C_4_0 C_4_1 C_4_2 C_4_3 C_4_4 D_1_0 D_2_0 D_3_0
D_3_1 D_3_2 D_3_3 D_3_4 D_3_5 D_3_6 D_3_7 gamma z")
p = C_1_0*C_2_0^2*C_3_0^3*(z^4*C_4_4 + z^3*C_4_3 + z^2*C_4_2 + z*C_4_1
+ C_4_0 + z^5)^4*gamma^4 - D_1_0*D_2_0^2*(z^7*D_3_7 + z^6*D_3_6 +
z^5*D_3_5 + z^4*D_3_4 + z^3*D_3_3 + z^2*D_3_2 + z*D_3_1 + D_3_0 +
z^8)^3
# works ok:
print p.expand().coefficients(z)
# explodes:
print p.coefficients(z)
------------------------------------------------------------------------------------------------------------
The error is:
------------------------------------------------------------------------------------------------------------
TypeError: Error executing code in Maxima
CODE:
sage5 : coeffs(sage0,sage3)$
Maxima ERROR:
Maxima encountered a Lisp error:
EVAL: undefined function LSH
Automatically continuing.
To reenable the Lisp debugger set *debugger-hook* to nil.
------------------------------------------------------------------------------------------------------------
Code and the full error log is here:
http://carlo-hamalainen.net/sage/coeffproblem/
This is happening on 3.1.alpha0 and 3.1.alpha1 on Ubuntu/x86. Also,
p.coefficients(z) works on an unexpanded expression if there are only
a few variables, e.g. finding the coefficient of y in x*(y+z).
--
Carlo Hamalainen
http://carlo-hamalainen.net