r"""Compute eigenvectors of transition matrix.

    Parameters
    ----------
    T : (d, d) ndarray
        Transition matrix (stochastic matrix)
    k : int or tuple of ints, optional
        Compute the first k eigenvalues of T
    right : bool, optional
        If right=True compute right eigenvectors, left eigenvectors
        otherwise
    reversible : bool, optional
        Indicate that transition matrix is reversible
    mu : (d,) ndarray, optional
        Stationary distribution of T

    Returns
    -------
    eigvec : (d, n) ndarray
        The eigenvectors of T ordered with decreasing absolute value
        of the corresponding eigenvalue. If k is None then n=d, if k
        is int then n=k otherwise n is the length of the given tuple
        of eigenvector indices

    Notes
    -----
    Eigenvectors are computed using the numpy.linalg interface for the
    corresponding LAPACK routines.

    If reversible=True the the eigenvectors of the similar symmetric
    matrix `\sqrt(\mu_i / \mu_j) p_{ij}` will be used to compute the
    eigenvectors of T.

    The precomputed stationary distribution will only be used if
    reversible=True.

def eigenvectors(T, k=None, right=True, reversible=False, mu=None):
    r"""Compute eigenvectors of transition matrix.

    Parameters
    ----------
    T : (d, d) ndarray
        Transition matrix (stochastic matrix)
    k : int or tuple of ints, optional
        Compute the first k eigenvalues of T
    right : bool, optional
        If right=True compute right eigenvectors, left eigenvectors
        otherwise
    reversible : bool, optional
        Indicate that transition matrix is reversible
    mu : (d,) ndarray, optional
        Stationary distribution of T

    Returns
    -------
    eigvec : (d, n) ndarray
        The eigenvectors of T ordered with decreasing absolute value
        of the corresponding eigenvalue. If k is None then n=d, if k
        is int then n=k otherwise n is the length of the given tuple
        of eigenvector indices

    Notes
    -----
    Eigenvectors are computed using the numpy.linalg interface for the
    corresponding LAPACK routines.

    If reversible=True the the eigenvectors of the similar symmetric
    matrix `\sqrt(\mu_i / \mu_j) p_{ij}` will be used to compute the
    eigenvectors of T.

    The precomputed stationary distribution will only be used if
    reversible=True.

    """
    if reversible:
        eigvec = eigenvectors_rev(T, right=right, mu=mu)
    else:
        eigvec = eigenvectors_nrev(T, right=right)

    """ Return eigenvectors """
    if k is None:
        return eigvec
    elif isinstance(k, numbers.Integral):
        return eigvec[:, 0:k]
    else:
        ind = np.asarray(k)
        return eigvec[:, ind]