diff() in itensor



Dmitry,

Unfortunately, the itensor package cannot deal reliably with tensor expressions as function arguments. Most importantly, it does not know how to reconcile indices that appear in argument lists vs. indices that appear elsewhere. Take this simple example, for instance:

(%i2) exp(a([i],[]))*x([],[i]);
                                         a([i], [])
(%o2)                       x([], [i]) %e
(%i3) rename(%);
                                         a([i], [])
(%o3)                       x([], [i]) %e

As you can see, itensor does not recognize that the indices in the exponent and the multiplication factor can be reconciled.

So consider it either a limitation or a bug, but these are the kind of problems that unfortunately itensor is not well equipped to deal with at present.


Viktor



-----Original Message-----
From: maxima-bounces at math.utexas.edu [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Dmitry Shkirmanov
Sent: Wednesday, November 16, 2011 2:27 AM
To: maxima at math.utexas.edu
Subject: diff() in itensor

Hello, list, i would like to use the diff() function within the itensor package, but it returns the  unexpected answer. Let's consider
 the code:

(%i1) load(itensor);
(%o1)      /usr/local/share/maxima/5.25.1/share/tensor/itensor.lisp
(%i2) test: exp(R([i,j],[])*a([],[i])*b([],[j]))$
(%i3) ishow(test);
                                    i  j
                                   a  b  R
                                          i j
(%t3)                            %e
                       a([], [i]) b([], [j]) R([i, j], [])
(%o3)                %e
(%i4) res:contract(diff(test,a([],[m])))$
(%i5) ishow(rename(res));
                                  i  %1
                                 a  b   R
                            %1           i %1
(%t5)                      b   %e             R
                                               m %1
                    a([], [i]) b([], [%1]) R([i, %1], [])
(%o5) b([], [%1]) %e                                      R([m, %1], [])
(%i6)



=================================
The result of this calculation is 

                    a([], [i]) b([], [%1]) R([i, %1], [])
(%o5) b([], [%1]) %e                                      R([m, %1], []),

but the correct answer is something like

                    a([], [i]) b([], [%1]) R([i, %1], [])
(%o5) b([], [%2]) %e                                      R([m, %2], []).



So, the diff() function does not rename dummy indices. Is there any way to rename dummy indices automatically?