I'm utilizing Grover's algorithm to solve a straightforward problem. It presents eight options, but only four are correct (the 1's in the S column)
$$\begin{array}{c|c|c|c} q_0& q_1\ & q_2\ &S \\ \hline 0 & 0 & 0 &1 \\ \hline 0 & 0 & 1 &1 \\ \hline 0 & 1 & 0 &1 \\ \hline 0 & 1 & 1 &0 \\ \hline 1 & 0 & 0 &0 \\ \hline 1 & 0 & 1 &0 \\ \hline 1 & 1 & 0 &0 \\ \hline 1 & 1 & 1 &1 \\ \hline \end{array}$$
Why can't Grover's algorithm apparently solve this simple situation?
c example DIMACS-CNF 3-SAT p cnf 3 4 -1 2 3 0 1 -2 -3 0 -1 -2 3 0 -1 2 -3 0 This leads theThe oracle to produce the state (the order is $|q_2 q_1 q_o \rangle$):
where the solutions clearly are $|000 \rangle$ , $|010 \rangle$ , $|100 \rangle$ and $|111 \rangle$, but the oracle code did not find any.
c example DIMACS-CNF 3-SAT p cnf 3 4 -1 2 3 0 1 -2 -3 0 -1 -2 3 0 -1 2 -3 0 ┌───┐┌────┐ ░ ┌─┐ q_0: ┤ H ├┤0 ├─░─┤M├────── ├───┤│ │ ░ └╥┘┌─┐ q_1: ┤ H ├┤1 Q ├─░──╫─┤M├─── ├───┤│ │ ░ ║ └╥┘┌─┐ q_2: ┤ H ├┤2 ├─░──╫──╫─┤M├ └───┘└────┘ ░ ║ ║ └╥┘ meas: 3/═══════════════╩══╩══╩═ 0 1 2 {'001': 122, '110': 119, '101': 125, '100': 110, '111': 138, '011': 139, '010': 126, '000': 145} ```