Is the trace of a finite hypercubic tensor defined?


Clearly, for the bidimensional case $n \times n$ the trace is defined as the sum of the elements on the main diagonal:


$$\operatorname {tr} (\mathbf {A}\_{2D} )=\sum \_{i=1}^{n}a\_{ii}=a\_{11}+a\_{22}+\dots +a\_{nn}$$


Is there any sound attempt at generalizing the trace to hypercubic tensors of shape $n\times n \times \ldots \times n$?


I can imagine for instance something like:


$$\operatorname {tr} (\mathbf {A}\_{mD} )=\sum \_{i=1}^{n}a\_{\mathbf{i}}=a\_{\mathbf{1}}+a\_{\mathbf{2}}+\dots +a\_{\mathbf{n}}$$


where $\mathbf{i}$ is $m$ times $i$.



Trace of a finite hypercubic tensor
Although this is rather off-topic for mathoverflow, I'll provide an answer, given that no objections have been raised to the OP and since it's being explicitly requested:


First, one should carefully distinguish between tensors and matrices. These are distinct concepts, each with their own properties and with their own sets of operations that can be meaningfully carried out on them. Although contact points between these concepts exist, e.g., when one represents tensors in terms of matrices, one should not attribute properties of the one to the other.


The characterizing property of a tensor is its transformation behavior. This, in particular, allows for the "contraction" operation - setting two indices equal and summing over them. This operation produces again a tensor. By contrast, setting more than two indices equal and summing over them, as suggested in the OP, or even just summing over only one index does not produce again a tensor and therefore is not a useful operation on tensors.


Matrices (including higher dimensional versions as alluded to in the OP) are a priori a more malleable concept. In principle, they're just a way of arranging information, and it's usually necessary to explain what that information is in addition to writing the matrix itself, just as the components of a vector have no meaning without an explanation of what basis they are associated with. The malleability of the concept implies that one can define operations on matrices fairly freely. In principle, one can define the operation suggested in the OP as a generalization of the "trace" operation on $n\times n$ matrices - this by itself, however, does not yet impart meaning to the operation or suggest a possible application.


The tensor and matrix concepts make contact if one chooses to represent tensors as matrices. Different choices of bases lead to different matrix representations of a given tensor, underscoring again the distinction between the concepts. It so happens that the contraction of a rank-2 tensor corresponds to taking the trace of any of its $n\times n$ matrix representations (in a slight abuse of language, one might sometimes speak of the trace of the tensor). In particular, the result is independent of representation - it is a scalar. This property does not persist for the generalizations suggested by the OP, which do not again lead to a tensor. Thus, an application of these generalizations in the tensor context seems unlikely. It therefore remains unclear what a possible application might be - similar to the notion of just adding up the components of a vector, which also is an operation that, at the very least, requires further explication to be meaningful.


