Hi!
This was a bit more complicated than I thought because FindFreeIndices sorts the indices, so it can not be used to extract the index ordering. However, FindIndices keeps the order of the indices.
The following two functions might do what you need. SortFreeInds can be dangerous, in particular if you have indices belonging to different VBundles. In that case you have to separate the indices into groups belonging to the same VBundle and only sort within each group. I have also ignored the possibility of blocked indices.
FreeIndsDown[expr_] :=
ReplaceIndex[
Evaluate@expr, (# -> DownIndex[#]) & /@
List @@ FindFreeIndices[Evaluate@expr]]
SortFreeInds[expr_] :=
ReplaceIndex[Evaluate@expr,
Thread[(# -> Sort@#) &@
DeleteCases[List @@ #,
Alternatives @@ xAct`xTensor`Private`TakeEPairs[#]] &@
FindIndices[Evaluate@expr]]]
Regards
Thomas
--
You received this message because you are subscribed to the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xact+uns...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/xact/1f764d21-79e9-4310-8b34-6664f6a72ed2n%40googlegroups.com.