# Explicit Contraction of Tensor Indices [duplicate]

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.

## marked as duplicate by Artes, m_goldberg, user9660, MarcoB, JensDec 28 '15 at 4:55

• 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? – bbgodfrey Dec 27 '15 at 11:02
• @bbgodfrey Thanks for your comment. I fixed the input – jak Dec 27 '15 at 15:04
• Possible duplicate of Contracting with Levi-Civita (totally antisymmetric) tensor and closely related Using the epsilon tensor in Mathematica. – Artes Dec 27 '15 at 15:31

Sum[F[[x]] psi[[a, b]] psi[[c, d]] LeviCivitaTensor[5][[x, a, b, c, d]],