def stochastic_lanczos_quad(A: LinearOperator, fun: Callable, max_iters: int = 100, tol: float = 1e-5, vtol=0.1,
                            pbar: bool = False, key=None):
    """
    Approximates trace(f(A)) for a positive definite operator A and a given function
    f().

    Args:
        A (LinearOperator): A symmetric linear operator of size (n, n).
        fun (Callable): The function to apply to the eigenvalues.
        max_iters (int): The maximum number of iterations to run Lanczos.
        tol (float, optional): Lanczos stopping criteria. (Bias tolerance)
        vtol (float, optional): Variance tolerance for the stochastic estimate.
        pbar (bool, optional): Show a progress bar.

    Returns:
        float: The approximate value of trace(f(A)).
    """
    # TODO: bwds has a bug because it assumes f is log
    num_samples = max(int(1 / vtol**2), 1)
    return slq_fwd(A, fun, num_samples=num_samples, max_iters=max_iters, tol=tol, pbar=pbar, key=key)

    Approximates trace(f(A)) for a positive definite operator A and a given function
    f().

    Args:
        A (LinearOperator): A symmetric linear operator of size (n, n).
        fun (Callable): The function to apply to the eigenvalues.
        max_iters (int): The maximum number of iterations to run Lanczos.
        tol (float, optional): Lanczos stopping criteria. (Bias tolerance)
        vtol (float, optional): Variance tolerance for the stochastic estimate.
        pbar (bool, optional): Show a progress bar.

    Returns:
        float: The approximate value of trace(f(A)).
    
cola/linalg/tbd/slq.py