  An efficient Krylov subspace algorithm for computing actions of the $\varphi$
matrix function for large matrices is proposed. This matrix function is widely
used in exponential time integration, Markov chains and network analysis and
many other applications. Our algorithm is based on a reliable residual based
stopping criterion and a new efficient restarting procedure. For matrices with
numerical range in the stable complex half plane, we analyze residual
convergence and prove that the restarted method is guaranteed to converge for
any Krylov subspace dimension. Numerical tests demonstrate efficiency of our
approach for solving large scale evolution problems resulting from discretized
in space time-dependent PDEs, in particular, diffusion and convection-diffusion
problems.
