Dear all, On Wed, 30 Aug 2006, Chris Dams wrote:
What about modifying the canonicalization code in symmetry.cpp, then? We could at first decide the canonical form based only on the values and dimensions of the indices. Not on their variance. If that does not give a prefered ordering we would order them the same way as is done now. Besides that, we should reject a toggling of indices in reposition_dummy indices if it results in an expression with reordered indices. Does this sound any better?
I now patched the function reposition_dummy_indices to fix this. The idea is that the problem Alexei pointed out can only occur if there are varidxes involved in a cyclic symmetry. In that case the function reposition_dummy_indices now starts by trying out all variations obtained by raising/lowering varidxes that occur in dummy pairs of the tensor object that is given to reposition_dummy_indices. Of these posibilities the one that is the smallest in the sense of ex_is_less is chosen. The dummy indices that have taken part in this trying out of all posibilities are removed from the vector variant_dummy_indices. After that there shouldn't be a problem anymore using the rest of the function reposition_dummy_indices as it always has been. Best wishes, Chris