Accumulating probability density in the electron double-slit experiment simulation
Following my blog post on simulating the electron double-slit experiment here, in the second stage of my simulation of the electron double-slit experiment, I concentrate on the critical step of probability density accumulation on a screen, mimicking the detection of electrons after they pass through the double slit.
Setting up the screen
To capture the interference pattern, I set up a virtual screen in the simulation environment. This screen is represented as a set of coordinates that define its location relative to the slits:
Calculating which cells are crossed
The path of the electron’s wavepacket is mapped by calculating which grid cells are intersected as it travels towards the screen. This step uses Bresenham’s algorithm to efficiently determine the crossed cells:
Accumulating probability density
Each cell’s contribution to the overall interference pattern is quantified by computing the probability density or the modulus of the wavefunction for each cell crossed:
By accumulating the data over time, I can visualize how the interference pattern forms as more electrons are detected on the screen.
Conclusion
This detailed approach allows me to simulate the intricate behavior of quantum particles and provides a powerful visualization of the principle of quantum mechanics—the interference pattern.
For more insights into this topic, you can find the details here. If you’re interested in experimenting with the code and running your own simulations, you can access the full source on GitHub here.