Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I would like to use TensorReduce to work on the tensor contraction $y_{ib}y_{ia}$ (where index $i$ is summed). However, TensorReduce does not bring the following t1 and t2 into a unique form:

$Assumptions = y ∈ Arrays[{d, d}];
t1 = TensorContract[TensorProduct[y, y], {{1, 3}}];
t2 = TensorTranspose[TensorContract[TensorProduct[y, y], {{1, 3}}], {2, 1}];
TensorReduce[t1]
TensorReduce[t2]

(* Output: *)
(* t1 -> TensorContract[y ⊗ y, {{1, 3}}] *)
(* t2 -> TensorTranspose[TensorContract[y ⊗ y, {{1, 3}}], {2, 1}] *)

Shouldn't they be brought into the same form? Thank you!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Symbolic tensor analysis is new in version 9 and it is not yet fully implemented.

For example, Mathematica knows that t1 and t2 are symmetric

TensorSymmetry[t1]
TensorSymmetry[t2]
(* Symmetric[{1, 2}] *)
(* Symmetric[{1, 2}] *)

But it can't simplify transposition automatically. I think you can contact to the Wolfram support. Now you can use the following workaround:

transpose[t_, n_: {2, 1}] := Module[{t1}, 
  TensorReduce[Transpose[t1, n], 
    Assumptions -> {t1 ∈ Arrays[TensorDimensions[t], Complexes, TensorSymmetry[t]]}] /. 
   t1 -> t]

transpose[t1]
(* TensorContract[y\[TensorProduct]y, {{1, 3}}] *)

It is interesting that everything works fine for the contraction of the right indexes $y_{ai}y_{bi}$:

$Assumptions = y ∈ Arrays[{d, d}];
t1 = TensorContract[TensorProduct[y, y], {{2, 4}}];
t2 = TensorTranspose[
   TensorContract[TensorProduct[y, y], {{2, 4}}], {2, 1}];
TensorReduce[t1]
TensorReduce[t2]
(* TensorContract[y\[TensorProduct]y, {{2, 4}}] *)
(* TensorContract[y\[TensorProduct]y, {{2, 4}}] *)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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