In [a recent MO post](https://mathoverflow.net/questions/263708/is-there-a-trace-inequality-for-the-product-of-a-sequence-of-hermitian-postive-d), pallab1234 ask for trace inequalities for which counterexample were given. I wish to probe in a different direction.


Suppose $A, B$ are $n\times n$ symmetric matrices (with positive eigenvalues). Let $P\_1,P\_2,\dots,P\_{2k}$ be a sequence of $k$ copies of $A$ and $k$ copies of $B$. 


The trace operator, for matrices, enjoys the [*cyclic property*](https://en.wikipedia.org/wiki/Trace_(linear_algebra)#Trace_of_a_product). Furthermore, for symmetric matrices $tr(XYZ)=tr(XZY)$. This fails for more than $3$ matrices, in general. 



> 
> **Question.** What are "non-trivial" classes of symmetric matrices such that
>  $$tr(P\_1\cdots P\_{2k})=tr(A^kB^k),$$ 
>  for any permutation of the $P\_i$'s?
> 
> 
> 



a follow up question on traces of matrices
I realized that you asked a different question after writing the answer, but thought it might be helpful anyway. 


There are no equalities that depend only on the "string" of As and Bs.


We first check the base case, $k = 2$, with the rearrangement $ABAB$. This fails for a basic check of 2 by 2 matrices.


Now we can check the general case. A nontrivial equality would have to have a string of As and Bs with $ABAB$ as a substring (through deletion). 


Let $A' = A + a I\_n, B' = B + b I\_n$. Consider the $a^{k-2}b^{k-2}$ term of the equality using $A', B'$. This term involves 2 terms of A and 2 of B, so by the cyclic property, it is $m tr(AABB) + n tr(ABAB)$. The other side of the equality will be $(m + n) tr(AABB)$. As $ABAB$ is a substring (in order to get nontriviality), $n$ must be nonzero - so we get that the supposed equality must imply that $tr(ABAB) = tr(AABB)$. But we know that that is false in general, so there are no such nontrivial equalities.


