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 (m − 1)/s or n (m − 1)/s depth corresponding to (s + m)n or s + mn qubits for s ∈ {1, • • • , m/2 }, 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.