Comment #28 on issue 2552 by [email protected]: (1/(x*y)).subs(x*y, whatever)
doesn't work
http://code.google.com/p/sympy/issues/detail?id=2552
Chris, it is encouraging.
Aaron, thanks for detailed clarification. Now I understood.
x*y/x --> Mul(Mul(x, y), Pow(x, S.NegativeOne))
flatten called firstly for 'Mul(x, y)', then flatten called for 'Mul(Mul(x,
y), Pow(x, S.NegativeOne))' in which it removes nested Mul's:
'Mul(x, y, Pow(x, S.NegativeOne))' and then collect similar terms.
In other words the 'flatten' leads Mul to a canonical form while
constructing, and solving these:
- remove nested Muls (originally sense of flatten)
- collect similar terms, gather exponents of common bases. (used: for the
simplification on the fly)
- sort terms to some canonical order (for hash calculation, it is here)
(We do not concern the non commutative topics, and we do not that printer
have their own canonical representation)
Well, I do not mind this automatic conversion, finally. It would be better
IMO to split this methods to 'flatten' itself and 'canonical', but it can
be reduce the effectiveness of this procedure. Or at least to document it
more accurate ('flatten' name-token abd its docstring knocked me up)
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.