Variation of crystal quality and residual stresses in epitaxially grown thin film systems induced by ion implantation and annealing