1
$\begingroup$

I'm trying to find the exponent vector from a polynomial that has three variables.

For example

ClearAll["Global`*"]
M = x^4 + x^2 z^4 + y z^6 + z^10 + y^4
p = CoefficientRules[M][[All, 1]]

works well but when the exponent is rational it does not work.

ClearAll["Global`*"]
M1 = x^4 + x^(1/2) z^4 + y z^6 + z^10 + y^4
p1 = CoefficientRules[M1][[All, 1]]

I want the exponent vectors even if some exponents are rational.

$\endgroup$

closed as off-topic by m_goldberg, LCarvalho, bbgodfrey, Bob Hanlon, MarcoB Nov 9 '17 at 14:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, LCarvalho, bbgodfrey, Bob Hanlon, MarcoB
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    $\begingroup$ may be because CoefficientRules works only on polynomials. So you can't have powers that are fractions. It is no longer a polynomial then. You can check using PolynomialQ[M1, x] before calling CoefficientRules $\endgroup$ – Nasser Oct 28 '17 at 0:23
2
$\begingroup$

Try this

ClearAll["Global`*"];
M = x^4 + x^(1/2) z^4 + y z^6 + z^10 + y^4;
Table[Exponent[M[[i]], {x, y, z}], {i, 1, Length[M]}]

{{4, 0, 0}, {0, 4, 0}, {1/2, 0, 4}, {0, 1, 6}, {0, 0, 10}}
$\endgroup$
  • $\begingroup$ For brevity, you could also use Exponent[#, {x, y, z}] & /@ List @@ M. $\endgroup$ – aardvark2012 Oct 28 '17 at 7:58
  • $\begingroup$ It doesn't work for M = y z^6. $\endgroup$ – Carl Woll Oct 28 '17 at 15:41
  • $\begingroup$ Yes, the Length[] function is inconsistent, so for single terms Exponent[M,{x,y,z}] seems to work. $\endgroup$ – Bill Watts Oct 28 '17 at 21:58

Not the answer you're looking for? Browse other questions tagged or ask your own question.