def METHOD_NAME(CM, thrsh=0.001, verbose=False):
    """Compute inverse square root (C^{-0.5} of matrix."""
    spl = pg.optImport('scipy.linalg', 'scipy linear algebra')
    if spl is None:
        return None
    t = time.time()
    e_vals, e_vecs = spl.eigh(CM)
    if verbose:
        print('(C) Calculation time for eigenvalue decomposition:\n%s sec' %
              (time.time()-t))
    t = time.time()
    A = spl.inv(np.diag(np.sqrt(np.real(e_vals))))
    if verbose:
        print('(C) Calculation time for inv(diag(sqrt)):\n%s sec' %
              (time.time()-t))
    t = time.time()
    gemm = spl.get_blas_funcs("gemm", [e_vecs, A])
    B = gemm(1, e_vecs, A)
    if verbose:
        print('(C) Calculation time for dot 1:\n%s sec' % (time.time()-t))
    t = time.time()
    gemm2 = spl.get_blas_funcs("gemm", [B, np.transpose(e_vecs)])
    if verbose:
        print('gemm test:\n%s sec' % (time.time()-t))
    CM05 = gemm2(1, B, np.transpose(e_vecs))
    if verbose:
        print('(C) Calculation time for dot 2:\n%s sec' % (time.time()-t))
    if thrsh:
        nModel = len(CM)
        RCM05 = pg.matrix.SparseMapMatrix(nModel, nModel)
        for i in range(nModel):
            for j in range(nModel):
                if np.abs(CM05[i][j]) > thrsh:
                    RCM05.setVal(i, j, CM05[i][j])
        return RCM05
    else:
        return CM05  # not making sense as constraints matrix