I have a list of polynomials. Each polynomial looks like:
p[1, 2, 5] p[3, 6, 9] p[4, 7, 8] - 3 p[1, 2, 4] p[3, 6, 9] p[5, 7, 8]
How to convert each of these polynomials into a list. For example, I would like the above become:
{{1, {1, 2, 5}, {3, 6, 9}, {4, 7, 8}}, {-3, {1, 2, 4}, {3, 6, 9}, {5, 7, 8}}}
Thank you very much!
The Four Kinds of Bracketing in the Wolfram Language
$\endgroup$Apply[List, expr, {0, 2}]
$\endgroup$Apply[List, X, {0, ∞}]
to be more general $\endgroup$1
for the first term though $\endgroup$