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.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 2 a Solution Created 2026-10-03 Updated 2026-10-07
Use the bit-query Boolean quantum oracle , where denotes workspace. Initially every probability amplitude is independent of , hence is a constant polynomial. An input-independent unitary gate only forms linear combinations of probability amplitudes, so it does not increase their polynomial degree.
If is an amplitude before a query, its new value isOne query increases polynomial degree by at most one. Inductively, after queries each amplitude has polynomial degree at most . The acceptance probability is a sum of squared absolute values of the accepting amplitudes, so it is a real polynomial of degree at most . Intermediate quantum measurements and classical adaptation can be retained coherently, or handled by summing unnormalized branch probabilities; either approach yields the same degree bound.
An exact algorithm has acceptance probability precisely at every Boolean input. The multilinear reduction on the Boolean cube replaces positive powers of each by , preserving these values without increasing polynomial degree. Therefore the polynomial method for quantum query lower bounds givesHere is the degree of the unique multilinear polynomial representing the Boolean function, and is its exact quantum query complexity. Uniqueness follows, for example, by evaluating successively on the indicator vectors of subsets: the value on a subset determines its coefficient once all smaller-subset coefficients are known.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 2 c Solution Created 2026-10-03 Updated 2026-10-07
First use the allowed one-query algorithm to learn exactly. This restricted two-index Boolean quantum oracle is realized by relabelling indices in a single query to the original input. Measure its output and choose the second query classically.
If , the first two bits agree and their common value is the majority, irrespective of . Query and output it. If , the first two bits cancel in the vote, so query and output it. ThusThe exact two-query majority algorithm uses one parity query and one ordinary bit query on every branch, and is correct on all eight inputs. Together with the lower bound this proves .
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 1 b i Solution Created 2026-10-03 Updated 2026-10-06
Prepare an additional qubit in by applying and then the Hadamard gate to . Apply to the data register. The Boolean quantum oracle then produces quantum phase kickback:A final Walsh-Hadamard transform gives an amplitude for equal toTo see this identity, the sum factors over the bits; any position at which and differ contributes . This is Bernstein-Vazirani phase kickback, and its output isThere is exactly one oracle query, fixed quantum gates, and no probabilistic intermediate step. The ancilla qubit can be left in or reset to using its known inverse preparation. The construction includes the case .
Past exam of the mathematics course of the University of Cambridge 2014 iii Paper 61 2 iii Solution Created 2026-10-03 Updated 2026-10-06
Prepare the two data qubits in and a phase ancilla qubit in . A single Boolean quantum oracle query flips only the marked amplitude. Its success fraction is , so in amplitude amplification. The fixed diffusion reflection gives after one iteration.
Directly, after the query the marked amplitude is and the other three are . Their mean is . The diffusion reflection replaces each amplitude by , yielding one at the marked input and zero elsewhere. ThusHere is understood with its target ancilla qubit, and acts only on the data. It is independent of : , with the central diagonal gate implementable using two Pauli Z gates and one Controlled-Z gate. Measuring the data in the computational basis therefore finds the unique marked string with certainty after one oracle query.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 324 2 b Solution Created 2026-10-03 Updated 2026-10-06
Prepare an ancillary qubit inIt can be prepared from by an operation followed by a Hadamard gate, independently of . One call to the Boolean quantum oracle then gives quantum phase kickback:The data state receives a minus sign precisely on the basis vectors spanning , while the ancilla remains unchanged and unentangled. One oracle call realizes the reflection. By linearity it is the marked-state phase oraclewith one oracle call. The ancillary preparation and its optional inverse use only fixed operations, so no additional knowledge of is needed.
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 2018 ii Paper 3 10D a Solution Created 2026-09-24 Updated 2026-10-03
Apply a Pauli X gate and then a Hadamard gate to the third qubit, and apply Hadamard gates to the first two. This preparesOne application of the Boolean quantum oracle now gives, by quantum phase kickback,The answer qubit is unentangled and may be ignored. If all three qubits must be restored to the displayed register form, applying and then to the answer qubit maps back to . Thus the first register is exactly after one use of .