= Solution
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 $\rho=\sum_kp_k|u_k\rangle\langle u_k|$. Taken literally with a different bra, it need not be Hermitian or positive and is not generally a <density operator>.
Let $m=\sum_kp_ke^{i\phi_k}=\operatorname{Tr}(\rho U)$. A <quantum channel> and its measurement probabilities are linear in the <density operator>, so averaging the pure-state results gives
$$
P_0-P_1=\operatorname{Re}m,\qquad P_--P_+=\operatorname{Im}m.
$$
Therefore the same frequency estimator yields
$$
\boxed{\widehat m=(\widehat P_0-\widehat P_1)+i(\widehat P_--\widehat P_+).}
$$
More generally, after the controlled operation and before the final <Hadamard gate>, the reduced control <density operator> is
$$
\frac12\begin{pmatrix}1&\overline{\operatorname{Tr}(\rho U)}\\\operatorname{Tr}(\rho U)&1\end{pmatrix}.
$$
This follows by a <partial trace> of the control blocks $\rho$, $\rho U^\dagger$, $U\rho$ and $U\rho U^\dagger$. 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 $X$ to $Z$ and $Y$ to $-Y$, explaining the imaginary-part sign.
Back to article page