- exvector a = index_set_difference(ex_to_indexed(*self).get_indices(), dummy_indices);
- exvector b = index_set_difference(ex_to_indexed(*other).get_indices(), dummy_indices);
- GINAC_ASSERT(a.size() > 0);
- GINAC_ASSERT(b.size() > 0);
- *self = numeric(5, 3) * delta_tensor(a[0], b[0]);
- *other = _ex1();
+ exvector a;
+ std::back_insert_iterator<exvector> ita(a);
+ ita = set_difference(self_indices.begin(), self_indices.end(), dummy_indices.begin(), dummy_indices.end(), ita, ex_is_less());
+ ita = set_difference(other_indices.begin(), other_indices.end(), dummy_indices.begin(), dummy_indices.end(), ita, ex_is_less());
+ GINAC_ASSERT(a.size() == 2);
+ *self = numeric(5, 3) * delta_tensor(a[0], a[1]);
+ *other = _ex1;
+ return true;
+ }
+
+ } else if (is_exactly_a<su3t>(other->op(0))) {
+
+ // d.abc T.b T.c = 5/6 T.a
+ if (other+1 != v.end()
+ && is_exactly_a<su3t>(other[1].op(0))
+ && ex_to<indexed>(*self).has_dummy_index_for(other[1].op(1))) {
+
+ exvector self_indices = ex_to<indexed>(*self).get_indices();
+ exvector dummy_indices;
+ dummy_indices.push_back(other[0].op(1));
+ dummy_indices.push_back(other[1].op(1));
+ int sig;
+ ex a = permute_free_index_to_front(self_indices, dummy_indices, sig);
+ *self = numeric(5, 6);
+ other[0] = color_T(a, ex_to<color>(other[0]).get_representation_label());
+ other[1] = _ex1;