# Why can't $\psi(x) = \delta(x)$ in the case of Harmonic oscillator?

In the analysis of Harmonic Oscillator, it is claimed that $$\langle\hat H\rangle$$ cannot be zero, why is it so?

I mean $$\hat H = \frac{ \hat p^2 }{2m } + \frac12 k \hat x^2$$, and $$\left = \int dx (x\psi(x))^\dagger (x\psi(x)) = 0$$ would imply that $$x\psi(x) = 0 \quad \forall x.$$ In particular, this is true when $$x = 0$$, so we have two options; either $$\psi(x) = 0$$ or $$\psi(x) = \delta(x)$$.

So, why can't $$\psi(x) = \delta(x)$$ in the case of Harmonic oscillator ?

Note: $$\hat H = \frac{ \hat p^2 }{2m } + \frac12 k \hat x^2$$

The state $$\psi(x) = \delta(x)$$ is a perfectly valid state for the harmonic oscillator to occupy. (With caveats, though: it is not normalizable, so it's not a physically-accessible state. Still, it's a perfectly reasonable thing for the mathematical formalism to handle.) As you note, it has a position uncertainty equal to zero, as well as a vanishing expectation value $$⟨x^2⟩=0$$.

However, it does not have a vanishing momentum uncertainty, and in fact if you expand it as a superposition of plane waves, $$\delta(x) = \frac{1}{2\pi\hbar} \int_{-\infty}^\infty e^{ipx/\hbar}\mathrm dp = \frac{1}{\sqrt{2\pi\hbar}} \int_{-\infty}^\infty A(p) e^{ipx/\hbar}\mathrm dp,$$ you require an even weight $$A(p) \equiv 1/\sqrt{2\pi\hbar}$$ for all momenta, which means that the momentum-squared expectation value $$⟨p^2⟩ = \int_{-\infty}^\infty |A(p)|^2 p^2\mathrm dp = \frac{1}{2\pi\hbar}\int_{-\infty}^\infty p^2\mathrm dp = \infty$$ diverges to infinity. (This result is required by the uncertainty principle, but the derivation here does not rely on it - it's an independent proof of that fact. Still, you can see the consistency in that $$\Delta x=0$$ and $$\Delta p \geq \hbar/2\Delta x$$ can only be satisfied by having $$\Delta p = \infty$$.)

This then implies that the expectation value of the hamiltonian is also infinity: $$⟨H⟩ = \frac{1}{2m}⟨p^2⟩ + \frac12 k ⟨x^2⟩ = \infty.$$

As for this,

In the analysis of Harmonic Oscillator, it is claimed that $$\langle\hat H\rangle$$ cannot be zero, why is it so?

this is the zero-point energy of the oscillator, which has been explored multiple times on this site. If you want to ask why this is, you should ask separately, with a good showing of the previous questions here and what it is about them you do not understand.