I don't know the physics well enough to know from your pseudo code.
sympy.physics.quantum knows about quantum mechanics though:

* Operators, states (bras, kets), commutators, anticommutators, outer
projects, tensor projects, inner projects
* The representation of those entities in different bases

This stuff is done in completely generality, so you could define field
operators that obey the right commutator/anticommutator relationships
and then start computing commutators and expectation values needed for
perturbation theory.  I imagine that your expression above is further
down the chain after various steps have been done in the perturbation
theory.  At that point, you are just dealing with functions,
derivative, matrices = one particular representation of the theory.
This has always been my complaint about high energy theory - it is
developed in a way that makes it difficult to see that it is just
regular old quantum mechanics...

But the important question are these:

* What types of physics objects are gluon?  Operator?  State?
Representation of such in a particular basis?
* What types of objects are group_generator?  ...

Cheers,

Brian



On Sun, Jun 30, 2013 at 2:35 PM, Stefan Krastanov
<[email protected]> wrote:
> @Brian, what would be the correct way to write something like
>
> gluon(lorentz_index, su3_index) * group_generator(su3_index,
> antispinor_index, spinor_index) * top_quark(spinor_index)
>
> in the physics.quantum module?
>
> On 30 June 2013 21:31, Brian Granger <[email protected]> wrote:
>> Extra bonus points if this stuff can be integrated with sympy.physics
>> or even better sympy.physics.quantum...otherwise we just keep creating
>> new corners of sympy that don't work together.  I know it is easier,
>> but in the long run it is a horrible situation.  The stuff in
>> sympy.physics.quantum is completely general and should be able to
>> handle all of this with some work.  It would also be great to get
>> secondquant.py into sympy.physics.quantum so it doesn't reinvent the
>> wheel.  It even has wicks theorem, which is the foundation of all
>> Feynman diagrams.  Let's do this right!
>>
>> Cheers,
>>
>> Brian
>>
>> On Sun, Jun 30, 2013 at 10:38 AM, Ondřej Čertík <[email protected]> 
>> wrote:
>>> Hi Stefan,
>>>
>>> This is cool. I would be interested in having this in sympy. Long time
>>> ago I wrote some diagram generating code for scalar diagrams:
>>>
>>> https://github.com/certik/sympy/blob/wick/t.py
>>>
>>> but I didn't have time to polish it up and send a PR. As you correctly
>>> mentioned, there are lots of steps and actually several approaches to
>>> this problem and we should simply start adding such codes to sympy.
>>> What I wrote is just one little tiny bit, but it is still useful to
>>> check scalar particle diagrams. This is for relativistic theory.
>>>
>>> Then I have code here that generates the non-relativistic perturbation
>>> theory diagrams for total energy:
>>>
>>> https://github.com/certik/hfsolver/blob/master/src/diagrams_mbpt.py
>>>
>>> here is the corresponding Fortran code for evaluating them:
>>>
>>> https://github.com/certik/hfsolver/blob/master/src/mbpt.f90
>>>
>>> these 3 files are generated:
>>>
>>> https://github.com/certik/hfsolver/blob/master/src/mbpt2.f90
>>> https://github.com/certik/hfsolver/blob/master/src/mbpt3.f90
>>> https://github.com/certik/hfsolver/blob/master/src/mbpt4.f90
>>>
>>> and then the same for Green's functions:
>>>
>>> https://github.com/certik/hfsolver/blob/master/src/diagrams_gf.py
>>>
>>> and the Fortran code (this one I wrote by hand):
>>>
>>> https://github.com/certik/hfsolver/blob/master/src/gf2.f90
>>>
>>>
>>> Anyway, we should have this in sympy.
>>>
>>> Ondrej
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "sympy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/sympy.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>
>>
>>
>> --
>> Brian E. Granger
>> Cal Poly State University, San Luis Obispo
>> [email protected] and [email protected]
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
Brian E. Granger
Cal Poly State University, San Luis Obispo
[email protected] and [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to