# Is there any way to always output |1> if the measurement has a probability to output 1?

Let's say I have an oracle that outputs 1 on a specific input (there can be multiple inputs x so that f(x)=1), else it outputs 0.

If there is no such input so that f(x)=1, the quantum state of the output qubit will always be |0>

Is there a way so, that if the output state is not |0>, one can manipulate the qubit state as such that it transforms to |1>?

Not sure if I got your question exactly, so I reformulate it first. Assume some algorithm produces a state $$|\psi\rangle=\alpha |0\rangle+\beta|1\rangle.$$ It seems to me you are asking if there is a procedure to say if $$\beta=0$$ or not, i.e. if $$|\psi\rangle$$ is orthogonal to $$|1\rangle$$ or not. In other words, you want to discriminate two quantum states $$|\psi\rangle$$ and $$|\phi\rangle=|0\rangle$$. If you only have a single copy of $$|\psi\rangle$$ the answer is no, you can not do this with certainty.

Even if you know that the algorithm either produces $$|\phi\rangle=|0\rangle$$ or $$|\psi\rangle$$ (with known $$\alpha$$ and $$\beta$$) the best you can do is to tell them apart with with probability $$1-|\langle\psi|\phi\rangle|$$ https://en.wikipedia.org/wiki/POVM#An_example:_unambiguous_quantum_state_discrimination. Note that when the states are orthogonal $$\langle\psi|\phi\rangle=0$$ they can be discriminated with certainty.

• Yes, you got my question right and formulated it in a much better way. Thank you for your comment. You say, it is impossible to do that if I only have one copy of the qubit. What if I run my algorithm twice, so that I have two qubits in the same state. Is it possible then? If yes, how? Commented Jul 25, 2022 at 11:20
• @RobertoBernardo two copies are better, but not perfect. Generally, additional copies will allow you to increase the discrimination probability. The most straightforward thing to do is to repeat the discrimination procedure $n$ times, then the success probability will be $1-|\langle\phi|\psi\rangle|^n$. More efficient protocols using entangled copies of the state may exist, but before digging in, it would be better to formulate the problem more precisely. Commented Jul 25, 2022 at 11:56
• @RobertoBernardo If your non-$\vert 0\rangle$ states are randomly distributed over the Bloch sphere, the probability that you will detect $n$ $0$s when you measure in $Z$ basis would be very close to $1/2^n$ for large $n$. Thus, your probability of successfully distinguishing between the two cases will be $1-1/2^n$. However, if you know that the non-$\vert 0\rangle$ state is not random but $\alpha \vert 0\rangle +\beta \vert 0\rangle$ then the probability of successfully distinguishing between the two cases will be $1-\vert \alpha\vert^{2n}$. Commented Jul 25, 2022 at 12:41
• Ah, I should correct my previous comment. It's not correct to say that the probability of successfully distinguishing between the two cases will be $1-\vert \alpha\vert^{2n}$. Rather, if the state is non$-\vert 0\rangle$ then the probability to suss it out will be $1-\vert \alpha\vert^{2n}$. However, if the state is $\vert 0\rangle$ then you can be confident at the level of $1-\vert \alpha\vert^{2n}$ that you have $\vert 0\rangle$. You'll never be $100\%$ confident that you have $\vert 0\rangle$. Commented Jul 25, 2022 at 13:27
• If you want definite discrimination with some probability, you have to perform POVM but you can't do that if you don't know what your non$-\vert 0\rangle$ state will be. Thus, if your non$-\vert 0\rangle$ state is uniformly randomly distributed over the Bloch sphere, you can be $100\%$ confident that it is non$-\vert 0\rangle$ with a probability $1/2^n$ but you can only be confident at the level of $1-1/2^n$ that it is $\vert 0\rangle$. Commented Jul 25, 2022 at 13:27

@NikitaNemkov has provided a thorough answer to your question. I'd like to point out a simple reason as to why you cannot do that: namely, it violates both the unitarity as well as linearity of quantum mechanics.

Unitarity

A unitary process is reversible, i.e., it doesn't map two different states to the same state (otherwise, you cannot tell where the output state came from -- thus, making it irreversible). Now, it is obvious why the kind of operation you describe would be irreversible, i.e., non-unitary: just as an example, it would map both $$\frac{1}{\sqrt{2}}(\vert{0}\rangle \pm\vert{1}\rangle)$$ to $$\vert{1}\rangle$$.

Linearity

Linearity implies that if a process takes $$\vert\psi_1\rangle$$ to $$\vert\phi_1\rangle$$ and $$\vert \psi_2\rangle$$ to $$\vert \phi_2\rangle$$ then it ought to take $$\frac{1}{\sqrt{2}}(\vert \psi_1\rangle +\vert \psi_2\rangle)$$ to $$\frac{1}{\sqrt{2}}(\vert \phi_1\rangle +\vert \phi_2\rangle)$$. Now, the kind of operation you describe ought to take $$\vert 0\rangle$$ to $$\vert 0\rangle$$ and it ought to take $$\vert 1\rangle$$ to $$\vert 1\rangle$$. Thus, by linearity, it should take $$\frac{1}{\sqrt{2}}(\vert 0 \rangle + \vert 1\rangle)$$ to $$\frac{1}{\sqrt{2}}(\vert 0 \rangle + \vert 1\rangle)$$. However, since you want any state that is not $$\vert 0\rangle$$ to be mapped to $$\vert 1\rangle$$, your operation would rather want to map $$\frac{1}{\sqrt{2}}(\vert 0 \rangle + \vert 1\rangle)$$ to $$\vert 1\rangle$$ -- thus, violating linearity.

• Thanks! Your answer gave me clarity on how and why this is impossible to realize. Commented Jul 25, 2022 at 12:10

If that were possible, you could use it to communicate faster than light: Alice and Bob each hold one half of a Bell pair, and Alice measures in the computational basis if she wants to send a 0, and in the Hadamard basis if she wants to send a 1, while Bob measures $$|0\rangle$$ or not-$$|0\rangle$$. This channel has a high error rate (half of the 0 bits are flipped) but it can be made arbitrarily reliable with standard (classical) error correction techniques.