Search code examples
fortranlapackblas

Raise a matrix to a power


Suppose we have a Hermitian matrix A that is known to have an inverse.

I know that ZGETRF and ZGETRI subroutines in LAPACK library can compute the inverse matrix.

Is there any subroutine in LAPACK or BLAS library can calculate A^{-1/2} directly or any other way to compute A^{-1/2}?


Solution

  • You can raise a matrix to a power following a similar procedure to taking the exponential of a matrix:

    1. Diagonalise the matrix, to give the eigenvectors v_i and corresponding eigenvalues e_i.
    2. Raise the eigenvalues to the power, {e_i}^{-1/2}.
    3. Construct the matrix whose eigenalues are {e_i}^{-1/2} and whose eigenvectors are v_i.

    It's worth noting that, as described here, this problem does not have a unique solution. In step 2 above, both {e_i}^{-1/2} and -{e_i}^{-1/2} will lead to valid solutions, so an N*N matrix A will have at least 2^N matrices B such that B^{-2}=A. If any of the eigenvalues are degenerate then there will be a continuous space of valid solutions.