Rigorous coupled-wave analysis of grating diffraction— E-mode polarization and losses | Synapse