Suppose we have a qubit in the state $|q\rangle = a |0\rangle + b |1\rangle$, and another ancilla qubit $= |0\rangle$.

I wish to have the following black-box gate:

            if |a| > 0.8, then turn the ancilla to |1⟩
            else          leave the ancilla unchanged at |0⟩.

Is it possible to construct such a black-box gate?

(Background information: I do not want to use measurement on $|q\rangle$ because that will terminate the quantum process. I need to continue the quantum process. In my case, the resulting ancilla state is used to control the subsequent quantum computing as part of a larger quantum system where computation process will differ depending on whether the ancilla qubit is 0 or 1.)

  • 1
    $\begingroup$ At first, you mention a qubit $|q\rangle$ and then you mention you don't want to measure $|p\rangle$. Is this a typo and you meant to write $|q\rangle$ both times? If not, what does $|p\rangle$ correspond to? $\endgroup$
    – epelaez
    Jun 12, 2021 at 18:08
  • $\begingroup$ Oh, I see, "|p>" is indeed a typo. It should be |q>. Should have writen |q> both times. Thank you for pointing it out. $\endgroup$
    – John
    Jun 12, 2021 at 20:34
  • $\begingroup$ |p> has been corrected as |q> in the question. Thank you for pointing it out. $\endgroup$
    – John
    Jun 12, 2021 at 20:43

1 Answer 1


Is it possible to construct such a black-box gate ??

No, the gate you're describing isn't possible. It's not unitary.

You can't condition on amplitude thresholds, you can only condition on orthogonal states.

  • $\begingroup$ This is definitely not possible as a gate. But I guess such operation could be possible by inscribing the phase into an ancillary register and using that register to control the effect on the target qubit. Would something like that work? $\endgroup$
    – epelaez
    Jun 12, 2021 at 20:38
  • $\begingroup$ Thanks for describing the possible approach of inscribing the phase into an ancillary register. At the moment, it is not clear how to do it to check the condition on |a| > 0.8. I will look into it. Thank you. $\endgroup$
    – John
    Jun 12, 2021 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.