How to Set up Hamiltonian for a harmonic oscillator?