In https://github.com/sympy/sympy/pull/1326 it is implemented the canonicalization of Riemann invariants using monoterm symmetries; it is much faster than xperm.c from xPerm [1]; the reason is that in xperm.c there is duplication of tensors, related to the intersection of the dummy symmetry group with a conjugate of the slot symmetry group; this e.g. makes the difference between O(N^3.4) and exponential behavior in a class of Riemann invariants, N being the number of Riemann tensors.
>From the point of view of representing tensors in SymPy, the above one is an easy problem, since there is only one tensor type, only one index type, algebraic operations are absent. I think that now we should start to implement tensors in SymPy; here is an outline of the program: 1) reorder products of tensors in a standard way, so that they can be read as a single tensor T; this is explained in a paper by Portugal [2]; this step is absent in Riemann invariants. 2) Obtains the symmetries of the tensor T from the symmetries of the tensors composing it; for instance a tensor of the type T = R R A A p q where R is the riemann tensor, A is a symmetric tensor, p and q are vectors, and the indices are contracted in some way, with some free indices; tT inherits the slot symmetries of the single tensors, plus the symmetries due to the fact that the R's commute; same for the S's. This step is present in riemann.py with RiemannMonomial, and it is easily generalized to more tensor types. Then one canonicalizes T; this is done with canonicalize in perm_algorithms.py 3) Add to T algebraic operations; canonicalization allows simplification. 4) Deal with multiterm symmetries, like the cyclic symmetry of the Riemann tensor, 5) and with dimensional dependent identities, like the fact that a sum of tensors which is antisymmetric in d+1 indices in d dimensions is zero. For the last two steps probably one has to develop a module on Young tableaux; I saw there is one in cadabra [3] More points? It seems to me that one can work fairly well on the various points separately. I think that after implementing the first three points one can do already a lot of interesting things. Since canonicalization is very fast, I expect that tensors in SymPy can be fast. I would appreciate comments and I hope someone is interested in working on some of these points. [1] see http://www.xact.es/index.html [2] R. Portugal "An Algorithm to Simplify Tensor Expressions" Comput. Phys. Commun. 115, p.215 (1998) [3] http://cadabra.phi-sci.com/ -- You received this message because you are subscribed to the Google Groups "sympy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/PvihGMC541IJ. 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.
