  Calculating the trace of the product of $m$ $n$-qubit density matrices
(multivariate trace) is a crucial subroutine in quantum error mitigation and
information measures estimation. We propose an unified multivariate trace
estimation (UMT) which conceptually unifies the previous qubit-optimal and
depth-optimal approaches with tunable quantum circuit depth and the number of
qubits. The constructed circuits have $\lceil(m-1)/s\rceil$ or
$n\lceil(m-1)/s\rceil$ depth corresponding to $(s+m)n$ or $s+mn$ qubits for
$s\in\{1,\cdots,\lfloor m/2\rfloor\}$, respectively. Such flexible circuit
structures enable people to choose suitable circuits according different
hardware devices. We apply UMT to virtual distillation for achieving
exponential error suppression and design a family of concrete circuits to
calculate the trace of the product of $8$ and $9$ $n$-qubit density matrices.
Numerical example shows that the additional circuits still mitigate the noise
expectation value under the global depolarizing channel.
