# Find min of a quantum state L2 norm

I have a problem minimizing this norm with respect to $$\alpha$$:

$$\min_{\alpha}||e^{i\alpha}|\psi\rangle-|\phi\rangle ||^2$$ (1)

The result is that this achieves min when $$\alpha=-\measuredangle \langle\psi|\phi\rangle$$

and the above is equal to $$2-2\langle\psi|\phi\rangle$$.

But when I take the derivative of (1) and set it to 0, I get $$e^{i\alpha} = \langle\psi|\phi\rangle$$, which is not the right desired result.

For unit vectors $$|\psi\rangle, |\phi\rangle \in \mathbb{C^n}$$ we have: $$||e^{i\alpha}|\psi\rangle-|\phi\rangle ||^2 = \left(e^{-\alpha i}\langle\psi|-\langle \phi| \right) \left(e^{i \alpha} |\psi\rangle - |\phi\rangle \right) = 2 - 2Re(e^{i \alpha}\langle \phi|\psi \rangle).$$ Since the inner product of $$\langle \phi|\psi \rangle$$ might be a complex number, we can write it as $$\langle \phi|\psi \rangle = a + ib$$. We can set $$b=0$$ if the inner product is real. Then we have $$Re(e^{i \alpha}\langle \phi|\psi \rangle) = Re((\cos\alpha+i\sin\alpha)(a + ib)) = a \cos \alpha - b \sin \alpha.$$ Hence, the quantity we want to minimize is $$\min_{\alpha} \left \{2 - 2(a \cos \alpha - b \sin \alpha) \right\}.$$ Take the derivative of $$2 - 2(a \cos \alpha - b \sin \alpha)$$ w.r.t. $$\alpha$$ and set it to zero. Then we have $$a \sin \alpha = b \cos \alpha.$$ Equivalently, $$\tan \alpha = \frac{b}{a}, \textrm{ for } a \neq 0.$$