X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcolor.cpp;h=675d32747bc81d5129e29b74f08762ff262d392b;hp=65dcf4ae436d2648ebf7f83a143c606c90e7e22a;hb=7064a931c4b5bea8c4a924fc9e9edabe5584b57a;hpb=d1d329ec76f136524bcb066e012bce1eec91243c diff --git a/ginac/color.cpp b/ginac/color.cpp index 65dcf4ae..675d3274 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -301,39 +301,27 @@ bool su3d::contract_with(exvector::iterator self, exvector::iterator other, exve GINAC_ASSERT(self->nops() == 4); GINAC_ASSERT(is_ex_of_type(self->op(0), su3d)); - if (is_ex_exactly_of_type(other->op(0), su3d) || is_ex_exactly_of_type(other->op(0), su3f)) { + if (is_ex_exactly_of_type(other->op(0), su3d)) { // Find the dummy indices of the contraction exvector dummy_indices; dummy_indices = ex_to_indexed(*self).get_dummy_indices(ex_to_indexed(*other)); - if (is_ex_exactly_of_type(other->op(0), su3d)) { - - // d.abc*d.abc=40/3 - if (dummy_indices.size() == 3) { - *self = numeric(40, 3); - *other = _ex1(); - return true; - - // d.akl*d.bkl=5/3*delta.ab - } else if (dummy_indices.size() == 2) { - 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(); - return true; - } - - } else { - - // d.akl*f.bkl=0 (includes the case a=b) - if (dummy_indices.size() >= 2) { - *self = _ex0(); - *other = _ex0(); - return true; - } + // d.abc*d.abc=40/3 + if (dummy_indices.size() == 3) { + *self = numeric(40, 3); + *other = _ex1(); + return true; + + // d.akl*d.bkl=5/3*delta.ab + } else if (dummy_indices.size() == 2) { + 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(); + return true; } }