According to Wikipedia a square root of a 2×2 matrix M is another 2×2 matrix R such that M = R^2. In general, there can be zero, two, four, or even an infinitude of square-root matrices.
I tried to use MatrixPower
with n=1/2
with a classic case of 4 solutions (determinant and trace are non zero) but it returns only one solution... (Mathematica 11.0)
MatrixPower[{{17, -16}, {-8, 9}}, 1/2]
(* return 1 solution {{11/3, -(8/3)}, {-(4/3), 7/3}} *)
What about the other 3 ? How to get the four of them ?
In:= MatrixPower[{{-3, 4}, {2, -1}}, 2]
In:= MatrixPower[{{3, -4}, {-2, 1}}, 2]
In:= MatrixPower[{{11/3, -(8/3)}, {-(4/3), 7/3}}, 2]
In:= MatrixPower[{{-(11/3), 8/3}, {4/3, -(7/3)}}, 2]
Out= {{17, -16}, {-8, 9}}
Of course, I can try Solve[MatrixPower[{{a, b}, {c, d}}, 2] == {{17, -16}, {-8, 9}}, {a, b, c, d}]
and I'll get 4 solutions, but... why MatrixPower
has such undocumented limitation ?
Does anybody know a clever command to overcome this behavior or should I write a dedicated function to handle these cases ?
Power[]
orMatrixPower[]
are evaluated, only the principal root is taken. $\endgroup$Sqrt[4]
also only gives us one solution ($+2$) even though there are two ($+2$ and $-2$) available. $\endgroup$MatrixPower
returned anything other than a matrix; any other behavior would make it useless. So that "limitation" is both by design and utterly necessary. $\endgroup$