On Sun, Mar 18, 2012 at 11:12 AM, Alan Bromborsky <[email protected]> wrote: > If a1 is commutative and e1 and e2 are not then > > (a1*e1*e2).args_cnc() = [[a1], [e1, e2]] > > and > > (a1*e1*e1).args_cnc() = [[a1], [e1**2]] > > is there anyway to make > > (a1*e1*e1).args_cnc() = [[a1], [e1,e1]] > > or in general to convert > > e1**r to [e1,e1,...,e1] r-times
You could use something along the lines of what Chris said, but why do you need to have r copies of e1? Wouldn't it be more efficient to just add special handling for powers in whatever loop you have? Aaron Meurer > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
