4
$\begingroup$

I want to create a symmetric rank four tensor with this kind of symmetry: {1,2} and {3,4}. How can I implement this using "Array"?

v = Array[Subscript[a, ##] &, {5,5,5,5}]

$\endgroup$

2 Answers 2

6
$\begingroup$

You can use this construction, which is an efficient representation (avoiding repeating symmetry-related entries):

sa = SymmetrizedArray[{i_, j_, k_, l_} :> Subscript[a, i, j, k, l], {5, 5, 5, 5}, {Symmetric[{1, 2}], Symmetric[{3, 4}]}]

If you want the ordinary array just do

Normal[sa]

In this way you can also implement antisymmetries. For example you could have the symmetry

{Symmetric[{1, 2}], Antisymmetric[{3, 4}]}
$\endgroup$
2
  • $\begingroup$ Thank you so much! Do you know a way to make it also traceless? For example, I want Sum[sa[[i,l,i,k]],{i,1,5}]=0 $\endgroup$
    – Tony Stack
    Mar 28, 2022 at 15:35
  • $\begingroup$ SymmetrizedArray only handles symmetries under permutations, not trace conditions. There are many different trace conditions that can be imposed. I think you'll have to impose all conditions you want manually and solve the corresponding system of equations, in the direction that @Adam's answer suggests. $\endgroup$
    – jose
    Mar 28, 2022 at 16:48
3
$\begingroup$

Does this work?

#/.Solve[{
  TensorTranspose[#,{2,1,3,4}]==#,
  TensorTranspose[#,{1,2,4,3}]==#
}][[1]]& @ Array[Subscript[a,##]&,{5,5,5,5}]

Use TensorSymmetry@% to verify

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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