Ancilla bit 2026-10-14
An ancilla bit is an auxiliary bit providing workspace in reversible computation. In a quantum circuit, an ancilla qubit provides quantum workspace; a general quantum ancilla need not be a single bit.
The displayed Bernstein-Vazirani algorithm prepares its ancilla qubit in the computational-basis state before the first Hadamard gate. At the function oracle it is therefore the eigenstate of the Pauli X gate, which enables phase kickback. Preparing instead yields at the function oracle; target flips leave this state unchanged, so the data contain no information about .
The Hadamard-conjugated linear oracle makes the more general statement transparent. With zero data and initial ancilla qubit , the full fixed quantum circuit outputsFor nonzero , the correct data outcome has probability . To obtain exact identification for all , this preparation must have , so it is up to global phase. This is a condition on the prescribed preparation circuit: any alternative quantum state preparation that supplies at the function oracle is equivalent.
Ancilla qubit Created 2026-10-14 Updated 2026-11-05
An ancilla qubit is a two-dimensional quantum ancilla. It is the quantum version of an ancilla bit; an auxiliary quantum register can contain several such qubits.
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.
BQP error reduction 2026-10-06
Independent runs of a BQP algorithm with fresh ancilla qubits can be combined by a classical threshold rule. If completeness exceeds soundness by , a Hoeffding inequality bounds the error after runs by . Polynomial repetition handles inverse-polynomial gaps. This does not automatically preserve the restricted gate and measurement rules of a stoquastic circuit.
The four unitary operators can be identified with one use when an input qubit is entangled with a reference ancilla qubit. Applying the unknown operation to one half of produces the four orthogonal Bell states, which a Bell-basis measurement distinguishes exactly. For operators in any known orthonormal basis, prepare and apply after the unknown call. This reduces to the same quantum channel discrimination protocol. Direct expansion proves the four output identities; equivalently, their overlaps are .
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.
Input penalty of a history Hamiltonian Created 2026-10-06 Updated 2026-11-05
The input penalty of a history Hamiltonian tests prescribed ancilla qubits at clock time zero while leaving the quantum witness unrestricted. A zero ancilla qubit is tested by the bad-state projector ; a plus ancilla qubit is tested by .
Let , where each tests a different ancilla qubit. These orthogonal projections commute because they act on separate tensor product factors. Thus is a positive operator with integer eigenvalues between zero and . Zero is essential: its kernel contains exactly the valid ancillary input subspace, tensored with arbitrary quantum witness states. Only the nonzero eigenvalues are positive integers.
The clock-conditioned term is . For a normalized computational history state with clock labels forming an orthonormal basis,Together with correct propagation, zero input penalty selects histories with valid initial data. The displayed expectation concerns this fixed history state; a bound on the full Hamiltonian's lowest eigenvalue also has to account for propagation penalties.
Local-energy measurement verification Created 2026-10-06 Updated 2026-11-05
Uniformly sample one positive local term and measure the effect . The averaged energy-flag effect on a witness is , where is the number of terms. Repetition with a threshold halfway between the promised flag probabilities uses witness registers for constant error. A spectral tensor-product analysis, as in QMA parallel repetition with entangled witnesses, proves soundness against entangled witnesses. Constant-locality positive operator-valued measures are efficiently implementable using one ancilla qubit.
Use entanglement-assisted discrimination of a Pauli basis. Define the known single-qubit unitary operator by and . Prepare the device input and a reference ancilla qubit inApply the unknown device once to , then apply the known inverse to . Sincethe possible two-qubit outputs areThese are the four mutually orthogonal Bell states. A Bell-basis measurement therefore identifies the device with certainty. Explicitly, apply a controlled-NOT gate , then a Hadamard gate on , followed by computational-basis measurements. The readouts identify , respectively. Thus one use of the device and one reference qubit suffice.
Use deterministic two-qubit entanglement dilution, retaining the specified complex probability amplitudes. Alice implements a quantum instrument on with Kraus operatorsThe Kraus representation completeness condition holds even for complex :To realize this using the permitted quantum gates and a basic measurement, Alice initializes an ancilla qubit to . Conditional on her computational-basis state being , she applies to the unitary matrixEach has orthonormal columns. Therefore is a unitary gate, withA computational-basis measurement of implements the desired quantum instrument. Its two unnormalized branches on areEach has probability . Alice sends her outcome as one classical bit. For , both parties keep their qubits unchanged. For , both apply a Pauli X gate, givingThus both outcomes produce the exact target using one classical bit and local operations. The construction includes or and arbitrary relative quantum phases; it requires no quantum channel between the parties.
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.
The required identity is CNOT control reversal in the Hadamard basis. To derive it using standard quantum circuit identities, let be the Controlled-Z gate, which multiplies by and fixes the other computational-basis states. Since ,The Controlled-Z gate is symmetric in its two wires. Combining this symmetry with givesThis is an exact operator identity, including its global phase, and applies to arbitrary inputs. One can also check it directly from the orthogonal projectors : conjugating by gives
For the three-wire quantum circuit, put . Conjugation distributes over products because : . Each CNOT gate in therefore reverses direction, while the Hadamard gates on untouched wires cancel. The Hadamard-conjugated linear oracle isThese are the simplified quantum circuits in the figure: for there are no gates; for there is ; for there is ; and for there are both. The ancilla qubit becomes their common control. On every computational-basis state, the entire simplified circuit acts asStarting the data qubits at , the prescribed computational basis preparation of the ancilla qubit must therefore be : it activates the required flips and gives . Starting it at instead gives for every , so no information is obtained.
More generally, an initial ancilla qubit state in this same fixed quantum circuit givesFor nonzero , the desired data output has probability , and exact identification for every requires . This condition refers to the displayed ancilla preparation for the Bernstein-Vazirani algorithm: the state entering the function oracle must be , up to global phase. Other quantum state preparation procedures that deliver this same state are equivalent; is the prescribed input before the first Hadamard gate.
For arbitrary , linearity of the linear Boolean function suppliesThis decomposition is for analysis: the Bernstein-Vazirani algorithm calls the unknown function oracle as one supplied operation. The common control starts at , so the simplified quantum circuit takes to . Equivalently, phase kickback gives a product statewhich the final Hadamard transform decodes to . Thus one quantum oracle call suffices for every , compared with classical calls. This counts function oracle uses; the surrounding Hadamard gates and final computational-basis measurement still act on and qubits, respectively.
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 2005 iii Paper 58 3 i Solution Created 2026-10-03 Updated 2026-10-14
Number the physical wires from top to bottom and write a computational basis ket in that order. The first four are ancilla qubits and the fifth carries the input. It is enough to follow the basis input , , because the encoding quantum circuit acts linearly.
The first fan-out consists of four controlled-NOT gates from wire 5 to wires 1–4. It sends to . The three Hadamard gates then giveThe two Pauli X gates on wires 2 and 3, followed by a Controlled-Z gate and the same two X gates, restore the bits but contribute : the sign is negative exactly when the original bits on both wires were zero. Finally, the right-hand controlled-NOT gates are , , and . They leave the first three bits unchanged and turn the last two into and . ThusExplicitly, the logical basis quantum states produced by the printed gates areEach has eight orthogonal terms of equal magnitude, and their supports are disjoint, so they are normalized and mutually orthogonal. The arbitrary input is therefore encoded asThis is a realization of the five-qubit error correcting code. The input amplitudes and their relative quantum phase are preserved in the logical subspace; the encoding is an entangled-state linear isometry, not five independent copies of the unknown input. The explicit signs and bit ordering above are fixed by this circuit, rather than by a convention for a different encoder.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 58 4 b iii Solution Created 2026-10-03 Updated 2026-10-07
The product of the data Pauli Z gates has computational-basis eigenvalueUse the parity circuit from part (ii), apply the target unitary gate , and then uncompute the parity with . For every basis input,This equals on the data, with the ancilla qubit returned to zero. The compute-phase-uncompute construction therefore gives an exact linear-size circuit:This is a Pauli-string phase by parity computation, an instance of simulation of a computable diagonal Hamiltonian. Part (i) also explains it by , whose exponential restricts correctly to the target- subspace. If no extra line is desired, accumulate parity into the last data qubit, apply there, and undo the CNOT gates, for gates. Both constructions implement the global phase as well as the relative phases exactly.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 58 4 b ii Solution Created 2026-10-03 Updated 2026-10-07
Use one target ancilla qubit initially in . Apply a CNOT gate from each data qubit to that same target, for . Each CNOT gate adds its control bit modulo two without changing the control. After all gates the target contains the parity bit . Thus the required circuit is the -gate parity fan-in:This is parity computation by CNOT gates. The circuit also satisfies for either target value, and because all these shared-target CNOT gates commute and individually square to the identity. The action on general superpositions follows by linearity.
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.
