Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 66 1 c Solution Created 2026-10-03 Updated 2026-10-07
Use one shared pair to measure , and the other to measure . The latter entanglement-assisted nondemolition parity measurement is obtained by applying Hadamard gates to both system qubits before and after the -parity circuit. Since at each site, the two minus signs cancel, giving .
The Bell states have joint eigenvaluesand are therefore distinguished uniquely by the two meter parities. For records and , the combined Kraus operator isEach is the rank-one projector onto the corresponding Bell state. This is a Bell-state nondemolition measurement: an input Bell state remains exactly that state for every possible local record. The local circuits can be scheduled without communication; the identity of the Bell state is known only when the classical records are brought together. Two parity bits distinguish all four Bell states without disturbing them.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 3 b Solution Created 2026-10-03 Updated 2026-10-07
Replace every CNOT gate by . The resulting quantum circuit contains only Hadamard gates and Controlled-Z gates. Realize each Hadamard gate by a fresh one-bit teleportation link measured at angle zero, so every internal measurement is in the fixed basis. Insert a graph edge between the current wire vertices for each Controlled-Z gate. This gives a suitable graph state because the inputs are , and entangling gates can be moved to resource preparation: they commute with one another and with earlier measurements on vertices no longer used by the gate.
Track a Pauli frame . An angle-zero one-bit teleportation with raw result updates the frame on that wire bybecause equals up to global phase. A Controlled-Z gate updates and , leaving the bits unchanged. These are classical binary updates; no measurement angle depends on them.
All the internal quantum measurements consequently have predetermined bases. Their projectors act on distinct resource vertices and commute, so all internal measurements can be performed simultaneously: the logical measurement depth is at most one. If the output is to be read in the computational basis, those fixed-basis measurements can occur in the same layer; a raw output is relabelled . If quantum outputs are retained, the same calculation gives the desired output in a known Pauli frame. This nonadaptive Hadamard–CNOT measurement pattern concerns measurement depth, not the depth of resource preparation or classical frame computation.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 3 c Solution Created 2026-10-03 Updated 2026-10-07
Write the single-qubit gate as , where . Thus it is, up to global phase, a rotation about the x-axis, and it commutes with . Compile it as a Hadamard gate followed by the J gate . Compile each CNOT gate as before into . The usual wire-link construction yields a resource graph state for the fixed inputs; the same frame algebra also works for logical input states supplied to an open resource.
The point is stronger than counting two gates per rotation: a long circuit must not acquire a new adaptive layer for every rotation. We show that every nonzero-angle basis depends only on outcomes of the angle-zero measurements.
For an gadget, let the incoming Pauli frame be . Denote the angle-zero outcome by , and the subsequent angle- outcome by . The two one-bit teleportations givewhere omits a global phase. Consequently the rotation gadget updatesOnly its angle-zero outcome enters the new frame. Its arbitrary-angle outcome enters only the frame, which commutes through all later gates.
For a CNOT gate from to , call the outcomes of its two angle-zero target-wire measurements , in that order. The Pauli frame update isThese follow by applying the preceding Hadamard gate and Controlled-Z gate frame updates twice. In particular, the new frames depend on old frames and angle-zero outcomes only; they never depend on old frames or arbitrary-angle outcomes. This is the measurement-level version of the given fact that a CNOT gate propagates operators into products of operators.
Starting with no frame, induction in the original circuit order now computes every solely from angle-zero results. Therefore every sign is known after one simultaneous layer containing all angle-zero measurements, including those appearing late in the circuit. Compute those signs classically, and perform all remaining equatorial measurements in a second simultaneous layer. An angle zero that occurs accidentally among these remaining choices may stay in that layer. Reordering is valid because, once a branch's bases have been fixed, the projectors on different vertices commute; no second-layer result is needed to choose another second-layer basis.
The two-layer measurement pattern for CNOT and x-axis rotations thus hasindependently of the number or order of gates. Fixed computational-basis measurements of classical outputs can be included in layer two, followed by relabelling . For quantum outputs the final Pauli frame gives the required correction. The depth statement excludes graph preparation and classical processing, as in the definition in the paper.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 4 a Solution Created 2026-10-03 Updated 2026-10-07
Put and prepare control qubits in and the target in the supplied eigenstate . Apply a Hadamard gate to every control qubit. Let denote the integer encoded in that quantum register.
For every , apply a controlled unitary gate with control and the same target. The quantum phase kickback yieldsApplying to the controls therefore produces exactly. A computational-basis measurement returns with certainty, and the algorithm outputsThis is exact quantum phase estimation; exactness uses the finite dyadic phase promise, not a rounding argument.
Only a controlled-U gate is supplied as a primitive. Its repetitions implement controlled-, so the total number of black-box uses is . Access to powers as unit-cost primitives would be a different quantum query complexity model. This distinction is the cost of exact phase estimation on a dyadic spectrum.
Past exam of the mathematics course of the University of Cambridge 2012 iii Paper 67 4 b Solution Created 2026-10-03 Updated 2026-10-07
The quantum circuit has one control wire per binary digit and one target quantum register. Every control starts in , receives a Hadamard gate, controls the corresponding power , and then enters the collective inverse quantum Fourier transform. Only the control register is measured; the target stays in .
Exact dyadic phase-estimation circuit with controlled powers, inverse Fourier transform, and little-endian output bits
. The omitted intermediate wires continue the pattern . The inverse quantum Fourier transform black box is defined on the integer basis with , so the displayed ordering introduces no hidden bit reversal. The measured bits satisfyEach controlled power box represents sequential controlled- uses when only that primitive is available.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 57 3 c ii Solution Created 2026-10-03 Updated 2026-10-07
At the four eigenstates are the computational product basis, with irrelevant signs on two vectors. Alice and Bob measure their own system qubits in . These local projective measurements preserve each product eigenstate; their pair of records identifies the global outcome after local operations and classical communication.
At the four states are the Bell states. They are simultaneous eigenstates of the commuting Pauli operators and : have respective pairs . Their nonlocal parity measurements can be performed without directly distinguishing the local system spins.
Use the first shared Bell state pair to perform the entanglement-assisted nondemolition parity measurement of . Use the second shared pair for : both parties apply a local Hadamard gate to their system qubit, execute the same local system-to-meter CNOT gates and -meter measurements, then undo the Hadamard gates. This measures because . The two system parity projectors commute, since anticommutation at both sites cancels:Each is the corresponding rank-one Bell state projector. Every complete tuple of four local meter records has system Kraus operator for its two parities. Summing the four record tuples compatible with gives the ideal outcome map . The protocol is a Bell-state nondemolition measurement: an input Bell state is preserved, while an arbitrary input is projected onto the reported Bell state with the Born rule probability.
The local circuits need no adaptive communication between the laboratories, so both parties can finish inside the specified time window. Global identification of still requires later local operations and classical communication. This endpoint protocol respects quantum no-signalling, unlike the hypothetical intermediate-angle instrument in part (i).
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 58 2 i Solution Created 2026-10-03 Updated 2026-10-07
A good item must exist, so assume ; if , the requested search is impossible, while makes every output good. Put and . Normalize the good and bad components of the uniform superposition state asThe Boolean phase oracle negates and fixes . The Grover diffusion operator is . Its implementation is independent of : conjugate the reflection about by Hadamard gates. One Grover search algorithm iteration isHence, by the Grover rotation angle formula,Choose the nonnegative integer nearest to . Its final angle differs from by at most , so a computational-basis measurement succeeds with probability at least . The allowed small-density regime includes , giving the requested bound. Each iteration uses one Boolean phase oracle query, and .
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 4 b Solution Created 2026-10-03 Updated 2026-10-06
Use the operator norm induced by the usual vector norm, and assume the input quantum state is normalized. Since and the Hadamard gate is unitary, the J-gate phase-error operator norm isWrite the exact and implemented quantum circuits as ordered products and . The quantum circuit gate-error telescoping bound follows fromEvery surrounding factor is unitary, including gates tensored with identities on other qubits, so the triangle inequality and the submultiplicativity of the operator norm giveThe exact Controlled-Z gates contribute zero to that sum. ThusThe endpoint is sufficient because each implemented angle error is strictly smaller than . If , the circuits are identical and any positive works. The bound controls the stated vector distance with actual gate phases retained, so no adjustment of the global phase of one output is needed.
Past exam of the mathematics course of the University of Cambridge 2015 iii Paper 66 2 i Solution Created 2026-10-03 Updated 2026-10-06
Use superdense coding. For the two-bit message , Alice applies to her half of the shared Bell state, where are the Pauli X gate and Pauli Z gate. The encoded states areThese four Bell states are orthonormal. Alice then transmits her one qubit to Bob, who now holds both qubits. A Bell-basis measurement identifies the message with probability one.
More explicitly, Bob can apply a CNOT gate with the received qubit as control and his original qubit as target, followed by a Hadamard gate on the control. The CNOT gate sends the encoded state toand the Hadamard gate sends this to . Computational-basis projective measurements therefore read out exactly. One transmitted qubit, assisted by one previously shared Bell pair, communicates two classical bits.
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 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 3 iv Solution Created 2026-10-03 Updated 2026-10-06
Use GHZ preparation with Hadamard and controlled-Z gates for . Apply a Hadamard gate to the first qubit, then a controlled-NOT gate from that qubit to each of the other qubits. Every controlled-NOT can be written in the allowed gate set asIndeed conjugating the target by makes the controlled phase into a controlled . The rightmost gate acts first. Consequently the Clifford circuit uses allowed gates and givesFor every chosen qubit , tracing out the other qubits yields . Equivalently, across that qubit versus the rest, the displayed state is a Schmidt decomposition with two nonzero coefficients . It is therefore entangled across every such bipartition.
Entanglement does not prevent the polynomial single-output simulation from part (iii). The simulation follows the measured observable rather than claiming that the intermediate states remain product states. When , there is no remaining subsystem and the requested entanglement is impossible; the construction and claim require .
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 324 3 a Solution Created 2026-10-03 Updated 2026-10-06
Use exact quantum phase estimation with control qubits initially and one target quantum register prepared in the given eigenvector . Apply Hadamard gates to the control qubits. If control bit has significance , apply a controlled unitary gate from that qubit to the target. The target stays in , while quantum phase kickback producesSince , this is . The inverse quantum Fourier transform on the control quantum register therefore gives . The quantum measurement in the computational basis returns with certainty, soThe quantum circuit below reads left to right. The upper wires are control qubits, with least significant; the vertical ellipsis represents the intervening control wires and powers. The inverse quantum Fourier transform acts on the entire control quantum register, including any bit-order permutations.
Quantum phase estimation and spectral filtering
. A supplied controlled- can implement controlled- by repetitions with the same control. Hence this exact quantum circuit uses calls to the supplied controlled-, unless controlled powers are additionally available cheaply. The cost of exact phase estimation on a dyadic spectrum is not automatically polynomial in ; the question asks for an exact algorithm, not that stronger complexity guarantee. Exactness also uses the promised dyadic eigenphase, ideal gates, and the supplied inverse quantum Fourier transform.
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 2018 ii Paper 2 15D a Solution Created 2026-09-24 Updated 2026-10-03
Let be Alice's unknown qubit, and label her half of the shared Bell state by and Bob's by . Alice applies a Controlled-NOT gate from the unknown qubit to , then a Hadamard gate to the unknown qubit. The three-qubit state becomesAlice measures her two qubits in the computational basis and sends the two classical outcomes to Bob. Bob applies , recovering with certainty. This is quantum teleportation; Alice never needs to know the state.
For the shared GHZ state, Charlie first applies a Hadamard gate to his qubit. ThenCharlie measures in the computational basis. Outcome leaves Alice and Bob with ; outcome leaves , which either party converts to by applying after Charlie reports the outcome. Thus

