# Using LeviCivitaTensor

I have 2 questions about using LeviCivitaTensor, based on the following session:

1. The signs for the cross product seems to come out "opposite" of what I expected. Why is that? Did I miss anything? I thought the usual definition of the cross product of 2 vectors was $(\textbf{a}\times\textbf{b})_i=\epsilon_{ijk}\textbf{a}_j\textbf{b}_k$, which seems to use the Levi-Civita tensor directly (not transposing it).
2. In the second expression, I'm confused about the operation being performed. The reason I sandwiched the LeviCivitaTensor in the first expression is that I'm used to $\textbf{a}\ M\ \textbf{b}$ to compute e.g. inner products, but I wouldn't know how to understand $M\ \textbf{a}\ \textbf{b}$, unless maybe it should be read $(M\ \textbf{a})\ \textbf{b}$?
• Is this answer the answer? Using the epsilon tensor in Mathematica – Kuba Apr 26 '15 at 17:25
• Using Trace confirms that the second expression corresponds to $(M \mathbf{a})\mathbf{b}$ – Marius Ladegård Meyer Apr 26 '15 at 17:41
• One of the basic examples in the docs for LeviCivitaTensor is "Build a cross product", in which the code is the same the OP's, changing a, b to x, y. Of course they get the opposite of the cross product, which is clear in the example because they include the cross product. But no mention of the discrepancy nor of the fact that they haven't built the cross product. It looks as though didn't even compare the outputs. – Michael E2 Apr 26 '15 at 22:24
• @MichaelE2 That's a good point - the documentation is a little confusing on that issue. If one doesn't look carefully, it creates the wrong impression about the order of arguments. – Jens Apr 27 '15 at 4:24

I believe the reason for the confusion is the way the Dot product operates. It is a Flat but non-commutative operation when the factors aren't just vectors. In particular, it contracts the last index of the first factor with the first index of the next factor, going from left to right. But in the form $a\cdot\varepsilon\cdot b$, this means that the contraction between $a$ and $\varepsilon$ occurs too early. It then doesn't correspond to the desired summation.

You want the summation over the last index of $\varepsilon$ to occur first, multiplied by the components of the second vector. This can be enforced by simply changing the order of the factors in the dot product so that the innermost sum is done first and the next sum is again over the last index of the result, multiplied by the first vector:

LeviCivitaTensor[3].b.a == Cross[a, b]

(* ==> True *)


Now that we have arranged things so that it's always the last index of the product involving $\varepsilon$ that gets summed over with the next dot operation, we can further use the special symmetry of $\varepsilon$ to change the order in the first factor, to make the expression look like this:

b.LeviCivitaTensor[3].a == Cross[a, b]

(* ==> True *)


If you now rename a to b and vice versa, you have the result

a.LeviCivitaTensor[3].b == Cross[b, a]


which is the expression with the opposite sign that you were confused by.

I believe you seek:

a.Transpose[LeviCivitaTensor[3]].b

• I believe it might help the OP if you could explain why it should be written this way. – Sjoerd C. de Vries Apr 26 '15 at 17:45
• Yes - I totally believe it - but the formula for the cross product uses $\epsilon_{ijk}$ directly, not its transpose, hence my surprise. – Frank Apr 26 '15 at 19:05