]> www.ginac.de Git - ginac.git/blobdiff - ginac/tensor.cpp
epsilon tensor contractions evaluate to metric tensors instead of deltas,
[ginac.git] / ginac / tensor.cpp
index 0d93e6529ea387c48a63963c16fd1fb5719da72d..7b3d1417cf40362dfe38cbef2c3312061e38cbfd 100644 (file)
@@ -507,9 +507,14 @@ bool tensepsilon::contract_with(exvector::iterator self, exvector::iterator othe
                // Contraction of two epsilon tensors is a determinant
                ex dim = ex_to<idx>(self->op(1)).get_dim();
                matrix M(num, num);
-               for (int i=0; i<num; i++)
-                       for (int j=0; j<num; j++)
-                               M(i, j) = delta_tensor(self->op(i+1), other->op(j+1));
+               for (int i=0; i<num; i++) {
+                       for (int j=0; j<num; j++) {
+                               if (minkowski)
+                                       M(i, j) = lorentz_g(self->op(i+1), other->op(j+1), pos_sig);
+                               else
+                                       M(i, j) = metric_tensor(self->op(i+1), other->op(j+1));
+                       }
+               }
                int sign = minkowski ? -1 : 1;
                *self = sign * M.determinant().simplify_indexed();
                *other = _ex1();