ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 23 Jun 2019 17:54:57 +0200Tensor orderinghttps://ask.sagemath.org/question/46976/tensor-ordering/I've been trying to figure out how tensor indices work with sage and I have a really simple question - how are the indices ordered after contracting two tensors? For example, if I have two tensors S,T or type (s_1,s_2) and (t_1,t_2) and I contract them, how will the indices of the resulting tensor be ordered? e.g. if S and T are both of type (3,3), then:
$$ S.\text{contract}(1,T,4) = S^{abc}_{\quad def} {\color{white}*} T^{ghi}_{\quad jbk}$$
how would the resulting tensors indicices be ordered?
$$R^{ac\quad ghi}_{\quad def \quad jk}$$
or
$$
R^{acghi}_{\quad \quad defjk}$$
I tried looking on the page for tensor indices but I couldn't figure it out; experimentation seemed to suggest the second but I wanted to be sure. Thanks; and sorry if this is a silly question whose explanation I missed in the docsSun, 23 Jun 2019 08:57:27 +0200https://ask.sagemath.org/question/46976/tensor-ordering/Answer by eric_g for <p>I've been trying to figure out how tensor indices work with sage and I have a really simple question - how are the indices ordered after contracting two tensors? For example, if I have two tensors S,T or type (s_1,s_2) and (t_1,t_2) and I contract them, how will the indices of the resulting tensor be ordered? e.g. if S and T are both of type (3,3), then:</p>
<p>$$ S.\text{contract}(1,T,4) = S^{abc}_{\quad def} {\color{white}*} T^{ghi}_{\quad jbk}$$</p>
<p>how would the resulting tensors indicices be ordered?</p>
<p>$$R^{ac\quad ghi}_{\quad def \quad jk}$$</p>
<p>or</p>
<p>$$
R^{acghi}_{\quad \quad defjk}$$</p>
<p>I tried looking on the page for tensor indices but I couldn't figure it out; experimentation seemed to suggest the second but I wanted to be sure. Thanks; and sorry if this is a silly question whose explanation I missed in the docs</p>
https://ask.sagemath.org/question/46976/tensor-ordering/?answer=46979#post-id-46979Yes this is the second form, namely
$$ S^{abc}\_{\quad def} T^{ghi}\_{\quad jbk} = R^{acghi}\_{\quad \ \ defjk} $$
This is so because in SageMath, the contravariant indices come always before the covariant ones. Sun, 23 Jun 2019 17:54:57 +0200https://ask.sagemath.org/question/46976/tensor-ordering/?answer=46979#post-id-46979