The project, in collaboration with Dr. Manuel Sanchez del Rio (ESRF), is to develop a fast and accurate code for simulating partially coherent radiation from synchrotron sources and its propagation through different optical elements. The HYBRID method uses geometric raytracing as its backbone and combines it with wavefront propagation within the framework of Fourier optics. The code computes diffraction effects when the beam is clipped by an aperture or by the finite size of the optics and can also simulate the effect of mirror figure errors when diffraction is present. The far field version [(a) in image] of the code can be applied to an entire beamline by simulating each optical element iteratively, while the near field version is also available for investigating individual optics [(b) in image]. The partial coherence of the source is taken into account by numerical convolution and ray position/divergence resampling in order to improve the calculation efficiency. The HYBRID code has been benchmarked against the multielectron version of SRW to show its validity in the case of fully, partially and noncoherent beams. The results demonstrate that the code is considerably faster than the multielectron version of SRW and is therefore a useful tool for beamline design and optimization. The HYBRID code uses SHADOW as the raytracing program for its popularity in the synchrotron radiation community. The wavefront propagation part uses the fast Fourier transformbased algorithm for its calculation speed. In general, the method used in the HYBRID code can be easily adapted to any raytracing program. 
Distribution & Impact 
The HYBRID code was initially developed using Igor Pro. The Igor version is also used as the master version for future improvement and is available upon request. The HYBRID code was also translated into IDL and implemented in SHADOWVUI (an XOP extension) as a macro. The latest version was distributed with SHADOWVUI in December 2014. The details of the code and its application can be found in the Publications section. Screenshots of the input panel from both versions are shown to the right

Funding Source 
This project has been produced using APS Upgrade funding, as well as APS operational funding. 
Please cite 
For HYBRID: X. Shi, R. Reininger, M. Sanchez del Rio, L. Assoufid, “A hybrid method for Xray optics simulation: combining geometric raytracing and wavefront propagation”, J. Synchrotron Rad. 21, 669 (2014). DOI:10.1107/S160057751400650X For SHADOWVUI: X. Shi, M. Sanchez del Rio, R. Reininger, “A new SHADOW update: integrating diffraction effects into raytracing”, Proc. SPIE, 9209, 920911 (2014). DOI:10.1117/12.2061984

Related Publications 
X. Shi, R. Reininger, M. Sanchez del Rio, J. Qian, L. Assoufid, “Xray optics simulation and beamline design using a hybrid method: diffractionlimited focusing mirrors”, Proc. SPIE, 9209, 920909 (2014). DOI:10.1117/12.2061950 
Immediate development goals include 

Possible longerterm goals include 
