Balanced Boolean function 2026-10-25
A Boolean function on a finite nonempty domain is balanced when it is zero on exactly half the inputs and one on the other half. For a one-bit domain, the balanced functions are and , while the remaining two functions are constant functions. The Deutsch algorithm distinguishes these two classes with one Boolean quantum oracle query in the absence of noise.
Bernstein-Vazirani algorithm 2026-10-24
The Bernstein-Vazirani algorithm identifies the coefficient string of a linear Boolean function with one Boolean quantum oracle call. It contrasts with the calls required by the classical query complexity of linear Boolean function identification. Prepare the data qubits at and an ancilla qubit at , apply a Hadamard gate to every wire, query the function oracle, and apply the Hadamard gates again. The full output is .
The mechanism is Bernstein-Vazirani phase kickback. The Pauli X gate has eigenvector with eigenvalue . Thus the target flips become relative quantum phases on the data, givingThe final Hadamard transform maps this product to , so computational-basis measurement recovers every coefficient with certainty. The ancilla preparation for the Bernstein-Vazirani algorithm ensures the required minus sign, and the Hadamard-conjugated linear oracle gives an exact quantum circuit interpretation. One query is optimal for , since without a query the output cannot depend on the unknown string.
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.
Deutsch algorithm 2026-10-14
The one-input Deutsch algorithm determines whether a Boolean function is constant or balanced using one Boolean quantum oracle call. Initialize the input qubit in and the answer qubit in . Quantum phase kickback changes the input to . A Hadamard gate and computational-basis measurement therefore return the parity with certainty.
Function oracle 2026-10-24
A function oracle supplies access to an unknown function : given an allowed input , one query returns . Query complexity counts these accesses separately from known local computation. A classical query receives one definite answer; a quantum oracle specifies coherent access through a unitary operator, allowing inputs in quantum superposition. The distinction is part of the access model, not a change to the mathematical function.
A Boolean quantum oracle preserves and adds a one-bit value into an answer qubit by exclusive or. On known computational-basis states, its output determines the same value as a classical function oracle query.
Hadamard-conjugated linear oracle 2026-10-24
Let be the Boolean quantum oracle for a linear Boolean function, and put . The CNOT gates implement , where the data wires control the ancilla qubit. CNOT control reversal in the Hadamard basis and imply the exact unitary operator identityHere on strings is bitwise exclusive or. To conjugate a product, insert between its factors; each factor reverses its control and target, and the unused Hadamard gates cancel. The global phase is exactly . In particular, the identity holds on arbitrary quantum superpositions, not only on the initialized inputs of the Bernstein-Vazirani algorithm.
Normalize the second qubit as . Since a Pauli X gate changes to , the Boolean quantum oracle acts asThis quantum phase kickback leaves the second qubit uncorrelated with the first. Put : for a constant function and for a balanced Boolean function. Apart from the irrelevant global phase , the first qubit and environment reachThe population-preserving interaction commutes with the quantum oracle on this answer-register input, so its placement before or after the oracle, between the two Hadamard gates, gives the same result. Substitute into b:The printed Deutsch algorithm uses the rule zero means constant function; one means balanced Boolean function. With that rule, the Deutsch algorithm with pure dephasing succeeds for either class withFor real nonnegative environment overlap this is , ranging from certainty at to random guessing at . For general complex overlap, a coherent shift can invert the printed answer: for example makes the printed rule always wrong. If the overlap is known but the printed quantum measurement is retained, choose the better labeling of its outcomes; this givesThere is a further improvement if a known can be compensated by the phase gate before the final Hadamard gate. It removes the coherent shift without reversing any actual quantum decoherence, and yieldsThis is optimal when only the first qubit is accessible, with equal prior probabilities for the two classes. Before the final Hadamard gate, their reduced density matrices areThe difference has eigenvalues , giving trace distance . The Holevo–Helstrom theorem therefore bounds the success probability by , exactly attained by the compensated procedure. A known phase shift and loss of coherence have different effects: at the two density matrices coincide and no measurement on the available qubit can reveal the answer.
Write and , with the top wire carrying , the middle wire , and the bottom wire the ancilla bit . The binary inner product is , where is exclusive or. Let denote a CNOT gate controlled by wire and targeting . The four linear Boolean functions and their Boolean quantum oracles are:
| Reversible circuit for | : three unchanged wires |
|---|
The CNOT gates in the last row commute: their common target acquires the exclusive or of the two controls. Each input wire is preserved, and applying any of these reversible circuits twice restores .
The four two-bit linear oracles and their exact simplifications after Hadamard gates on all three wires; a filled dot is a control and a circled plus is a target
. Details. For classical reversible computation, call the unknown function oracle on and . The resulting ancilla bits are respectively and :Use a fresh zero ancilla bit for each call, or preserve the first result in workspace before restoring the target to zero. Thus two classical calls determine the two-bit string.
For input bits, query the standard basis strings , since . This gives an upper bound of calls. It is also optimal for exact identification: every classical query reveals at most one new bit, since is unchanged and reveals just when is known. A depth- decision tree has at most answer histories, but must distinguish possible hidden strings. Hence , including adaptive strategies. The classical query complexity of linear Boolean function identification is therefore
Use the Hadamard basis states . The Hadamard gate satisfies , , and . After the first three Hadamard gates, the full quantum state isThe Pauli X gate obeys . Consequently the Boolean quantum oracle produces phase kickback:Factoring out the ancilla qubit, the four states immediately after the function oracle areThe final Hadamard gates send to and to . In particular, the printed quantum circuit includes a final Hadamard gate on the ancilla qubit too. Its full outputs, ordered as , areThus one oracle call identifies with certainty: a computational-basis measurement of the first two qubits returns . The ancilla qubit returns to and carries no additional information about . The Bernstein-Vazirani algorithm turns the pattern of relative quantum phases into a definite computational-basis state.
A two-query network begins in , calls , flips the input with , calls again, and measures the answer wire in Z. The successive states areThe measured answer is zero for constant functions and one for balanced functions. The circuit is drawn in i.
Explicit oracle circuits follow from the form :Thus the four circuits, respectively for the truth tables in i, are the identity on both wires; a NOT on the answer wire; a CNOT from input to answer; and a CNOT together with an answer NOT. The latter commute, so their order is immaterial. These circuits leave the input wire unchanged and XOR precisely into the answer.
Let be as in i. Insert the explicit oracle from ii between the two pairs of Hadamard gates. The network identitiesturn the entire network intoThis is the last simplified circuit in i. On the designated input , its reversed control is certainly one, soThe global phase is unobservable. Measuring the first wire therefore determines the function class with certainty after one oracle query, while the second wire returns to . These circuit identities are the network form of quantum phase kickback: the answer state between the Hadamards is the eigenstate , on which an XOR acts as a phase.
Past exam of the mathematics course of the University of Cambridge 2003 iii Paper 47 1 Solution Created 2026-10-03 Updated 2026-10-14
Take the Hadamard gate to be and the phase gate to be . This fixes the sign convention for the interference phase.
For the coherent quantum circuit, the successive quantum states areThe Born rule therefore gives the concise answer
With the stated quantum decoherence after the phase gate, the joint pure state before the last Hadamard gate isAfter that Hadamard gate, its environment coefficient at output zero is . Squaring its norm sums over every unobserved environment outcome, soThe Cauchy-Schwarz inequality gives . In this single-qubit interference with conditional environment states, is the interference visibility: orthogonal environment states erase the fringe, while a unit-modulus overlap shifts its phase without reducing visibility. The plus sign in follows from the specified overlap , rather than its complex conjugate.
If the same quantum decoherence occurs before the phase gate, the joint pure state is first . The phase gate then produces exactly the same state used above. Equivalently, the controlled environment interaction commutes with the diagonal phase gate. The probability is unchanged.
For the Deutsch algorithm, use the reversible Boolean quantum oracleThe algebraic oracle map printed in the source has its arguments misplaced: taken literally, it sends two distinct answer inputs to the same output for constant , so it cannot be a unitary operator. The corrected map above agrees with the diagram's input-control, answer-target arrangement. Put the answer qubit in . Since the Pauli X gate satisfies , quantum phase kickback givesWrite . Up to the irrelevant global phase , the input qubit acquires relative phase , so its ideal final computational-basis measurement returns : zero for a constant function and one for a balanced function.
Let the specified quantum decoherence occur in the interference portion between the two Hadamard gates. It commutes with the oracle's effective diagonal phase on the input, so the same analysis applies whether it occurs just before or just after the query. The two likelihoods areThus the diagram's usual zero-for-constant decision rule hasThis is the reliability for either promised class separately, with no prior needed. For equally likely classes, if is known to be negative, reversing the interpretation gives . A known environment phase can instead be compensated by the phase gate before the final Hadamard gate, giving success probability . In particular, gives no information and permits certainty after phase compensation. These refinements distinguish a shifted fringe from lost quantum coherence; with the unmodified diagram a phase shift alone can reverse the apparent answer. Quantum decoherence after the final Hadamard gate leaves its computational populations unchanged, so that different placement would not spoil the measured answer.
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 2004 iii Paper 53 2 2 Solution Created 2026-10-03 Updated 2026-10-14
The first Hadamard transform prepares a uniform superposition in the first register while the second stays zero. The Boolean quantum oracle, now with an -bit output register and bitwise addition, therefore givesThis state is normalized because distinct labels are orthogonal, even when their oracle outputs coincide. Addition in the oracle is bitwise exclusive-or, making the oracle reversible; replacing the first register by would not define a unitary gate for a two-to-one function.
For the later recovery steps we use the intended nonzero hidden-period promise . Then two-to-one behavior and force each fibre to be exactly . The printed allowance does not explicitly exclude zero. If zero were allowed without a nonzero-period promise, the displayed identity would hold trivially for every function and would not specify Simon's problem. That distinction is addressed again in the query count.
Past exam of the mathematics course of the University of Cambridge 2007 iii Paper 58 2 d Solution Created 2026-10-03 Updated 2026-10-14
An oracle can recognize a solution without disclosing it in advance. If an efficiently evaluable or black-box predicate has the promised unique marked input, write exactly for that input. A Boolean quantum oracle computes this predicate reversibly asIts diagonal projector on the search register is . To implement a selectable phase, compute into a zero quantum ancilla, apply a known phase to its component, and uncompute. The search register then undergoesThis requires evaluation access to the predicate, not classical knowledge of which input passes it. The term is known from the Hadamard transform. With Hamiltonian-oracle access, or by controlled short-time simulations of the two terms, their sum can realize continuous-time quantum search.
The unknown projector is supplied through an oracle or a physically encoded recognition rule. It cannot be manufactured for an arbitrary hidden with no such input-dependent resource. The oracle assumption and the fixed energy scale are essential when interpreting the square-root search time as a computational advantage.
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 2009 iii Paper 51 1 b Solution Created 2026-10-03 Updated 2026-10-14
When , the first two qubits after the Boolean quantum oracle are . The Hadamard gate obeys for . Applying the Walsh-Hadamard transform therefore givesConsequently the quantum measurement in the computational basis has the deterministic outcomesThese four distinct answers identify the four promised Boolean quantum oracles with one query and certainty. The constant term does not affect the measurement in quantum mechanics, because a global phase does not change its probabilities.
Past exam of the mathematics course of the University of Cambridge 2009 iii Paper 51 1 c Solution Created 2026-10-03 Updated 2026-10-14
All four promised functions have . Use quadratic Boolean phase cancellation: apply a Controlled-Z gate to remove the phase , then apply the Walsh-Hadamard transform. With the rightmost gate acting first, chooseBecause and the Controlled-Z gate commutes with the Pauli Z gates,The quantum measurement in the computational basis consequently producesEach answer occurs with probability one for its promised Boolean quantum oracle.
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 49 1 a Solution Created 2026-10-03 Updated 2026-10-14
Write and . The initial Hadamard gates prepare in the search register and in the final quantum ancilla. Since the Pauli X gate satisfies , the Boolean quantum oracle acts by quantum phase kickback:For a single marked entry this is the marked-state phase oracle on the search register. The ancilla stays separate and unchanged throughout.
The Grover diffusion operator is , because . The PDF circuit places one diffusion after each oracle call, so the state before measurement isIn the supplied amplitude amplification theorem, take and . Their overlap has modulus , so the Grover rotation angle is . A quantum measurement in the computational basis therefore givesThe inverse sine here is applied to the overlap of the two different states. The converted TeX's self-overlap in the angle definition is a transcription error; the original PDF has .
Past exam of the mathematics course of the University of Cambridge 2010 iii Paper 49 1 b Solution Created 2026-10-03 Updated 2026-10-14
If there is no marked entry, the Boolean quantum oracle is the identity. The uniform superposition state is a positive eigenstate of the Grover diffusion operator:Thus every iteration leaves the full state unchanged. The measured search bits have the uniform distributionOnly the first qubits are measured in the printed circuit. If the untouched ancilla were also measured in the computational basis, its bit would be an independent fair bit, giving probability for each joint outcome.

