Quantum oracle (source code)

= Quantum oracle
{title2=$U_f|x,y\rangle=|x,y\oplus f(x)\rangle$}

A <quantum oracle> supplies coherent access to a function through a specified <unitary operator>. For a function with <binary string> output, the standard construction retains the input and adds the output into an answer <quantum register> by bitwise <exclusive or>. This operation is its own inverse, even when the function is not <injective>. A <Boolean quantum oracle> is the single-output-bit case; <Simon's algorithm> uses several answer <qubits>. Other encodings, such as a <modular-addition quantum oracle> or a <phase gate> encoding, require their own explicit query conventions.