For second-qubit inputs and , c gives control expectation values and . Preparing the maximally mixed state is equivalent to choosing these inputs independently with equal probability and discarding the choice. Linearity of the density operator evolution and quantum measurement probabilities therefore gives
Hence
The factor two is essential: the Hadamard test directly estimates the normalized trace. More generally, a target density operator gives . This argument never requires knowledge of the eigenvectors of .
Yes. Replace the target qubit by a register of qubits and implement the controlled unitary gate
The algebra in c uses only normalization and unitarity, so for an arbitrary pure register quantum state it still gives . For a mixed register quantum state , linearity gives . With ,
Only the control qubit needs to be pure. A uniformly randomized computational basis preparation supplies the target maximally mixed state. This is the principle of trace estimation by a maximally mixed Hadamard test. The extension is algebraic; efficiently implementing controlled- still requires a known suitable gate construction. Moreover, estimating the unnormalized trace to fixed additive precision requires increasingly precise estimation of the normalized signal as grows. There is no automatic efficient reconstruction of all entries of .