  Estimating nonlinear functions of quantum states, such as the moment
$\tr(\rho^m)$, is of fundamental and practical interest in quantum science and
technology. Here we show a quantum-classical hybrid framework to measure them,
where the quantum part is constituted by the generalized swap test, and the
classical part is realized by postprocessing the result from randomized
measurements. This hybrid framework utilizes the partial coherent power of the
intermediate-scale quantum processor and, at the same time, dramatically
reduces the number of quantum measurements and the cost of classical
postprocessing. We demonstrate the advantage of our framework in the tasks of
state-moment estimation and quantum error mitigation.
