Return factors of a monomial in Maple.

45 Views Asked by At

Let $$ m = Y_{{1,0}}{Y_{{1,2}}}^{2}Y_{{2,5}}Y_{{1,8}}. $$ Using the function op in Maple, we have $op(m) = Y[1, 0], Y[1, 2]^2, Y[2, 5], Y[1, 8]$. But $op(Y[1,0])=1,0$ and $op(Y[1,0]^2)=Y[1,0],2$. Are there some functions in Maple such that the value of $$ Y_{{1,0}}{Y_{{1,2}}}^{2}Y_{{2,5}}Y_{{1,8}} $$ is $Y[1, 0], Y[1, 2]^2, Y[2, 5], Y[1, 8]$ and the value of $Y[1,0]^n$ is $Y[1,0]^n$? Thank you very much.

2

There are 2 best solutions below

0
On BEST ANSWER

The function $f$ that you need is

f:= P-> `if`(P::`*`, op(P), P);

Note carefully the two pairs of backquotes.

2
On

Well $$ [op(m)][2] = {Y_{{1,2}}}^{2}. $$