Abstract
Maximallylocalised Wannier functions (MLWFs) are routinely used to compute from firstprinciples advanced materials properties that require very dense Brillouin zone integration and to build accurate tightbinding models for scalebridging simulations. At the same time, highthroughput (HT) computational materials design is an emergent field that promises to accelerate reliable and costeffective design and optimisation of new materials with target properties. The use of MLWFs in HT workflows has been hampered by the fact that generating MLWFs automatically and robustly without any user intervention and for arbitrary materials is, in general, very challenging. We address this problem directly by proposing a procedure for automatically generating MLWFs for HT frameworks. Our approach is based on the selected columns of the density matrix method and we present the details of its implementation in an AiiDA workflow. We apply our approach to a dataset of 200 bulk crystalline materials that span a wide structural and chemical space. We assess the quality of our MLWFs in terms of the accuracy of the bandstructure interpolation that they provide as compared to the bandstructure obtained via full firstprinciples calculations. Finally, we provide a downloadable virtual machine that can be used to reproduce the results of this paper, including all firstprinciples and atomistic simulations as well as the computational workflows.
Introduction
The combination of modern highperformance computing, robust and scalable software for firstprinciples electronic structure calculations, and the development of computational workflow management platforms, has the potential to accelerate the design and discovery of materials with tailored properties using firstprinciples highthroughput (HT) calculations^{1,2,3,4}.
Wannier functions (WFs) play a key role in contemporary stateoftheart firstprinciples electronic structure calculations. First, they provide a means by which to bridge lengthscales by enabling the transfer of information from the atomic scale (e.g., densityfunctional theory and manybody perturbation theory calculations) to mesoscopic scales at the level of functional nanodevices (e.g., tightbinding calculations with a firstprinciplesderived WF basis)^{5,6}. Second, the compact WF representation provides a means by which advanced materials properties that require very fine sampling of electronic states in the Brillouin zone (BZ) may be computed at much lower computational cost, yet without any loss of accuracy, via Wannier interpolation^{7}.
Among several variants of WFs^{8}, maximallylocalised Wannier functions (MLWFs), based on the minimisation of the Marzari–Vanderbilt quadratic spread functional Ω, are those most employed in actual calculations in the solid state^{8}. One ingredient in the canonical minimisation procedure is the specification of a set of initial guesses for the MLWFs. These are typically trial functions localised in realspace that are specified by the user, based on their experience and chemical intuition. As shall be described in more detail later, in the case of an isolated manifold of bands, the final result for the MLWFs is almost always found to be independent of the choice of initial guess^{9}. In the case of entangled bands^{10}, however, this tends not to be the case and the choice of initial guess strongly affects the quality of the final MLWFs, presenting a challenge to the development of a generalpurpose approach to generating MLWFs automatically without user intervention.
Several approaches have been put forward to remove the necessity for userintervention in generating MLWFs, including the iterative projection method of Mustafa et al.^{11}, the smooth orthonormal Bloch frames of Levitt et al.^{12}, and the automated construction of pseudoatomic orbitals rather than WFs as the local basis to represent the target space, as described by Agapito et al.^{13,14,15}. In addition, some ad hoc solutions have been proposed, whose range of applicability is focused onto specific classes of materials^{16,17,18,19}.
A recently proposed algorithm by Damle et al.^{20,21}, known as the selected columns of the density matrix (SCDM) method, has shown great promise in avoiding the need for user intervention in obtaining MLWFs. Based on QR factorisation with column pivoting (QRCP) of the reduced singleparticle density matrix, SCDM can be used without the need for an initial guess, making the approach ideally suited for HT calculations. The method is robust, being based on standard linearalgebra routines rather than on iterative minimisation. Moreover, the authors have proposed an efficient algorithm for the QRCP factorisation that operates on a smaller and numerically more tractable matrix than the full density matrix. Finally, SCDM is parameterfree for an isolated set of composite bands, and requires only two parameters in the case of entangled bands together with the choice of the target dimensionality for the disentangled subspace (i.e., the number of MLWFs required). We emphasise here that the SCDM method can be seen as an extension to solidstate periodic systems of the Cholesky orbitals approach of Aquilante et al.^{22}, that has been developed from a quantumchemistry molecular perspective for finite systems. SCDM focuses instead on periodic systems, and it is based on a realspace grid discretisation of the wavefunctions. We discuss in more detail this equivalence in the “The SCDM algorithm and its physical interpretation” section and in the “Methods” section of the Supplementary Material.
In this article, we present a fullyautomated protocol based on the SCDM algorithm for the construction of MLWFs, in which the two free parameters are determined automatically (in our HT approach the dimensionality of the disentangled space is fixed by the total number of states used to generate the pseudopotentials in the density functional theory (DFT) calculations). We have implemented the SCDM algorithm in the PW2WANNIER90 interface code between the Quantum ESPRESSO software package^{23} and the WANNIER90 code^{24}. We have used our implementation as the basis for a complete computational workflow for obtaining MLWFs and electronic properties based on Wannier interpolation of the BZ, starting only from the specification of the initial crystal structure. We have implemented our workflow within the AiiDA^{25,26} materials informatics platform, and we used it to perform a HT study on a dataset of 200 materials.
We anticipate here that our scheme works extremely well for our purposes, i.e., bandstructure interpolation of both insulating and metallic systems with Wannier functions, but is less suitable for other applications where, for instance, a specific symmetry character of the WFs is required. It is worth mentioning that there are other approaches for constructing Wannier functions, which are based on a minimisation procedure and therefore require an initial guess^{27,28,29} and which could also be automated in a similar fashion. In this work however, we focus only on the automatic generation of maximallylocalised Wannier functions. We also note that there exist efficient nonWannierbased techniques for bandstructure interpolation, e.g., Shirley interpolation^{30,31}. Whilst these approaches have their own advantages, they do not provide the same insight afforded by a realspace, localised description of the electronic structure, which can often be very helpful for understanding and computing advanced properties.
The manuscript is organised as follows. First, we present a summary of the background theory, starting with MLWFs for isolated and entangled bands followed by the SCDM algorithm, where we focus in particular on providing a physical interpretation of the method. In the “Results and discussions” section, we first provide a preliminary comparison, for a few wellknown materials, between MLWFs obtained via the conventional method (i.e., with userdefined initial guesses) and those obtained from SCDM. We then proceed to show the validation of the SCDM method and our workflow for the valence bands of 81 insulating materials. We then discuss our automated protocol to determine the free parameters in the case of entangled bands and validate it on a dataset of 200 semiconducting and metallic materials. Finally, details on the implementation of the SCDM method in PW2WANNIER90 and of the AiiDA workflow are presented in the “Methods” section.
We summarise in this section the main concepts and notations related to maximallylocalised Wannier functions that will be useful in the rest of the paper, following the notation in ref. ^{8}.
A Wannier function associated to a band n can be obtained via a unitary transformation of the Bloch state \(\left{\psi }_{n{\bf{k}}}\right\rangle\), known as Wannier transform^{32}
where V is the realspace primitive cell volume, R is a Bravais lattice vector, and the integral is over the first BZ. For clarity of notation, we assume spindegeneracy unless otherwise specified.
The gauge freedom of the Bloch state under multiplication by a kdependent phase \({e}^{i{\varphi }_{n}({\bf{k}})}\) results in a nonuniqueness in the definition of the Wannier function. Maximallylocalised Wannier functions represent the choice of gauge in which the realspace quadratic spread of the Wannier function is minimised^{8,9}. In order to obtain a minimal TB basis set it is therefore beneficial to select the optimal phases that minimise the total spread, so that overlaps and Hamiltonian matrix elements between different Wannier functions decay rapidly to zero as a function of the distance between their centres. Since the integral transformation in Eq. (1) is still a unitary transformation, the resulting \(\{\left{w}_{{\bf{R}}n}\right\rangle \}\) span the same Hilbert space as the original Bloch states \(\{\left{\psi }_{n{\bf{k}}}\right\rangle \}\). Moreover, from the orthogonality of the \(\left{\psi }_{n{\bf{k}}}\right\rangle\) readily follows the orthogonality of the \(\left{w}_{{\bf{R}}n}\right\rangle\), since unitary transformations preserve inner products. Finally, two WFs \(\left{w}_{{\bf{R}}n}\right\rangle\) and \(\left{w}_{{\bf{R}}^{\prime} n}\right\rangle\) transform into each other under translation by the Bravais lattice vector \({\bf{R}}{\bf{R}}^{\prime}\)^{33}.
For an isolated set of J bands describing, e.g., the valence bands of a semiconductor, the most general phase choice for a Wannier transform can be written as
where U^{(k)} is a unitary matrix that, at each wave vector k, mixes Bloch states belonging to different bands, giving as a result a set of J composite WFs. The localisation of the WFs may be improved by choosing the unitary matrices U^{(k)} such that \(\left{\widetilde{\psi }}_{n{\bf{k}}}\right\rangle ={\sum }_{m}\left{\psi }_{m{\bf{k}}}\right\rangle {U}_{mn}^{({\bf{k}})}\) in Eq. (2) is as smooth as possible, i.e., analytic with respect to k (see, e.g., Duffin^{34}). Different approaches have been put forward^{35,36,37,38,39} to generate welllocalised WFs. In the Marzari–Vanderbilt (MV) approach^{9} U^{(k)} is chosen to minimise the sum of the quadratic spreads of the WFs, given by
where 〈⋅〉_{n} ≡ 〈w_{n0}∣ ⋅ ∣w_{n0}〉 and \({\overline{{\bf{r}}}}_{n}={\langle {\bf{r}}\rangle }_{n}=\langle {w}_{n{\bf{0}}} {\bf{r}} {w}_{n{\bf{0}}}\rangle\) is the centre of the nth Wannier function. The resulting WFs are known as maximallylocalised Wannier functions (MLWFs), and are the solidstate equivalent of the Foster–Boys molecular orbitals^{40,41,42} in quantum chemistry.
The total quadratic spread Ω may be separated into two positivedefinite terms: \(\Omega ={\Omega }_{{\rm{I}}}+\widetilde{\Omega }\), where
and
It can be shown that^{8,9} Ω_{I} is gauge invariant, whereas \(\widetilde{\Omega }\) depends on the particular choice of the gauge (i.e., on the choice of U^{(k)}). For an isolated group of bands, therefore, Ω_{I} is evaluated once and for all in the initial gauge and minimising the total spread Ω is equivalent to minimising only the gaugedependent part \(\widetilde{\Omega }\).
For crystalline solids with translational symmetry, it is natural to work in reciprocal space, henceforth referred as kspace. Applying Blount’s identities^{33} for the representation of the position operator r and r^{2} in kspace and discretising in k (on a uniform grid) gives^{9}
and
where the vectors {b} connect a BZ mesh point k to its nearest neighbours k + b, the associated weights w_{b} come from the finite difference representation of the gradient operator in kspace (a result of the change of representation r → i/\(\hbar\)∇_{k}), and M^{(k,b)} is given by
Since the gradient of Ω with respect to the \({U}_{mn}^{({\bf{k}},{\bf{b}})}\) degrees of freedom can be expressed analytically as function of the \({M}_{mn}^{({\bf{k}},{\bf{b}})}\), the minimisation of the spread functional may be obtained, for instance, by steepestdescent or conjugategradient methods (see refs. ^{8,9}).
Interestingly, even though the global minimisation of Ω fixes the gauge, a certain degree of nonuniqueness may remain for instance if the minimum is very shallow or flat as in the case of LiCl^{9}. This results in different configurations to be degenerate and therefore different solutions (usually related by a global rotation of the MLWFs) can be obtained depending on the initial guess. Moreover, MLWFs are only defined modulo a lattice vector by definition.
In many applications, the group of bands of interest are “entangled”, i.e., are not separated by an energy gap from other bands throughout the whole Brillouin zone.
Souza, Marzari, and Vanderbilt^{10} (SMV) proposed a “disentanglement” strategy that involves two steps. In the first step, one defines an energy window that encompasses the states of interest and which contains \({J}_{{\bf{k}}}^{{\rm{win}}}\) bands at each k. This defines a local Hilbert space \({\mathcal{F}}({\bf{k}})\) at each kpoint, which is spanned by the \({J}_{{\bf{k}}}^{{\rm{win}}}\) states. Then, for a given number \(J\le {\min }_{{\bf{k}}}{J}_{{\bf{k}}}^{{\rm{win}}}\) of target Wannier functions, one finds the optimal set of Jdimensional subspaces \(\{{\mathcal{S}}({\bf{k}})\}\), with \({\mathcal{S}}({\bf{k}})\subseteq {\mathcal{F}}({\bf{k}})\), that have maximum intrinsic smoothness over the BZ, where the intrinsic smoothness of the Hilbert space is measured by Ω_{I}. Heuristically, Ω_{I} represents the “change of character” of the states across the Brillouin zone. (For a rigorous derivation see ref. ^{9}.) The subspaces \({\mathcal{S}}({\bf{k}})\) are defined as the span of \(\{\left{u}_{n{\bf{k}}}^{{\rm{opt}}}\right\rangle \}\), which are obtained via a unitary transformation on the \(\left{u}_{n{\bf{k}}}\right\rangle\) that span \({\mathcal{F}}({\bf{k}})\):
Note that here the U^{dis(k)} are rectangular \({J}_{{\bf{k}}}^{{\rm{win}}}\times J\) matrices, and are unitary in the sense that \({({{\bf{U}}}^{{\rm{dis}}({\bf{k}})})}^{\dagger }{{\bf{U}}}^{{\rm{dis}}({\bf{k}})}={{\boldsymbol{1}}}_{J}\) (with 1_{J} being the J × J identity matrix), ensuring that \(\{\left{u}_{n{\bf{k}}}^{{\rm{opt}}}\right\rangle \}\) form an orthonormal set. Maximum intrinsic smoothness is achieved by choosing U^{dis(k)} to minimise Ω_{I}, which, as discussed earlier, is a measure of the “spillage” between neighbouring subspaces \({\mathcal{S}}({\bf{k}})\)^{10}.
In the second step, having defined a Jdimensional subspace \(\left{u}_{n{\bf{k}}}^{{\rm{opt}}}\right\rangle\) at each k, one proceeds by minimising \(\widetilde{\Omega }\) following the same recipe described in the previous section for the case of an isolated manifold of bands. Further details on the disentanglement procedure can be found in refs. ^{8,10}.
The iterative minimisation of Ω_{I} starts with an initial guess for the subspaces \({\mathcal{S}}({\bf{k}})\). However, the spread functional is nonconvex and the minimisation may get trapped in a local minimum, often resulting in complexvalued WFs^{9} (in the absence of spin–orbit coupling, the WFs at the global spread minimum are expected to be real^{43}). For gradientbased minimisation methods, thus, the ability to reach the global minimum strongly depends on the choice of an appropriate starting point, sufficiently close to the final solution. To this aim, if one has a chemical intuition of the target J Wannier functions, an initial guess of J trial localised functions g_{n}(r) can be defined. These are then projected at every k onto the \({J}_{{\bf{k}}}^{{\rm{win}}}\) Bloch states inside the target energy window (for isolated bands, \({J}_{{\bf{k}}}^{{\rm{win}}}=J,\quad \forall \,{\bf{k}}\)), yielding:
where, at every k, \({A}_{mn}^{({\bf{k}})}=\langle {\psi }_{m{\bf{k}}} {g}_{n}\rangle\) is a J × J square matrix in the case of an isolated manifold of bands and a \({J}_{{\bf{k}}}^{{\rm{win}}}\times J\) rectangular matrix in the case of entangled bands. The initial unitary matrix U^{dis(k)} can then be obtained by orthonormalising the projected guess orbitals \(\left{\phi }_{n{\bf{k}}}\right\rangle\) through a Löwdin orthogonalisation of A^{(k)}:
One possible choice, for instance, is to start from the Bloch states themselves as the projection functions (g_{n}(r) = ψ_{nk}(r)), so that the elements of A^{(k)} are the (random) phases of the Bloch states that are computed by the ab initio code. In the case of isolated bands, even a poor initial choice such as this is often sufficient to reach the global minimum of the spread functional (with enough iterations of the minimisation algorithm). Conversely, in the case of entangled bands, the twostep “disentanglement” procedure is usually unable to reach the global minimum of the spread functional unless the initial trial orbitals are already quite close to the final solution.
This strong dependence of the SMV minimisation algorithm on the initial trial functions, and hence on the user’s intuition and intervention, has been the main obstruction in the development of fullyautomated workflows for generating MLWFs for highthroughput applications.
Results and discussions
The SCDM algorithm and its physical interpretation
An alternative method to the SMV approach described in the “Introduction” has recently been proposed by Damle et al.^{20,21} in the form of the aforementioned selected columns of the density matrix (SCDM) algorithm. The method uses a QR factorisation with column pivoting (QRCP)^{44} of the singleparticle density matrix (DM),
to fix the gauge freedom in a single step, without the need for an iterative minimisation algorithm. In this section, we outline the core concepts of the SCDM method, focusing mainly on the aspects needed to provide a physical interpretation and facilitate its understanding. We refer to the original publications^{20,21} for additional details.
For clarity, we start by considering a system sampled at a single kpoint, e.g., Γ, and so we drop the index k from the DM and other quantities; the extension to multiple kpoints is given in the next section. We start by considering systems with a finite bandgap between the J valence bands and the conduction bands, e.g., insulators and semiconductors.
Let us first recall that \(P=\mathop{\sum }\nolimits_{n = 1}^{J}\left{\psi }_{n}\right\rangle \left\langle {\psi }_{n}\right\) is gaugeinvariant and it is a projector on the space \({\mathcal{S}}\) spanned by the J valence wavefunctions \(\{\left{\psi }_{n}\right\rangle \}\). Moreover, in the insulating case, the realspace representation \(P({\bf{r}},{\bf{r}}^{\prime} )\equiv \langle {\bf{r}} P {\bf{r}}^{\prime} \rangle\) of the DM decays exponentially with the distance between two points r and \({\bf{r}}^{\prime}\): \(P({\bf{r}},{\bf{r}}^{\prime} ) \sim {e}^{\gamma \left{\bf{r}}{\bf{r}}^{\prime} \right}\). This is the wellknown nearsightedness principle^{45,46,47}. In particular, this means that for a given fixed \({\bf{r}}^{\prime} ={{\bf{r}}}_{0}\), the function
represents the projection on the subspace \({\mathcal{S}}\) of a delta function centred at r_{0}, and that this projection is an exponentiallylocalised orbital.
To understand the numerical implementation of the method, we consider from now on the realspace discretised version of the DM. The J valence wavefunctions (or, in the case of periodic systems, the periodic part u_{nk}(r) of the J valence Bloch states) can be stored on a grid of n_{G} points in real space \({{\bf{r}}}_{1},{{\bf{r}}}_{2},\ldots ,{{\bf{r}}}_{{n}_{G}}\). We can then define the following n_{G} × J matrix Ψ that contains the values of the J wavefunctions on the grid points:
With this definition, the orthonormality condition is written as Ψ^{†}Ψ = 1_{J}, while the density matrix (which in discretised form is an n_{G} × n_{G} matrix) can be written as P = ΨΨ^{†}, i.e., \({P}_{ij}=\mathop{\sum }\nolimits_{n = 1}^{J}{\psi }_{n}({{\bf{r}}}_{i}){\psi }_{n}^{* }({{\bf{r}}}_{j})\).
We can now interpret the jth column \({{\mathcal{C}}}^{j}\) of the DM, \({{\mathcal{C}}}_{i}^{j}\equiv {P}_{ij}\), as the projection on the valence subspace \({\mathcal{S}}\) of a test orbital ϕ_{j} that is zero everywhere except at the jth grid position (i.e., at position r_{j}). This statement is the discretised version of the projection of a delta function in Eq. (13), i.e., apart from normalisation, ϕ_{j} is the discretised version of δ(r − r_{j}). Therefore, thanks to the nearsightedness principle, the orbitals represented by the columns of the DM are localised.
This statement is at the core of the SCDM method. In fact, when searching for Wannier functions, we are looking for a complete and orthogonal basis set of J localised functions that span the subspace \({\mathcal{S}}\). In our case, the set of all columns \({{\mathcal{C}}}^{j}\) clearly spans the whole subspace \({\mathcal{S}}\) (since the P operator is the projector on \({\mathcal{S}}\)). However, in essentially all practical situations, J ≪ n_{G} and the set of all these n_{G} orbitals is redundant. In addition, these orbitals are not orthogonal—intuitively, projecting on delta functions centred at two neighbouring points will typically result in a large overlap between the projected orbitals—and not normalised (e.g., in the limiting case of a delta function centred at a position in space where there is no charge density, the resulting projection will have zero norm). Selecting any set of J linearlyindependent columns would form a basis for \({\mathcal{S}}\), and an initial guess for the Wannier functions could be obtained by orthonormalising these J columns, e.g., with a Löwdin symmetric orthogonalisation. However, if these J columns are not already almost orthogonal, the orthogonalisation will be numerically unstable and, most importantly, will mix them and thereby degrade their localisation. Therefore, the goal of the SCDM method is to select the “most representative” J columns, i.e., the columns that possess the largest norm and that are as orthogonal to each other as possible, i.e., the most “wellconditioned subset”, so that the Löwdin orthogonalisation will mix these orbitals as little as possible (Löwdin orthogonalisation minimises the squared difference between the original and orthogonalised functions^{48}). Equivalently, as every column is the projection of a deltalike test orbital centred at r_{j}, we can say that the SCDM algorithm selects J points, from among the original n_{G} grid points, that define the “most representative” localised projected orbitals.
To achieve this goal, SCDM uses the standard linear algebra QRCP method^{44}, which factorises a matrix P as PΠ = QR, where Q is a matrix with orthonormal columns, R is a uppertriangular matrix, and Π is a permutation matrix that swaps the columns of P so that the diagonal elements of R are in order of decreasing magnitude \( {R}_{11} \ge  {R}_{22} \ge \cdots \ge  {R}_{{n}_{G}{n}_{G}}\) (see Methods section of the Supplementary Material for more details). The relevant output of the algorithm is the Π permutation matrix, or more specifically the indexes of the first J columns chosen by the algorithm: these are the “most representative” columns discussed above and, after orthonormalisation, they provide the best guess for the localised Wannier functions of the system. With a slight abuse of notation, in the following we will use the symbol Π also to identify the vector of indexes of the permutation matrix, such that Π(i) = j has the following meaning: Π_{ij} = 1, and all of the other elements in the jth column are equal to zero.
QRCP (a greedy algorithm) selects columns as follows: since R is triangular (and Q has orthonormal columns), the norm of the first selected column \({{\mathcal{C}}}^{\Pi (1)}\) of P is ∣R_{11}∣^{2} and must be the largest possible, therefore the algorithm will choose the column with the largest norm. The second column \({{\mathcal{C}}}^{\Pi (2)}\) is chosen to maximise ∣R_{22}∣^{2} that, due to the properties of Q and R, is the component of \({{\mathcal{C}}}^{\Pi (2)}\) orthogonal to \({{\mathcal{C}}}^{\Pi (1)}\), as shown in the Methods section of the Supplementary Material. So, the QRCP algorithm will select as the second vector the one with the largest orthogonal component to the first, and in general will select the kth vector as the one with the largest orthogonal component to the subspace spanned by the previous (k − 1) columns (to be more precise the actual selection process is a heuristic for trying to keep principal submatrices of R as wellconditioned as possible). It is worth mentioning that this approach is related to the Cholesky orbitals approach of Aquilante et al.^{22}, that applies to finite (nonperiodic) systems and for a different basis set (a basis of atomic orbitals rather than a realspace grid discretisation). In particular, the Cholesky algorithm used in ref. ^{22} is a refined version of the original Cholesky decomposition specifically adapted for positive semidefinite matrices, i.e., Cholesky decomposition with full column pivoting (CholCP) \({\widetilde{\Pi }}^{T}P\widetilde{\Pi }={L}^{\dagger }L\), where L is an upper triangular matrix and \(\widetilde{\Pi }\) is a permutation matrix. In the Methods section of the Supplementary Material, we demonstrate that the selection of the columns in CholCP is the same as in QRCP, at least for the first J = rank(P) columns, i.e., \({(P\Pi )}_{:,1:J}={(P\tilde{\Pi })}_{:,1:J}\). This is due to wellknown connections between QR factorisations and Cholesky factorisations^{44}. Finally, the two methods use undoubtedly related ideas but they are not direct analogues since there are multiple “variants” of SCDM when using localised orbitals.
For an effective practical implementation of the method, a final step is required. In fact, the P matrix can be extremely large, since n_{G} can be of the order of 100,000 or more (while J is often of the order of 10–100). Therefore, applying the QRCP algorithm directly to P is impractical, both for the memory required to store it (\({\mathcal{O}}({n}_{G}^{2})\)), and for the time needed to compute the result (\({\mathcal{O}}(J\times {n}_{G}^{2})\)). Instead, using the fact that P = ΨΨ^{†} and that the original columns of Ψ are orthonormal, one can prove (see Methods section of the Supplementary Material) that the same permutation matrix Π can be obtained applying the QRCP algorithm directly to the much smaller matrix Ψ^{†} (of size J × n_{G}), with a computational cost that scales as \({\mathcal{O}}({J}^{2}\times {n}_{G})\). Moreover, the matrix obtained from the first J columns of (Ψ^{†}Π) may be used as the A_{mn} projection matrix of Eq. (10) as a starting point for the usual Wannierisation procedure in order to obtain MLWFs.
Finally, it is worth noting the connection with the “canonical” approach of userdefined initial guesses (e.g., atomiclike orbitals at specified centres): the SCDM method may be thought of as using as initial guesses a set of extremely localised slike “orbitals” (actually, δ functions), whose centres (located at the points of the realspace grid) are optimally chosen by the SCDM algorithm via the QRCP factorisation.
SCDM for periodic systems: SCDMk
We now extend the discussion to the case of kpoint sampling with more than one kpoint (i.e., not only at Γ), still considering an isolated manifold (e.g., the valence bands). The DM \({P}_{{\bf{k}}}={\sum }_{n}\left{\psi }_{n{\bf{k}}}\right\rangle \left\langle {\psi }_{n{\bf{k}}}\right\) is an analytic function of k^{43,49}, and it is also proven that WFs with an exponential decay exist^{50}; numerical studies for the specific case of MLWFs have confirmed this claim for several materials^{50,51}, and recently there has been a formal proof for 2D and 3D timereversalinvariant insulators^{43}. The SCDM method has been extended also to the case of ksampling^{21} and named in this case “SCDMk”. In summary, the goal is now to select a common set of columns for all the kdependent density matrices P_{k}. Reference^{21} discusses extensively how the method can be extended to a kpoint sampling with more than one k point and it shows detailed results of the convergence as a function of the number of k points used in the columnselection algorithm. The final conclusion of the authors is that it is typically sufficient to select the columns using a single “anchor” k point (typically chosen to be Γ), i.e., it is sufficient to compute the permutation matrix Π using a QRCP on P_{k=Γ} only. Then, this selection of columns can be used for all other kpoints.
Extension to entangled bands
Finally, the extension to the entangled case (e.g., for metals or when considering also the conduction bands of insulators and semiconductors) has been proposed in ref. ^{21}. In this case, a socalled quasidensity matrix is defined,
where f(ϵ_{nk}) is an occupancy function. The isolatedbands case can be recovered by setting f(ϵ_{nk}) = 1 for energy values ϵ_{nk} within the energy range of the isolated bands, and zero elsewhere. For the typical cases of interest of this work (metals, and valence bands and lowenergy conduction bands in semiconductors and insulators), one needs bands up to a given energy (typically slightly above the Fermi energy). Then, as suggested in ref. ^{21}, f(ϵ) can be chosen as the complementary error function:
This function depends on two free parameters μ and σ, whose choice is critical to tune the algorithm and obtain a set of Wannier functions that correctly interpolate the lowenergy electronic bands of a given material. In the “Entangled bands” section, we describe our protocol to choose the values of μ and σ based on the electronic structure of the material, allowing us to implement a fully automated workflow to construct its Wannier functions via the SCDM method.
The algorithm then proceeds as in the case for isolated bands, computing the QRCP factorisation on the quasidensitymatrix or, in practice, on the matrix \(\bf{F}_{{\bf{k}}}{\bf{\Psi} }_{{\bf{k}}}^{\dagger }\) at the k = Γ anchor point, with F_{k} a diagonal matrix with matrix elements \(\{f({\epsilon }_{1,{\bf{k}}}),\ldots ,f({\epsilon }_{{J}_{{\bf{k}}}^{{\rm{win}}},{\bf{k}}})\}\). This approach, therefore, constitutes an alternative to the SMV disentanglement procedure described in the “Introduction” section: matrices obtained from the first J selected columns of \(\bf{F}_{{\bf{k}}}{\bf{\Psi} }_{{\bf{k}}}^{\dagger }\) at each k form the projection matrices A^{(k)}, and the U^{dis(k)} matrices of Eq. (9) are obtained using the Löwdin transformation of Eq. (11).
SCDM and MLWFs
The SCDM algorithm is able to robustly generate welllocalised functions that are used to generate Wannier functions without the need for an initial guess. Whilst this makes the algorithm wellsuited for direct integration within HT frameworks, the selection of the columns cannot be controlled by external parameters (at least for isolated bands), and therefore it is not possible to enforce constraints that might be desirable, such as point symmetries. On the contrary, when explicitly specifying atomiclike initial projections, these (if appropriately chosen) provide at least some degree of chemical and symmetry information. In the “SCDM vs MLWFs in wellknown materials” section, we discuss how this affects the WFs obtained by the algorithm. Our aim is to leverage on the ability of SCDM to automatically generate a good set of localised functions, and to use these to seed the MV algorithm for the minimisation of the total spread functional, which will give in turn an automated protocol to generate MLWFs. Being able to automatically generate MLWFs will also allow users to seamlessly exploit the set of computational tools that have been developed in recent years for MLWFs and implemented in various codes, such as WANNIER90. In practice, this entails employing the SCDM algorithm to compute the A^{(k)} matrices of Eq. (10) as follows:
where the J points r_{n} are obtained from the first J columns of the permutation matrix Π, computed at Γ, i.e., \({{\bf{A}}}^{({\bf{k}})}=\bf{F}_{{\bf{k}}}{\bf{\Psi}}_{{\bf{k}}}^{\dagger }{\bf{\Pi} }_{\Gamma }(J)\), with Π_{Γ}(J) representing the reduced matrix formed by the first J columns of Π_{Γ}.
SCDM and “disentanglement”
It is worth noting that the SCDM method can be also combined with the SMV disentanglement procedure, as a means of seeding the initial subspace projection. However, this introduces two additional parameters associated with the SMV approach, namely ε_{outer}, and ε_{inner}, giving a total of four parameters (together with μ and σ). ε_{outer} defines the upper limit of the socalled “outer” energy window discussed in the “Introduction” section, and ε_{inner} defines the upper limit of a smaller energy window contained within the outer energy window. This inner window is used to “freeze” the Bloch states within during the minimisation of Ω_{I}, such that they are fully preserved within the selected subspaces \(\{{\mathcal{S}}({\bf{k}})\}\) (see ref. ^{10} for a comprehensive description of the outer and inner energy windows). Each additional parameter makes it increasingly difficult to find a robust and automated protocol for obtaining MLWFs. Consequently, when combining SCDM with SMV disentanglement, an optimal selection of all the parameters can be achieved only in an ad hoc, nonautomatic fashion (hence only for few materials). As shown in the “The SCDM algorithm and its physical interpretation” section, SCDM employs a generalised form of the density matrix, Eq. (15), which implicitly defines an energy window via the function f(ε) and selects a smooth manifold by construction. Intuitively, this suggests that SCDM can be used in lieu of the SMV disentanglement procedure. In general, we have found that for the sole purpose of interpolating the energy bands up to a given energy, performing SMV disentanglement step on top of SCDM has at best a marginal improvement on the quality of the interpolation (see “Entangled bands”), and in some cases can even be detrimental due to the casebycase sensitivity on the choice of energy windows. For this reason, in the “Entangled bands” section we focus exclusively on a protocol for the automatic selection of the free parameters in SCDM, i.e., μ and σ, without considering any additional SMV disentanglement.
SCDM vs MLWFs in wellknown materials
As a precursor to the fullyautomated highthroughput study on a set of 200 materials that focuses on automatic Wannierisation and band interpolation from SCDM projections and which will be presented in the “Entangled bands” section, in this section we consider in greater depth and detail the performance of the SCDM method on a small set of simple systems with wellknown Wannier representations of the electronic structure. Specifically, we compare quadratic spreads, centres and symmetries of the WFs computed from the SCDM gauge (as described in the “The SCDM algorithm and its physical interpretation” section) with the ones computed from carefully chosen initial projections. Comparative studies between SCDM localised functions and MLWFs on wellknown materials have recently appeared in the literature^{21,29}. However, here we expand on different aspects, focusing in particular on the combination of the SCDM and the MV approaches (SCDM+MLWFs), to better assess its range of applicability, for instance for beyondDFT methods, e.g., ab initio tightbinding^{52,53}, DFT+U^{54,55,56}, and DMFT^{57,58}, where the symmetries of the Wannier functions are important.
All DFT calculations have been carried out with Quantum ESPRESSO, using the PBE exchangecorrelation functional and Vanderbilt ultrasoft pseudopotentials^{59}. MLWFs are generated from Bloch states calculated on a 10 × 10 × 10 Monkhorst–Pack grid of kpoints. The SCDM method has been implemented in the PW2WANNIER90 code, which interfaces Quantum ESPRESSO with the WANNIER90 code^{24,60}, as explained in “Methods”. WANNIER90 is used throughout this work to generate the WFs on a realspace grid and to perform the interpolation of band structures in reciprocal space.
We consider four different schemes for generating Wannier functions: (1) Full minimisation of Ω using the SMV disentanglement algorithm to minimise Ω_{I} and the MV algorithm to minimise \(\widetilde{\Omega }\) (DIS+MLWF); (2) Minimisation of Ω_{I} only, using the SMV algorithm (DIS); (3) Minimisation of \(\widetilde{\Omega }\) only, using the MV algorithm (MLWF); and (4) No minimisation of Ω (projONLY). In each case, the initial Jdimensional subspace at each k is determined in one of two ways, either by the SCDM method or by projection onto specific atomiclike localised orbitals (Eq. (10)).
We start by studying the Wannierisation of a manifold of bands consisting of the four valence bands plus the four lowlying conduction bands in silicon, the latter being entangled with bands at higher energies. For the SCDM method, we use σ = 2 eV and μ = 10 eV. This choice is equivalent to that of ref. ^{21}, taking into account a shift in the absolute energy scale, which shifts the value of μ. The outer and inner energy windows (described in the “Introduction”), obtained through convergence tests, are set to ε_{outer} = 17.0 eV and ε_{inner} = 6.5 eV.
When using initial projections onto atomiclike orbitals, we find that the spread functional Ω has three minima that are very close to each other and each of which gives eight real MLWFs. The global minimum corresponds to four sp^{3}type MLWFs per Si atom in the twoatom unit cell, oriented in a backbonding (BB) configuration, i.e., with the major lobes of the sp^{3}type MLWFs pointing towards the tetrahedral interstitial sites. A representative example of one such BB MLWF is shown in the isosurface plots in the first row of Fig. 1. Intuitively, from an atomic orbital perspective, one might instead expect the sp^{3}type MLWFs to be in a frontbonding (FB) configuration, i.e., with the major lobes pointing towards the vertices of the tetrahedra centred on the two nonequivalent Si atoms, as shown in the isosurface plots in the second row of Fig. 1. However, this FB configuration corresponds to a slightly larger value of the total spread Ω and, therefore, constitutes a local minimum of the spread. A third (intermediate) local minimum gives four sp^{3}type MLWFs that are in the BB configuration on one Si atom in the unit cell and four sp^{3}type in the FB configuration on the other Si atom. At variance with what is stated in ref. ^{29}, all these cases can be found by specifying as initial projections four appropriately oriented sp^{3}type orbitals on each Si atom in the unit cell. For the BB configuration: four sp^{3}type orbitals centred on the Si atom at (0.0, 0.0, 0.0) (Si1), and four rotated sp^{3}type orbitals centred on the other Si atom (Si2) at (\(\frac{1}{4},\frac{3}{4},\frac{1}{4}\)) in fractional coordinates with respect to the lattice vectors a_{1} = (−5.10, 0.00, 5.10), a_{2} = (0.00, 5.10, 5.10) and a_{3} = (−5.10, 5.10, 0.00) (in a_{0}). In the WANNIER90 code this can be specified in the projection block of the input file as: Si1:sp3:z = 0,0,−1:x = 0,1,0; Si2:sp3. For the FB configuration: same as above but with the labels 1 and 2 on the Si atoms interchanged.
With these initial projections, the four different minimisation options described earlier give the same qualitative results. Going from the DIS+MLWF case to DIS to MLWF to projONLY, the spreads of the MLWFs increase, as expected, but the FB/BB character is consistently present (see the top two rows of Fig. 1, the spread of the individual MLWFs (in units of Å^{2}) is reported underneath each isosurface plot). Performing the SMV disentanglement step results in a reduction of Ω_{I} from 26.54 to 20.06 Å^{2} in both the FB and BB cases, showing that the initial and final selected subspaces from the two different choices of projection have the same intrinsic smoothness.
Instead, starting from SCDM to define the initial subspace, we obtain different qualitative results for the four different minimisation schemes. Wannier functions in the BB configuration are found when a full minimisation is performed (i.e., SCDM followed by SMV and MV minimisation). A representative example of one such WF is shown in the third row and first column of Fig. 1. SCDM selects a less smooth initial subspace (Ω_{I} = 27.54 Å^{2}) than specifying atomic orbital initial projections (26.54 Å^{2}), but the final spreads are the same as in the equivalent BB case with atomic orbital initial projections. We also observed that in the case of SCDM, the minimisation of both Ω_{I} and \(\widetilde{\Omega }\) required more iterations to achieve the same level of convergence, perhaps reflecting the fact that the initial subspace is less smooth. When using the other minimisation schemes, we find functions of both FB and BB character, all with slightly different individual spreads. Representative isosurfaces are shown in the last three columns of the row labelled “SCDM” in Fig. 1. It is clear that the tetrahedral site symmetry is not preserved in the resulting WFs. Moreover, there is no clear pattern in the individual spreads going from the DIS case to the projONLY case.
When looking at the interpolated band structure, however, a different picture emerges. In the case of choosing atomic orbital projections, the interpolation is very poor if no SMV disentanglement step is included in the minimisation. This shows the importance of disentangling the correct manifold and it is in agreement with what has been previously reported in the literature^{8}. On the other hand, in the case of an SCDMgenerated initial subspace, the interpolation is only marginally affected by the minimisation scheme employed (see Fig. S1 in Supplementary Note 1).
To summarise, in silicon SCDM performs very well when combined with full spread minimisation, both in terms of the symmetries of the WFs and band interpolation (see Fig. S1). When SCDM is used in isolation, the individual spreads of the resulting WFs are larger than WFs generated from userdefined atomic orbital projections; the quality of band structure interpolation, however, is almost independent of whether or not subsequent spread minimisation is carried out.
Copper presents a paradigmatic case of a noble metal where a set of bands (e.g., of dorbital character) cross and mix in a narrow energy window around the Fermi energy with a set of broad, nearlyfreeelectron bands. In this case, the SMV algorithm turns out to be very sensitive to the choice of the initial gauge and a good Wannier representation of the band structure can be achieved only by a careful choice of both initial projections and energy windows. Consequently, the possibility of bypassing these userintensive steps makes the SCDM an attractive approach. This is particularly important for methodologies such as ab initio tight binding^{53}, DFT+U^{55}, and DMFT^{58}, which deal with strong correlation in a local subspace, e.g., the subspace spanned by d orbitals (for transition metals or transitionmetal oxides) or f orbitals (for rareearth or actinide intermetallics). For copper, as suggested by Souza et al.^{10}, in order to generate a faithful representation of the band structure around the Fermi level, we work with a manifold of dimension J = 7, which contains one more function than the conventional minimal basis usually employed in tightbinding models. For this system, we focus only on the full minimisation scheme (DIS+MLWF), as it is the most representative when comparing the symmetries of the WFs, as shown in the previous section. For the disentanglement step we set ε_{outer} = 38.0 eV and ε_{inner} = 19.0 eV. For SCDM, we set μ = 11.40 eV and σ = 2.0 eV. The Fermi energy in our calculation is at 12.18 eV. As shown in ref. ^{10}, appropriately selected initial projections are five dtype orbitals centred on the Cu atom and two stype orbitals, each centred on one of the two tetrahedral interstitial sites. The resulting seven MLWFs respect the symmetries one would expect from group theory. In fact, the five dlike functions give a representation of dimension 3+2 of the O_{h} point group (which is isomorphic to the sitesymmetry group of the origin), with the usual t_{2g} and e_{g} character (see Fig. 2a, b). The two slike functions give each a onedimensional representation (a_{1}) of T_{d} (which is the sitesymmetry group of the tetrahedral interstitial sites), as shown in Fig. 2c.
When using SCDM projections, the symmetries of the dtype MLWFs are not fully recovered. This can clearly be seen in Fig. 2d, e, where the dtype functions show mixed t_{2g}/e_{g} character (this is a feature of all five dtype functions).
Isolated bands
Until here, we have looked into the details of the Wannier functions that can be obtained from SCDM projections, by focusing on the paradigmatic examples of silicon and copper (see “SCDM vs MLWFs in wellknown materials”). We focused on comparing Wannier functions as obtained by adopting different initial projections, given that good atomiclike projections can often be easily identified through chemical intuition. Now we take a complementary perspective, by considering any given crystal structure, where we face the problem of finding good initial projections without any prior chemical knowledge of the system. This is particularly relevant for highthroughput studies, where crystalstructure databases are systematically screened with firstprinciples simulations. In order to produce highthroughput Wannier functions, it is fundamental to provide an algorithm that does not require human interaction in the choice of the initial projections. In addition, such an algorithm must be able to use only information that is either contained in the crystal structure and the pseudopotential, or that can be computed by a simple firstprinciples simulation, such as the projected density of states. To this aim, humanspecified atomiclike projections are not suitable, and we propose the SCDM method as the workhorse for the automated choice of the initial projections.
In order to ascertain the effectiveness of the SCDM method in generating welllocalised Wannier functions in an automated way, we start by testing the algorithm for isolated manifolds. We compare Wannier interpolations and direct DFT calculations for the band structure of the valence bands of a set of 81 insulating bulk crystalline materials spanning a wide range of chemical and structural space, for the full list the Reader is referred to ref. ^{61}. We quantify the differences between two band structures by introducing a simple metric that is inspired by the socalled “bands distance” introduced in ref. ^{62}. Here we define the distance between DFT and Wannierinterpolated bands as:
where \({\varepsilon }_{n{\bf{k}}}^{{\rm{DFT}}}\) and \({\varepsilon }_{n{\bf{k}}}^{{\rm{Wan}}}\) are respectively the DFT and Wannierinterpolated band structures, and the summation runs over the occupied bands only. Later in the “Entangled bands” section, we will introduce a finite smearing to deal with conductionband states and metallic systems. As in ref. ^{62}, to take into account the possibility that significant differences between band structures may occur only in subregions of the Brillouin zone or in small energy ranges, we also compute
where, essentially, we select the point (nk) with the worst interpolation, which is responsible for the largest contribution to η. We use η and \({\eta }^{\max }\) to assess the effect of iteratively minimising the spread \(\widetilde{\Omega }\) to obtain maximallylocalised Wannier functions (“SCDM+MLWF”), compared to the oneshot Wannier orbitals that are obtained by using the SCDM projections only (“SCDMonly”). We note that in the following MLWF might refer either to a maximallylocalised WF or to the maximal localisation procedure itself, the meaning being always clear from the context.
For each of the 81 structures of the benchmark set, we first perform a variablecell optimisation and we then compute the band structure on a highsymmetry path using DFT. The cell and the path are standardised using seekpath according to the prescription of ref. ^{63}. The groundstate charge density is obtained using a kpoint spacing of 0.2 Å^{−1} in the irreducible Brillouin zone (unless otherwise stated). Band structures are then calculated using the charge density frozen from the earlier calculation and sampling the highsymmetry path with a spacing of 0.01 Å^{−1}. Then we compute the WFs and the realspace Hamiltonian with WANNIER90, starting from a nonselfconsistent field (NSCF) DFT calculation performed on a possibly different kpoint grid on the full BZ and employing the groundstate charge density computed earlier. At this point, the bands distance is then calculated by diagonalising the Wannier Hamiltonian using the TBMODELS code^{64} on the same kpoints used in the DFT bands calculation.
All DFT calculations are carried out using the Quantum ESPRESSO distribution^{23}, employing the PBE functional^{65} and a beta version of the SSSP v1.0 efficiency pseudopotential library^{62,66,67,68,69,70}, where the normconserving ONCV pseudopotentials^{71} are recompiled using version 3.3.1 of the code, and the pseudopotentials for Ba and Pb are replaced by Ba.pbespnkjpaw_psl.1.0.0.UPF and Pb.pbednkjpaw_psl.0.2.2.UPF of the pslibrary. In Fig. 3, we report histograms of η and \({\eta }^{\max }\) for four different kpoint spacings, namely ρ_{k} = 0.15, 0.2, 0.3, and 0.4 Å^{−1}, used in the NSCF step to construct Wannier functions. We stress that for an isolated set of bands, such as for the valence bands of an insulator, the SCDM method involves no free parameters and the only parameter to set is the kpoint grid spacing ρ_{k} of a uniform grid that is used to diagonalise the Hamiltonian. Hence it is fundamental to elaborate a strategy for the choice of ρ_{k}, as this finally removes every free parameter from the construction of Wannier functions for isolated bands.
The SCDM method is found to work well for all of the 81 systems studied, with the exception of two that have very poor interpolation. Notably, these two structures (three if we consider the SCDMonly method) are the ones that exhibit the highest initial spread Ω per Wannier function. Although a large initial spread does not necessarily imply poor interpolation, it certainly correlates with a potential risk of poor Wannierisation and it could be used as a marker for triggering a check on the quality of bands interpolation within the calculation workflow. We postpone the discussion on the causes of the poor performance of the SCDM method in these systems until the end of this section, where we also provide possible solutions that can be automated.
To get a sense of the typical quality of a good SCDM+MLWF interpolation, we report in Fig. 4 the comparison between directDFT and SCDM+MLWF interpolated band structures for CaO (η = 0.06 meV, \({\eta }^{\max }=0.23\) meV) and C_{3}Mg_{2} (η = 0.4 meV, \({\eta }^{\max }=5.6\) meV) run with a kpoint spacing ρ_{k} = 0.2 Å^{−1}; the direct and interpolated band structures are essentially indistinguishable (e.g., the largest difference in energy between the bands in the case of CaO is of \({\eta }^{\max }=0.23\) meV).
Figure 3 shows the distribution of η and \({\eta }^{\max }\) across the whole set of insulators for the four different kpoint grids. We find that a grid with spacing ρ_{k} = 0.2 Å^{−1} is typically sufficient to provide accurate interpolated band structures, in particular 96% of the materials (78/81) for SCDMonly and 98% (79/81) for SCDM+MLWF show η < 20 meV, and 93% (75/81) of the SCDM+MLWF bands and 74% (60/81) of the SCDMonly bands display η < 2 meV. As shown in Fig. 3, \({\eta }^{\max }\) follows a similar trend, with 95% (77/81) of the SCDM+MLWF bands and 86% (70/81) of the SCDMonly bands showing an \({\eta }^{\max }\,<\,50\) meV, and 90% (73/81) of SCDM+MLWF bands and 77% (62/81) of the SCDMonly bands showing an \({\eta }^{\max }\,<\,20\) meV.
Those systems with η > 20 meV or, in other words, interpolated bands that are significantly less accurate with respect to the majority of the sample, are considered to be outliers. In Table 1, we report the number of outliers for the four different kpoint spacings, both in the case of SCDMonly and SCDM+MLWF. Clearly, increasing the kpoint density produces fewer outliers and, in this respect, the SCDM+MLWF seems to converge slightly faster than SCDMonly, in agreement with the results shown in Fig. 3.
As we will discuss shortly, the superior performance of SCDM+MLWF is linked with the increased localisation associated with the MLWF procedure. As mentioned before, localisation is also related to the poor interpolation of the outliers: at all kpoint spacings, outliers are among the systems with the largest initial spreads. On one hand, a larger initial spread signals a potential problem with the SCDM projections, on the other hand it requires a denser kpoint grid for convergence (the less localised the Wannier functions are, the more longrange the Wannier Hamiltonian is).
Figure 3 also shows that, when considering valence bands only, the MLWF procedure moderately improves the quality of band interpolation with respect to SCDMonly, resulting in narrower η and \({\eta }^{\max }\) distributions, although band interpolation is often already excellent using an SCDMonly approach. We emphasise, however, that it is known that for the valence bands of gapped systems, a set of randomlycentred Gaussian functions can be often used as starting projections leading to good MLWFs. We compare, therefore, the performance of SCDM projections vs randomlycentred Gaussian orbital projections as a starting point for the MLWF procedure (which we refer to as the “random+MLWF” scheme), assessing their comparative robustness and accuracy of band interpolation. Figure 5 reports the distribution of η and \({\eta }^{\max }\) with kpoint spacing ρ_{k} = 0.2 Å^{−1}. The SCDM projections are found to perform better, leading to narrower distributions: 98% of the materials (79/81) show η < 20 meV for SCDM+MLWF against the 89% (72/81) for random+MLWF, and 93% (75/81) of the SCDM+MLWF bands display η < 2 meV against 75% (61/81) of random+MLWF bands. As shown in Fig. 5, \({\eta }^{\max }\) follows a similar trend, with 95% (77/81) of the SCDM+MLWF bands and 81% (66/81) of the random+MLWF bands showing an \({\eta }^{\max }\,<\,50\) meV, and 90% (73/81) of SCDM+MLWF bands and 74% (60/81) of the random+MLWF bands showing an \({\eta }^{\max }\,<\,20\) meV. Therefore, while SCDM is able to provide WFs resulting in a more accurate band interpolation, we emphasise here that for isolated manifolds the minimisation procedure is quite robust also when providing randomlycentred slike Gaussian orbital projections.
We now elaborate on the differences between random and SCDM initial projections. First, random projections typically generate a much higher initial spread (7.5 Å^{2} per WF) compared to SCDM (1.0 Å^{2} per WF). We find that the MLWF procedure is often sufficient to localise Wannier functions even in the case of large initial spreads: for 63 out of 81 materials the MLWF procedure brings both the random projections and the SCDM projections cases to the same minimum spread value. Notably, it never happens that the spread is similar and the quality of the interpolation is very different, while the opposite happens only in the case of He, a pathological case (1 atom and 2 electrons per cell) where random projections give a poorly localised Wannier function while still being able to provide a very good interpolation. For 15 materials (16 if we include He), random projections provide a very poor starting point and the MLWF procedure remains trapped in a local minimum with large spread. In these cases, instead, SCDM projections are a good starting point with low spread and the MLWF procedure further reduces it and a higherquality interpolation is achieved, as demonstrated by the lower η values. Finally, there are two materials for which both SCDMonly and SCDM+MLWF do not perform well, but where random+MLWF happens to perform better than SCDM+MLWF. For one of these cases, Al_{2}Os, we have checked that excluding the semicore states greatly improves the performance and the quality of the interpolated bands. We believe that the reason lies in the fact that, if semicore states are present, then there are some projections, centred on the same site, that possess the same symmetry character, e.g., plike projections with different principal quantum numbers (for instance 1p and 2plike). With a relatively low planewave energy cutoff, the realspace grid is too coarse and there are not enough degrees of freedom for the column selection in the QRCP step to distinguish or describe sufficiently well these samesymmetrycharacter states.
In the other case, Se_{2}Sn, there are no semicore states. Here instead, some SCDM projections show an initial value of Ω_{D}—the sum of the diagonal elements of \(\widetilde{\Omega }\) in Eq. (5)—that is not zero or very close to zero (Ω_{D} > 0.5 Å^{2}), which could be used as a diagnostic indicator for problematic systems. In particular, SCDM+MLWF seems to get trapped in a state in which there are a number of welllocalised WFs and two that are diffuse and spread over multiple sites. This set of WF are real with a total spread of 28 Å^{2} and Ω_{D} of 2 Å^{2}. We found that a possible solution to recover a good interpolation is to add some noise (adding small random numbers to the search direction components, as implemented in WANNIER90) during the minimisation to help the algorithm escape from the unwanted local minimum.
We propose some technical solutions that could be easily added to a workflow:

