0
$\begingroup$

Is there any way to construct tensor of any given dimension d and rank r with symbolic entries? i.e., instead of manually constructing one as

Table[T[i,j,k],{i,1,10},{i,1,10},{i,1,10}]

for d=3 and r=10, I wish to only feed values of d and r and let Mathematica generate such a tensor.

$\endgroup$
1
  • $\begingroup$ Array[T, ConstantArray[10, 3]]? $\endgroup$ – J. M.'s torpor May 31 '16 at 3:06
2
$\begingroup$

Just make a function yourself:

tensor[d_, r_] := Outer[t, ##] & @@ ConstantArray[Range[r], d]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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