1

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

Min Wu
  • 461
  • 2
    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. – Michael Engelhardt Aug 11 '23 at 14:14
  • 3
    This absolutely is a tensor, and a tensor absolutely can be a generalized array. – Zach Teitler Aug 11 '23 at 15:10
  • 1
    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. – Aaron Bergman Aug 11 '23 at 17:35
  • @MichaelEngelhardt this way of defining a tensor can also be found in the very beginning of the Definition section of https://en.wikipedia.org/wiki/Tensor – Min Wu Aug 11 '23 at 18:08
  • 2
    @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. – Michael Engelhardt Aug 11 '23 at 20:22

0 Answers0