TITLE: Can $AB = \gamma BA$ for matrices $A$ and $B$
QUESTION [5 upvotes]: For what values of $\gamma \in \mathbb{C}$ do there exist non-singular matrices $A , B \in \mathbb{C}^{n \times n}$ such that
  $$AB = \gamma BA \,?$$

So far what I have done shown that $\gamma$ must be an nth root of unity, by considering the determinant.
$$det(AB) = det(\gamma BA)$$
$$det(A)det(B) = \gamma ^n det(B)det(A)$$
Now since both $A$ and $B$ are non singular we have $det(A) \neq 0$ and $det(B) \neq 0$ So:
$$\gamma ^n =1$$.
I also know that 
$$tr(AB - \gamma BA)=0$$
$$tr(AB) - \gamma tr(BA)=0$$
$$tr(AB)\big(1-\gamma \big) = 0$$
Clearly we can assume $\gamma \neq 1$ since surely we can find $A$ and $B$ such that they commute so we conclude that $tr(AB) = tr(BA) = 0$
Now i'm thinking that we can find matrices $A$ and $B$ for any $\gamma = e^{\frac{2 \pi i}{n}}$ such that $AB = \gamma BA$ but I cannot think of a way of constructing them. Does anyone have any ideas? thanks in  advance!

REPLY [4 votes]: For any $n$, define $$B = \text{diag}(e^{2\pi i k / n} : 0 \leq k \leq n-1)$$ and then for any $0 \leq k \leq n-1,$ we can define $A = [a_{i,j}]$ by $$a_{i,j} = \begin{cases}1, & i \equiv j+k\pmod{n} \\ 0, & \text{otherwise}\end{cases}$$
Now just consider the actions of $A$ and $B$ on the standard basis vectors.