On Sun, Jul 30, 2006 at 03:26:08PM +0200, Chris Dams wrote:
But even GiNaC developers *do* write such things, see: http://thep.physik.uni-mainz.de/pipermail/ginac-list/2005-April/000638.html
Yes, unfortonately they do :-(. Also in code that went into GiNaC :-(. See http://www.ginac.de/pipermail/ginac-devel/2006-July/000985.html . IIRC it was also Vladimir who submitted the first patch to start doing automatic index renaming.
However, if we start doing that we also should be careful that our indexed expressions make sense. This means that symbols in indices should occur once or twice in a product of indexed objects and if they occur twice in a varidx it should be in an up/down pair. Unfortunatelly, the `matrix' class does not follow the same rule :(.
For everything else there can be no guarantee whatsoever. It doesn't mean anyting. We shouldn't be showing that kind of stuff on our webpage.
OK, here is better (?) variant of FAQs: Q1: I am wondering how to convince GiNaC that the following to expressions are equal: [[-1,0],[0,1]~mu~mu * a~mu [[-1,0],[0,1].nu~mu * a~nu A: Actually, these expressions are meaningless. Indexed objects are tensors. Thus, symbols in indices should occur once or twice in a product of indexed objects and if they occur twice in a varidx it should be in an up/down pair. Q2: I'd like to know if is it possible to unroll indexed objects. As example, I would like to do something like this a_i a~i = (a_1)^2 + (a_2)^2 + (a_3)^2 + ... A: The indexed class (and most derived classes) is intended for tensor manipulation without referring to a particular basis. Thus, the indexed class is well suited for calculations involving (formally defined) tensor algebra of non-integer-dimensional space. This is particularly useful for evaluation of Feynman integrals in the framework of dimensional regularization. In that framework, unrolling a_i a^i to a_1^2 + a_2^2 + a_3^2 +... is not possible, since the dimension is not integer! Q3: I wish to mix matrices and indexed objects. How can that be done? A: The indexed class (and most derived classes) is intended for tensor manipulation without referring to a particular basis. On the other hand, the `matrix' class is _not_ treated as a tensor, so mixing matrices with indexed objects typically gives meaningless result. See also Q2. Best regards, Alexei. P.S.: There is no need to CC me, I read the list. -- All science is either physics or stamp collecting.