Skip to main content
KetQat

Appearance

Equation · intermediate

Hadamard test

One ancilla prepared in |+>, a controlled-U and a measurement of the ancilla in the X (or Y) basis give the outcome +1 with probability (1 + Re Tr(rho U))/2 (or (1 + Im Tr(rho U))/2), so repeated runs estimate the expectation value of a unitary.

Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

Pr⁡[X=+1]=12(1+Re⁡Tr⁡(ρU)),Pr⁡[Y=+1]=12(1+Im⁡Tr⁡(ρU))\Pr[X = +1] = \tfrac12\big(1 + \operatorname{Re}\tr(\rho U)\big), \qquad \Pr[Y = +1] = \tfrac12\big(1 + \operatorname{Im}\tr(\rho U)\big)

For a pure target state ∣ψ⟩\ket{\psi}, controlled-UU maps ∣+⟩∣ψ⟩\ket{+}\ket{\psi} to 12(∣0⟩∣ψ⟩+∣1⟩U∣ψ⟩)\tfrac{1}{\sqrt2}(\ket{0}\ket{\psi} + \ket{1}U\ket{\psi}). Projecting the ancilla onto ∣+⟩\ket{+} leaves 12(∣ψ⟩+U∣ψ⟩)\tfrac12(\ket{\psi} + U\ket{\psi}), of squared norm 12(1+Re⁡⟨ψ∣U∣ψ⟩)\tfrac12(1 + \operatorname{Re}\bra{\psi}U\ket{\psi}); projecting onto (∣0⟩+i∣1⟩)/2(\ket{0} + i\ket{1})/\sqrt2 leaves 12(∣ψ⟩−iU∣ψ⟩)\tfrac12(\ket{\psi} - iU\ket{\psi}), of squared norm 12(1+Im⁡⟨ψ∣U∣ψ⟩)\tfrac12(1 + \operatorname{Im}\bra{\psi}U\ket{\psi}). Both are affine in ∣ψ⟩⟨ψ∣\ketbra{\psi}{\psi}, so for a mixed state ⟨ψ∣U∣ψ⟩\bra{\psi}U\ket{\psi} becomes Tr⁡(ρU)\tr(\rho U).

Each run is a ±1\pm 1 random variable with mean Re⁡Tr⁡(ρU)\operatorname{Re}\tr(\rho U) (or the imaginary part), so by Hoeffding's inequality N≥(2/η2)ln⁡(2/γ)N \ge (2/\eta^2)\ln(2/\gamma) runs estimate it to additive error η\eta with probability at least 1−γ1 - \gamma. For an eigenvector, Tr⁡(ρU)=e2πiφ\tr(\rho U) = e^{2\pi i\varphi}: this is the single-ancilla phase measurement of Kitaev, and replacing UU by U2sU^{2^s} yields one bit of information about 2sφ2^s\varphi, the building block of iterative phase estimation. It also appears as the one-control-qubit case of the analysis of Cleve, Ekert, Macchiavello and Mosca. It costs O(1/η2)O(1/\eta^2) runs, against the O(1/η)O(1/\eta) uses of UU of phase estimation.

Holds when

  • The controlled unitary is exactly ∣0⟩⟨0∣⊗I+∣1⟩⟨1∣⊗U\ketbra{0}{0}\otimes I + \ketbra{1}{1}\otimes U; a different global phase of UU changes the result.
  • ρ\rho is any state of the target register; for the YY-basis version the ancilla is measured in the basis (∣0⟩±i∣1⟩)/2(\ket{0} \pm i\ket{1})/\sqrt2.

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. A. Yu. Kitaev (1995). Quantum measurements and the Abelian stabilizer problem. arXiv:quant-ph/9511026
  2. Richard Cleve, Artur Ekert, Chiara Macchiavello, Michele Mosca (1998). Quantum algorithms revisited. Proceedings of the Royal Society A 454, 339-354. doi:10.1098/rspa.1998.0164arXiv:quant-ph/9708016

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Both outcome probabilities re-derived for pure states (projection onto |+> and onto (|0> + i|1>)/sqrt2) and extended to mixed states by linearity; the Hoeffding sample count N >= (2/eta^2) ln(2/gamma) for +-1 variables re-derived. Attribution compared with Kitaev arXiv:quant-ph/9511026 abstract (procedure for measuring an eigenvalue of a unitary) and Cleve-Ekert-Macchiavello-Mosca arXiv:quant-ph/9708016 Section 5 (which cites Kitaev's method as the motivation).

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 60d14f2a1e59dd94. Source file knowledge/records/equation/hadamard-test.md in the content repository (readable there once it is public).