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 outputs
For 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.
Charlie cannot send a bit to Alice with the stated preparation, fixed interaction and final local measurements. Write and , so the complete gate is with the rightmost gate acting first. Alice has finished interacting before the gate involving Charlie acts.
For arbitrary product input density matrices, put . The final reduced density matrix of Alice is
The equality follows because a unitary operator on the traced-out systems leaves the partial trace unchanged. The right-hand side is independent of Charlie's preparation. Therefore every outcome probability of every local measurement by Alice is independent of Charlie's message. Quantum no-signalling applies after Alice's last interaction, even though phase kickback can allow communication between the two qubits of an individual CNOT gate.
Reverse communication is also possible. Prepare Alice in . Bob encodes as and as . Since , phase kickback gives
where and . Alice measures in the Hadamard basis: means zero and means one, deterministically.
The target's Pauli X gate eigenvalue becomes a relative phase on the control. This is the operational content of CNOT control reversal in the Hadamard basis; the computational basis control arrow alone does not determine every possible direction of communication.
Use the Hadamard basis states . The Hadamard gate satisfies , , and . After the first three Hadamard gates, the full quantum state is
The 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 are
The 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 , are
Thus 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 gives
This 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 is
These 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 as
Starting 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 gives
For 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 supplies
This 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 state
which 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.
A constant function has , whereas a balanced one has one zero and one one, so . The four oracles require only the following circuits:
Prepare , apply a Hadamard gate to each qubit, apply the oracle once, apply another Hadamard gate to the first qubit, and measure that first wire in the computational basis. Immediately before the oracle the state is . The identity gives phase kickback:
The output is certainly zero for constant and one for balanced. In circuit terms the target contributes only a global sign, and a controlled with target acts as on the control; then turns that phase into a measured bit. These identities prove the network for all four explicit oracles. The unused sign contains only as a global phase, consistent with the full-identification lower bound.
The Hadamard gate H and T gate form a universal quantum gate set for single-qubit operations: finite sequences approximate any target single-qubit unitary arbitrarily well, up to a physically irrelevant global phase. Universality is not a claim that every arbitrary rotation has a finite exact H,T word. With products acting right to left, exact Pauli constructions are
Indeed , , and .
Initialize the search register in and the output qubit in , then apply H to all three. The search state becomes , and the output becomes . The oracle obeys
This phase kickback leaves the output qubit factored out, so subsequent analysis can use the phase oracle on the two search qubits alone. Apply one Grover diffusion operator , then measure the search register.
Figure 1.
Exact Pauli circuits from H and T, and a two-search-qubit Grover network with a factored output ancilla
. Details.
A promise restricts which Boolean functions may be supplied. For the exact one-iteration four-entry search here, promise exactly one marked input. The four functions are precisely when , for . Other known numbers of marked entries require a correspondingly chosen iteration count; uniqueness is the promise for this particular exact circuit.
In basis order , the requested explicit calculation is
Thus the promised marked entry is found with probability one.
For two weakly coupled spin-half nuclei in nuclear magnetic resonance, a useful rotating-frame Hamiltonian is
where is in hertz and , . Resonant pulses and refocusing separate local rotations from the scalar coupling. For positive , evolution for supplies . Combining it with local Z phases gives the phase oracle
The scalar global phase is immaterial. Local pulses interchange zero and one, so
This implements the desired change of marked input without an additional output qubit.
Let and let be one only at the marked input. A three-qubit implementation of Grover's algorithm starts with , applies a Hadamard gate to each qubit, queries the reversible quantum oracle , applies the Grover diffusion operator to the first two qubits, and measures those two qubits in the computational basis. Here . The full three-wire quantum circuit is the composition
Figure 1.
Three- and two-qubit implementations of Grover's algorithm for four inputs
. Details.
Here . Since , phase kickback gives . The third qubit remains separable and unchanged. A direct marked-state phase oracle therefore replaces the three-qubit query using only two qubits:
For the explicit choice only at , is a Controlled-Z gate. Immediately after it,
The mean of these four probability amplitudes is . The Grover diffusion operator maps each probability amplitude to . The three unmarked probability amplitudes become zero and the marked one becomes one. A single query consequently finds with probability one.
A gate-level implementation of is . Up to an irrelevant global phase, it is . For any other chosen marked word, conjugate the Controlled-Z gate by Pauli X gates on precisely the positions where the marked word has a zero.
Let , where the conditional target operators are unitary. For product input ,
Tracing over removes cross terms with unequal control labels. Tracing over leaves , proving the formula and its independence of . Exchanging and proves the corresponding reverse independence. Thus the two targets cannot signal to each other through this fixed common-control interaction, despite phase kickback allowing a target to affect its control.
Two controlled-NOT gates with a common control and distinct targets are an example. They commute; their chronological order can be exchanged, giving an equivalent causal proof. Intervening control rotations or additional interactions can change the conclusion.