I think that canonicalization must be modified in presence of numerical indices, otherwise there would be expressions which equal terms not simplified. I think I will implement it; if it takes some time, one can anyway implement meanwhile numerical indices in tensor.py; it is sufficient to keep at first only examples in the tests which do not have canonicalization problems due to numerical indices.
It seems to me that A(m0, m1, m2)[2,0, 1] and A(F(2), F(0), F(1)) are equivalent representations; e.g. A(-m0, m1, m2)[2,0, 1] corresponds to A(-F(2), F(0), F(1)), etc. I do not like A(m0, m1, m2)[2,0, 1]; I do not think it is standard notation. I suggest that the string representation be >>> A(-F(2), -F(0), F(1)) A(-2, -0, 1) but the use of the minus sign to represent covariant indices is controversial, especially for numerical indices. Anyway this is just a representation choice, e.g. printing a tensor in latex form the problem disappears. On Friday, September 20, 2013 9:28:16 PM UTC+2, F. B. wrote: > > I was just considering, isn't it easier to store abstract and numeric > indices separately? > > I mean, the idea of changing all canonization algorithm is long and will > need a longer phase of testing to check all possible cases. > > Besides, I have already prepared some code to add a numpy ndarray to the > tensor objects in order to perform numerical calculations on them. The idea > behind that is just to use both abstract indices and integer positions, i.e. > > A(m0, m1, m2)[2,0, 1] > > Here [2, 0, 1] are the values to access positions identified by abstract > indices (m0, m1, m2). > > The problem here is that this A(m0, m1, m2)[2,0, 1] notation clashes with > the A(F(2), F(0), F(1)) notation. > > An easier to implement idea would be to create hidden *TensorIndex* objects, > and put the numerical value inside of them. Hidden indices will be of a > particular type which does not perform contraction, but otherwise behaves > like a free index. > > In any case, it is better to take some days to think about it before > starting to write any code. > > Do you believe that my alternative could be a good one? > -- 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.
