For my undergrad optics class I am taking we have to select final projects to work on for second half of the semester. I have spent the last few weeks working on my own project which was a GPU accelerated Barnes-Hunt tree N-Body simulator. I was wondering if I could use a similar idea but for photons. I would put "light sources" in my simulation and emit "photon" particles. I would probably want to simulate billions of these photons. They could bounce off of mirrors and diffract through lenses and be absorbed by a screen.
I am fairly certain this would work well for plain geometric optics, however, I would like to find a way to incorporate the wave properties of light into this simulation so I can form interference and diffraction patterns. I think I can do the interference by having each photon keep track of its phase / path difference as it propagates since the length of the path is easy to track. Then all the photons which strike the same cell on the screen will have their electric fields added together so they interferer with each over. What I am wondering about is what would be a good way to model diffraction? I can't think of a way to generate realistic diffraction patterns given that I am modelling particles and not plane waves. Does anyone know of a method?
I would rather do something a little more physical though than just knowing what a diffraction pattern should look like forcing the rays to conform to that pattern. For instance in my gravitational N-Body sim I only use Newtonian gravity and I can get a galaxy without hard coding it so long as I have the correct initial conditions.
I am also open to other ideas than just random statistical photon ray tracing. I think it would be interesting if I could just straight up model the waves with Maxwell's equations. I looked into doing finite difference analysis but I think you would need a grid cell size on the order of optical wavelength, and for modelling large optical set-ups on the size of meters a 3D grid with nano-meter cells would consume peta-bytes of memory.