relation between indices of a tensor and its vectorization Assume three-mode tensor $A \in R^{n_1 \times n_2 \times n_3}$ and its vectorization as $a=vec(A)$. What is the relation between the index elements of tensor $A$ and vector $a$? Specifically, I would like to know which element of tensor $A$ is correspond to the $i$th element of vector $a$.

More generally, for a tensor $A \in \mathbb{R}^{r_1 \times \cdots \times r_m} $, an entry $a_{i_1, \cdots, i_m}$ of $A$ maps to the $j$-th entry of vec$(A)$, in which $j=1+\sum_{k=1}^m(i_k-1)\prod_{k'=1}^{k-1}r_{k'}$. You can understand this vectorization as stacking the model-1 fibers of $A$.
