2

I have executed this circuit and I don't understand why the result is $|11\rangle$ ?

  • [q[0], q[1]] : solution register
  • [q[2]] : ancilla register (clause value)
  • [q[3]] : boolean value of Oracle function

Circuit

Thanks you

Martin Vesely
  • 13,891
  • 4
  • 28
  • 65

2 Answers2

0

3 out of 4 states are inverted, that leads to the following situation before you do the Grover Diffusion, which mirror around the red line:

enter image description here

This will bring the all states to zeros, but not $|11\rangle$...

draks ...
  • 658
  • 3
  • 15
  • So, i think it's because the number of solutions is greater than N/2 ? How can I fix it if it's possible ? – julien rodriguez Apr 27 '20 at 17:12
  • @julienrodriguez what do you expect from the circuit? What are you looking for? Do you know what would happen if the number is exactly N/2? – – draks ... Apr 27 '20 at 19:10
  • this circuit compute a simple 2-sat formula (not a or not b). I see https://quantumcomputing.stackexchange.com/questions/5318/grover-algorithm-for-more-than-one-element before my ask. – julien rodriguez May 01 '20 at 08:28
  • @julienrodriguez I'm not sure if this will really help you, since you're dealing with a special case. – draks ... May 01 '20 at 21:57
0

So, I add a "ghost qubit" in the solution space in order to increase N. I fixe the "ghost qubit" to a state (|1> here) and we get #solutions < N/2

The circuit

The results