X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcolor.cpp;h=7d71facf896eb9aca5b0f32126ec4dc0a7480678;hp=aeaf112c6e16adb9e9b9906a74bb9c3bca86eab6;hb=9254356cc8381a5c189eb48cd40f316916453172;hpb=3ce9adede6e316865ae7d862bf58db8ab6999c1b;ds=sidebyside diff --git a/ginac/color.cpp b/ginac/color.cpp index aeaf112c..7d71facf 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -308,6 +308,11 @@ bool su3t::contract_with(exvector::iterator self, exvector::iterator other, exve if (is_ex_exactly_of_type(other->op(0), su3t)) { + // Contraction only makes sense if the represenation labels are equal + GINAC_ASSERT(is_a(*other)); + if (ex_to(*other).get_representation_label() != rl) + return false; + // T.a T.a = 4/3 ONE if (other - self == 1) { *self = numeric(4, 3);