clifford and color objects are not contracted if their representation labels
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 25 Jun 2002 21:36:23 +0000 (21:36 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 25 Jun 2002 21:36:23 +0000 (21:36 +0000)
are different

ginac/clifford.cpp
ginac/color.cpp

index 66ddc019ea5e76b0d10bfdb96d80e8718eb4c6b2..86678ecc6f342e881b3074c524258160287b8917 100644 (file)
@@ -179,6 +179,9 @@ static void base_and_index(const ex & c, ex & b, ex & i)
        if (is_a<diracgamma>(c.op(0))) { // proper dirac gamma object
                i = c.op(1);
                b = _ex1;
+       } else if (is_a<diracgamma5>(c.op(0))) { // gamma5
+               i = _ex0;
+               b = _ex1;
        } else { // slash object, generate new dummy index
                varidx ix((new symbol)->setflag(status_flags::dynallocated), ex_to<idx>(c.op(1)).get_dim());
                b = indexed(c.op(0), ix.toggle_variance());
@@ -196,6 +199,10 @@ bool diracgamma::contract_with(exvector::iterator self, exvector::iterator other
 
        if (is_a<clifford>(*other)) {
 
+               // Contraction only makes sense if the represenation labels are equal
+               if (ex_to<clifford>(*other).get_representation_label() != rl)
+                       return false;
+
                ex dim = ex_to<idx>(self->op(1)).get_dim();
 
                // gamma~mu gamma.mu = dim ONE
index aeaf112c6e16adb9e9b9906a74bb9c3bca86eab6..7d71facf896eb9aca5b0f32126ec4dc0a7480678 100644 (file)
@@ -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<color>(*other));
+               if (ex_to<color>(*other).get_representation_label() != rl)
+                       return false;
+
                // T.a T.a = 4/3 ONE
                if (other - self == 1) {
                        *self = numeric(4, 3);