Suppose I have a list of numbers from 0 to 32, that is $ [0,1,2....31, 32].$ I want to find a number $n$ in this list such that it satisfies a property, say $n$ is prime. How would I translate this to an Oracle that can be used with Grovers's Algorithm in Qiskit?
I am following this guide but, it seems like the general pattern to the solution is already known in this Sudoku example, that is the pattern of the bits of a potential solution is known and it can be checked.
What if there isn't a general pattern? How would you implement an oracle to look through the list, check each item and return the one that matches some criteria?
I'm following the same code in the link referenced above but, changing the sudoku_oracle
to my own custom function.
Any help is appreciated, thanks.