J Synchrotron Radiat. 2023 Jan 1;30(Pt 1):217-226. doi: 10.1107/S1600577522010748. Epub 2023 Jan 1.
FOCUS (Fast Monte CarlO approach to Coherence of Undulator Sources) is a new GPU-based simulation code to compute the transverse coherence of undulator radiation from ultra-relativistic electrons. The core structure of the code, which is written in the language C++ accelerated with CUDA, combines an analytical description of the emitted electric fields and massively parallel computations on GPUs. The combination is rigorously justified by a statistical description of synchrotron radiation based on a Fourier optics approach. FOCUS is validated by direct comparison with multi-electron Synchrotron Radiation Workshop (SRW) simulations, evidencing a reduction in computation times by up to five orders of magnitude on a consumer laptop. FOCUS is then applied to systematically study the transverse coherence in typical third- and fourth-generation facilities, highlighting peculiar features of undulator sources close to the diffraction limit. FOCUS is aimed at fast evaluation of the transverse coherence of undulator radiation as a function of the electron beam parameters, to support and help prepare more advanced and detailed numerical simulations with traditional codes like SRW.