Theory of optical absorption in diamond, Si, Ge, and GaAs