Quantum Harmonic Oscillator Back
Quantum Mechanics

Quantum Harmonic Oscillator

Visualize wave functions, probability densities, and energy levels of the quantum harmonic oscillator interactively.

Quantum Number

Quantum number n (0–8)

Parameters
Angular frequency ω (rad/s)
ω
Mass m (×mₑ)
mₑ
Display Options
Energy Eigenvalue
Results
0.500
Eₙ (units of ℏω)
0.500
E₀ Zero-point energy
0.707
Δx (units of x₀)
0.707
Δp (units of ℏ/x₀)
Wave Function / Probability Density
Energy Level Diagram
Theory & Key Formulas
Hamiltonian: $\hat{H}= -\frac{\hbar^2}{2m}\frac{d^2}{dx^2}+ \frac{1}{2}m\omega^2 x^2$

Energy eigenvalues: $E_n = \hbar\omega\!\left(n+\tfrac{1}{2}\right)$

Wave function: $\psi_n(x) = N_n\, H_n\!\left(\frac{x}{x_0}\right) e^{-x^2/2x_0^2}$

Characteristic length: $x_0 = \sqrt{\dfrac{\hbar}{m\omega}}$

Uncertainty: $\Delta x \cdot \Delta p = \hbar\!\left(n+\tfrac{1}{2}\right)$

What is the Quantum Harmonic Oscillator?

🙋
What exactly is a "quantum harmonic oscillator"? I know a regular spring oscillates back and forth, but what makes it quantum?
🎓
Basically, it's the quantum version of a mass on a spring. In the classical world, the mass can have any energy. But in quantum mechanics, its energy is "quantized" into specific, allowed levels. In this simulator, you can see those discrete energy levels on the right. Try moving the "Quantum Number n" slider from 0 to 8 to jump between these allowed states.
🙋
Wait, really? So the particle isn't just sitting at the bottom? What are those squiggly lines (the wave functions) actually telling me?
🎓
Great question! The wave function $\psi_n(x)$ itself isn't directly measurable. Its square, $|\psi_n(x)|^2$, is the probability density—it tells you the likelihood of finding the particle at position *x*. That's why we also plot the shaded curve. For instance, in the ground state (n=0), you're most likely to find the particle near the center. Switch to the "Probability Density" view to see this clearly.
🙋
Okay, that makes sense for n=0. But when I slide up to n=4 or n=8, the probability density splits into multiple blobs. How can the particle be in several places at once, and what do the "Mass" and "Angular Frequency" sliders do?
🎓
That's the weirdness of quantum mechanics! For high *n*, there are regions where the particle is very likely to be found, separated by nodes where it will never be found. This actually starts to resemble the classical picture where a bouncing mass spends more time near the turning points. The sliders for mass (*m*) and angular frequency (*ω*) change the "stiffness" of the potential. Increase *ω* (make the spring stiffer) and you'll see the wave functions and probability densities squeeze closer to the center. Give it a try!

Physical Model & Key Equations

The system is defined by its Hamiltonian, which is the quantum mechanical operator representing the total energy (kinetic + potential).

$$\hat{H}= -\frac{\hbar^2}{2m}\frac{d^2}{dx^2}+ \frac{1}{2}m\omega^2 x^2$$

Here, $\hat{H}$ is the Hamiltonian operator, $\hbar$ is the reduced Planck constant, $m$ is the particle's mass, $\omega$ is the angular frequency of the oscillator, and $x$ is position. The first term represents kinetic energy, and the second is the parabolic potential energy.

Solving the time-independent Schrödinger equation $\hat{H}\psi_n = E_n \psi_n$ yields quantized energy levels and corresponding wave functions.

$$ E_n = \hbar\omega\left(n+\frac{1}{2}\right), \quad \psi_n(x) = \frac{1}{\sqrt{2^n n!}}\left(\frac{m\omega}{\pi \hbar}\right)^{1/4}H_n\!\left(\frac{x}{x_0}\right) e^{-x^2/(2x_0^2)}$$

$n = 0, 1, 2, ...$ is the quantum number, $E_n$ is the energy of the $n$th state, $H_n$ are the Hermite polynomials, and $x_0 = \sqrt{\hbar / (m\omega)}$ is the characteristic length scale of the oscillator, which you directly influence with the mass and frequency sliders.

