Is a black-box gate whose output is conditional on the value of an input amplitude possible?

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.)

• 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? – epelaaez Jun 12 at 18:08
• Oh, I see, "|p>" is indeed a typo. It should be |q>. Should have writen |q> both times. Thank you for pointing it out. – John Jun 12 at 20:34
• |p> has been corrected as |q> in the question. Thank you for pointing it out. – John Jun 12 at 20:43