# Is there a standard operation to “rotate rings on matrices”?

Is there some standard operation to "rotate rings on matrices"? Look at the image below:

The numbers around the four empty squares are what I'm calling ring, In the second matrix, this ring has been rotated counterclockwise. I'm aware that ring may not be the right name.

-
 What should I review? – Gustavo Bandeira Jul 5 '12 at 7:38 Ring is perhaps a poor choice of words, since it's very common to talk about "matrices defined over a ring", which has a very different meaning. – Alex Becker♦ Jul 5 '12 at 7:39 Oddly enough, if you do the same thing to $2\times 2$ matrices and restrict you attention to those of the form $$\begin{pmatrix}a & b \\ c & a\end{pmatrix}$$ then rotation counterclockwise corresponds to multiplication on the right by $$\begin{pmatrix}0 & 1\\ 1 & 0\end{pmatrix}$$ while rotation clockwise corresponds to multiplication on the left by the same matrix. – Alex Becker♦ Jul 5 '12 at 8:07 @AlexBecker Yep, But I've explained it. It's also because my native languange is portuguese, I just didn't know which word to use. Suggestions? – Gustavo Bandeira Jul 5 '12 at 9:23

Use the vector representation $\mathrm{vec}$ of your matrix $X$, by stacking all columns on top of each other: $$\mathrm{vec}\: \pmatrix{ 1 &4&2&6\\ 7&\square&\square&2 \\ 7&\square&\square&4 \\ 8&2&5&6\\ } =\pmatrix{ 1 &4&2&6& 7&\square&\square&2 & 7&\square&\square&4 & 8&2&5&6\\ }^T.$$ Now apply $\pi_{\text{rot.ring}}$, a permutation (matrix $M$, with dimension $4^2$) on $\mathrm{vec}\;X$, such that $\left(\mathrm{vec}\;X\right)_1$ is sent to $\left(\mathrm{vec}\;X\right)_5$, $\left(\mathrm{vec}\;X\right)_2$ to $\left(\mathrm{vec}\;X\right)_1$,... So $\pi_{\text{rot.ring}}=\left(5,1,2,3,4,8,12,16,15,14,13,9\right)$ and $M_{j,j+1}=\left(\pi_{\text{rot.ring}}\right)_{j,j+1}$ and $M_{jj}=1$ if $j\in\{6,7,10,11\}$.

Undo the $\mathrm{vec}$ operation and you'll get a matrix with your ring rotated.

-
 Will this procedure work on matrices bigger than 4x4? And will the same procedure work for rotating the inner "rings"? – Gustavo Bandeira Jul 5 '12 at 22:42 Sure, this will work for larger matrices and other rings (for the inner ring cycle the elements $\{6,7,10,11\}$). – draks ... Jul 6 '12 at 6:32 @GustavoBandeira do you agree? – draks ... Jul 11 '12 at 11:05 Actually I'll need to translate what you said - and also what others said - so I can apply it. I was just ashamed of asking for help but here it goes: What topics do I need to learn? I supose matrices are the topic, but could it be more specifical? – Gustavo Bandeira Jul 11 '12 at 13:27 Are you asking for a good book on matrices? Here you'll find some examples... – draks ... Jul 11 '12 at 13:46
If you identify the space $M_{n\times n}$ with $\mathbb R^{n^2}$, and let $S_{n^2}$ act on $\mathbb R^{n^2}$ by permuting the axes, then your operation corresponds to the action of a $4n-4$ cycle on $M_{n\times n}$. This interpretation is purely geometrical though, and does not give any understanding of how the operation affects the linear transformation corresponding to a matrix.
 Will this procedure work on matrices bigger than 4x4? And will the same procedure work for rotating the inner "rings"? – Gustavo Bandeira Jul 5 '12 at 22:41 @GustavoBandeira Yes, it works for any $n$. And any "ring" as well,. However, you must choose the correct $4n-4$ cycle; not just any cycle will do. – Alex Becker♦ Jul 6 '12 at 1:03 What you mean with "cycle", is this a name for my "ring"? – Gustavo Bandeira Jul 6 '12 at 2:39 @GustavoBandeira No, "cycle" is a technical term. It describes certain elements of the permutation group $S_{n^2}$. You can read about cycles on Wikipedia. – Alex Becker♦ Jul 6 '12 at 2:41 Oh, ok. I was confused because you suggested a better term instead of "ring". – Gustavo Bandeira Jul 6 '12 at 2:44