On Mon, Nov 10, 2008 at 8:31 PM, Ondrej Certik <[EMAIL PROTECTED]> wrote:
> On Mon, Nov 10, 2008 at 8:16 PM, Brian Granger <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> By default, Python's * operator work in L->R order, so:
>>
>> a*b*c*d = ((a*b)*c)*d
>>
>> But, I am implementing some operators from quantum mechanics that I
>> want to apply like this:
>>
>> a*b*c*d = a*(b*(c*d))
>>
>> Is this possible with sympy?  In my case, a, b, c, and d are custom
>> subclasses of Basic that don't commute.  I would like to do this using
>> a custom __mul__ method on my class, but I am not sure that will work.
>>
>> Any thoughts?
>
> Could you please elaborate? What you want is a noncommutative
> *nonassociative* algebra. As far as I know, everything in quantum
> mechanics is at least associative.

Or do you want to implement something like nested functions calls:

f(g(h(x)))

but write it as

f * g * h  (x)

or something like that? But still I think this is associative, isn't it?

Ondrej

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to