These are finite-difference time-domain (FDTD) simulations of the double slit experiment with coherent light, spatially incoherent light and partially spatially coherent light.
The simulations are performed at three different time scales: femtoseconds, picoseconds and microseconds to show the differences between them.
The simulations use the open source FDTD meep simulator
The simulations are stored in HDF5 file format which is very good to store large amounts of data. Then, the simulation are represented and animated with matplotlib.
Check the article and the video for further explanation of the simulations.
Just clone or download the repository. The package requeriments are:
- meep
- numpy
- h5py
- matplotlib
To install meep follow the guide of the official page: https://meep.readthedocs.io/en/latest/Installation/
To perform the simulations, just run from the command prompt the corresponding Python scripts:
python simulation_coherent_femtoseconds.py
python simulation_coherent_picoseconds.py
python simulation_incoherent_femtoseconds.py
python simulation_incoherent_picoseconds.py
python simulation_partially_incoherent_femtoseconds.py
python simulation_partially_incoherent_picoseconds.py
The fastest simulations are the femtoseconds, you can complete them in two minutes.
For the microseconds simulations, you need to run the simulation at least with 10000 samples and averaging them to get a denoised image. This task could take several hours on a personal computer. The smartest approach is taking a sample each time interval equal to the coherence time of the source: λ * λ / (c * Δλ). This is because it is the minimum time to make the electric field change considerably.