This question already has an answer here:

I am trying to contract two Levi-Civita symbols in tensor format like so:

$\epsilon_{a b} \epsilon_{c d}$

This code generates the Levi-Civita:

n = 2;
LevCiv := LeviCivitaTensor[2, List];

listLevCiv := 
 Table[If[UnsameQ[LevCiv[[a, b]], 0], {ToString[LeCi[a, b]], 
    LevCiv[[a, b]]}] 
  , {a, 1, n}, {b, 1, n}]
TableForm[Partition[DeleteCases[Flatten[listLevCiv], Null], 2], 
 TableSpacing -> {2, 2}]
LevCiv // MatrixForm

I would like something of this form:

    Output = Simplify[
   Table[LevCiv[[a, b]]*LevCiv[[c, d]], {a, 1, n}, {b, 1, n}, {c, 1, 
     n}, {d, 1, n}]];
Output // MatrixForm

Does anyone have experience working with such tensors and how to generate one output please?



marked as duplicate by Artes, J. M. will be back soon Aug 21 '17 at 18:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Is what you're looking for Outer[Times, LevCiv, LevCiv]? $\endgroup$ – evanb Aug 21 '17 at 10:57
  • $\begingroup$ Also, you should turn LevCiv := into =---no need to re-generate the tensor every time you want to mention it. $\endgroup$ – evanb Aug 21 '17 at 10:58
  • $\begingroup$ See also mathematica.stackexchange.com/q/138167/7936 $\endgroup$ – evanb Aug 21 '17 at 10:59

You can get this by using TensorProduct directly on your LeviCivitaTensor

TensorProduct[LeviCivitaTensor[2, List], LeviCivitaTensor[2, List]] // MatrixForm

or more concise

#\[TensorProduct]# &[LeviCivitaTensor[2]] // Normal // MatrixForm

The infix version of TensorProduct can be entered as ESCt*ESC.

  • $\begingroup$ Thank you for your answer. It looks great. I hope it holds up when I perform metric tensor contractions on it. Thanks sir! $\endgroup$ – Mark Pace Aug 21 '17 at 11:36

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