Removal of a half-oscillator wall (source code)

= Removal of a half-oscillator wall
{title2=$P_{\mathrm{new\ ground}}=1/\pi$}

Suddenly remove the wall of a <half-harmonic oscillator> in its ground state, leaving the same harmonic potential on the whole line. The <sudden approximation> keeps its wavefunction unchanged during removal. The new normalized ground state is $\psi_0=\pi^{-1/4}\ell^{-1/2}e^{-x^2/(2\ell^2)}$, so
$$
\langle0|\psi_h\rangle=\frac{2}{\sqrt\pi\ell^2}\int_0^\infty xe^{-x^2/\ell^2}\,dx=\frac1{\sqrt\pi},\qquad \boxed{P_0=\frac1\pi.}
$$
The integration is over the initially occupied half-line. The final first excited state instead has probability $1/2$, since the initial half-line state equals $\sqrt2$ times its positive-half restriction. This also checks that removing the wall does not simply create the full oscillator's odd state.