A photo (or movie) is, however, taken through a lens that distorts the image (sometimes intentionally; what is and isn't in focus in a composition is important for drawing the viewers attention).
A path tracer can already simulate this by just putting a bunch of pieces of glass shaped like the real lenses of a camera, but this is extremely computationally intensive.
This particular implementation uses a few (already known in the literature) techniques for making it faster: bidirectional tracing, selective oversampling, and thin-lens approximations.
This is an implementation of these techniques for Arnold, which is a renderer implementation used for many feature films[1].