> 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.
Sure, everything in my case is associative. But in practice, it is easier to do the multiplications in a certain order. I end up with things like: A*B*C*|state> And the thing that I know how to do is anything*|state>. Thus, I want to evaluate this like this: A*(B*(C*|state>) = A*(B*|newstate>) = A*|another_newstate> = |final_state> In my case A, B C are creation/annihilation operators and |state> is a Fock state. The main issue is that is easy to do anything*|state> but much more difficult to do A*B or B*C directly. > Maybe you want some way to evaluate the operators starting from the > right hand side? Then I suggest to simply construct the whole > expression, store it into a variable "e" and access "e.args". One option is to simply let Sympy do its thing and I would end up with something like: A*B*C*|state> = Mul(A,B,C,|state>) Then I could make an additional function that walks through the args of Mul from R -> L and does the right thing. Maybe in this case explicit is better than implicit :) But, I would like to at least know if this can be done. Cheers, Brian PS - I have begun to work more on the second quantization code and it is shaping up rather nicely. > Or am I missing something? > > Ondrej > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---