  The study of defect phases is important for designing nanostructured metals
and alloys. Grain boundaries (GBs) form one class of defects that directly
influence materials properties, such as deformability and strength. At the same
time, alloying can introduce GB phase transformations and can therewith alter
mechanical performance. In this work, the defect phases of a $\Sigma$7
$(12\bar{3}0)$ [0001] 21.78$^\circ$ symmetric tilt GB in hcp Mg are
investigated. Ab-initio simulations as a function of stress and temperature
(using quasi-harmonic approximation) are performed, and different types of
phase transformations are revealed. To this end, the influence of the chemical
degree of freedom on the defect phases is studied for the example of Ga
addition, using an efficient screening approach that combines empirical
potentials and accurate ab-initio calculations. By exploiting the concept of
defect phase diagrams, a phase transformation from the T to the A structural
type and as well as a systematic transition of the segregation site preference
is revealed. The results qualitatively agree well with experimental
observations from scanning transition electron microscopy. The underlying
physical mechanisms have an impact on grain-boundary engineering in metallic
alloys.
