def arnoldi(A: LinearOperator, start_vector=None, max_iters=100, tol: float = 1e-7, use_householder: bool = False,
            pbar: bool = False, key=None):
    """
    Computes the Arnoldi decomposition of the linear operator A, A = QHQ^*.

    Args:
        A (LinearOperator): A linear operator of size (n, n).
        start_vector (Array, optional): An initial vector to start Arnoldi of size (n, ).
         Defaults to a random probe.
        max_iters (int): The maximum number of iterations to run.
        tol (float, optional): Stopping criteria.
        use_householder (bool, optional): Use Householder Arnoldi iteration.
        pbar (bool, optional): Show a progress bar.
        key (PNRGKey, optional): PRNGKey for random number generation.

    Returns:
        tuple:
            - Q (Array): Unitary matrix of size (n, max_iters) or (b, n, max_iters)
            - H (Array): The upper Hessenberg matrix of size (max_iters, max_iters) or (b, max_iters, max_iters)
            - info (dict): General information about the iterative procedure.
    """
    xnp = A.xnp
    if start_vector is None:
        key = xnp.PRNGKey(42) if key is None else key
        start_vector = xnp.randn(A.shape[-1], dtype=A.dtype, device=A.device, key=key)
    if len(start_vector.shape) == 1:
        rhs = start_vector[:, None]
    else:
        rhs = start_vector
    if use_householder:
        Q, H, infodict = run_householder_arnoldi(A=A, rhs=rhs, max_iters=max_iters)
    else:
        init_val = init_arnoldi(xnp, rhs, max_iters=max_iters, dtype=A.dtype)
        Q, H, _, infodict = arnoldi_fact(A=A, init_val=init_val, max_iters=max_iters, tol=tol, pbar=pbar)
    if len(start_vector.shape) == 1:
        return Stiefel(Dense(Q[0])), Dense(H[0]), infodict
    else:
        H = xnp.vmap(Dense)(H)
        Q = Stiefel(xnp.vmap(Dense)(Q))
        return Q, H, infodict

    Computes the Arnoldi decomposition of the linear operator A, A = QHQ^*.

    Args:
        A (LinearOperator): A linear operator of size (n, n).
        start_vector (Array, optional): An initial vector to start Arnoldi of size (n, ).
         Defaults to a random probe.
        max_iters (int): The maximum number of iterations to run.
        tol (float, optional): Stopping criteria.
        use_householder (bool, optional): Use Householder Arnoldi iteration.
        pbar (bool, optional): Show a progress bar.
        key (PNRGKey, optional): PRNGKey for random number generation.

    Returns:
        tuple:
            - Q (Array): Unitary matrix of size (n, max_iters) or (b, n, max_iters)
            - H (Array): The upper Hessenberg matrix of size (max_iters, max_iters) or (b, max_iters, max_iters)
            - info (dict): General information about the iterative procedure.
    
cola/linalg/decompositions/arnoldi.py