2
$\begingroup$

How to compute the square root of the matrix

Rho = {{Wxx, Wxy, Wxz}, {Wyx, Wyy, Wyz}, {Wzx, Wzy, Wzz}}

if not all of its elements are real?

$\endgroup$
7
$\begingroup$

Not all matrices have a square root matrix, but you can try:

Rho = {{Wxx, Wxy, Wxz}, {Wyx, Wyy, Wyz}, {Wzx, Wzy, Wzz}};
MatrixPower[Rho, 1/2]

You can achieve the same result through diagonalization of Rho into $V\Lambda V^{-1}$ then taking the square root of the eigenvalues to give $V\Lambda^{1/2} V^{-1}$:

val = Eigenvalues[Rho];
vec = Eigenvectors[Rho]; (* each vec needs to be a column so use transpose *)
Transpose[vec].Sqrt[DiagonalMatrix[val]].Inverse[Transpose[vec]]
$\endgroup$
5
  • $\begingroup$ Simplify will shorten this considerably. $\endgroup$
    – Bob Hanlon
    May 27 '20 at 21:32
  • $\begingroup$ @flinty Can you please explain this sentence "then taking the square root of the eigenvalues to give..."? $\endgroup$
    – Bekaso
    May 27 '20 at 21:48
  • 1
    $\begingroup$ You put your eigenvalues in a diagonal matrix $$\Lambda=\left( \begin{array}{ccc} \lambda _1 & 0 & 0 \\ 0 & \lambda _2 & 0 \\ 0 & 0 & \lambda _3 \\ \end{array}\right)$$ Then raise that matrix to the power 1/2. It's diagonal, so you just have $$\Lambda^{1/2}=\left(\begin{array}{ccc}\sqrt{\lambda _1} & 0 & 0 \\ 0 & \sqrt{\lambda_2} & 0 \\ 0 & 0 & \sqrt{\lambda _3} \\ \end{array}\right) $$ $\endgroup$
    – flinty
    May 27 '20 at 21:58
  • 1
    $\begingroup$ This of course assumes the starting matrix is not defective. Otherwise, you would need to use the Jordan form instead of the eigendecomposition. $\endgroup$
    – J. M.'s torpor
    May 28 '20 at 5:41
  • $\begingroup$ Relevant MathematicsSE answer for taking the power if you have the Jordan form: math.stackexchange.com/questions/910635/… $\endgroup$
    – flinty
    May 28 '20 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.