At sufficiently small energies, the harmonic oscillator as governed by the laws of quantum mechanics, known simply as the quantum harmonic oscillator, differs significantly from its description according to the laws of classical physics. Whereas the energy of the classical harmonic oscillator is allowed to take on any positive value, the quantum harmonic oscillator has discrete energy levels given by
where is the Planck constant, is the (classical) angular frequency, and is a non-negative integer. Furthermore, whereas the classical harmonic oscillator is confined to a finite region of space, the quantum harmonic oscillator has a nonzero (but asymptotically vanishing) probability of being found anywhere.
As one of the few important quantum mechanical systems whose dynamics can be determined exactly, the quantum harmonic oscillator frequently serves as a basis for describing many real-world phenomena, such as molecular vibrations.
where and are the position and momentum operators, respectively. The ladder operator method to obtain the eigenfunctions and energies (due to Dirac) is to factor the equation by using the so-called lowering operator
and its adjoint, the raising operator
which satisfy the commutation relation
The Schrödinger equation can then be factored as
Using the commutation relation, one can show that if is an eigenfunction with eigenvalue then so must also with corresponding eigenvalue and with corresponding eigenvalue In essence, given an eigenfunction and corresponding energy, applying the raising operator obtains a new eigenfunction namely with corresponding energy increased by while applying the lowering operator obtains a new eigenfunction with energy decreased by
The lowering cannot proceed indefinitely; there must exist some lowest energy level corresponding to an eigenfunction for which
Therefore, the spectrum of all eigenfunctions can be enumerated by a non-negative integer
with corresponding eigenvalues
From the time-independent Schrödinger equation, it is straightforward to show that the wavefunction corresponding to (that is, the ground state wavefunction) is
with corresponding energy eigenvalue
In general, the closed-form expression for the wavefunctions (which can be found by solving the Schrödinger wave equation analytically) is
where is the Hermite polynomial. A plot of the first few wavefunctions is shown below:
Since the harmonic potential is non-vanishing, all of the eigenstates are bound and the energy spectrum is discrete, although, as is characteristic in quantum mechanics, the wavefunctions extend to all space (zero only at nodes). This should be contrasted with the classical harmonic oscillator, whose probability density is bounded by the amplitude of its oscillation and whose energies are continuous. Below is the probability density of the ground state of the quantum harmonic oscillator compared with the U-shaped density of the classical oscillator.
Using the ladder operators, many dynamical quantities can be calculated for the harmonic oscillator without direct integration. One can express the position and momentum operators as follows:
Furthermore, one can show that the action of the ladder operators on the eigenstates works according to
With these relations, as well as the fact that the eigenfunctions are orthogonal, that is
one can compute many quantities of interest.
It is easy to show that the expectation values of the position and momentum must vanish for any since the eigenfunctions are orthogonal:
Show that the ground state is the only eigenstate of the harmonic oscillator that is a minimum-uncertainty state in position-momentum space i.e., equality holds for the Heisenberg uncertainty relation in and
First, we compute the expectation of the square of the position
and square of the momentum
Combining with the previously calculated result yields
which achieves the mininmum uncertainty of only for the ground state
Many practical potentials can be treated (or at least closely approximated) as harmonic potentials. The internuclear potential well of a molecule of diatomic gas, such as molecular oxygen or nitrogen, can be taken as a harmonic potential, in which case the vibrational energy levels are given by
where the vibrational angular frequency can be computed from the force constant of the molecule and its reduced mass.
The partition function for the system is
From the partition function, one can compute many thermodynamics quantities of interest, such as the thermodynamic vibrational energy
or vibrational heat capacity
For one obtains the classical result and
 Griffiths, D.J. Introduction to Quantum Mechanics. Second edition. Pearson, 2004.
 McQuarrie, D.A. Statistical Mechanics. University Science Books, 2000.
 Shankar, R. Principles of Quantum Mechanics. Second edition. Plenum, 1994.