The meaning of the phase in the wave function I have just started studying QM and I got into some trouble understanding something:
Let's say there is a wave function of a particle in a 1D box ($0\leq x\leq a$):
$$\psi(x,t=0) = \frac{i}{\sqrt{5}} \sin\left(\frac{2\pi}{a}x\right) + \frac{2}{\sqrt{5}} \sin\left(\frac{5\pi}{a}x\right)$$
Then if we measure the energy, the probability of getting the energy associated with $ \sin(\frac{2\pi}{a}x) $ is $\left| \frac{i}{\sqrt{5}} \right|^2 = \frac{1}{5}$ and the probability of measuring the energy associated with $\sin\left(\frac{5\pi}{a}x\right)$ is $\left| \frac{2}{\sqrt{5}}\right|^2 = \frac{4}{5}$. So the magnitude of $ \frac{i}{\sqrt{5}} , \frac{2}{\sqrt{5}} $ determines the probability, but what is the meaning of the phase? To me, as someone who measures energy, I'll get the same thing if 
$$\psi(x,t=0) = \frac{-1}{\sqrt{5}} \sin\left(\frac{2\pi}{a}x\right) + \frac{2}{\sqrt{5}} \sin\left(\frac{5\pi}{a}x\right) $$
So why does the phase matter? If it matters, how do I know to which phase the wave function collapsed after the measurement?
 A: Also you can modify the wavefunction with a global phase $\psi(x)\rightarrow e^{i\phi}\psi(x)$ without affecting any expectation values because the phase factor will cancel when taking inner products, so this global phase doesn't contain any information. Only relative phases are meaningful in quantum mechanics.
A: For a particle of mass $m$ with a simple Hamiltonian in position-space $\mathcal{H} = -\frac{\hbar^2}{2m}\nabla^2+V(\vec{x})$, if you write a general wavefunction as $$\Psi(t;\vec{x}) = \sqrt{\rho}e^{iS/\hbar}\text{,}$$
where $S$ and $\rho\geq 0$ are real, then the phase information $S$ directly corresponds to the probability current
$$\mathbf{J} = \frac{\rho}{m}\nabla S\text{,}$$
the continuity equation for which turns out to be exactly the imaginary component of the Schrödinger equation,
$$\frac{\partial\rho}{\partial t} + \nabla\cdot\mathbf{J} = 0\text{.}$$
As expected from more general considerations, a global phase factor is irrelevant because only its gradient appears. As a side note, the real component of the Schrödinger equation turns out to be the classical Hamilton–Jacobi equation corrected by one extra term proportional to $\hbar^2$.
The probability current can also be defined in more complicated situations, but it remains the case that morally speaking, the phase information is critical to how the wavefunction evolves in time.
A: This is an important question. You are correct that the energy expectation values do not depend on this phase. However, consider the spatial probability density $|\psi|^{2}$. If we have an arbitrary superposition of states $\psi = c_{1} \phi_{1}  + c_{2} \phi_{2}$, then this becomes
$|\psi|^{2} = |c_{1}|^{2}|\phi_{1}^{2} + |c_{2}|^{2} |\phi_{2}|^{2} + (c_{1}^{*} c_{2} \phi_{1}^{*} \phi_{2} + c.c.)$.
The first two terms do not depend on the phase, but the last term does. ($c_{1}^{*}c_{2} = |c_{1}||c_{2}|e^{i (\theta_{2} - \theta_{1})}$). Therefore, the spatial probability density can be heavily dependent on this phase.  Remember, also, that the coefficients (or the wavefunctions, depending on which "picture" you are using) have a rotating phase angle if $\phi_{1,2}$ are energy eigenstates.  This causes the phase difference $\theta_{2} - \theta_{1}$ to actually rotate at the energy difference, so that $|\psi|^{2}$ will exhibit oscillatory motion at the frequency $\omega = (E_{2} - E_{1})/\hbar$.
In summary, the phase information in a wavefunction holds information, including, but not limited to, the probability density.  In a measurement of energy this is not important, but in other measurements it certainly can be.
