Suppose I have a simple function $f(x): 1 + x$ and I want to find $x$ such that $f(x) = 5$, for instance, using the Grover search. Am I correct to say that I will need to implement this function $f(x)$ within the oracle itself? For example:
def oracle_qc(desired_output): """implement adder quantum circuits?""" return qc such that the oracle circuit will mark out the state that gave the desired output.
So far, the oracles in the examples I have seen are hard-coded such that $|100\rangle$ will return a negative. However, if I were to change the desired output to say $f(x) = 6$, then the oracle needs to be changed again so that $|101\rangle$ will now be marked instead. It doesn't actually implement the function itself.
This is just for a simple function so I cannot imagine the complexity involved for a more complicated function, especially one with floating point, if the function needs to be implemented in the quantum oracle.