Real-World Applications

Molecular Vibrations: The bonds between atoms in a molecule act like tiny springs. At low temperatures, their vibrational energies are quantized, and the harmonic oscillator model is a fundamental first approximation for understanding infrared spectra and molecular dynamics simulations.

Quantum Optics and Lasers: The electromagnetic field inside an optical cavity can be described as a harmonic oscillator. Its quantized energy levels are called photons, making this model the cornerstone of quantum optics and laser physics.

Solid-State Physics: Vibrations in a crystal lattice, called phonons, are modeled as a collection of coupled harmonic oscillators. This explains fundamental properties like heat capacity and thermal conductivity in solids.

Quantum Computing: Some quantum computing architectures, like superconducting qubits, use circuits that behave as nonlinear harmonic oscillators. Their quantized energy levels are used as the basis states (|0⟩ and |1⟩) for quantum bits.

Common Misunderstandings and Points to Note

First, note that the wave function $\psi(x)$ itself is a "probability amplitude" and is not a directly observable physical quantity. What you observe is the probability density $|\psi(x)|^2$. Many people get confused when they see parts of the $\psi(x)$ graph taking negative values and think "negative probability?", but it's an amplitude, so that's fine. The probability density is always positive or zero.

Next, a tip on parameter settings. If you simultaneously increase the mass $m$ and the angular frequency $\omega$, the characteristic length $x_0 = \sqrt{\hbar/(m\omega)}$ rapidly decreases, and the wave function may appear compressed into a very narrow range on the graph, becoming invisible. For example, if you set $m$ to about the proton mass, $1.67 \times 10^{-27}$ kg, and $\omega$ to $1 \times 10^{16}$ rad/s, then $x_0$ becomes approximately $6 \times 10^{-13}$ m (on the order of femtometers), and within the default display range, it will look like just a point. In such cases, narrowing the displayed $x$ range (e.g., from -$2x_0$ to $2x_0$) makes the shape easier to see.

Another practical pitfall is that "the ground state (n=0) is often mistakenly thought of as a stationary state in classical terms." While the classical minimum energy state is indeed being stationary at the origin, the quantum ground state has zero-point energy, and the particle always possesses "fluctuations." If you design based on classical physics ignoring these fluctuations (uncertainty), you risk significantly mispredicting the behavior of nanodevices in extremely low-temperature environments.

How to Use

  1. Set angular frequency ω using the slider (range 0.5 to 5.0 rad/s) or enter directly in omegaValNum field
  2. Adjust particle mass via massSlider (0.1 to 10.0 amu) to observe how reduced mass affects wavefunction width and energy spacing
  3. Select quantum number n from 0 to 8 to display corresponding energy level Eₙ and wavefunction ψₙ(x)
  4. Toggle showPsi checkbox to overlay real/imaginary components of ψₙ(x) on the x-axis plot
  5. Enable showProb to visualize probability density |ψₙ(x)|² and classical turning points (showTurning)
  6. Compare quantum distribution against classical prediction (showClassical) as dashed envelope

Worked Example

For a 1.0 amu particle (electron-like) with ω = 1.0 rad/s: ground state n=0 yields E₀ = 0.5ℏω, zero-point energy 5.27 × 10⁻³⁵ J. Position uncertainty Δx = 0.707 x₀ and momentum uncertainty Δp = 0.707 ℏ/x₀ satisfy Δx·Δp = 0.5ℏ (saturation of uncertainty principle). For n=3 excited state: E₃ = 3.5ℏω, classical turning points expand to ±√7 x₀, and probability density develops secondary peaks reflecting three nodes in ψ₃(x).

Practical Notes

  1. Increase ω to compress wavefunction width—quantum confinement energy scales as ℏω, useful for modeling molecular vibrations in diatomic bonds (ω ~ 10¹⁴ Hz)
  2. Heavy masses (≥5 amu) push turning points outward; compare with light masses to see quantum tunneling penetration depth beyond classical boundary
  3. Δx and Δp outputs assume normalized Gaussian-like profiles; verify against analytical ℏ/(2mω)^(1/2) for position width
  4. Toggle all four visualization flags simultaneously to identify energy crossover points where quantum probability deviates maximally from Boltzmann distribution