# Quantum harmonic oscillator Hamiltonian terms

I am trying to get the Hamiltonian for the harmonic oscillator using the following approach. \begin{align} p=&-i\sqrt{\frac{m\omega\hbar}{2}}\left(a-a^+\right) \\ H=&\frac{p^2}{2m}=\frac{\hbar \omega}{2}\left(aa^+-aa-a^+a^++a^+a\right) \\ =&\frac{\hbar\omega}{2}\left(1+2a^+a-aa-a^+a^+\right) \\ =&\hbar \omega \left(a^+ a+\frac{1}{2}-\frac{1}{2}aa-\frac{1}{2}a^+a^+\right) \, . \end{align}

As far as I know, the Hamiltonian should read $$H=\hbar \omega\left(a^+a+\frac{1}{2}\right) \, .$$

My question is if there is any way I did not see to get rid of the remaining terms.

• You missed the harmonic potential $V(x)=\frac{1}{2}m \omega^2 x^2$ in the Hamiltonian. – Stephan Sep 12 '16 at 12:47
• @Stephan put this as an answer so people know this is answered. – probably_someone Jan 2 '17 at 0:34

As per my comment, the Hamiltonian should include the harmonic potential $V(x) = \frac{1}{2} m \omega^2 x^2$.