Square root of matrix

The concept of square root can be generalized from scalars to (symmetric and nonnegative definite) matrices. For any symmetric and nonnegative matrix $$A$$, there exists a symmetric and nonnegative definite matrix $$R$$ such that $$A=R^2$$. Moreover, $$R$$ is unique and is expressible as

$$R = Q \text{diag}(\sqrt{d_1}, \sqrt{d_2}, \dots, \sqrt{d_n})Q'$$

where $$A = Q \text{diag}({d_1}, {d_2}, \dots, {d_n})Q'$$ (T21.9.1 ).