3

enter image description here

In the above question from de Wolf's lecture notes, I'm facing difficulties in constructing the oracle. I'm unable to understand how to use the boolean oracle to construct a phase oracle. Any help would be appreciated!

spigen
  • 33
  • 2

1 Answers1

3

In practice, this is often done with an ancilla qubit in three (four) steps:

  1. add an ancilla qubit by default in the $|0\rangle$ state
  2. perform a multi control-X (mcx) gate where the target is the ancilla qubit, ensuring that the control on the $j+1$ qubit is inverted (i.e. control if only 0). This mcx gate can be decomposed into native gates if desired
  3. apply a $Z$ gate to the ancilla qubit
  4. (optional) you can reset the ancilla qubit back to the original state by re-applying the same mcx gate

Hope this helps

sheesymcdeezy
  • 2,021
  • 8
  • 27