I'm trying to write the expression $$\sum_{\alpha,\beta = 1}^{4}\epsilon_{\mu \nu\alpha\beta}a^{\nu} b^{\alpha} c^{\beta}$$ in Mathematica, where $\epsilon$ is the Levi-Civita symbol and $a$, $b$, $c$ are 4-dimensional vectors.

I tried this but the problem is with Levi-Civita as $\mu$ and $\nu$ are not specified in advance

a = {a1, a2, a3, a4}; 
b = {b1, b2, b3, b4}; 
c = {c1, c2, c3, c4};

  LeviCivitaTensor[4][[mu, nu, alpha, beta]] a[[nu]] b[[alpha]] c[[beta]],
  {alpha, 1, 4}, {beta, 1, 4}
  • $\begingroup$ This is not a question. $\endgroup$ – user23127 Jul 28 '14 at 17:14
  • $\begingroup$ It looks like LeviCivitaTensor, not LeviCivita. Also the code you give has syntax errors, and even if it didn't it doesn't work because a and so on aren't defined and when you try to retrieve their elements, you get an error. Not to put too fine a point on it, but you need to look at the docs. $\endgroup$ – acl Jul 28 '14 at 18:02
  • $\begingroup$ Of course; a, b, c are defined $\endgroup$ – Matej Jul 28 '14 at 18:09
  • $\begingroup$ Output needs to be a vector and $\mu$ and $\nu$ are not known. That is the problem. $\endgroup$ – Matej Jul 28 '14 at 18:16
  • $\begingroup$ @Dave84 since you have explicit values for the $a,b,c$ you can use TensorProduct $\endgroup$ – acl Jul 28 '14 at 18:21

You need to construct a "table" that acts like a vector

a = {a1, a2, a3, a4}; b = {b1, b2, b3, b4}; c = {c1, c2, c3, c4};
   Sum[LeviCivitaTensor[4][[mu, nu, alpha, beta]] 
        a[[nu]] b[[alpha]] c[[beta]], {alpha, 1, 4}, {beta, 1, 4}, {nu, 1, 4}], 
  {mu, 1, 4}]
| improve this answer | |

Assuming $\mu$ and $\nu$ also run from 1 to 4 (which they have to, otherwise your expression doesn't make sense), you can simply take a cue from this Q&A and write

  TensorProduct[LeviCivitaTensor[4], a, b, c],
  {{2, 5}, {3, 6}, {4, 7}}
] // Normal
 -a4 b3 c2 + a3 b4 c2 + a4 b2 c3 - a2 b4 c3 - a3 b2 c4 + a2 b3 c4, 
  a4 b3 c1 - a3 b4 c1 - a4 b1 c3 + a1 b4 c3 + a3 b1 c4 - a1 b3 c4, 
 -a4 b2 c1 + a2 b4 c1 + a4 b1 c2 - a1 b4 c2 - a2 b1 c4 + a1 b2 c4,  
  a3 b2 c1 - a2 b3 c1 - a3 b1 c2 + a1 b3 c2 + a2 b1 c3 - a1 b2 c3

This is actually the same output as in @QuantomDot's answer.

| improve this answer | |
  • $\begingroup$ Thank you, both answers are great. $\endgroup$ – Matej Jul 28 '14 at 19:53

In the question, there is no summation over $\nu$, as there is in other answers. In case $\nu$ is not specified, as the OP explicitly states, and meant to be an index, here is a way to calculate the desired tensor without using Table and Sum.

    a \[TensorProduct] b \[TensorProduct] c \[TensorProduct] LeviCivitaTensor[4],
    {{2, 6}, {3, 7}}],
 {{1, 3}}, List]

One can compare its output with the output of Table -- they're the same:

 Sum[Signature[{mu, nu, alpha, beta}] a[[nu]] b[[alpha]] c[[beta]], {alpha, 4}, {beta, 4}],
 {mu, 4}, {nu, 4}]
  {{ 0,  -a2 b4 c3 + a2 b3 c4,  a3 b4 c2 - a3 b2 c4, -a4 b3 c2 + a4 b2 c3},
   { a1 b4 c3 - a1 b3 c4,  0,  -a3 b4 c1 + a3 b1 c4,  a4 b3 c1 - a4 b1 c3},
   {-a1 b4 c2 + a1 b2 c4,  a2 b4 c1 - a2 b1 c4,  0,  -a4 b2 c1 + a4 b1 c2},
   { a1 b3 c2 - a1 b2 c3, -a2 b3 c1 + a2 b1 c3,  a3 b2 c1 - a3 b1 c2,  0 }}

Note: LeviCivitaTensor[4][[mu, nu, alpha, beta]] is the same as Signature[{mu, nu, alpha, beta}] (thanks to Szabolcs for pointing it out).

Admittedly, it seems odd not to sum over $\nu$, but I thought I may as well answer the question as it is (currently) stated.

| improve this answer | |
  • 1
    $\begingroup$ Instead of LeviCivitaTensor[...][[mu,nu,alpha,beta]] you can use Signature[{mu,nu,alpha,beta}]. $\endgroup$ – Szabolcs Sep 8 '14 at 17:31
  • $\begingroup$ Of course. Thanks. I don't remember but I think I just adapted the OP's or QuantumDot's code. Since QuantumDot's is the accepted answer, your comment might help more visitors there. But I'll use it to improve my answer anyway. :) $\endgroup$ – Michael E2 Sep 8 '14 at 18:14

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