Bernstein-Vazirani decoding controlled by a quantum register Created 2026-10-06 Updated 2026-10-07
For a Boolean quantum oracle whose function is , place its target in . Conjugating the oracle by a Walsh-Hadamard transform on the register translates that register by . This is Bernstein-Vazirani phase kickback without measuring its output, so the index may remain in an arbitrary quantum superposition. A second application undoes the translation. A phase evaluation between the two calls therefore transfers a hidden-label-dependent phase to the index register while uncomputation returns the decoding register to zero.
Suppose a reversible circuit computes the angle bits in , where are known binary place values. Apply a controlled unitary gate to the target for each set angle bit. The rotations about the y-axis commute and their angles add, giving . Finally perform uncomputation of the angle and arithmetic workspace. An -bit angle needs controlled rotations and twice the reversible angle-computation cost. This preserves coherent superpositions of inputs and underlies the HHL controlled reciprocal rotation.
HHL controlled reciprocal rotation 2026-10-05
On a positive eigenvalue label and a clean quantum ancilla, the HHL algorithm applies a quantum variable rotation with angle , where :Uncomputation of the eigenvalue register followed by conditioning on flag one multiplies each input eigenvector amplitude by . If is normalized, the success probability is . Choosing from a valid condition number bound gives success probability at least .
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 1 a Solution Created 2026-10-03 Updated 2026-10-07
Cyclic periodicity on implies that the least positive period divides : the shifts preserving the function form a subgroup of the cyclic group. Injectivity within one period says that distinct residue classes modulo have distinct function values. Write .
Prepare the uniform superposition state by applying the quantum Fourier transform to , and evaluate reversibly into a second quantum register. This is efficient because the given classical Boolean circuit can be converted into a reversible circuit, with its workspace cleaned by uncomputation. The resulting quantum state isMeasuring the function quantum register leaves a uniform coset state for some . The amplitude at after a quantum Fourier transform isThe finite geometric series is zero unless is a multiple of , and then equals . Thus a computational-basis measurement produces a uniform Fourier sampleThe exact period recovery from a Fourier sample computesA greatest common divisor is computable in time polynomial in . The candidate is always a divisor of the true period, and equals it precisely when is coprime to .
For the success flag, compute and compare with . If , injectivity within the first period makes these unequal. If , periodicity makes them equal, including . Hence accept and output exactly when this comparison succeeds; otherwise report failure. This is heralded exact quantum period finding when the period divides the register size, with no false acceptance. The case succeeds even on the sample .
The exact success probability iswhere is the Euler totient function. For , the prime-product formula gives . A Rosser–Schoenfeld totient bound supplies the needed lower bound for large . Every single attempt, including verification, has the assumed polynomial-in- gate cost. Repeating times gives constant success probability with a certified result whenever one is found.
The printed in the totient hint should be a lower-bound statement, . Literally, is false: at primes , . Likewise the exact single-sample success probability need not be ; for prime period it tends to one. The useful intended guarantee is the displayed inverse-log-log lower bound, not a universal upper bound. If an algorithm satisfying the literal success upper bound is desired, one can additionally accept an otherwise certified run only when independent fair bits are all zero. This retains a detectable failure flag and polynomial runtime, and has success at most , but deliberately weakens the useful guarantee. The standard unsuppressed algorithm above gives the stronger intended performance. Small can be handled directly. Primary evidence for the totient lower bound is Theorem 15, equations (3.41)–(3.42), in denisevellachemla.eu/Rosser-Schoenfeld-1962.pdf .
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 61 1 b ii Solution Created 2026-10-03 Updated 2026-10-06
The linear decoding must be done coherently, so its output is available inside the next Boolean quantum oracle call. Use registers of qubits and a shared phase ancilla qubit in . Define the Bernstein-Vazirani decoding controlled by a quantum registerThe ancilla qubit is implicit. For every computational index , the Walsh-Hadamard transform calculation givesIn particular on these states. Initialize to and to . The three query stages areThe middle equality uses the matching index , not a classical guess of that string. The second performs uncomputation, removing the hidden-string register without losing its phase on . Apply to to obtainThis requires precisely two queries to and one to , and only additional fixed quantum gates. No measurement of is made: such a measurement would spoil the required coherence. Preparing all registers and the phase ancilla qubit uses only the initially available zero states.
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 61 3 iii Solution Created 2026-10-03 Updated 2026-10-06
The binary phase is . ThereforeOn the phase register, apply the tensor product of phase gatesIts action on is multiplication by . Thus the positive-phase fractional power of a unitary operator is implemented by uncomputation after coherent phase estimation:HenceThe inverse phase-estimation circuit uses controlled powers of built from the supplied inverse oracle, with all other quantum gates reversed. No phase-register measurement is made, so arbitrary superpositions are preserved and the ancilla qubits return to zero. The straightforward implementation uses controlled-unitary queries plus the Fourier and phase circuitry; the arbitrary phase gates are accepted exactly as stipulated.
The branch convention matters. This construction uses the phase representative specified here, corresponding to argument in . It implements that explicitly defined root, even for . The usual complex principal branch with argument in would choose a different root on some eigenvalues. No substitution of that alternative branch is implicit.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 324 1 a Solution Created 2026-10-03 Updated 2026-10-06
Use the positive-exponent quantum Fourier transform convention . The period of a function here is the least positive translation leaving the function unchanged on the cyclic group . The injective promise means exactly when . In particular : the subgroup of period translations is generated by , and wrapping the argument by preserves its value. This is exact quantum period finding on a finite cyclic group, rather than the truncated, nondividing-period version requiring continued fractions.
Prepare a uniform superposition state in the first quantum register using , and perform a reversible computation of the function into a second quantum register, cleaning its workspace by uncomputation:A quantum measurement in the computational basis of the second quantum register leaves a periodic coset state in the first:For the quantum Fourier transform of this periodic coset state, the finite geometric series vanishes unless the measured label is . On those labels its normalized amplitude is . Thus has the uniform distribution on a finite set on , irrespective of .
Compute the greatest common divisor by the Euclidean algorithm, and set , with . Since ,The exact period recovery from a Fourier sample is therefore certified by testing . Every candidate divides and lies between and , so the injective promise makes that equality equivalent to . This includes , where the test uses input , and , which always succeeds. The test does not assert that an arbitrary equality of function values certifies an arbitrary period; the Fourier-derived divisor restriction is essential.
The concise result isHere is the Euler totient function, with . The totient lower bound from the Mertens product gives for . Each trial uses polynomial time quantum Fourier transforms, function evaluations and Euclidean algorithm arithmetic in . Repeating independent trials gives constant success probability; the herald accepts only correct answers.
The printed asymptotic bound has the wrong direction for this argument. In Big O notation, the stated upper bound on the number of coprime integers supplies no success lower bound and is itself false uniformly: for prime , , not . Likewise the single-trial success need not be , since it tends to one for prime. The meaningful corrected guarantee is the lower bound above. If an upper-bounded success rate is literally required, one may deliberately retain an accepted result with an independent probability proportional to ; this discards useful successes and is unnecessary for efficient recovery.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 324 3 b ii Solution Created 2026-10-03 Updated 2026-10-06
Apply to the data and phase quantum registers, leaving the flag quantum ancilla untouched. This inverse needs no extra oracle assumption: the promised dyadic eigenvalues give , hence . The inverse of each controlled unitary gate used in can therefore be built from repeated uses of the supplied controlled-, and the known Hadamard gates and quantum Fourier transform gates can be reversed. Uncomputation is necessary to erase the eigenvalue label coherently. The resulting quantum state isA quantum measurement in the computational basis of the flag followed by postselection on one yieldsThis requires . For a normalized input and nonnegative eigenvalues, the success probability of positive quantum spectral filtering satisfies . In the general inequality, equality holds precisely when the input is supported on the minimum-eigenvalue eigenspace. Omitting uncomputation and discarding the phase quantum register would instead leave a mixed state with diagonal weights proportional to , rather than the desired coherent pure state.
The printed universal nonzero-success request needs a nonkernel-input hypothesis. An -qubit Hermitian operator has eigenvalues, counted with multiplicity. All are distinct, and the printed dyadic grid contains exactly possible values. They therefore occupy the entire grid, including zero: this is a multiplicity-free complete dyadic spectrum, and . Taking , , and satisfies every printed spectral promise but gives . No normalized output vector exists, so no algorithm can deliver it with nonzero probability.
For every input outside the kernel, the procedure above has , giving the requested strict bound on the meaningful domain. The corrected result is therefore exact quantum spectral filtering conditional on , with the boxed probability. This does not require knowing the input probability amplitudes or making extra copies of an unknown quantum state. Arbitrarily small nonzero support outside the kernel gives arbitrarily small success probability, and a failed flag measurement disturbs the input; fresh independent trials cannot be assumed when only one unknown physical input is supplied.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 324 2 b iii Solution Created 2026-10-03 Updated 2026-10-05
Let the known phase gate on the answer register bewhere the comparison uses ordinary integers, not modular arithmetic. A reversible circuit computes the predicate, applies a Pauli Z gate to its flag, then performs uncomputation.
The compute-phase-uncompute construction now givesUse modular-oracle inversion by negation to realize the last operation with one further query. Exactly two oracle queries implement , returning the answer register and comparison workspace to their initial states.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 324 4 a ii Solution Created 2026-10-03 Updated 2026-10-05
Write the normalized input as , where and . Use a data register, an -qubit eigenvalue register, and a flag quantum ancilla. Begin with .
Apply exact quantum phase estimation to . Its controlled evolutions and inverse quantum Fourier transform produceApply the HHL controlled reciprocal rotation, with :The function of is computed by quantum arithmetic; the rotation is a quantum variable rotation. On a zero eigenvalue label with no input amplitude, define any unitary action, for example no rotation.
Run the inverse phase-estimation circuit. Because each amplitude multiplier depends only on , the eigenvalue register is reset to on both flag branches. Measuring the flag and conditioning on outcome one leavesThe successful unnormalized branch is , giving the probability in the preceding part. The operations independent of are the Hadamard gates preparing the phase register, the inverse quantum Fourier transform, the reversible reciprocal/angle arithmetic, the controlled fixed-angle rotations, and the final flag measurement. Uncomputation removes all arithmetic workspace; the -dependent controlled evolutions and the -dependent state-preparation circuit supply the input-specific operations.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 324 4 b Solution Created 2026-10-03 Updated 2026-10-05
Use a reversible circuit to compute an -bit representation of the angle into a workspace register, with all additional work bits retained:Write that representation as , with known binary place values (including the fixed scale and any integer bit). On the target, apply a controlled unitary gate controlled by each angle bit . Rotations about the same axis add their angles, so their product isFinally apply to perform uncomputation. The workspace returns to zero while the control register and rotated target remain unchanged; the construction works coherently on every superposition of .
A polynomial time classical calculation has a polynomial-size reversible circuit with Toffoli gates, and each Toffoli gate has a constant-size decomposition into one-qubit and two-qubit gates. The controlled rotations are themselves two-qubit gates. Thus the total quantum circuit size is . This is the binary-angle implementation of a quantum variable rotation; the stipulated angle precision is understood.
Past exam of the mathematics course of the University of Cambridge 2024 iii Paper 324 4 c Solution 2026-09-25
Implement the assumed efficient classical algorithm for as a reversible circuit. On input , it computes an -bit binary expansion of the angle in a work register using Toffoli gates and elementary reversible gates. Write the computed angle as a sum of binary-weighted angles. For each angle bit, apply the corresponding controlled single-qubit rotation to the target. These rotations have the same axis, so their angles add and produceFinally apply uncomputation to erase the work register. Each Toffoli gate and controlled rotation has a constant-size decomposition into one- and two-qubit gates when arbitrary one-qubit rotations are available. Ignoring the stipulated precision costs, the resulting circuit has size and returns every quantum ancilla to zero.
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 324 3 c Solution Created 2026-09-24 Updated 2026-09-25
Start with and a zeroed second register. Apply the coherent construction from part (a)(iv) to obtainNow run the inverse of the phase-estimation map from part (b) on the two registers. It erases the first label in both branches:Discarding the zeroed register leaves the required quantum Fourier transform of the superposition. The coherent use of a computed label followed by its inverse is an uncomputation.
Permutation-preimage quantum search 2026-10-06
To find an input of a permutation whose output lies in a known -element subset, compute the output, apply its marked-state phase oracle, and use uncomputation. A modular-addition quantum oracle costs two forward queries per marked reflection, because modular-oracle inversion by negation supplies its inverse. Amplitude amplification then uses queries for fixed success probability. Positive-square outputs have and hence query cost .
Quantum register 2026-10-06
A quantum register is a named tensor product factor of a quantum circuit's Hilbert space, usually a collection of qubits. Registers separate data, control, output and workspace roles; uncomputation returns workspace to a fixed quantum state without destroying coherence in the data.
Quantum spectral filtering 2026-10-06
Let a Hermitian operator have dyadic eigenvalues in for known , with controlled access to the unitary operator . This interval ensures that different eigenvalues have different eigenphases; exact representability alone would not exclude phase aliasing, as and both give phase zero. Let a real function obey , and assume the required quantum variable rotations are available. Coherent exact quantum phase estimation, a quantum variable rotation and uncomputation implementPostselection on flag one gives normalized, with probability , provided this vector is nonzero. Erasing the eigenvalue label by uncomputation is essential to preserve coherence between different eigenvectors. On this dyadic spectrum, gives , so reversing the phase-estimation gates is possible using forward controlled- calls. The choice multiplies by ; a scaled reciprocal gives the different filter used in the HHL algorithm.
Reversible computation 2026-09-25
A reversible computation has an injective transition function, so its preceding configuration can be recovered from its current configuration. Any finite classical computation can be simulated reversibly while retaining enough workspace to uncompute its temporary results.
Let , where a reversible circuit computes into a clean register. Then applying as a phase on that register and performing uncomputation implements on the data register. For , a Boolean output qubit suffices: acts as when that qubit starts in . This exact construction avoids a Lie-Trotter product formula because the eigenvalue is computed directly.