The "Possible Issues" section of the documentation for MatrixFunction lists several possible ways in which a call to MatrixFunction can fail or not have a well-defined answer, and it gives clear error messages for each. But I just called MatrixFunction[Sqrt, {{0, 1}, {0, 0}}] and got the cryptic error message

StringForm::sfr: Item 1 requested in "Cannot compute the matrix function for the function 1." out of range; 0 items available"

MatrixFunction::nosol: Cannot compute the matrix function for the function 1.

This error mode is not discussed in the documentation for MatrixFunction. I understand why the function call should fail, since the matrix does not actually have a square root. But I don't understand this error message. Where is it getting "the function 1" from? 1 is not a function.

  • 1
    $\begingroup$ Try MatrixFunction[Power[#, 1/2] &, {{0, 1}, {0, 0}}] -- there seems to be a mathematical problem with the square-root function (that it does not have a power series expansion about the eigenvalue 0). $\endgroup$
    – Michael E2
    Feb 24, 2020 at 13:36

1 Answer 1


That specific message being thrown is a bug, please report it.

On the other hand, consider the general formula for the matrix function of a Jordan block (see e.g. this reference):

MatrixFunction[f, {{x, 1}, {0, x}}]
   {{f[x], f'[x]}, {0, f[x]}}

Recalling that Sqrt'[x] == 1/(2 Sqrt[x]) and that we are considering the value x == 0, you can immediately see why this evaluation is not supposed to work.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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