@staticmethod 
    def matrixPowerh(A, n):
        Parameter.checkClass(A, numpy.ndarray)
        tol = 10**-10

        lmbda, V = scipy.linalg.eigh(A)
        lmbda[numpy.abs(lmbda) < tol] = 0
        lmbda[numpy.abs(lmbda) > tol] = lmbda[numpy.abs(lmbda) > tol]**n
        # next line uses the fact that eigh claims returning an orthonormal basis (even if 
        #one sub-space is of dimension >=2) (to be precise, it claims using dsyevd which claims returning an orthonormal matrix)
        return (V*lmbda).dot(V.T)
Compute the matrix power of A using the exponent n. The computation simply
dataset/ETHPy150Open charanpald/APGL/apgl/util/Util.py/Util.matrixPowerh