

def _fractional_power_pade(R, t, m):
    '\n    Evaluate the Pade approximation of a fractional matrix power.\n\n    Evaluate the degree-m Pade approximation of R\n    to the fractional matrix power t using the continued fraction\n    in bottom-up fashion using algorithm (4.1) in [1]_.\n\n    Parameters\n    ----------\n    R : (N, N) array_like\n        Upper triangular matrix whose fractional power to evaluate.\n    t : float\n        Fractional power between -1 and 1 exclusive.\n    m : positive integer\n        Degree of Pade approximation.\n\n    Returns\n    -------\n    U : (N, N) array_like\n        The degree-m Pade approximation of R to the fractional power t.\n        This matrix will be upper triangular.\n\n    References\n    ----------\n    .. [1] Nicholas J. Higham and Lijing lin (2011)\n           "A Schur-Pade Algorithm for Fractional Powers of a Matrix."\n           SIAM Journal on Matrix Analysis and Applications,\n           32 (3). pp. 1056-1078. ISSN 0895-4798\n\n    '
    if ((m < 1) or (int(m) != m)):
        raise ValueError('expected a positive integer m')
    if (not ((- 1) < t < 1)):
        raise ValueError('expected -1 < t < 1')
    R = np.asarray(R)
    if ((len(R.shape) != 2) or (R.shape[0] != R.shape[1])):
        raise ValueError('expected an upper triangular square matrix')
    (n, n) = R.shape
    ident = np.identity(n)
    Y = (R * _fractional_power_pade_constant((2 * m), t))
    for j in range(((2 * m) - 1), 0, (- 1)):
        rhs = (R * _fractional_power_pade_constant(j, t))
        Y = solve_triangular((ident + Y), rhs)
    U = (ident + Y)
    if (not np.array_equal(U, np.triu(U))):
        raise Exception('internal inconsistency')
    return U

dataset/ETHPy150Open scipy/scipy/scipy/linalg/_matfuncs_inv_ssq.py _fractional_power_pade/original