3
$\begingroup$

Is there any easy way to explicitly contract indices of several given tensors.

For example,

F = {F11, F12, F13, F14, F15};

psi = {{0, f1011, f1021, f1031, f1041},{0, 0, f1051, f1061, f10171},
    {0, 0, 0, f1081, f1091},{0, 0, 0, 0, f10101},{0, 0, 0, 0, 0}}

and I want to evaluate $F_{x}\psi_{ab}\psi_{cd} \epsilon^{xabcd}$, where $\epsilon$ is the LeviCivita symbol or similar equations, as $\psi_{ba}\psi_{bd} F_{d}$. Is there any package or inbuild function that enables to enter such computations in a non-confusing manner? So far, I tried to work with workarounds like this and using Inner, which becomes quite confusing as soon as there are several tensors involved. All packages I was able to find are built specifically for computations in general relativity and thus not really straight-forward to use for such computations.

$\endgroup$
3
  • $\begingroup$ The dimension of index d in the Levi-Civita symbol used in the question is six, but the dimension of index d in psi is five. How is the sum over d to be constructed? $\endgroup$
    – bbgodfrey
    Commented Dec 27, 2015 at 11:02
  • $\begingroup$ @bbgodfrey Thanks for your comment. I fixed the input $\endgroup$
    – jak
    Commented Dec 27, 2015 at 15:04
  • 6
    $\begingroup$ Possible duplicate of Contracting with Levi-Civita (totally antisymmetric) tensor and closely related Using the epsilon tensor in Mathematica. $\endgroup$
    – Artes
    Commented Dec 27, 2015 at 15:31

1 Answer 1

3
$\begingroup$

A simple, although inelegant, approach to evaluating the expression in the question or similar expressions is

Sum[F[[x]] psi[[a, b]] psi[[c, d]] LeviCivitaTensor[5][[x, a, b, c, d]], 
    {x, 5}, {a, 5}, {b, 5}, {c, 5}, {d, 5}] // Simplify
(* 2 (-f1061 f1091 F11 - f1041 f1081 F12 + f1031 f1091 F12 + 
      f1041 f1061 F13 + f10101 (f1051 F11 - f1021 F12 + f1011 F13) - 
      f1041 f1051 F14 - f1011 f1091 F14 + 
      f10171 (f1081 F11 - f1031 F13 + f1021 F14) + f1031 f1051 F15 - 
      f1021 f1061 F15 + f1011 f1081 F15) *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.