+ GINAC_ASSERT(is_a<spinmetric>(self->op(0)));
+
+ // Contractions between spinor metrics
+ if (is_ex_of_type(other->op(0), spinmetric)) {
+ const idx &self_i1 = ex_to<idx>(self->op(1));
+ const idx &self_i2 = ex_to<idx>(self->op(2));
+ const idx &other_i1 = ex_to<idx>(other->op(1));
+ const idx &other_i2 = ex_to<idx>(other->op(2));
+
+ if (is_dummy_pair(self_i1, other_i1)) {
+ if (is_dummy_pair(self_i2, other_i2))
+ *self = _ex2;
+ else
+ *self = delta_tensor(self_i2, other_i2);
+ *other = _ex1;
+ return true;
+ } else if (is_dummy_pair(self_i1, other_i2)) {
+ if (is_dummy_pair(self_i2, other_i1))
+ *self = _ex_2;
+ else
+ *self = -delta_tensor(self_i2, other_i1);
+ *other = _ex1;
+ return true;
+ } else if (is_dummy_pair(self_i2, other_i1)) {
+ *self = -delta_tensor(self_i1, other_i2);
+ *other = _ex1;
+ return true;
+ } else if (is_dummy_pair(self_i2, other_i2)) {
+ *self = delta_tensor(self_i1, other_i1);
+ *other = _ex1;
+ return true;
+ }
+ }