1
$\begingroup$

I recently need to apply the following concept of product of two 2d tensors to create a 3d tensor (tensors understood as generalized arrays): given two 2d tensors $A_{m\times n}$ and $B_{n\times p}$, we define the 3d tensor $C_{m\times n\times p}$ by $$ C_{ijk}:=A_{ij}B_{jk}. $$ Does anyone know what this product is called? Is there any public codebase in Python that implements this product for sparse tensors? Any reference is appreciated. Thanks

$\endgroup$
5
  • 2
    $\begingroup$ This is an egregious misuse of the term "tensor". A tensor is not simply a generalized array, and your object $C_{ijk} $ is not a tensor as commonly understood. $\endgroup$ Commented Aug 11, 2023 at 14:14
  • 3
    $\begingroup$ This absolutely is a tensor, and a tensor absolutely can be a generalized array. $\endgroup$ Commented Aug 11, 2023 at 15:10
  • 1
    $\begingroup$ You could define the sparse tensor $H_a^{bc}$ which is 1 when $a=b=c$ and zero otherwise, and then it's just a tensor product followed by a contraction. $\endgroup$ Commented Aug 11, 2023 at 17:35
  • $\begingroup$ @MichaelEngelhardt this way of defining a tensor can also be found in the very beginning of the Definition section of en.wikipedia.org/wiki/Tensor $\endgroup$
    – Min Wu
    Commented Aug 11, 2023 at 18:08
  • 2
    $\begingroup$ @MinWu - you are pointing me to a wikipedia definition - ok, let's go with that. The wikipedia definition you are pointing me to indeed explains that a tensor is not simply a generalized array, and a generalized array does not define a tensor. Rather, a tensor can be represented as a generalized array, in many different ways that are related by a transformation law. This transformation behavior is an important part of the definition of a tensor. It is the transformation behavior of your $C_{ijk} $ object that is the issue. $\endgroup$ Commented Aug 11, 2023 at 20:22

0

You must log in to answer this question.