# Coordinate-free notation for tensor contraction?

I am not sure if I can prevent this question from being too vague or with too large an overlap with other similar math.SE questions, but I will do my best...

A standard linear operation in tensor calculus is tensor contraction, which can be conveniently expressed in a given coordinate basis (or using Penrose-Rindler's abstract index notation) by means of Einstein's summation convention. Since this is a "pointwise" (i.e. algebraic) operation, we can restrict our discussion to (constant) mixed tensors of contravariant rank $r$ and covariant rank $s$ $$T\in\otimes^r_s V\doteq(\otimes^r V)\otimes(\otimes^s V^*)=\underbrace{V\otimes\cdots\otimes V}_{r\text{ times}}\otimes\underbrace{V^*\otimes\cdots\otimes V^*}_{s\text{ times}}$$ on a (finite dimensional) vector space $V$ over $\mathbb{R}$ or $\mathbb{C}$ with dual $V^*$. If $\{e_1\ldots,e_n\}$ is a basis of $V$ with dual basis $\{\theta^1,\ldots,\theta^n\}$ on $V^*$, i.e. $$\theta^j(e_i)=\delta^j_i=\begin{cases} 1 & (i=j) \\ 0 & (i\neq j) \end{cases}\ ,$$ and we expand $T$ in the corresponding basis of $\otimes^r_s V$ as $$T=\sum^n_{\substack{i_1,\ldots,i_r,\\ j_1,\ldots,j_s=1}} T^{i_1\cdots i_r}_{j_1\cdots j_s}e_{i_1}\otimes\cdots\otimes e_{i_r}\otimes\theta^{j_1}\otimes\cdots\otimes\theta^{j_s}\ ,$$ the tensor contraction of the $k$-th contravariant index with the $l$-th covariant index in this basis yields a tensor $S$ of contravariant rank $r-1$ and covariant rank $s-1$ whose components in the corresponding basis of $\otimes^{r-1}_{s-1}V$ are given by $$S^{i_1\cdots i_{r-1}}_{j_1\cdots j_{s-1}}=\sum^n_{m=1}T^{i_1\cdots i_{k-1}mi_k\cdots i_{r-1}}_{j_1\cdots j_{l-1}mj_l\cdots j_{s-1}}\text{ or simply }T^{i_1\cdots i_{k-1}mi_k\cdots i_{r-1}}_{j_1\cdots j_{l-1}mj_l\cdots j_{s-1}}$$ by Einstein's summation convention. For example, if $r=2$, $s=3$, $k=1$ and $l=2$, the tensor contraction of $T^{ab}_{cde}$ at the aforementioned indices would be $S^b_{ce}=T^{mb}_{cme}$ if one employs Penrose-Rindler's abstract index notation instead.

Since tensor contraction is a partial trace, it does not depend on a choice of basis. This can also be seen by the following, equivalent definition of tensor contraction (as done in this math.SE question): if $T$ is completely factorized, i.e. $T=X_1\otimes\cdots\otimes X_r\otimes\omega^1\otimes\cdots\otimes\omega^s$ with $X_i\in V$, $\omega^j\in V^*$, $i=1,\ldots,r$, $j=1,\ldots,s$, tensor contraction of the $k$-th contravariant index with the $l$-th covariant index yields $$S=\omega_l(X_k)X_1\otimes\cdots\otimes\widehat{X}_k\otimes\cdots\otimes X_r\otimes\omega_1\otimes\cdots\otimes\widehat{\omega}_l\otimes\cdots\otimes\omega_s\ ,$$ where the hats stand for omission. The above formula is then extended to general $T$ by linearity. In the particular case $r=s=k=l=1$, tensor contraction applied to $T$ is just the trace of the linear transformation $T:V\rightarrow V$, usually denoted by $\mathrm{Tr}\,T$.

Question: However, I have not found in the literature so far a good, general and coordinate-free notation (i.e. without referring to components in a given basis) for tensor contraction besides appealing to Penrose-Rindler's abstract index notation, which, though computationally efficient (as physicists know well), aesthetically speaking is kind of a crutch. Any ideas? I would specially like to have references for such notation(s?), should they exist.

(Remark: I am aware of this other closely related math.SE question, but the only answer given to it, based on the report by T.G. Kolda and B.W. Bader (Tensor Decompositions and Applications, Sandia Report 6702 (2007)), does not seem to cover my question)

• There's also Penrose's diagrammatic notation. May 19 '16 at 22:55
• Ah yes, I've just checked it in my copy of "The Road to Reality"... People working with symmetric monoidal categories like to use this notation. It helps you visualize what is happening when multiple contractions take place, but it seems to get messy really quickly. Besides, it doesn't seem to have a particular notation for contraction involving non-factorized tensors (does it?), so it seems still not enough. May 20 '16 at 0:28
• @PedroLauridsenRibeiro Contraction for non-factorized tensors can be expressed just fine in the Penrose notation. For example $T^{abc}_{db}$ would be drawn as a box labelled $T$ with three wires going in at the bottom, two wires coming out from the top, and with the right wire on top looping round to connect to the middle wire going in at the bottom. May 20 '16 at 11:48
• @OscarCunningham I figured it would be something like that, but I couldn't find an example of this in "The Road to Reality" or the appendix to the first volume of Penrose-Rindler's "Spinors and Space-Time" (the latter seems to be a standard reference for diagrammatic notation). In any case, I still imagine this notation can get really messy when many of those lines start getting entangled with each other when performing multiple contractions involving both different tensor factors and within the same (non-factorized) tensor factor, for example. May 20 '16 at 17:56

I've seen in the literature the notation $C$ with some additional specifications for the contraction maps of all sorts, but the amount of decorations on the symbol $C$ varied depending on the context. See, e.g., A.Gray, Tubes, p.56, where these maps are used in the case of somewhat special tensors, and therefore the notation is simpler.

In general, there is a whole family of uniquely defined maps

$$C^{(r,s)}_{p,q} \colon \otimes^{r}_{s} V \to \otimes^{r-1}_{s-1} V$$

which are collectively called tensor contractions ($1 \le p \le r, 1 \le q \le s$).

These maps are uniquely characterized by making the following diagrams commutative:

$$\require{AMScd} \begin{CD} \times^{r}_{s} V @> {P^{(r,s)}_{p,q}} >> \times^{r-1}_{s-1} V\\ @V{\otimes^{r}_{s}}VV @VV{\otimes^{r-1}_{s-1}}V \\ \otimes^{r}_{s} V @>{C^{(r,s)}_{p,q}}>> \otimes^{r-1}_{s-1} V \end{CD}$$

Explanations are in order.

Recall that the tensor products $\otimes^{r}_{s} V$ are equipped with the universal maps $$\otimes^{r}_{s} \colon \times^{r}_{s} V \to \otimes^{r}_{s} V$$ where $\times^{r}_{s} V := ( \times^r V) \times (\times^s V^*)$.

Besides that, there is a canonical pairing $P$ between a vector space $V$ and its dual: $$P \colon V \times V^* \to \mathbb{R} \colon (v, \omega) \mapsto \omega(v)$$

Notice that map $P$ is bilinear and can be extended to a family of multilinear maps $$P^{(r,s)}_{p,q} \colon \times^{r}_{s} V \to \times^{r-1}_{s-1} V$$ by the formula: $$P^{(r,s)}_{p,q} (v_1, \dots, v_p, \dots, v_r, \omega_1, \dots, \omega_q, \dots, \omega_s) = \omega_q (v_p) (v_1, \dots, \widehat{v_p}, \dots, v_r, \omega_1, \dots, \widehat{\omega_q}, \dots, \omega_s)$$ where a hat means omission.

Since maps $P^{(r,s)}_{p,q}$ are multilinear, the universal property of the maps $\otimes^{r}_{s}$ implies that there are uniquely defined maps $$\tilde{P}^{(r,s)}_{p,q} \colon \otimes^{r}_{s} V \to \times^{r-1}_{s-1} V$$ and then the maps $C^{(r,s)}_{p,q}$ are given by $$C^{(r,s)}_{p,q} := \otimes^{r-1}_{s-1} \circ \tilde{P}^{(r,s)}_{p,q}$$

• Thanks for the answer and the reference. Now in retrospect it seems more reasonable to replace $C$ by $\mathrm{Tr}$ in order not to mistake it for another tensor (e.g. the Weyl tensor, which is often denoted by the same letter, standing for "conformal") and to recall that we're dealing with a partial trace. It also seems to me that since the rank of the tensor is usually clear from the context, we can abuse notation a bit and write, say, $\mathrm{Tr}_{p,q}$ or even $\mathrm{Tr}^p_q$ to make clear we are contracting the $p$-th contravariant index with the $q$-th covariant index. May 29 '16 at 15:53
• One could even elaborate further on this: for multiple contractions, one could write it in a condensed form: $$\mathrm{Tr}^I_\phi=\mathrm{Tr}^{i_1}_{\phi(i_1)}\circ\cdots\circ\mathrm{Tr}^{i_{|I|}}_{\phi(i_{|I|})}\ ,$$ where $I\subset\{1,\ldots,r\}$ with $1\leq|I|=$ cardinality of $I\leq\min\{r,s\}$ and $\phi:I\rightarrow\{1,\ldots,s\}$ is any injective map. In any case, your answer is conceptually very neat and worthy of the bounty. Thanks again! May 30 '16 at 16:55
• Do we even need the superscript $(r,s)$? Couldn't we define $C_{p,q}$ on all tensors, just by linearity and $C_{p,q}(X)=0$ if $X$ has $r<p$ or $s<q$? Dec 10 '18 at 3:05
• @mr_e_man My goal was just to convey the idea. You may elaborate it to your liking. Indeed, there are many approaches to this task. Moreover, everyone is encouraged either to post their answer, or make an edit to existing ones, if appropriate. Dec 10 '18 at 8:38