epsilon tensor contractions evaluate to metric tensors instead of deltas,
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 30 Jul 2001 20:02:34 +0000 (20:02 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 30 Jul 2001 20:02:34 +0000 (20:02 +0000)
which is more general

ginac/tensor.cpp

index 0d93e65..7b3d141 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();