# Getting dot product from two wavefunctions

I'm looking at some examples, but I cannot get the expected result when it comes down to making the measurement on the following state where we measure the first qubit which is the ancilla state.

Here is $$|\psi\rangle = \frac{1}{2} |{0}\rangle \otimes (|\psi_a\rangle |\psi_b\rangle + |\psi_b\rangle |\psi_a\rangle) + \frac{1}{2} |{1}\rangle \otimes (|\psi_a\rangle |\psi_b\rangle - |\psi_b\rangle |\psi_a\rangle)$$

My calculation suggests that the probability of the ancilla being in the state $$|0\rangle$$ is:

$$p_{0} =\frac{1}{2} + \frac{1}{2}|\langle\psi_a | \psi_b \rangle|^2$$

However the text suggests that there is a minus in place of the plus. I'm not sure if I'm doing anything wrong here or this is a typo.

• Does the text say that $p_{0} =\frac{1}{2} - \frac{1}{2}|\langle\psi_a | \psi_b \rangle|^2$ or $p_{1} =\frac{1}{2} - \frac{1}{2}|\langle\psi_a | \psi_b \rangle|^2$ – Victory Omole Feb 19 '20 at 21:27
• $p_{0}$ it says. I can see a minus coming in if its $p_{1}$. – disruptive Feb 20 '20 at 7:21