Automatically detect and exclude semicore states (if any). This is generally a safe choice as these states are not physically interesting for most applications. Alternatively, one could retain the semicore states and increase the cutoff energy (or equivalently the density of the realspace grid).

If the problem is not in describing semicore states, then check the value of Ω_{D}, if it is above a given threshold (e.g., >1.0 Å^{2}) for one or more initial projections, introduce some noise in the minimisation.

If none of the above work, switch to random+MLWF projections, which may give a better final result.
To study now more in detail the effect of minimising the spread, we start by comparing the total spread Ω obtained using SCDM+MLWF and SCDMonly, by computing:
where Ω^{SCDM} and Ω^{MLWF} are the total spreads obtained with SCDMonly and SCDM+MLWF, respectively. As reported in Fig. 6, the SCDMonly Wannier functions are already well localised and \(\frac{\Delta \Omega }{{\Omega }^{{\rm{MLWF}}}}\) is less than 10% for 68% (55/81) of systems, and less than 20% for 88% of them (71/81).
An interesting question is whether the difference in spread due to the MLWF procedure correlates with the difference in the quality of the interpolation. To assess this, we compute the quantity
where η^{SCDM} and η^{MLWF} are the band distances obtained with SCDMonly and SCDM+MLWF respectively. Figure 7 shows a scatter plot of Δη vs ΔΩ/Ω^{MLWF}, showing that a reduction in the spread typically implies an improvement in the quality of the interpolation (Δη < 0). These findings highlight that SCDMonly Wannier functions are already sufficiently localised and represent well the valence manifold, and the subsequent MLWF procedure (starting from a very good guess) safely refines the initial choice of SCDM, improving the accuracy of the Wannier Hamiltonian by increasing localisation. In general, the greatest benefit from the MLWF procedure is visible in the interpolation of the almostflat semicore states. In fact often, when using SCDMonly Wannier functions for the interpolation of these states, the interpolated bands show an oscillatory behaviour, with the maximum absolute difference with respect to the DFT bands of the order of a few meV (comparable to the spread of those bands). From our results, a smoother and more accurate interpolation is usually recovered after a MLWF procedure.
Before discussing the case of entangled bands, we summarise here the main conclusions that can be drawn for isolated bands. All the results we obtained, displayed in Figs 3, 4, and 6, consistently support the effectiveness of adopting SCDM projections for the Wannier interpolation of the valence bands of insulators. The quality of the interpolation is very high for 98% of the structures, with only 2 (out of 81) cases showing a poor interpolation. Although SCDMonly Wannier functions are shown to provide already accurate band structures, the MLWF procedure appears to improve both the quality of interpolation (lower η) and localisation (lower spread). Hence, we suggest the SCDM+MLWF method with ρ_{k} = 0.2 Å^{−1} as the standard protocol for producing accurate and efficient Wannier Hamiltonians describing the valence bands of bulk insulating crystals.
Entangled bands
We now consider the case of entangled bands. With the intent of describing a fully automatic protocol, we limit ourselves to the case of Wannier interpolation of all states up to a given energy (excluding, if appropriate, manifolds of lowlying semicore states that are isolated in energy from the rest of the band structure) and we do not consider the case of computing Wannier functions for a manifold of bands of given symmetry within a narrow energy window (e.g., d states in copper or \({t}_{{2}_{g}}/{e}_{g}\) states in a transitionmetal oxide, see “SCDM vs MLWFs in wellknown materials”) that is entangled with bands above and below in energy.
In the case of entangled bands, the SCDM method demands the choice of three free parameters: μ and σ, as described at the end of “The SCDM algorithm and its physical interpretation” section, as well as J, the target number of Wannier functions. These parameters play a fundamental role in the selection of the columns of the quasiDM and hence greatly affect the overall quality of the subspace selection and, consequently, the bands interpolation. In particular, since there is no equivalent definition of an inner energy window^{10} in the SCDM method, it is not guaranteed that a subspace that includes the physicallyrelevant lowestlying bands will be selected because the greedy QRCP algorithm, owing to an inappropriate choice of μ and σ, might favour states that are higher in energy. It is, therefore, key to the success of the automation process to have a protocol that automatically chooses these parameters in a robust and systematic way. We will now describe such a protocol, and in the “Highthroughput verification” section we show its effectiveness on a large set of chemically diverse materials.
Protocol
To identify appropriate values of μ, σ, and J, we first compute the “projectability” p_{nk}, which measures how well each Bloch state \(\left{\psi }_{n{\bf{k}}}\right\rangle\) is represented in a Hilbert space \({\mathcal{A}}\) defined by a given set of localised functions. Indeed, in the entangled case, WFs contain contributions from the valence states plus specific conduction states, typically corresponding to the antibonding partners of the valence states. The selection of these specific conduction states—out of the very many—can be challenging, because they are not necessarily the lowest energy ones. This idea motivates the use of projectability as a measure to see which conduction states might be more important.
Similarly to Agapito et al.^{14}, we choose as our localised functions the set of N_{PAO} pseudoatomic orbitals (PAO) ϕ_{Ilm}(r) employed in the generation of the pseudopotentials, where I is an index running over the atoms in the cell and lm define the usual angular momentum quantum numbers. We then construct Bloch sums \({\phi }_{\mu {\bf{k}}}({\bf{r}})=\frac{1}{{N}_{\mu }}{\sum }_{{\bf{R}}}{e}^{i{\bf{k}}\cdot {\bf{R}}}{\phi }_{\mu }({\bf{r}}{\bf{R}})\), where μ = {Ilm} and N_{μ} is the number of lattice vectors R contained in the Bornvon Karman cell (which is equal to the number of kpoints sampled in the BZ). Finally, a Hilbert space \({{\mathcal{A}}}^{{\bf{k}}}\) at each kpoint in the BZ is defined as the space spanned by the Löwdinorthogonalised functions \({\widetilde{\phi }}_{\mu {\bf{k}}}({\bf{r}})={\sum \nolimits_\nu }{\left({\left({\bf{S}}^{\bf{k}}\right)}^{1/2}\right)}_{\mu \nu }{\phi}_{\nu {\bf{k}}}({\bf{r}})\), with \({S}_{\mu \nu }^{{\bf{k}}}=\langle {\phi }_{\mu {\bf{k}}}({\bf{r}}) {\phi }_{\nu {\bf{k}}}({\bf{r}})\rangle\), and \({\mathcal{A}}\) is given by the direct sum \({\mathcal{A}} = {\bigoplus }_{{\bf{k}}}{{\mathcal{A}}}^{{\bf{k}}}\).
The projectability of each Bloch state onto \({\mathcal{A}}\) is then defined as
where 0 ≤ p_{nk} ≤1. The projections \(\langle {\psi }_{n{\bf{k}}} {\phi }_{{\bf{k}}Ilm}\rangle\) are computed straightforwardly using the projwfc.x code from Quantum ESPRESSO. In particular, for the pseudopotentials considered in this work, the number of valence electrons and the atomic orbitals included in the pseudopotential files may be found in Table S1 in Supplementary Note 2.
As the first step of our protocol, we choose J as the total number of projections N_{PAO} considered in the sum of Eq. (22). Since we aim to interpolate the bands up to a given energy above the Fermi level, fixing J = N_{PAO} is a conservative choice, as the number of PAOs is usually greater or equal to the number of valence bands plus few conduction bands.
We then use the values of the projectability to inform the choice of μ and σ. First, we plot the projectability for all Bloch states as a function of the corresponding band energy ϵ_{nk}, as shown in Fig. 8 (to illustrate the procedure, we show plots for one prototypical material, namely crystalline tungsten (W), but similar plots and trends also hold for the other materials considered in this work). The general trend is that p_{nk} ~ 1 for lowenergy states, which are wellrepresented by the chosen pseudoatomic orbitals, and p_{nk} ~ 0 for highenergy states that originate either from freeelectronlike states or from localised states with an orbital character that is not included in the set listed in Table S1 in Supplementary Note 2, e.g., atomic orbitals with principal quantum number n > 3 (i.e., more than two radial nodes). We then fit this plot to a complementary error function as in Eq. (16), extracting the two parameters μ_{fit} and σ_{fit}. The core of our protocol lies on the actual choice of the μ and σ parameters used as input for the SCDM method by setting
Let us now motivate this choice. We observe that σ_{fit} measures the typical energy spread of the bands originating from states within \({\mathcal{A}}\), and therefore is a good physical guess also for σ. The naive choice μ = μ_{fit}, however, produces extremely poor interpolation of the bands for most of the materials that we have tested, see “Highthroughput verification”. The reason is that it gives too great a weight in Eq. (15) to states that have relatively small projectability (p_{nk} < 1). As a consequence the SCDM algorithm might select columns representing better these states rather than those with projectability close to 1 at low energy, that are essential and physically relevant to include. In these cases, the corresponding band interpolation shows large oscillations and has large errors with respect to the DFT band structure in large portions of the BZ. We need therefore to choose a smaller value μ < μ_{fit}. On the other hand, however, we note that the weight of states much above μ becomes numerically zero in Eq. (15), i.e., these states become completely unknown to the algorithm. Therefore, by choosing a too low value of μ, i.e., discarding too many relevant states, the SCDM algorithm will fail because it will have to choose J columns within a matrix of smaller rank.
We need, therefore, a general and automatic recipe for choosing an appropriate, intermediate value of μ. Our choice μ = μ_{fit} − κσ_{fit} is guided by the consideration that states that start to have a significant component of their character outside \({\mathcal{A}}\) should be weighted in SCDM by Eq. (16) with a small weight, that is still though not exactly zero, giving the algorithm some freedom to pick up some of their character (for instance, states at energy ϵ ≥ μ_{fit} have more than 50% of their character outside \({\mathcal{A}}\) and are weighted in SCDM with a factor \(\le \frac{1}{2}{\rm{erfc}}(\kappa )\); e.g., κ = 3 gives \(\frac{1}{2}{\rm{erfc}}(3)\approx 1{0}^{5}\)).
In order to explain better our specific choice of κ = 3, we consider again the case of tungsten for the SCDM+MLWF case and we report in Fig. 9 the final total spread Ω (lefthand side) and the band distance η (righthand side) as a function of a range of values of μ and σ. In particular, in the case of entangled bands, we generalise the definition of η by introducing a smearing, as we have mentioned in the previous section. More specifically, we extend the definition of the distance between DFT and Wannierinterpolated bands to:
where
and \({f}_{n{\bf{k}}}^{{\rm{DFT(Wan)}}}(\nu ,\tau )\) is the Fermi–Dirac distribution for the state at energy \({\varepsilon }_{n{\bf{k}}}^{{\rm{DFT(Wan)}}}\), ν is a fictitious chemical potential and τ is a smearing width computed on the direct (\({\varepsilon }_{n{\bf{k}}}^{{\rm{DFT}}}\)) and Wannierinterpolated (\({\varepsilon }_{n{\bf{k}}}^{{\rm{Wan}}}\)) band structures. As in the “Isolated bands” section, we take into account the possibility that significant differences between band structures may occur only in subregions of the Brillouin zone or in small energy ranges, so we also compute
In particular, the value of ν in \({\widetilde{f}}_{n{\bf{k}}}(\nu ,\tau )\) is set to 1 eV above the Fermi energy and the smearing width τ is 0.1 eV. In this way, only states up to slightly more than 1 eV above the Fermi level have a weight significantly different from zero when comparing band structures. In both panels of Fig. 9, we also show the line representing μ = μ_{fit} − 3σ to discuss our choice of κ = 3, as well as the point (μ_{fit} − 3σ_{fit}, σ_{fit}) on this line. Our target is to have η as small as possible, indicating a good interpolation of the band structure. As visible in Fig. 9, and as mentioned in the previous two paragraphs, large values of μ and σ degrade significantly the quality of the band interpolation: in this case there are many states at high energy with a nonnegligible weight and the QRCP, being a greedy algorithm, might select a subspace that better represents these states rather than the lowest energy states. It can also be seen that a larger μ, which results in more states with higher weight, gives the SCDM algorithm more freedom in the choice of the subspace, which in turn results in a lower total spread Ω (at the expenses of a potentially worse interpolation).
On the other hand, also moving to the region of small μ and σ is detrimental for the quality of the band interpolation (and partially also for the value of Ω). Even if the values of η in this region are not so large as in the region of large μ and σ, the quality of the interpolation is much less robust and both η and Ω depend strongly on the precise values of the two parameters. In this case, we are discarding relevant states from the initial space used for the column selection of F_{k}Ψ_{k}, therefore removing important information needed by the method for a good interpolation.
Our choice of κ = 3, thus, together with σ = σ_{fit}, allows us to locate our choice of (μ, σ) in the intermediate region where η is small and both η and Ω are relatively insensitive to small variations of the two parameters. Ultimately, this specific choice for κ will be justified and validated in our highthroughput study of “Highthroughput verification”, where we show that the automated algorithm resulting from this choice is robust when tested on 200 chemically and structurally different materials, whose full list is available in ref. ^{61}.
We also emphasise here that the choice of μ and σ plays two different roles: the first is to give a relative weight to the states at the anchor point, namely Γ, that are used for the SCDM column selection; the second is to have a smooth dependence of the subspace as a function of k, therefore resulting in a small Ω_{I}.
Highthroughput verification
In this section, we present the results of the highthroughput calculations for the general case of 200 materials that have been chosen to cover a large region of structural (12 different Bravais lattices) and chemical (67 different elements) space. The free parameters in the SCDM method have been chosen by the automatic procedure outlined in the previous section. The structure of this section parallels the one for isolated bands; in particular, we make use of the bands distance η introduced in Eq. (24) to quantitatively assess the Wannier interpolation. In the case of metals, we also need to appropriately select the value of the fictitious chemical potential ν and of the smearing width τ in the distribution \({\tilde {f}}\)_{nk}(ν, τ) of Eq. (25) (the final values used in this work are reported in the previous section), in order for η and \({\eta }^{\max }\) to be reliable measures for the interpolation quality of the bands of physical interest. Indeed, the Wannierinterpolated bands are not expected to reproduce accurately the dispersion of the DFT bands at high energies; and the energy up to which the Wannierinterpolated bands may be deemed to be accurate depends mainly on the number of target WFs J which, in turn, is determined in our procedure by the number of PAOs in the pseudopotentials. In most applications, however, the highenergy bands are not of interest; therefore, ν and τ should be chosen so as to define a bands distance that only takes into account the relevant lowenergy bands. For most practical applications, this means for states up to a small amount (usually a few eV) above the Fermi energy.
To verify up to which energy the interpolation is accurate (for the number of PAOs in the pseudopotentials chosen in this work, see Table S1 in Supplementary Note 2) we show in Fig. 10 the distribution of band distances for different values of ν = ε_{F} + Δ, with Δ = 1, 2, 3, 4, 5 eV, and τ fixed at 0.1 eV in order to have a smooth but sharpedged Fermi–Dirac distribution. When ν is set at 4 eV or more above the Fermi energy (Δ ≥ 4 eV, bottom panels in Fig. 10), the distribution is very broad and with a long tail. In this case states much above the Fermi energy, where the Wannier interpolation does not reproduce any more the DFT band structure, are given a nonnegligible weight \({\tilde {f}}\)_{nk} which significantly increases the value of the band distance. The distribution becomes much narrower and closer to η = 0 eV for Δ ≤ 3 eV; in particular, for ν = ε_{F} + 1.0 eV, 98% of the materials have η < 50 meV. Since for many applications having a good interpolation up to 1 eV above the Fermi energy is sufficient, in the rest of this work we choose ν = ε_{F} + 1.0 eV (for entangled bands) as a reliable measure of the quality of the interpolation in the energy region of interest.
As in the case of isolated bands, the first step is to study the effect of the kpoint grid density on the interpolation, to fix the last free parameter in the calculations. As shown in Fig. 11, a grid with spacing ρ_{k} = 0.2 Å^{−1} is typically sufficient to provide accurate interpolated band structures: in particular, 94% of the materials (187/200) for SCDMonly and 97% (193/200) for SCDM+MLWF show η < 20 meV, and 72% (144/200) of the SCDM+MLWF bands and 79% (157/200) of the SCDMonly bands display η < 5 meV. Moreover, \({\eta }^{\max }\) follows a similar trend, with 72% (143/200) of the SCDM+MLWF bands and 82% (163/200) of the SCDMonly bands showing an \({\eta }^{\max }\,<50\) meV, and 35% (70/200) of SCDM+MLWF bands and 52% (104/200) of the SCDMonly bands showing an \({\eta }^{\max }\,<20\) meV, as shown in Fig. 11. We therefore set ρ_{k} to 0.2 Å^{−1} for further analysis in this section.
Figure 12a shows the Wannierinterpolated bands (red lines) for tungsten (W), a metallic system, and Fig. 12b shows the Wannierinterpolated valence bands plus few conduction bands (in red) for the insulator C_{3}Mg_{2} (and these can be compared with Fig. 4b for the interpolation of the valence bands only).
Unlike the case of isolated bands, for entangled bands the MLWF procedure substantially increases the localisation of the resulting Wannier functions from SCDM projections, giving for instance a \(\frac{\Delta \Omega }{{\Omega }^{{\rm{MLWF}}}}\) between 20 and 60% for 75% (149/200) of materials, with 30 materials showing a 60% or more increase in \(\frac{\Delta \Omega }{{\Omega }^{{\rm{MLWF}}}}\), see Fig. 13.
We now look at how the difference in spread due to the MLWF procedure correlates with the difference in the quality of the interpolated band structures. Although the correlation is not as strong as in the case of isolated bands, it can be seen (Fig. 14) that the trend is almost reversed: reducing the spread tends to worsen the quality of the band interpolation. In fact, the majority of systems (71%, 142/200) show a positive change in Δη, meaning that SCDMonly provides better interpolation. The main reason behind this effect is that, in the selection of the optimal manifold \({\mathcal{S}}({\bf{k}})\), the SCDM algorithm might include contributions from higher energy states. The subsequent MLWF step does not use the information on the target band structure. Therefore, while mixing the states via the U matrix to minimise the spread, such spurious contributions can be distributed on the lowerenergy states and, as a consequence, worsen the interpolation quality. However, we emphasise that in most cases, even when the MLWF algorithm increases the value of η, it does so only marginally: in 182 out of 200 systems (91%) the MLWF scheme either increases η by less than 5 meV or reduces it. More in detail, 163 out of these 182 materials show a variation ∣Δη∣ within only 5.0 meV, and only one system among these exhibits η^{MLWF} > 20 meV. Moreover, for the remaining 19 (out of 182) systems the MLWF procedure improves the bands interpolation, notably yielding η^{MLWF} < 20 meV for all of them. Finally, for the remaining 18 systems (9%), the MLWF scheme worsens the results with ∣Δη∣ > 5 meV and only in six cases the interpolation quality is quite poor (η^{MLWF} > 20 meV). In all these cases, a possible reason for failure might be related to the choice of columns in the SCDM algorithm, which is performed only at Γ (see discussion in “SCDM for periodic systems: SCDMk”), for materials where the relative order of electronic states at Γ and at the BZ boundary is inverted. In this situation, spurious contributions might enter into the QR decomposition as discussed above.
We have presented an approach to generate a set of maximally localised Wannier functions in an automated way that has the advantage of being simple, robust and applicable also in the more general case of socalled entangled bands. The high sensitivity of iterative minimisation algorithms to the initial conditions, which was a longstanding problem in particular for the entangledband case, is overcome by employing the selected columns of the density matrix^{20,21} (SCDM) algorithm to automatically choose the initial subspace. For the Wannierisation of isolated bands, SCDM is a parameterfree method, whereas for entangled bands two real numbers μ and σ must be specified, whose appropriate choice is critical for the success of the method, in addition to the target dimensionality of the manifold to be described (i.e., the number of Wannier functions). We have proposed and validated a protocol to choose these parameters by leveraging information encoded in the projectability of the Bloch states on pseudoatomic orbitals. We found that the SCDM method works very well for bandstructure interpolations, but does not perform as well for other kind of applications where, for instance, a specific symmetry character of the WFs is desirable.
To make the method available to any researcher, we have implemented the SCDM algorithm in PW2WANNIER90, part of the opensource Quantum ESPRESSO distribution, and added corresponding functionality to the opensource WANNIER90 code. We have also discussed how the full procedure is implemented as AiiDA^{25,26} workflows, encoding the knowledge that is needed to perform all steps (DFT simulations, selection of the parameters, Wannierisation) into an automated software. This enables MLWFs to be obtained and used to calculate material properties by providing the crystal structure of a material as the only input. Furthermore, we are distributing publicly and freely all codes and workflows discussed in this work within a virtual machine^{61} preconfigured with the open source codes AiiDA, Quantum ESPRESSO, and WANNIER90. This VM allows anyone to explore and reproduce straightforwardly the present results without the need to install or configure anything, and without the need of implementing again workflows and algorithms, in the true spirit of FAIR data sharing^{72} and Open Science. In addition, interested researchers are not constrained to rerun the calculations performed in this work, but can perform their own simulations, either with different parameters or on new materials. To the best of our knowledge, this is the first time that such level of reproducibility is offered accompanying a scientific paper in the field of DFT simulations.
We have demonstrated the robustness of the present approach by carrying out highthroughput calculations on a dataset of 200 bulk crystalline materials, of which 81 are insulators, spanning a wide chemical and structural space. The main metric we used to assess the results is the socalled band distance^{62}, quantifying the difference between the Wannierinterpolated band structures and the corresponding direct DFT band structures. In particular, we obtain excellent interpolations: for entangled bands, 97% of the materials show an average bands distance η < 20 meV and 72% show η < 5 meV. For the insulating subset, when limiting to valence bands only, 93% show η < 2 meV.
We believe that this work is a significant step forward towards completely automated highthroughput calculations of advanced materials properties exploiting Wannier functions.
Methods
AiiDA^{25,26} is a python materials’ informatics platform to automate, manage and coordinate simulations and workflows, and to encourage sharing of both the resulting data and the workflow codes used to generate them. While general in its design, its plugins cover many materials science codes, including Quantum ESPRESSO^{73} and WANNIER90^{74}.
Our implementation of the SCDM method inside the opensource code Quantum ESPRESSO makes it available to any researcher. Moreover, our protocol for the choice of the SCDM parameters discussed in “Protocol” describes an effective procedure to automatically compute the Wannier functions of any material. However, the actual computation starting only from the crystal coordinates is nontrivial. The choice of numerical parameters (cutoffs, kpoint grid density, convergence parameters) requires some prior knowledge and experience. Moreover, the full simulation for each material involves a complex sequence of steps, requiring a user to run over 10 different executables. Therefore, we have implemented the full procedure as AiiDA workflows, making it thus possible to repeat seamlessly the calculations for many different materials with minimal effort.
Furthermore, AiiDA keeps track of the provenance of the data generated in the simulations in a fully automated way, in the form of a directed graph (see Fig. 15 for an example of the provenance tracked for one material), where nodes can be calculations, workflows or data. This means that any researcher accessing the AiiDA database can inspect not only the final data, but also explore which calculation generated it, its relevant (raw and parsed) outputs and the complete set of its input parameters, and see how these input data were, in turn, obtained as output of previous calculations, traversing the graph up to the original input crystal structure.
The AiiDA workflows that we have written start by calling existing subworkflows available in the AiiDAquantumespresso^{73} plugin that, given a crystal structure, perform a variablecell atomic relaxation to obtain the converged DFT charge density. These workflows also contain useful heuristics and recovery mechanisms to reach convergence in case of common problems (e.g., by changing the diagonalisation algorithm) as well as automatic selection of parameters, including pseudopotentials and cutoffs from the SSSP library^{62}. Once the charge density is computed, the workflow first standardises the cell using the symmetrydetection library spglib^{75} and the seekpath^{63} library that, in addition, provide a standardised bandstructure path. Then, it proceeds along two parallel branches: on one side, it computes the DFT band structure along the suggested path. In parallel, it computes the Wannier functions: if first computes wavefunctions on a full uniform grid using a nonselfconsistent Quantum ESPRESSO calculation, and then computes the PDOS, the projectabilities, and fits them to obtain the μ and σ parameters for the SCDM. Using these data, it prepares the WANNIER90 input file and runs it in preprocessing mode to generate the input file needed by the code interfacing Quantum ESPRESSO with WANNIER90 (PW2WANNIER90). The latter is then run to compute quantities needed by WANNIER90, including the A^{(k)} matrices obtained with the SCDM method. Finally, the workflow drives the execution of WANNIER90 to compute the (maximallylocalised) Wannier functions and produce the output quantities of interest (spreads, interpolated band structure on the same path of the DFT code, plots of the Wannier functions, etc.).
In an effort to improve the verification and dissemination of computational results, and in order to make the present work available to all, we are distributing all codes and workflows discussed here within a preconfigured virtual machine (VM)^{61} based on the Quantum Mobile VM^{76} available on the Materials Cloud^{77}. The relevant quantum codes (Quantum ESPRESSO, WANNIER90) and the informatics’ platform AiiDA come preinstalled and configured in the VM, ready to run through the workflows described above. A simple README file guides new users in the installation of the VM and in the execution of the workflow, to compute—with essentially no user intervention—the interpolated band structure of a material of choice.
Data availability
All data generated for this work can be obtained by downloading the publicly available Virtual Machine (VM) on the Materials Cloud (https://doi.org/10.24435/materialscloud:2019.0044/v2). The VM contains the AiiDA workflow, the structures of the 200 materials (in XSF format) and the simulation codes (Quantum ESPRESSO and WANNIER90). The latter have been preinstalled and, once configured, the VM is ready to be used. Inside, a README file explains in detail how to retrieve all data. In addition, the VM also contains the Ansible scripts to regenerate the VM from scratch.
Code availability
All codes used for this work are opensource and hence available to any researcher. In particular, the latest stable version of WANNIER90 can be downloaded at http://www.wannier.org/download.
The latest stable version of Quantum ESPRESSO can be found at https://www.quantumespresso.org/download.
Likewise, for the AiiDA code the latest stable version can be found at http://www.aiida.net/download.
References
Curtarolo, S. et al. The highthroughput highway to computational materials design. Nat. Mater. 12, 191 (2013).
Oba, F. & Kumagai, Y. Design and exploration of semiconductors from first principles: a review of recent advances. Appl. Phys. Express 11, 060101 (2018).
Marzari, N. The frontiers and the challenges. Nat. Mater. 15, 381 (2016).
Mounet, N. et al. Twodimensional materials from highthroughput computational exfoliation of experimentally known compounds. Nat. Nanotechnol. 13, 246–252 (2018).
Calzolari, A., Marzari, N., Souza, I. & Nardelli, M. B. Ab initio transport properties of nanostructures from maximally localized Wannier functions. Phys. Rev. B 69, 035108 (2004).
Gresch, D. et al. Automated construction of symmetrized Wannierlike tightbinding models from ab initio calculations. Phys. Rev. Mater. 2, 103805 (2018).
Yates, J. R., Wang, X., Vanderbilt, D. & Souza, I. Spectral and Fermi surface properties from Wannier interpolation. Phys. Rev. B 75, 195121 (2007).
Marzari, N., Mostofi, A. A., Yates, J. R., Souza, I. & Vanderbilt, D. Maximally localized Wannier functions: theory and applications. Rev. Mod. Phys. 84, 1419–1475 (2012).
Marzari, N. & Vanderbilt, D. Maximally localized generalized Wannier functions for composite energy bands. Phys. Rev. B 56, 12847–12865 (1997).
Souza, I., Marzari, N. & Vanderbilt, D. Maximally localized Wannier functions for entangled energy bands. Phys. Rev. B 65, 035109 (2001).
Mustafa, J. I., Coh, S., Cohen, M. L. & Louie, S. G. Automated construction of maximally localized Wannier functions: optimized projection functions method. Phys. Rev. B 92, 165134 (2015).
Cancès, E., Levitt, A., Panati, G. & Stoltz, G. Robust determination of maximally localized Wannier functions. Phys. Rev. B 95, 075114 (2017).
Agapito, L. A., Ferretti, A., Calzolari, A., Curtarolo, S. & Nardelli, M. B. Effective and accurate representation of extended Bloch states on finite Hilbert spaces. Phys. Rev. B 88, 165127 (2013).
Agapito, L. A., IsmailBeigi, S., Curtarolo, S., Fornari, M. & Nardelli, M. B. Accurate tightbinding Hamiltonian matrices from ab initio calculations: minimal basis sets. Phys. Rev. B 93, 035104 (2016).
Agapito, L. A. & Bernardi, M. Ab initio electron–phonon interactions using atomic orbital wave functions. Phys. Rev. B 97, 235146 (2018).
Rajen, N. & Coh, S. What can one learn about material structure given a single firstprinciples calculation? Phys. Rev. Mater. 2, 053606 (2018).
Zhang, Z. et al. Highthroughput screening and automated processing toward novel topological insulators. J. Phys. Chem. Lett. 9, 6224–6231 (2018).
Olsen, T. et al. Discovering twodimensional topological insulators from highthroughput computations. Phys. Rev. Mater. 3, 024005 (2019).
Gresch, D. et al. Automated construction of symmetrized Wannierlike tightbinding models from ab initio calculations. Phys. Rev. Mater. 2, 103805 (2018).
Damle, A., Lin, L. & Ying, L. Compressed representation of Kohn–Sham orbitals via selected columns of the density matrix. J. Chem. Theory Comput. 11, 1463–1469 (2015).
Damle, A. & Lin, L. Disentanglement via entanglement: a unified method for Wannier localization. Multiscale Model. Simul. 16, 1392–1410 (2018).
Aquilante, F., Pedersen, T. B., Sánchez de Merás, A. & Koch, H. Fast noniterative orbital localization for large molecules. J. Chem. Phys. 125, 174101 (2006).
Giannozzi, P. et al. Advanced capabilities for materials modelling with Quantum ESPRESSO. J. Phys.: Condens. Matter 29, 465901 (2017).
Mostofi, A. A. et al. An updated version of Wannier90: a tool for obtaining maximallylocalised Wannier functions. Comput. Phys. Commun. 185, 2309–2310 (2014).
Pizzi, G., Cepellotti, A., Sabatini, R., Marzari, N. & Kozinsky, B. AiiDA: automated interactive infrastructure and database for computational science. Comput. Mater. Sci. 111, 218–230 (2016).
Huber S. P. et al. AiiDA 1.0, a scalable computational infrastructure for automated reproducible workflows and data provenance. Preprint at https://arxiv.org/abs/2003.12476 (2020).
Thygesen, K. S., Hansen, L. B. & Jacobsen, K. W. Partly occupied Wannier functions. Phys. Rev. Lett. 94, 026405 (2005).
Thygesen, K. S., Hansen, L. B. & Jacobsen, K. W. Partly occupied Wannier functions: construction and applications. Phys. Rev. B 72, 125119 (2005).
Damle, A., Levitt, A. & Lin, L. Variational formulation for Wannier functions with entangled band structure. Multiscale Model. Simul. 17, 167–191 (2019).
Shirley, E. L. Optimal basis sets for detailed Brillouinzone integrations. Phys. Rev. B 54, 16464–16469 (1996).
Prendergast, D. & Louie, S. G. Blochstatebased interpolation: an efficient generalization of the Shirley approach to interpolating electronic structure. Phys. Rev. B 80, 235126 (2009).
Wannier, G. H. The structure of electronic excitation levels in insulating crystals. Phys. Rev. 52, 191–197 (1937).
Blount, E. Formalisms of Band Theory, Vol. 13 (Elsevier, 1962).
Duffin, R. J. Discrete potential theory. Duke Math. J. 20, 233–251 (1953).
Stephan, U., Martin, R. M. & Drabold, D. A. Extendedrange computation of Wannierlike functions in amorphous semiconductors. Phys. Rev. B 62, 6885–6888 (2000).
Ku, W., Rosner, H., Pickett, W. E. & Scalettar, R. T. Insulating ferromagnetism in La_{4}Ba_{2}Cu_{2}O_{10}: an ab initio Wannier function analysis. Phys. Rev. Lett. 89, 167204 (2002).
Lu, W. C., Wang, C. Z., Chan, T. L., Ruedenberg, K. & Ho, K. M. Representation of electronic structures in crystals in terms of highly localized quasiatomic minimal basis orbitals. Phys. Rev. B 70, 041101 (2004).
Qian, X. et al. Quasiatomic orbitals for ab initio tightbinding analysis. Phys. Rev. B 78, 245112 (2008).
Andersen, O. K. & SahaDasgupta, T. Muffintin orbitals of arbitrary order. Phys. Rev. B 62, R16219–R16222 (2000).
Boys, S. F. Construction of some molecular orbitals to be approximately invariant for changes from one molecule to another. Rev. Mod. Phys. 32, 296–299 (1960).
Foster, J. M. & Boys, S. F. Canonical configurational interaction procedure. Rev. Mod. Phys. 32, 300–302 (1960).
Foster, J. M. & Boys, S. F. A quantum variational calculation for HCHO. Rev. Mod. Phys. 32, 303–304 (1960).
Panati, G. & Pisante, A. Bloch bundles, MarzariVanderbilt functional and maximally localized Wannier functions. Commun. Math. Phys. 322, 835–875 (2013).
Golub, G. & Van Loan, C. Matrix Computations. Johns Hopkins Studies in the Mathematical Sciences (Johns Hopkins University Press, 1996).
Cloizeaux, J. D. Analytical properties of ndimensional energy bands and Wannier functions. Phys. Rev. 135, A698–A707 (1964).
Prodan, E. & Kohn, W. Nearsightedness of electronic matter. Proc. Natl. Acad. Sci. U.S.A. 102, 11635–11638 (2005).
Benzi, M., Boito, P. & Razouk, N. Decay properties of spectral projectors with applications to electronic structure. SIAM Rev. 55, 3–64 (2013).
Carlson, B. C. & Keller, J. M. Orthogonalization procedures and the localization of Wannier functions. Phys. Rev. 105, 102–103 (1957).
Nenciu, G. Dynamics of band electrons in electric and magnetic fields: rigorous justification of the effective Hamiltonians. Rev. Mod. Phys. 63, 91–127 (1991).
Brouder, C., Panati, G., Calandra, M., Mourougane, C. & Marzari, N. Exponential localization of Wannier functions in insulators. Phys. Rev. Lett. 98, 046402 (2007).
He, L. & Vanderbilt, D. Exponential decay properties of Wannier functions and related quantities. Phys. Rev. Lett. 86, 5341–5344 (2001).
Horsfield, A. P. & Bratkovsky, A. M. Ab initio tight binding. J. Phys.: Condens. Matter 12, R1–R24 (1999).
Fang, S. et al. Ab initio tightbinding hamiltonian for transition metal dichalcogenides. Phys. Rev. B 92, 205108 (2015).
Anisimov, V. I., Aryasetiawan, F. & Lichtenstein, A. I. Firstprinciples calculations of the electronic structure and spectra of strongly correlated systems: the LDA+U method. J. Phys.: Condens. Matter 9, 767–808 (1997).
Schnell, I., Czycholl, G. & Albers, R. C. HubbardU calculations for Cu from firstprinciple Wannier functions. Phys. Rev. B 65, 075103 (2002).
Novoselov, D., Korotin, D. M. & Anisimov, V. I. Hellmann–Feynman forces within the DFT+U in Wannier functions basis. J. Phys.: Condens. Matter 27, 325602 (2015).
Georges, A., Kotliar, G., Krauth, W. & Rozenberg, M. J. Dynamical meanfield theory of strongly correlated fermion systems and the limit of infinite dimensions. Rev. Mod. Phys. 68, 13–125 (1996).
Lechermann, F. et al. Dynamical meanfield theory using Wannier functions: a flexible route to electronic structure calculations of strongly correlated materials. Phys. Rev. B 74, 125120 (2006).
Vanderbilt, D. Soft selfconsistent pseudopotentials in a generalized eigenvalue formalism. Phys. Rev. B 41, 7892–7895 (1990).
Mostofi, A. A. et al. Wannier90: A tool for obtaining maximallylocalised Wannier functions. Comput. Phys. Commun. 178, 685–699 (2008).
Vitale, V. et al. Automated highthroughput wannierisation. Materials Cloud Archive. https://doi.org/10.24435/materialscloud:2019.0044/v2 (2019).
Prandini, G., Marrazzo, A., Castelli, I. E., Mounet, N. & Marzari, N. Precision and efficiency in solidstate pseudopotential calculations. npj Comput. Mater. 4, 72 (2018).
Hinuma, Y., Pizzi, G., Kumagai, Y., Oba, F. & Tanaka, I. Band structure diagram paths based on crystallography. Comput. Mater. Sci. 128, 140–184 (2017).
Gresch, D. et al. Automated construction of symmetrized Wannierlike tightbinding models from ab initio calculations. Phys. Rev. Mater. 2, 103805 (2018).
Perdew, J. P., Burke, K. & Ernzerhof, M. Generalized gradient approximation made simple. Phys. Rev. Lett. 77, 3865–3868 (1996).
Garrity, K. F., Bennett, J. W., Rabe, K. M. & Vanderbilt, D. Pseudopotentials for highthroughput DFT calculations. Comput. Mater. Sci. 81, 446–452 (2014).
Corso, A. D. Pseudopotentials periodic table: from H to Pu. Comput. Mater. Sci. 95, 337–350 (2014).
Schlipf, M. & Gygi, F. Optimization algorithm for the generation of ONCV pseudopotentials. Comput. Phys. Commun. 196, 36–44 (2015).
Topsakal, M. & Wentzcovitch, R. Accurate projected augmented wave (PAW) datasets for rareearth elements (RE = La–Lu). Comput. Mater. Sci. 95, 263–270 (2014).
van Setten, M. et al. The PseudoDojo: training and grading a 85 element optimized normconserving pseudopotential table. Comput. Phys. Commun. 226, 39–54 (2018).
Hamann, D. R. Optimized normconserving Vanderbilt pseudopotentials. Phys. Rev. B 88, 085117 (2013).
Wilkinson, M.D. et al. The FAIR Guiding Principles for scientific data management and stewardship.Scientific data,3 (2016).
AiiDA Plugin for the Quantum ESPRESSO Codes. http://github.com/aiidateam/aiidaquantumespresso (accessed 27 June 2019).
AiiDA Plugin for the Wannier90 Code. http://github.com/aiidateam/aiidawannier90 (accessed 27 June 2019).
Togo, A. & Tanaka, I. Spglib: a software library for crystal symmetry search. Preprint at http://arxiv.org/abs/1808.01590 (2018).
Quantum Mobile on the Materials Cloud. https://www.materialscloud.org/work/quantummobile (accessed 27 June 2019).
Talirtz, L. et al. Materials Cloud, a platform for open computational science. Preprint at https://arxiv.org/abs/2003.12510 (2020).
Acknowledgements
V.V. acknowledges support from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 676531 (project ECAM). G.P., A.M., and N.M. acknowledge support by the NCCR MARVEL of the Swiss National Science Foundation and the European Union’s Centre of Excellence MaX “Materials design at the Exascale” (Grant No. 824143). G.P., A.M., and N. M. acknowledge PRACE for awarding us simulation time on Piz Daint at CSCS (project ID 2016153543) and Marconi at CINECA (project ID 2016163963). V.V. and A.A.M. acknowledge support from the Thomas Young Centre under grant TYC101. J.R.Y. is grateful for computational support from the UK national high performance computing service, ARCHER, for which access was obtained via the UKCP consortium and funded by EPSRC Grant Ref EP/P022561/1. V.V. acknowledges Prof. Mike Payne for support, and Prof. Lin Lin and Dr. Anil Damle for useful discussions. G.P. acknowledges Dr. Francesco Aquilante for useful discussions. A.M. acknowledges Prof. Ivo Souza for useful comments on the manuscript. The authors acknowledge Norma Rivano for testing the virtual machine and Dr. Sebastiaan P. Huber for the implementation of the AiiDAQuantum ESPRESSO workflow for geometry relaxations.
Author information
Authors and Affiliations
Contributions
V.V. implemented and tested the SCDM method on selected materials. G.P. and A.M. developed the automation protocols and the workflows, run the highthroughput simulations, and generated the Virtual Machine. N.M., A.A.M., and J.R.Y supervised the project. All authors analysed the results and contributed to writing the manuscript.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Vitale, V., Pizzi, G., Marrazzo, A. et al. Automated highthroughput Wannierisation. npj Comput Mater 6, 66 (2020). https://doi.org/10.1038/s415240200312y
Received:
Accepted:
Published:
DOI: https://doi.org/10.1038/s415240200312y
This article is cited by

Projectability disentanglement for accurate and automated electronicstructure Hamiltonians
npj Computational Materials (2023)

Electron–phonon physics from first principles using the EPW code
npj Computational Materials (2023)

Towards highthroughput manybody perturbation theory: efficient algorithms and automated workflows
npj Computational Materials (2023)

Automated mixing of maximally localized Wannier functions into target manifolds
npj Computational Materials (2023)

Shared metadata for datacentric materials science
Scientific Data (2023)