A two-query network begins in , calls , flips the input with , calls again, and measures the answer wire in Z. The successive states are
The 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 identities
turn the entire network into
This is the last simplified circuit in i. On the designated input , its reversed control is certainly one, so
The 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.