# How can I get an exponent vector from monomials?

I am trying to get an exponent vector from a list of monomials. I am using the CoefficientRules command; however, it is returning a list that includes the coefficients of the monomial. I don't need the coefficient and need to remove it before I can use the exponent vector, however I am finding this quite difficult.

poly = x^2 + 2 x*y + y^2;
monomialList = MonomialList[poly];
alpha = CoefficientRules[monomialList]

{{{2, 0} -> 1}, {{1, 1} -> 2}, {{0, 2} -> 1}}


Is there a way to remove the -> and the value that follows it, or a better way to generate the exponent vector?

One quick method (also used in this answer):

GroebnerBasisDistributedTermsList[x^2 + 2 x*y + y^2, {x, y}][[1, All, 1]]
{{2, 0}, {1, 1}, {0, 2}}


Another one, based on this answer:

Cases[CoefficientRules[x^2 + 2 x*y + y^2], v_?VectorQ, 2]

• That solution is excellent, however is there a way to modify the second answer to accept the list of monomials instead of the original polynomial?
– Lee
Feb 7 '13 at 5:25
• Sure, do something like Map[Cases[CoefficientRules[#], v_?VectorQ, 2] &, (* monomials *)]`... Mar 23 '13 at 12:34