]> www.ginac.de Git - ginac.git/blobdiff - ginac/clifford.cpp
dimension in dirac gamma contractions was miscalculated
[ginac.git] / ginac / clifford.cpp
index b12e385ce4f03f2ca6f9bc7d6fd09342f5f6ef28..b6dd31ef9d09e7765ba36fec1be0c5b0fd7c1a6c 100644 (file)
@@ -208,10 +208,11 @@ bool diracgamma::contract_with(exvector::iterator self, exvector::iterator other
        GINAC_ASSERT(is_a<indexed>(*other));
        GINAC_ASSERT(is_a<diracgamma>(self->op(0)));
        unsigned char rl = ex_to<clifford>(*self).get_representation_label();
+
        ex dim = ex_to<idx>(self->op(1)).get_dim();
+       if (other->nops() > 1)
+               dim = minimal_dim(dim, ex_to<idx>(other->op(1)).get_dim());
 
-      if (other->nops() > 1)
-              dim = minimal_dim(dim, ex_to<idx>(self->op(1)).get_dim());
        if (is_a<clifford>(*other)) {
 
                // Contraction only makes sense if the represenation labels are equal