I've got a big expression I need to dissect a certain way
I've got a BIG polynomial (7 indeterminates, total degree 12), and I want to collect all the terms therein that contain only EVEN powers of all the indeterminates. Is there any reasonably simple way to do this? By "simple," I mean short of traversing the whole expression tree, testing each term to see if it contains only even powers, and collecting them one-by-one in a list (which, BTW, I also don't really know how to do)! If it makes any difference, I haven't been using the sage.rings.polynomial module, just generic Sage expressions.
Can you convert it to an element of a polynomial ring? (Or better yet, create it as such in the first place.) Then it's easy. Please post some of the terms, to make the question easier to answer.
I suppose I could convert it to (or more easily, just recreate it as) an element of a multivariate polynomial ring over the integers, but before I do, I'd like to know how that makes it "easy."
Anyway here's three of the terms (which I don't think is going to tell you much that you don't already know): -A_123^5A_124^3A_12_34^4 - 2A_123^4A_124^4A_12_34^4 - A_123^3A_124^5*A_12_34^4 + ... In this case, I want to keep the 2nd term and throw out the other two.