Try to look at this example:
https://github.com/sympy/sympy/blob/master/examples/advanced/qft.py
I wrote it couple years ago. If you would like to help improve this
functionality, that would be absolutely awesome. Let us know.
Ondrej
That's right. There are basically 2 approaches:
1) use some particular representation, and simply multiply all the
matrices and then take a trace
2) do things symbolically using the relations between the matrices
I decided to try 1), as it seemed to me, that it should work fine. But
the resulting matrix is quite a mess, so one would need to figure out
whether there is some good way to simplify the result.
As to 2), I think there the difficulty is in the fact, that one needs
to know which rules to apply and how. If you go this route, I would be
very interested if you manage to get it working.
>
> I seriously think of implementing this functionality.
That would be really great. Whenever you have something, just let us
know on the list and we'll help you with git and patches. Or any other
question you might have.
Ondrej
* We already have abstract/symbolic states operators that behave like
they should.
* Everything can be defined symbolically, but states and operators can
be represented in a given basis.
* Symbolic commutation/antocommutation relationships can be defined.
* And more...
The best starting place is to look at how we handle spin in
sympy.physics.quantum.spin. I should note that we don't have a
symbolic trace operation, but that could be implemented quite easily.
Cheers,
Brian
2011/8/5 Ondřej Čertík <ondrej...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "sympy" group.
> To post to this group, send email to sy...@googlegroups.com.
> To unsubscribe from this group, send email to sympy+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
>
>
--
Brian E. Granger
Cal Poly State University, San Luis Obispo
bgra...@calpoly.edu and elli...@gmail.com
The IndexedBase class and friends basically symbols with index, and
are non-commutative by default:
In [22]: mu = Idx('mu')
In [23]: IndexedBase?
In [26]: A = IndexedBase('A')
In [27]: B = IndexedBase('B')
In [28]: A[mu]*B[mu]
A[mu]*B[mu]
In [29]: B[mu]*A[mu]
B[mu]*A[mu]
In [30]: A[mu]*B[mu] - B[mu]*A[mu]
A[mu]*B[mu] - B[mu]*A[mu]
(btw, imho, they shouldn't be non-commutative by default, but they are)
Aaron Meurer
>
> On Aug 5, 8:49 pm, Brian Granger <elliso...@gmail.com> wrote:
>> The best starting place is to look at how we handle spin in
>> sympy.physics.quantum.spin. I should note that we don't have a
>> symbolic trace operation, but that could be implemented quite easily.
>
> Thank you for the pointer, I will have a look into it.
>
> Christopher
>