Deutsch algorithm
= Deutsch algorithm
{c}
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 $|+\rangle$ and the answer <qubit> in $|-\rangle$. <Quantum phase kickback> changes the input to $(-1)^{f(0)}(|0\rangle+(-1)^{f(0)\oplus f(1)}|1\rangle)/\sqrt2$. A <Hadamard gate> and <computational-basis measurement> therefore return the parity $f(0)\oplus f(1)$ with certainty.