I to write the index notation correctly in matrix/tensor product.
For example, I found notes that:
$$\sum_{i j k r p q} A_{j r} B_{r k} A_{i k} A_{i p} C_{p q} A_{j q} u_{j q}$$
By switching index $i \Leftrightarrow j, p \Leftrightarrow q, r \Leftrightarrow k$, we have
$$\sum_{i j k r p q} A_{j r} B_{r k} A_{i k} A_{i p} C_{p q} A_{j q} u_{j q} = \sum_{i j k r p q} A_{i k} B_{k r} A_{j r} A_{j q} C_{q p} A_{i p} u_{i p}$$
My question is how to know this switching index is correct. Any Principle?
For example, for the following equation:
$$\sum_{i j k} A_{j r} B_{r k} A_{i k}$$
Is it legal to swith $i \Leftrightarrow j$ and obtain the following:
$$\sum_{i j k} A_{j r} B_{r k} A_{i k} = \sum_{i j k} A_{i r} B_{r k} A_{j k} $$
Is it correct?
The name of the indices does not bear any meaning, you can change them at will,
$$ \sum_{i}A_i = \sum_{} A_{} = \sum_{j}A_j $$
This being, there are some rules you should follow, e.g. in the example below you are not allowed to make the change $\color{blue}{i}\to \color{red}{j}$
$$ \sum_{\color{blue}{i}j} A_{\color{blue}{i}j} \not=\sum_{\color{red}{j}j} A_{\color{red}{j}j} $$
but you can do something like
$$ \sum_{ij} A_{ij} \stackrel{i\to k}{=} \sum_{kj} A_{kj} \stackrel{j\to i}{=} \sum_{ki} A_{ki} \stackrel{k\to j}{=} \sum_{ji} A_{ji} $$
which ultimately is the result of changing $i\leftrightarrow j$