Is there a matrix $B$ such that $B^2=A$, with $A$ being diagonalizable?

I have the following matrix: $$\begin{pmatrix} 0 & -7 & 1 \\ 0 & 4 & 0 \\ -2 & 1 & 3 \\ \end{pmatrix}$$ I already found the eigenvalues which are $$\lambda_1=1$$ $$\lambda_2=2$$ $$\lambda_3=4$$ They are distinct so the matrix is clearly diagonalizable. I know a matrix is similar to its diagonal matrix so we can write this as follows: $$A= PDP^{-1}$$ We also have that : $$A^n=PD^nP^{-1}$$ Now is it possible to find $B$ such that $B^2=A$ ? I have been trying to use the fact that $A$ is similiar to its diagonal, but i do not know if i have to use that or not.

Try to compute $(PD^\frac12P^{-1})^2$
• I see, it need not be the case, for example, let $A=-1$, unless you want to work with complex number, it doesn't exist for $n=2$. – Siong Thye Goh Mar 23 '18 at 5:30
• sure, I was referring to the scalar $-1$ having no real square root. – Siong Thye Goh Mar 23 '18 at 16:30