Si dielectric function in a local basis representation: Optical properties, local field effects, excitons, and stopping power