Ondrej Certik wrote:
On Tue, Jun 8, 2010 at 6:28 AM, Andy Ray Terrel <[email protected]> wrote:
Hello Alan,
Do you have anymore details of how the tensor module will work? Way
back when I was coding more with Sympy we tried to do something based
on GiNaC's Indexed system. It would be good to have a more uniform
system such that vectors, matrices, and tensors were implemented in a
very similar manner.
Ųyvind is working on code generation for quantum chemistry. This
requires tensors so we are definitely interested in your work.
Yes, I am interested as well. Here is ho ginac does it:
http://www.ginac.de/tutorial/Indexed-objects.html#Indexed-objects
http://www.ginac.de/tutorial/Non_002dcommutative-objects.html#Non_002dcommutative-objects
Ondrej
Ondrej
I am currently doing a rewrite of my first effort since it was
insufficiently object oriented an I couldn't understand the code I had
written. The initial rewrite should be done soon and only thing that
would take a while is automatic simplification using symmetries (Kasper
Peeters of Cadabra sent me the reference R Portugal, "Algorithmic
simplification of tensor expressions", J. Phys. A32 (1999)).
Tensors are instantiated as follows (Riemann tensor example)
R = Tensor('R__i_jkl')
A double underscore prefaces a group of contravariant indices and a
single underscore a group of covariant indices. Contraction is
Rc = R.contract(1,4)
print Rc
gives R__z_bcz
print R.pderv()
gives Pd_a*R__b_cde or in latex r'\partial_{a}R\indices{^{b}_{cde}}
print R.cderv()
gives Cd_a*R__b_cde or in latex r'\nabla_{a}R\indices{^{b}_{cde}}
Note it is the pattern that determines the representation of the tensor
in abstract index notation. Tensor('R__i_jkl') has the same
representation as Tensor('R__a_bcd').
--
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.