TITLE: Square root of doubly positive symmetric matrices
QUESTION [15 upvotes]: I wonder whether the following property holds true: For every real symmetric matrix $S$, which is positive in both senses:
$$\forall x\in{\mathbb R}^n,\,x^TSx\ge0,\qquad\forall 1\le i,j\le n,\,s_{ij}\ge0,$$
then $\sqrt S$ (the unique square root among positive semi-definite symmetric matrices) is positive in both senses too. In other words, it is entrywise non-negative.
At least, this is true if $n=2$. By continuity of $S\mapsto\sqrt S$, we may assume that $S$ is positive definite. Denoting
$$\sqrt S=\begin{pmatrix} a & b \\ b & c \end{pmatrix},$$
we do have $a,c>0$. Because $s_{12}=b(a+c)$ is $\ge0$, we infer $b\ge0$.

REPLY [31 votes]: Robert Bryant already showed via an example that the answer is "no". To come up with lots of counterexamples, recall that (under some mild assumptions) if $A$ has maximal eigenvalue $\lambda_{\text{max}}$ and corresponding unit eigenvector $\mathbf{v}$ then $(A/\lambda_{\text{max}})^k \rightarrow \mathbf{v}\mathbf{v}^*$ as $k \rightarrow \infty$.
So if you pick any matrix that is (a) positive semidefinite with a negative entry, and (b) has a unique maximal eigenvalue with corresponding entrywise positive eigenvector, then repeatedly squaring $A$ will eventually give a counterexample to the original question.

REPLY [26 votes]: No.  If $$A = \begin{pmatrix}10&-1&5\\-1&10&5\\5&5&10\end{pmatrix},$$ then $A$ is positive definite but does not have all entries positive, while
$$
A^2 = \begin{pmatrix}126&5&95\\5&126&95\\95&95&150\end{pmatrix}
$$
is positive in both senses.