Effect of magnesium on structural and optical properties of CaTiO3: A DFT study