The Hamiltonian operator for the quantum harmonic oscillator follows directly from [quantizing](Quantization.md) the [1D Harmonic Hamiltonian](1D%20Harmonic%20Oscillator.md#Hamiltonian). Here this just means promoting position and momentum, $q$ and $p$ to the [position operator](Position%20Operator.md) and [momentum operator](Quantum%20Mechanics/Quantum%20Measurement/Momentum%20Operator.md) by placing hats on them and imposing the [position-momentum commutation relation](Position-Momentum%20Commutators.md) to obtain the [Hamiltonian operator](Hamiltonian%20operator.md)
$\hat{H}=\frac{\hat{p}^2}{2m}+\frac{m\omega^2}{2}\hat{q}^2.$
In addition the spring constant depends on particle mass and [Frequency](Frequency.md) and is written $k=m\omega.$ Typically this Hamiltonian is also presented without specifying whether or not we're dealing in [Generalized coordinates](Generalized%20coordinates.md) such that
$\hat{H}=\frac{\hat{p}^2}{2m}+\frac{m\omega^2}{2}\hat{x}^2.$
# The Energy spectrum
As with the [1D Harmonic Hamiltonian](1D%20Harmonic%20Oscillator.md#Hamiltonian), the Hamiltonian gives the total energy of the system. In quantum mechanics, the lowest energy level is always non-zero and expressed as the ground state energy.
# ladder operator formulation
The Hamiltonian given in terms of [Ladder operators](Harmonic%20Oscillator%20Ladder%20Operators.md) is expressed as
$\hat{H}=\hbar\omega\bigg(\hat{a}^{\dagger}\hat{a}+\frac{1}{2}\bigg)$
This form of the Hamiltonian relates to the position and momentum representation [as shown here](Harmonic%20Oscillator%20Ladder%20Operators.md#Correspondence%20with%20position%20and%20momentum%20representation). Notice that $\hat{a}^{\dagger}\hat{a}$ is the [number operator](number%20operator%20of%20a%20Harmonic%20Oscillator.md) thus we sometimes write
$\hat{H}=\hbar\omega\bigg(\hat{N}+\frac{1}{2}\bigg)$
## The energy spectrum
In the ladder operator formulation the energy levels of a quantum harmonic oscillator are the [eigenvalues](Eigenvalues%20and%20eigenvectors.md) of $\hat{H}$ expressed as
$E_n=\hbar\omega\bigg(n+\frac{1}{2}\bigg)$ ^318a35
### Ground state energy
#QuantumMechanics/QuantumHarmonicOscillators
#QuantumMechanics/QuantumMeasurement/QuantumObservables