  We propose a method to compute spectral functions of generic Hamiltonians
using the density matrix renormalization group (DMRG) algorithm directly in the
frequency domain, based on a modified Krylov space decomposition to compute the
correction-vectors. Our approach entails the calculation of the root-N (N=2 is
the standard square root) of the Hamiltonian propagator using Krylov space
decomposition, and repeating this procedure N times to obtain the actual
correction-vector. We show that our method greatly alleviates the burden of
keeping a large bond dimension at large target frequencies, a problem found
with conventional correction-vector DMRG, while achieving better computational
performance at large N. We apply our method to spin and charge spectral
functions of t-J and Hubbard models in the challenging two-leg ladder geometry,
and provide evidence that the root-N approach reaches a much improved
resolution compared to conventional correction-vector.
