## 6 Methodology for First-Principles Studies of Localization
### From DFT to the EDHM  
To describe the effect of disorder within realistic first-principles simulations, we use our recently developed EDHM [192]. The EDHM maps DFT calculations of ordered materials onto low-energy effective tight-binding Hamiltonians. These, then in turn, can be used as input for the TMDCA calculations. The EDHM is a Wannier-function-based method [74; 75; 76]. It makes the TMDCA more tractable by significantly reducing the number of basic functions (i.e., from hundreds of plane waves to a few Wannier functions per atom). Besides the EDHM, there are other electronic structure methods that aim at reducing the number of basic functions such as Numerical Atomic Orbitals [193; 194; 195] and Density-Functional Tight-Binding theory [196]. Conceptually the EDHM is based on a cluster expansion approximation [197] (not to be confused with the clusters embedded in the effective medium theories discussed in the previous sections). In this approximation a physical quantity, the low-energy effective Hamiltonian in this case, is expanded in impurity clusters of increasing size. Specifically, the effective Hamiltonian of an arbitrary configuration of \(N\) impurities, positioned at \((x_{1},...,x_{N})\), can be exactly rewritten as  
\[H^{(x_{1},...,x_{N})}=H^{0}+\sum_{i=1}^{N}V^{(x_{i})}+\sum_{i>j=1}^{N}V^{(x_{i },x_{j})}+... \tag{81}\]  
where \(H^{0}\) denotes the Hamiltonian of the system with no impurities, \(V^{(x_{i})}=H^{(x_{i})}-H^{0}\), denotes the potential of an impurity at \(x_{i}\) and \(V^{(x_{i},x_{j})}=H^{(x_{i},x_{j})}-V^{(x_{i})}-V^{(x_{j})}-H^{0}\) denotes the two-impurity correction of a pair of impurities at \((x_{i},x_{j})\), etc. We have found that for many materials it is already highly accurate to retain only the single-impurity potentials and neglect the higher order corrections [192; 198; 199; 200]. Furthermore, we are typically interested in very dilute impurity concentrations for which Anderson and Mott localization take place. In this limit it is unlikely that multi-impurity corrections to the Hamiltonian need to be considered. Here we emphasize that keeping only the single-impurity potentials in Equation (81) does not mean that multi-impurity scattering is not considered. At this point we are deriving the low-energy Hamiltonian which can, in principle, be solved by exact diagonalization that considers multi-impurity scattering exactly to all orders. In practice, the EDHM consists of three steps. Figure 28: Organization of the modular approach to first-principles calculations of localization. A DFT of the pure system and a DFT supercell calculation of a single impurity are performed as the first step. In the second step, the EDHM converts the DFT output into model parameters of the disordered system. In the third step, the TMDCA is used to study the materials-specific localization properties. In the first step two DFT calculations are performed: a normal cell calculation of the pure host material and a supercell calculation of the host material with a single impurity in it. For example, for KFe\({}_{2-y}\)Se\({}_{2}\), an iron-based superconductor that contains Fe vacancies, the normal cell of the host will be KFe\({}_{2}\)Se\({}_{2}\). To capture the impurity potential of an Fe vacancy one can run a DFT calculation for a K\({}_{8}\)Fe\({}_{15}\)Se\({}_{16}\) supercell containing a single Fe vacancy [199]. 2. The second step is to derive the low-energy Hamiltonians using a projected Wannier function transformation in which a set of atomic orbitals is projected on the bands close to the Fermi level [75; 76; 202]. For the case of KFe\({}_{2-y}\)Se\({}_{2}\), one can project Fe-\(d\) and Se-\(p\) orbitals on the bands within \([-6,\,2]\) eV [199]. This results in two ordered tight-binding Hamiltonians. One for the normal cell \(H^{0}\), and one for the single-impurity supercell \(H^{(x_{j})}\). 3. Finally, a superposition of these ordered Hamiltonians is used to build Hamiltonians of arbitrary impurity configurations.