X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fclifford.cpp;h=86678ecc6f342e881b3074c524258160287b8917;hp=66ddc019ea5e76b0d10bfdb96d80e8718eb4c6b2;hb=9254356cc8381a5c189eb48cd40f316916453172;hpb=3ce9adede6e316865ae7d862bf58db8ab6999c1b diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index 66ddc019..86678ecc 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -179,6 +179,9 @@ static void base_and_index(const ex & c, ex & b, ex & i) if (is_a(c.op(0))) { // proper dirac gamma object i = c.op(1); b = _ex1; + } else if (is_a(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(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(*other)) { + // Contraction only makes sense if the represenation labels are equal + if (ex_to(*other).get_representation_label() != rl) + return false; + ex dim = ex_to(self->op(1)).get_dim(); // gamma~mu gamma.mu = dim ONE