Trace inequality for real matrices

Is there any general result characterizing real matrices $A$ such that $$[\mathrm{tr}(A)]^2\leq n\mathrm{tr}(A^2)?$$

I can see that the inequality holds if:

  1. all eigenvalues of $A$ are real (by the Cauchy-Schwarz inequality) or

  2. $A$ is a nonnegative matrix. To see this write $$n\mathrm{tr}(A^2)=n\sum_{i=1}^{n}(A_{ii})^{2}+n\sum_{i,j=1,i\neq j}^{n}A_{ij}A_{ji},$$ and note that, by the sum of squares inequality, $$n\sum_{i=1}^{n}(A_{ii})^{2}\geq\left( \sum_{i=1}^{n}A_{ii}\right)^{2}=\left[\mathrm{tr}(A)\right]^{2}.$$ If $A$ is nonnegative
    $$n\sum_{i,j=1,i\neq j}^{n}A_{ij}A_{ji}\geq 0,$$ and therefore the inequality holds.

But what about matrices not satisfying 1. or 2.? Are there more general conditions (or other specific ones) under which the inequality above holds?


The inequality in question can be rewritten as $$\renewcommand{\tr}{\operatorname{tr}}\tr(X^2)\ge0,$$ where $X=A-\frac{\tr(A)}{n}I$ is the traceless part of $A$. With this alternative formulation, I don't expect any nice characterisation of the feasible $A$s, but we immediately see that it is easier to work with this formulation:

  1. When all eigenvalues of $A$ are real, all eigenvalues of $X^2$ are nonnegative. Hence $\tr(X^2)\ge0$. Cauchy-Schwarz inequality is not needed.
  2. When $A$ has nonnegative off-diagonal entries, write $X=D+F$, where $F$ is the off-diagonal part of $X$ or $A$. Then $DF$ is a matrix with a zero diagonal and both $D^2$ and $F^2$ are nonnegative matrices. Hence $\tr(X^2)=\tr(D^2)+\tr(F^2)\ge0$. No tedious summation is needed here and we can even obtain a weaker sufficient condition than yours.

The inequality is not true in general for a real diagonalizable $n\times n$ matrix $A=SDS^{-1}$ with complex eigenvalues, where $D$ is the diagonal matrix containing the eigenvalues of $A$; that is $D_{i,i}=e_{i}$, $i=1...n$.

The inequality:

$[\mathrm{tr}(A)]^2\leq n\mathrm{tr}(A^2)$

implies:

$[\mathrm{tr}(SDS^{-1})]^2\leq n\mathrm{tr}(SDS^{-1}SDS^{-1})$

and by the cyclic property of the trace:

$[\mathrm{tr}(D)]^2\leq n\mathrm{tr}(D^2)$,

because $D$ is diagonal this is equivalent to:

$\left(\sum_{i=1}^n e_{i}\right)^2\leq n\left(\sum_{i=1}^n e_{i}^2\right)$.

As $A$ and $A^2$ are real their traces are real and thus:

$\mathrm{tr}(D)=\sum_{i=1}^n e_{i}=\sum_{i=1}^n \Re(e_{i})$

$\mathrm{tr}(D^2)=\sum_{i=1}^n e_{i}^2=\sum_{i=1}^n \Re(e_{i}^2)=\sum_{i=1}^n \left(\Re(e_i)^2-\Im(e_i)^2\right)$

where we used:

$(\Re(e_i)+i\Im(e_i))^2=\Re(e_i)^2-\Im(e_i)^2+i2\Re(e_i)\Im(e_i)$.

The inequality then becomes:

$\left(\sum_{i=1}^n \Re(e_{i})\right)^2\leq n\sum_{i=1}^n \Re(e_i)^2-n\sum_{i=1}^n \Im(e_i)^2$

and as:

$0\leq\left(\sum_{i=1}^n \Re(e_{i})\right)^2$

the inequality fails to hold if (..but not iff):

$\sum_{i=1}^n \Re(e_i)^2< \sum_{i=1}^n \Im(e_i)^2$.

To demonstrate failure, assume the real diagonalizable matrix $A$ has complex eigenvalues such that:

$0< \sum_{i=1}^n \Im(e_i)^2$

then the real diagonalizable matrix:

$B=A-S^{-1}\Re(D)S$

has pure imaginary eigenvalues because:

$SBS^{-1}=SAS^{-1}-\Re(D)=D-\Re(D)=i\Im(D)$.

For an example of a matrix built in such a way take:

$A=\left( \begin{array}{cc} 1 & 2 \\ -3 & 4 \\ \end{array} \right)$,

from which we get:

$B=\left( \begin{array}{cc} -3/2 & 2 \\ -3 & 3/2 \\ \end{array} \right)$, $e_{i}=\pm i/2\sqrt{15}$

$B^2=\left( \begin{array}{cc} -15/4 & 0 \\ 0 & -15/4 \\ \end{array} \right)$,

$[\mathrm{tr}(B)]^2=0$,

$2\mathrm{tr}(B^2)=-15$,

and thus we do not have:

$[\mathrm{tr}(B)]^2\leq n\mathrm{tr}(B^2)$.