What does type (r, s) mean? I’d like to discuss the notation of the tensor type, commonly denoted $(r, s)$ as it relates to the tensor product. Specifically, the ordering of the vector spaces and dual vector spaces involved in the product. The order matters since tensors are typically categorized by the number of vectors and dual vectors they require as arguments. To avoid ambiguity, for a given tensor $T$, I will denote the number of vector arguments as $n_v$ and the number of dual vector arguments as $n_d$.

The introduction to tensor products and tensor algebras is often riddled with rigor, in which a mathematician would delight but a programmer would despair. I find myself in the intersection of these camps and while I appreciate notation, a simpler introduction is possible using functional programming concepts.
Tensors are defined and introduced in two equivalent ways. The first way, called the “expansion coefficient” (or array) style of introducing tensors relies on many indices and iterates over the n dimensions of some array (n-dimensional generalization of a matrix).