  Core-level shifts and core-hole screening effects in alloy formation are
studied ``ab initio'' by constrained-density-functional total-energy
calculations. For our case study, the ordered intermetallic alloy MgAu,
final-state effects are essential to account for the experimental Mg 1s shift,
while they are negligible for Au 4f. We explain the differences in the
screening by analyzing the calculated charge density response to the core hole
perturbation.
