Spatially varying refractive index due to strain