The mixed-state expression in the PDF contains a mismatched bra in its second term. A probability mixture of the stated orthonormal eigenvectors must be interpreted as . Taken literally with a different bra, it need not be Hermitian or positive and is not generally a density operator.
Let . A quantum channel and its measurement probabilities are linear in the density operator, so averaging the pure-state results gives
Therefore the same frequency estimator yields
More generally, after the controlled operation and before the final Hadamard gate, the reduced control density operator is
This follows by a partial trace of the control blocks , , and . It proves the mixed-state Hadamard-test quadratures for any auxiliary density operator, even one not diagonal in the eigenbasis. Conjugation by the final Hadamard gate maps to and to , explaining the imaginary-part sign.
Prepare the auxiliary register in the maximally mixed state and estimate both mixed-state Hadamard-test quadratures. Multiplying the normalized expectation by estimates the trace of . A uniformly randomized preparation of any orthonormal basis produces ; the eigenvectors of need not be known.