Commuting hermitian matrices Let $A$, $B$ be $n\times n$ hermitian matrices. Denote by $(\alpha_i)$, $(\beta_i)$, $(\gamma_i)$  the eigenvalues of $A$, $B$, and $A+B$.  Assume that there exists permutations $\sigma$, $\tau \in \frak S_n$ so that 
$$\gamma_i = \alpha_{\sigma(i)} + \beta_{\tau(i)}$$ for all $1\le i \le n$. Does this imply that $A$, $B$ commute? 
 A: This question was the topic of Commutativity and spectra of Hermitian matrices, by Wasin So (1994). 
The statement is negative in general: Richard Stanley's counterexample has size $n\geq 6$, a counterexample for $n=3$ is
$$A=\begin{pmatrix}0&0&0\\
0&6-\sqrt 2&2\\
0&2&4+2\sqrt 2
\end{pmatrix},\;\;B=\begin{pmatrix}
4&0&0\\
0&-4&0\\
0&0&0
\end{pmatrix},$$
There are special cases when the statement holds:
If $\gamma_i = \alpha_{\sigma(i)} + \beta_{\tau(i)}$ for a permutation $\sigma(i)$ and $\tau(i)$ of the eigenvalues $\alpha_i,\beta_i,\gamma_i$ in non-increasing order, then the $n\times n$ Hermitian matrices $A,B$ commute if either


*

*$n=2$

*rank $A=1$

*$\sigma(i)=i$ for all $i$ (identity permutation)

*$\sigma(i)=n+1-i$ for all $i$ (reverse permutation)

A: The answer is negative. Let $C$ and $D$ be two noncommuting $n\times n$ hermitian matrices, and define the block matrices
  $$ A=C\oplus (C+D)\oplus 0_n,\ \ \ B=D\oplus(-C)\oplus 0_n, $$
where $0_n$ is the $n\times n$ matrix of all 0's.
