First-principles calculations to investigate the structural, electronic and optical properties of Zn 1 - x Mg x Te ternary alloys