# Preface

I know that the title is not clear, if you want to change feel free to suggest an edit. I used the term rotating shift because is similar to the operation that one could perform on array in computer science.

# Question

Lets suppose I have these two vectors:

$$A = \begin{bmatrix} a_1 \\ a_2 \\ a_3 \\ \end{bmatrix} \quad B = \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix}$$

I want to write this operation

$$k_1 \cdot (a_1 b_1 + a_2 b_2 + a_3 b_3) + k_2 \cdot (a_2 b_1 + a_3 b_2 + a_1 b_3) + k_3 \cdot (a_3 b_1 + a_1 b_2 + a_2 b_3)$$

in a compact form. I could express the first term as:

$$k_1 A^T B$$

How could I express the others? There is a standard notation for this?

## 1 Answer

What about the following? $$\begin{bmatrix} a_1 \\ a_2 \\ a_3 \\ \end{bmatrix} \cdot \begin{bmatrix} k_1 & k_3 & k_2\\ k_2 & k_1 & k_3\\ k_3 & k_2 & k_1\\ \end{bmatrix} \cdot \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ \end{bmatrix}$$ Note that the "k" matrix is a circulant matrix, with many interesting properties.

Another typical notation is the use of the cyclic sum operator: $\sum_{cyc}$. Your expression then becomes $$k_1 \sum_{cyc} a_i b_{i} + k_2 \sum_{cyc} a_i b_{i+2}+ k_3 \sum_{cyc} a_i b_{i+1}$$ or, equivalently, $$k_1 \sum_{cyc} a_i b_{i} + k_2 \sum_{cyc} a_i b_{i-1}+ k_3 \sum_{cyc} a_i b_{i-2}$$ Here, it is understood that there are three terms to be summed, and the indices are shifted cyclically, i.e. they go through the three positions, modulo 3.

• Two good solution imho. However the first one is not applicable in my case (the $k$ terms are too long). But the second one is perfect in my case. – gvgramazio Jun 3 '18 at 13:01
• Yes, these are nice if the coordinates are going to be accessed directly. If cyclic permutations are only going to be used for the case of three, then using $P=\begin{bmatrix}0&0&1\\1&0&0\\0&1&0\end{bmatrix}$ you could use the circulant matrix identity to write this in a basically component free way as $\mathbf a\cdot (k_1 I+k_2P+k_3P^2)\mathbf b$, too. – Mark S. Jun 3 '18 at 17:00