Amplitude amplification Created 2026-09-24 Updated 2026-10-13
Amplitude amplification increases the probability of obtaining an answer accepted by a specified Boolean function. It requires a coherent preparation , its inverse, and a marked-state phase oracle that negates accepted components. Alternating that sign change with a reflection operator about the prepared state directs interference toward the accepted subspace. Brassard, Høyer, Mosca, and Tapp developed the general framework, extending Grover's algorithm beyond a uniform quantum superposition. [ref]
https://arxiv.org/abs/quant-ph/0005055. Brassard et al., Quantum Amplitude Amplification and Estimation, 2000, §2
.If a normalized quantum state has good amplitude , the product of the reflection in the bad axis and the reflection in the state line rotates its good-bad plane by . After iterations the good probability isso iterations raise a small good amplitude close to one. Success subsequently oscillates, making the stopping time part of the algorithm.
Compute the exact Grover search on four entries directly. Order the computational basis as and mark . The Hadamard transform prepares amplitudes . The marked-state phase oracle changes these to , whose arithmetic mean is . The Grover diffusion operator performs inversion about the mean:The three unmarked amplitudes become , while the marked amplitude becomes . All three stages have squared norm one. Here , so and one iteration gives , agreeing with the explicit calculation.
One Grover iteration on four states: a phase flip followed by reflection about the mean concentrates all amplitude on the marked state
. Details. Grover's original search paper was submitted on 29 May 1996; its algorithm combines selective sign changes with inversion about the mean. The example exposes the beauty of that construction: a change initially invisible to computational-basis measurement becomes complete cancellation of every wrong answer. [ref].
The marked-state phase oracle is an assumed operation, whose implementation cost must be counted. Computational-basis measurement yields a candidate label, here ; using it to retrieve a record requires the relevant data access. Preparing a quantum superposition does not make all its entries available as classical outputs. The improvement concerns the number of oracle queries needed to obtain an accepted label.
Dyadic phase-gate identification 2026-10-14
For the phase gate , apply powers to a uniform quantum superposition on qubits. Binary positional weights multiply the phases into on basis vector . The inverse quantum Fourier transform returns exactly, by orthogonality of roots of unity. Preparing the powers by repeated applications uses copies of ; this does not claim a number of gate calls polynomial in . If is odd, its powers generate the entire set of dyadic phase gates because has a modular inverse modulo .
Hadamard transform Created 2026-10-13 Updated 2026-10-18
The normalized Hadamard transform maps a vector indexed by binary strings through entries , where the dot product is evaluated modulo two. It is its own inverse and an orthogonal transformation, hence also a unitary operator on complex input vectors. The Hadamard gate is the quantum case, and the Hadamard basis is the image of the computational basis. The Walsh-Hadamard transform gives the same tensor product construction.
For two qubits, applying one Hadamard gate to each prepares the uniform quantum superpositionEach probability amplitude is , so each computational-basis measurement outcome has probability . Applying the Hadamard transform again reconstructs : signed contributions cancel at the other three outputs. Its usefulness lies in combining simple local quantum gates into an operation on exponentially many amplitudes. Extracting useful information still requires an appropriate subsequent transformation and measurement.
Marked density under a permutation Created 2026-10-06 Updated 2026-10-14
For a permutation of an -element set and a known marked output subset of size , exactly inputs have marked outputs. The uniform quantum superposition thus has good probability , independent of which permutation the oracle represents. This allows a known-angle amplitude amplification schedule without counting unknown preimages.
Apply one Hadamard gate to each of the qubits, with all gates acting in parallel. This quantum circuit implements the tensor product ; it needs single-qubit gates and one layer. For one qubit,Taking the tensor product of these expressions multiplies the probability amplitudes and adds their exponents, givingHere the dot product is evaluated using modular arithmetic modulo two.
In particular, an initially zero quantum register becomes the uniform quantum superpositionThis is useful at the start of a quantum algorithm because a subsequent quantum oracle acts on all these components coherently. Later quantum interference can reveal a global property of the function. Measuring immediately would merely produce a uniformly random binary string; the useful resource is the preserved quantum coherence, rather than the ability to read every function value in one run.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 47 2 Solution Created 2026-10-03 Updated 2026-10-14
The Walsh-Hadamard transform is the tensor product of one Hadamard gate on each qubit. Indeed,The network therefore consists of parallel Hadamard gates, with no interaction between wires. Applied to an all-zero quantum register, it produces the uniform quantum superposition of all input strings. This lets a Boolean quantum oracle act coherently on all those inputs; a subsequent operation can turn their relative phases into useful interference. It does not permit reading all oracle values from a single measurement in quantum mechanics.
Parallel Hadamard gates and the one-query Bernstein-Vazirani network
. Details. For the supplied linear-phase input, the amplitude on output isEach factor is obtained by summing over the independent bit . This directly proves the relevant orthogonality of the binary Fourier phases, and yields the output state exactly.
For exact classical identification, query the Boolean function at the standard unit vectors: . Hence oracle calls suffice. They are also necessary in the worst case, even with adaptive queries: every answer supplies one binary linear equation in the unknown string. With fewer than queries, their coefficient matrix has matrix rank at most the number of queries, so its null space contains a nonzero string . The strings and give identical answers along that adaptive transcript and cannot both be identified correctly. Equivalently, a depth- binary decision tree has at most leaves and must distinguish possibilities. Thus the exact classical query count is . This concerns exact recovery, rather than allowing an arbitrary error probability.
The quantum network in the lower panel starts its data quantum register in and its answer ancilla qubit in , which can be prepared as . Apply Hadamard gates to the data wires, make one Boolean quantum oracle call, then apply Hadamard gates again to all data wires. Quantum phase kickback producesA computational-basis measurement of the data wires gives all bits of with certainty. This is Bernstein-Vazirani phase kickback: one quantum query, data Hadamard gates, and one answer-state preparation suffice. The answer ancilla qubit stays separate from the data at the output.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 51 1 a Solution Created 2026-10-03 Updated 2026-10-14
The answer qubit enters the Boolean quantum oracle in , because the Pauli X gate followed by the Hadamard gate maps to . Since , quantum phase kickback multiplies the component by and leaves the answer qubit unchanged. The two input qubits enter in the uniform quantum superposition . ThusEquivalently, using the Controlled-Z gate and the Pauli Z gate,Here the exponent in the phase may be evaluated as an ordinary integer, since its parity agrees with the exclusive or expression. In particular, contributes only a global phase.
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 49 4 a Solution Created 2026-10-03 Updated 2026-10-14
Put and label the binary digits of by , with . The Walsh-Hadamard transform prepares the uniform quantum superposition . Applying the phase gate to the qubit for digit multiplies its basis amplitude by . Taking their product givesWith the most significant qubit written first, this provesEach power is implemented by repeated uses of the supplied gate. The total is uses. This realizes dyadic phase-gate identification without needing an unknown controlled gate or asserting a gate-call cost polynomial in .
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 324 1 ii Solution Created 2026-10-03 Updated 2026-10-06
Let . In the Shor algorithm, first use classical arithmetic to deal with even and perfect powers, and to reject prime inputs. Perfect-power recognition and primality testing have polynomial-time classical algorithms. Factoring a perfect power , with , already gives a nontrivial factor . We may therefore consider an odd composite with at least two distinct prime factors.
Choose uniformly from and compute its greatest common divisor with using the Euclidean algorithm. A proper nontrivial divisor ends the computation. Otherwise is a unit, and the remaining task is quantum order finding. SetPrepare a uniform quantum superposition in a -qubit register and use quantum modular exponentiation in a second register to obtainRepeated squaring and reversible modular multiplication implement this step with polynomially many quantum gates in . Apply the inverse quantum Fourier transform to the first register and perform a quantum measurement in the computational basis, obtaining . Measuring the second register first, and Fourier-transforming the resulting periodic coset, gives the same distribution of .
Here is a quantitative quantum Fourier sampling bound for order finding. If , multiplication by cycles its orbit states. The Fourier eigenstates of that cycle have eigenvalues , and the initial state has squared overlap with each, for . ThereforeConditioned on a particular eigenphase , its nearest integer outcome obeys and has probability at least . Indeed the absolute amplitude is , where . For , the numerator is at least and the denominator at most ; the limiting value at is one.
If , the fraction is reduced, and givesUse continued-fraction recovery in quantum order finding. The relevant approximation theorem says that reduced fractions satisfying are continued fraction convergents of . For an input rational of digits, their candidates can be enumerated classically in time, and their denominators are at most the reduced input denominator. This is the supplied continued-fraction result; discard candidate denominators exceeding . A zero measurement is treated as a failed order-finding sample.
For each remaining even candidate denominator , compute by repeated squaring, and try and . Return only a divisor with ; otherwise repeat the quantum sample or choose another . This candidate-denominator gcd post-processing cannot return an incorrect factor, since its output is checked directly. When the recovered denominator is the true even multiplicative order and the square root of one is nontrivial, part (i) guarantees success. Checking before trying the gcds is also a valid, more restrictive convention; the single-run distinction matters in part (iii).
Two further standard quantitative facts explain why repetitions remain efficient. First, for a uniformly chosen unit modulo an odd integer with at least two distinct prime divisors, the probability of a useful unit in Shor factorization is at least : its true multiplicative order is even and . To see the source of this bound, the Chinese remainder theorem for unit groups makes the prime-power components independent. Each odd-prime-power unit group is cyclic. If its 2-primary order is , the probability of the largest possible value of is , and the probability of any specified smaller value is at most . Failure requires all components to have the same : either all zero, making odd, or all the same positive value, making the halfway power in every component. Conditioning on one component, the chance another component matches it is at most , so total failure is at most .
Second, the fraction of phase numerators coprime to is , where is the Euler totient function. The elementary totient-ratio lower bound suffices: if the distinct prime divisors are , then and . The totient product formula therefore givesThus for a good , the probability of sampling a coprime phase numerator with the required accuracy is at least . This is inverse-polynomial in the input length, so polynomially many repetitions achieve any fixed success probability. The quantum Fourier transform uses elementary rotations and Hadamard gates in the ideal gate description, and the other quantum and classical stages are polynomial in .
The reduction is therefore polynomial in the bit length:A small denominator need not itself be the true multiplicative order; verification of the final factor is essential, and no guarantee is claimed for every individual sample.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 324 2 c Solution Created 2026-10-03 Updated 2026-10-06
Follow the printed examples by counting positive squares, so zero is not marked. For , the marked output set isA one-to-one map from the finite set to itself is a permutation, so exactly inputs have outputs in . In the uniform quantum superposition , the initial good probability is therefore . For permutation-preimage quantum search, this known marked density under a permutation is .
Define the efficiently computable predicate to be one if and only if is a positive square. The assumed Boolean quantum oracle for , acting on and a ancilla, implements its diagonal sign operation . Compute the modular-addition quantum oracle into a zero output register, apply this sign operation, and uncompute:This implements for , with the work registers clean. Only forward calls to were promised, but its inverse costs one such call: if on the second register, thenIndeed the output addition is changed into subtraction. Thus each marked reflection costs exactly two queries to ; all other operations used here are independent of the unknown .
Use the amplitude amplification theorem with , whose reflection is allowed by the assumptions. With , choose nearest to . Here for every , so a trial succeeds with probability at least . AlsoMeasure and use one additional query to evaluate and check . On failure, restart with fresh registers. Four independent trials have failure probability at most , so the required confidence and query bound areThis is an upper bound on quantum query complexity, not a claim that arbitrary reflections or every classical gate have constant cost. Including zero as a square would change to without changing the asymptotic bound. With the printed positive-square interpretation, has no valid output and no algorithm can satisfy the success requirement; the intended asymptotic task necessarily has .
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 324 2 a Solution Created 2026-10-03 Updated 2026-10-06
Assume first . Define the orthonormal quantum statesand by . The relevant invariant subspace is the two-dimensional span of these quantum states, not the entire Hilbert space. The uniform quantum superposition is .
In the ordered orthonormal basis , the marked-state phase oracle is the reflection operator . Since , conjugation by the Walsh-Hadamard transform gives the Grover diffusion operatorIt is the reflection in the line through . The product of these two reflection operators is a rotation matrix by toward the marked quantum state:Thus the Born rule gives . Choose a nonnegative integer nearest to . Rounding changes the angle from by at most , soEach Grover search algorithm iteration uses one marked-state phase oracle query; all other gates are known. A final quantum measurement in the computational basis therefore produces a uniformly chosen marked item, conditional on success, with probability better than one half when . This uses the supplied marked count to select the stopping time; an unknown needs an additional search schedule or counting procedure. If , no oracle query is needed; if , no marked item exists, so a successful search is impossible.
Past exam of the mathematics course of the University of Cambridge 2020 ii Paper 2 15C a Solution Created 2026-09-24 Updated 2026-10-03
Starting from the -qubit computational basis state , apply one Hadamard gate to every qubit. Since ,Thus parallel Hadamard gates prepare the uniform quantum superposition.
Simon's algorithm Created 2026-09-28 Updated 2026-10-25
Simon's algorithm prepares hidden-subgroup coset states, applies the quantum Fourier transform over , and samples vectors satisfying over . Repeated samples and Gaussian elimination recover with oracle queries and polynomial computation.
To solve Simon's problem, prepare a uniform quantum superposition, evaluate the function coherently into a second quantum register, and perform Simon Fourier sampling on the first. Each run produces a uniform binary string with over the two-element field. Once the observed rows have matrix rank , Gaussian elimination recovers as the unique nonzero element of their kernel. The random spanning of a binary vector space bounds the required number of runs.


