Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to extract exponents from a monomial in a FreeAlgebra

I want something like this, or a way to get the equivalent information:

sage: S.<X,Y> = FreeAlgebra(QQ)
sage: m = X*Y*X^2
sage: m.my_exponents_function()


sage: m.my_factor_function()

would be as good or maybe better.

How can I get that information? I've looked over the available methods and can't seem to find anything. This is easy to do with Polynomial Rings.

I guess I could parse the string representation, but shouldn't there be a better way?