## Visualizing time-dependent wavefunctions

In my previous post, I presented a method of visualizing wavefunctions that are inherently complex-valued using a single plot that shows both the probability density and phase but frozen in time. Here, I complete this visualization by animating the plot.

For starters, let’s start with the eigenmode of the wave produced by the transverse displacement $y$ of a string of length $L$ (like that of a guitar) with fixed endpoints. The modes of these vibrations is given by $y(x,t)=y_0 \sin(n \pi x/L)\cos(\omega_n t)$, where $y_0$ is the maximum displacement, $x$ is the position, $n$ is the mode number, and $\omega_n$ is the mode frequency. Shown below is wavefunction for $n=3$ plotted as a single image for different snapshots in time.