Overview: Quantum Mechanics & Wave Function Dynamics
Quantum mechanics reveals that physical entities at the microscopic scale—such as electrons, photons, neutrons, and fullerenes—do not possess single, localized classical trajectories prior to physical measurement. Instead, their dynamical evolution is strictly governed by the time-dependent Schrödinger wave equation:
$$i\hbar \frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat{H}\Psi(\mathbf{r},t) = \left[ -\frac{\hbar^2}{2m}\nabla^2 + V(\mathbf{r},t) \right] \Psi(\mathbf{r},t)$$
In the seminal double-slit experiment, a quantum particle emitted toward a barrier containing two parallel apertures behaves not as a discrete particle localized in space, but as a delocalized probability amplitude wave $\Psi(\mathbf{r},t)$. The probability density of locating the particle at spatial coordinate $\mathbf{r}$ at time $t$ is given by Born's rule:
$$P(\mathbf{r},t) = |\Psi(\mathbf{r},t)|^2 = \Psi^*(\mathbf{r},t)\Psi(\mathbf{r},t)$$
When both slits remain unobserved, the initial state splits into two coherent wavepacket components, $\psi_1(\mathbf{r},t)$ and $\psi_2(\mathbf{r},t)$, traversing Slit 1 and Slit 2 in quantum superposition. As these wavepackets propagate beyond the barrier, they overlap on the detector screen, yielding a superposition wavefunction $\Psi = \frac{1}{\sqrt{2}}(\psi_1 + \psi_2)$. The resulting probability distribution contains a crucial cross-interference term:
$$|\Psi|^2 = \frac{1}{2}|\psi_1|^2 + \frac{1}{2}|\psi_2|^2 + \text{Re}(\psi_1^* \psi_2)$$
The cross term $\text{Re}(\psi_1^* \psi_2)$ gives rise to alternating constructive and destructive interference fringes on the detector array. However, introducing a physical detector ("Observer") at the slits forces entanglement between the quantum system and the macroscopic measurement apparatus. This decoherence mechanism destroys the phase correlation between $\psi_1$ and $\psi_2$, causing wave function collapse into a mixture where $|\Psi|^2 = \frac{1}{2}|\psi_1|^2 + \frac{1}{2}|\psi_2|^2$. The interference fringes vanish instantly, replaced by two classical particle impact peaks.
Technical Details & Numerical Implementation
To maintain smooth performance across mobile and desktop devices without compromising physical fidelity, the visualizer uses numerical rejection sampling derived from exact optical interference equations rather than solving grid-bound partial differential equations. The far-field intensity distribution $I(\theta)$ at angular dispersion $\theta = \arctan((y - y_{center})/L)$ combines single-slit Fraunhofer diffraction with double-slit interference:
$$I(\theta) = I_0 \cdot \cos^2\left( \frac{\pi d \sin\theta}{\lambda} \right) \cdot \text{sinc}^2\left( \frac{\pi a \sin\theta}{\lambda} \right)$$
where $\text{sinc}(\alpha) = \frac{\sin\alpha}{\alpha}$. When an unobserved particle crosses the barrier ($x \ge x_{barrier}$), the destination coordinate $y$ on the detector screen ($x = x_{detector}$) is selected by sampling from $I(\theta)$. Particle trajectories smoothly transition from wave propagation before the barrier into localized impacts on the detector screen.
The rendering engine enforces strict high-DPI resolution matching by multiplying canvas buffer dimensions by `window.devicePixelRatio` while decoupling inline CSS display properties. Control targets adhere to a minimum 48px footprint, and touch interactions on the visualizer canvas pass `{ passive: false }` event configuration to prevent window lockup.