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 66ddc01..86678ec 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 aeaf112..7d71fac 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);