Re: [sympy] Ideas for extending Mul

2010-07-24 Thread Ronan Lamy
Le samedi 24 juillet 2010 à 13:10 -0700, Brian Granger a écrit : > I written tests for this now. > > > Brian > > On Sat, Jul 24, 2010 at 10:07 AM, Brian Granger > wrote: > Here is an addition patch that adds this capability to all > binary special methods in Expr: > >

Re: [sympy] Ideas for extending Mul

2010-07-24 Thread Brian Granger
I written tests for this now. Brian On Sat, Jul 24, 2010 at 10:07 AM, Brian Granger wrote: > Here is an addition patch that adds this capability to all binary special > methods in Expr: > > > http://github.com/ellisonbg/sympy/commit/116acd6ef2bde6d0d0aa8c2f2ec1f380abbabab1 > > The performance p

Re: [sympy] Ideas for extending Mul

2010-07-24 Thread Brian Granger
Here is an addition patch that adds this capability to all binary special methods in Expr: http://github.com/ellisonbg/sympy/commit/116acd6ef2bde6d0d0aa8c2f2ec1f380abbabab1 The performance penalty is still around 1%. If there is support for this approach, I would like to merge it to trunk soon a

Re: [sympy] Ideas for extending Mul

2010-07-24 Thread Brian Granger
Here is a simple implementation that does a priority based check for __mul__ and __rmul__: http://github.com/ellisonbg/sympy/commit/bb449fbdf78f5ef19351640d987d96204c6c3f34 On my machine the test suite does not slow down a significant amount (within 1%). Of course, if we use this approach on all

Re: [sympy] Ideas for extending Mul

2010-07-24 Thread Brian Granger
Alan, This only works because you have custom scalars as well. Because of this, you have overridden the __mul__ and __rmul__ methods of *every* object that is used in GA. But in quantum mechanics, I still need to use all the regular sympy scalars that use the default Expr.__mul__ and Expr,__rmul

Re: [sympy] Ideas for extending Mul

2010-07-24 Thread Alan Bromborsky
Brian Granger wrote: On Fri, Jul 23, 2010 at 8:30 PM, Ronan Lamy wrote: Le vendredi 23 juillet 2010 à 17:41 -0700, Brian Granger a écrit : On Wed, Jul 21, 2010 at 1:15 PM, Aaron S. Meurer wrote: First off, pragmatically speaking, is there a reason why you need to use the core