Approximate quantum counting 2026-10-24
Approximate quantum counting estimates the number of satisfying assignments of a Boolean function, using a quantum oracle and quantum measurement. Controlled repetitions of a Grover search algorithm iteration let quantum interference reveal the count. For one input bit, a Hadamard test can give Pauli Z gate expectation value : with the complemented phase oracle and , use to obtain . Repeated preparations estimate this expectation value; one binary measurement result does not distinguish all three counts .
Mixed-state Hadamard-test quadratures 2026-10-14
For the Hadamard test with a density operator in the auxiliary register, the output control qubit has Pauli Z gate expectation and Pauli Y gate expectation , where . The minus sign comes from the final Hadamard gate, since . Measuring in therefore estimates the imaginary part using the minus-outcome frequency minus the plus-outcome frequency.
Define the Hadamard basis states . The initial two Hadamard gates prepare . For one bracket, the two control branches giveUsing the Pauli X gate , unitary conjugation by the Hadamard gate gives , so . Keeping every sign, the target states along the control-one branch, in the exact gate order, areThe last column also includes the final target Hadamard gate, which lies outside the bracket. Writing , applying the final top Hadamard gate gives the exact normalized two-qubit quantum stateThus the complete outputs, in top-then-bottom computational basis order, areFor the first qubit, the Pauli matrix has expectation value by the Born rule. The two cases each have , while the and cases are deterministic. Equivalently, this Hadamard test measuresThis explains the approximate quantum counting interpretation: repeated preparations estimate the expectation value, and hence . A single top-qubit computational-basis measurement need not identify .
Read the source network as a Hadamard test: a Hadamard gate on the first qubit, a controlled unitary gate with the first qubit as control, and another Hadamard gate on that control. Starting from , the successive quantum states areApply b to the last line. Since by unitarity,For the Pauli Z gate observable on the first qubit, the two eigenvalues are and . ThusAs a check, returns outcome zero certainly, while returns one certainly. The controlled unitary gate makes this relative phase measurable even though multiplying an isolated system's quantum state by is only a global phase.
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 givesHenceThe 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 .
Past exam of the mathematics course of the University of Cambridge 2023 iii Paper 324 2 a Solution 2026-09-28
Efficiently prepare the normalized amplitude encoding .
Apply quantum phase estimation to the simulated evolution , producing an approximation of each eigenvalue: Add one ancilla and perform an eigenvalue-controlled rotationwhere .
Uncompute the eigenvalue register. Conditional on measuring the ancilla as , the system register isThe postselection probability can be increased with amplitude amplification.
Apply quantum phase estimation to the simulated evolution , producing an approximation of each eigenvalue: Add one ancilla and perform an eigenvalue-controlled rotationwhere .
Uncompute the eigenvalue register. Conditional on measuring the ancilla as , the system register isThe postselection probability can be increased with amplitude amplification.
The ingredients used here are efficient sparse Hamiltonian simulation of and quantum phase estimation, which converts an eigenphase of that evolution into a binary approximation of . For sparsity , condition number , and error , the cost is polynomial in , , , and under the stated access assumptions.
Finally estimate by repeated measurement of an efficient observable decomposition of , or by a Hadamard test when is unitary. A general efficiently block-encoded Hermitian can similarly be measured through its block encoding. Repetition and a concentration inequality give additive sampling error after independent preparations.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 15D d Solution Created 2026-09-24 Updated 2026-09-25
After the first Hadamard gate and the controlled unitary gate, the state isThe final Hadamard gate givesHence the Hadamard test returns one with probabilityIf , then and the outcome is zero with certainty. If , then modulo and the outcome is one with certainty. The single measurement therefore distinguishes the two promised cases exactly.
Past exam of the mathematics course of the University of Cambridge 2025 ii Paper 1 10C c Solution Created 2026-09-24 Updated 2026-09-25
Both and are unitary and Hermitian, so their expectations are real. Run the real-part Hadamard test twice, once with controlled and once with controlled . If the respective ancilla outcome-one probabilities are and , thenThe identity in part (b) implements each controlled tensor product by gates on its two target wires with the common control. By linearity,