Visualizing the beauty in physics and mathematics
It’s not terribly difficult to apply a similar approach of the simulation of the infinite square well to the simple harmonic oscillator (SHO). What’s the same? There are still energy eigenstates (stationary states) that have definite energy (frequency). You can still form superpositions of these stationary states to produce more general states that “slosh” in time. These superposition states can be used to model realistic scenarios that might occur in various situations. What’s different? Well, the potential energy function is pretty different, rather than a piecewise constant potential like the infinite square well, or the finite square well, the SHO potential is $V (x) = \frac{1}{2}m\omega^2 x^2$. This results in quantitatively different eigenstate energies and wavefunctions. — Visualizing Quantum Mechanics with Python
⭐ Idea taken from the book Visualizing Quantum Mechanics with Python
📌 Ported to JavaScript and Three.js in infinite_squarewell_3d.js
👉 The graph shows the expectation value of $x$ as function of time.
🔧 This quantum_harmonic_osc_2d.js is 100% JavaScript
👉 Based on HarmonicOscillator.html by Daniel V. Schroeder, Weber State University
🔑 Updated and refactored and by Zeger Hendrikse
👉 More physics software by Daniel V. Schroeder can be found here
This simulation animates infinite square well wavefunctions that are built from arbitrary superpositions of the lowest eight definite-energy wavefunctions. The “clock faces” show phasor diagrams for the complex amplitudes of these eight basis functions. Going from the ground state at the left to the seventh excited state at the right, the outside of each “clock” corresponds to the magnitude of each. The wavefunction is then built by summing the eight basis functions, multiplied by their corresponding complex amplitudes. As time passes, each basis amplitude rotates in the complex plane at a frequency proportional to the corresponding energy.
You can select either the real and imaginary parts of the wavefunction (shown in orange and blue, respectively), or the probability density and phase. The phase is represented by hues going from red (pure real and positive) to light green (pure imaginary and positive) to cyan (pure real and negative) to purple (pure imaginary and negative) and finally back to red.
Click (or tap) on any clock face to change the corresponding amplitude. To see an individual basis function, click “zero” and then click on the corresponding clock face. You can also create a coherent state (or an approximation thereof), which oscillates back and forth somewhat like a classical particle would (see Ehrenfest theorem). The parameter α determines the amplitude of this oscillation, with $\alpha^2$ equal to the average number of energy units above the ground state. — Paraphrased from instructions at HarmonicOscillator.html
⭐ Original 06_oscillator.py by Ruth Chabay 2004
🔧 Ported to JavaScript and Three.js in quantum_oscillator.js
👉 A VPython version is also available as quantum_oscillator.py
👉 Click on an energy level to put the oscillator into particular state.
For the quantum harmonic oscillator:
\[\begin{equation} \psi_n(x) = \frac{1}{\sqrt{2^n n! \sqrt{\pi}}} H_n(x) e^{-x^2/2} \end{equation}\]with energy:
\[E_n = \hbar \omega (n + 1/2)\]it holds that the time evolution is given by:
\[\begin{equation} \psi_n(x,t) = \psi_n(x) e^{-i (n+1/2)\omega t} \end{equation}\]In the code we assume
Share on: