Input files for the open source Quantum Espresso code are provided to reproduce the calculations presented in the paper with the following abstract.
A simple first-principles approach is used to estimate the core level shifts observed in X-ray photoelectron spectroscopy for the 4$f$ electrons of Hf, Ta, W and Re; these elements were selected because their 4$f$ levels are relatively shallow in energy. The approach is first tested by modeling the surface core level shifts of low-index surfaces of the four elemental metals, followed by its application to the well-studied material TaSe$_2$ in the commensurate charge density wave phase, where agreement with experimental data is found to be good, showing that this approach can yield insights into modifications of the charge density wave. Finally, unterminated surface core level shifts in the hypothetical MXene Ta$_3$C$_2$ are modeled, and the potential of XPS for the investigation of the surface termination of MXenes is demonstrated.