  Time-dependent Hamiltonian simulation (TDHS) is a critical task in quantum
computing. Existing algorithms are generally biased with a small algorithmic
error $\varepsilon$, and the gate complexity scales as
$O(\text{poly}(1/\varepsilon))$ for product formula-based methods and could be
improved to be polylogarithmic with complicated circuit constructions. Here, we
develop an unbiased random compiler for TDHS by combining Dyson expansion, an
unbiased continuous sampling method for quantum evolution, and leading order
rotations, and it is free from algorithmic errors. Our method has the single-
and two-qubit gate complexity $O(\Lambda^2)$ with a constant sampling overhead,
where $\Lambda$ is the time integration of the Hamiltonian strength. We perform
numerical simulations for a spin model under the interaction picture and the
adiabatic ground state preparation for molecular systems. In both examples, we
observe notable improvements of our method over existing ones. Our work paves
the way to efficient realizations of TDHS.
