I am having trouble understanding a particular step of the Swap-test algorithm. As I am struggling with this for the past week, I thought I should ask here. So, I get the procedure until right after we measure the probability of the the system to collapse at state $|0\rangle$.
$$P(\mathrm{First\:qubit=0})=\frac{1}{2}\big (\langle\phi|\langle\psi|+\langle\psi|\langle\phi|\big)\frac{1}{2}\big (|\phi\rangle|\psi\rangle+|\psi\rangle|\phi\rangle\big)=\frac{1}{2}+\frac{1}{2}|\langle\psi|\phi\rangle|^2$$
In this equation, I cannot understand how we go from the second part to the third part.
If I do the math, I get the second part to be equal with
$$=\frac{1}{4}\big(\langle\phi|\langle\psi||\psi\rangle|\phi\rangle+\langle\psi|\langle\phi||\phi\rangle|\psi\rangle\big)$$
How do we get from that to the third part with the l2-norm?
Perhaps I am missing something really simple here, but I cannot seem to get it.
Thanks in advance