Hello! This simple program fails: #include <iostream> #include <cassert> #include <ginac/ginac.h> using namespace std; using namespace GiNaC; int main(int argc, char** argv) { varidx mu1(symbol("mu1"), 4); varidx mu2(symbol("mu2"), 4); varidx mu3(symbol("mu3"), 4); varidx mu4(symbol("mu4"), 4); varidx mu5(symbol("mu5"), 4); varidx mu6(symbol("mu6"), 4); symbol A("A"); exvector ev2; ev2.push_back(mu3.toggle_variance()); ev2.push_back(mu6); ev2.push_back(mu5.toggle_variance()); ev2.push_back(mu6.toggle_variance()); ev2.push_back(mu5); ev2.push_back(mu3); ex test_cycl = indexed(A, sy_cycl(), ev2); test_cycl = test_cycl.simplify_indexed(); assert(test_cycl.get_free_indices().size() == 0); return 0; } The reason is that reposition_dummy_indices() (indexed.cpp:639) ignores symmetry properties of expression[s]. To be more specific, if the expression e has some symmetry properties, than the code like this (indexed.cpp:654): e = e.subs(lst( *it2 == ex_to<varidx>(*it2).toggle_variance(), ex_to<varidx>(*it2).toggle_variance() == *it2 ), subs_options::no_pattern); can yield some non-trivial permutation of indices (apart from swapping covariant and contravariant instances of some index), so subsequent manipulations become incorrect. However, I don't know how to fix this. Any ideas? -- All science is either physics or stamp collecting.