Combining Pseudopotential and All Electron Density Functional Theory for the Efficient Calculation of Core Spectra using a Multiresolution Approach

Laura E. Ratcliff,∗,†,‡ W. Scott Thornton,¶ Alvaro´ V´azquezMayagoitia,§,‡ and Nichols A. Romero§,‡

†Department of Materials, Imperial College London, London SW7 2AZ, UK ‡Argonne Leadership Computing Facility, Argonne National Laboratory, Illinois 60439, USA ¶Stony Brook University, Stony Brook, New York 11794, USA §Computational Science Division, Argonne National Laboratory, Illinois 60439, USA

E-mail: laura.ratcliff[email protected]

Abstract Introduction

Broadly speaking, the calculation of core spec- (Multiresolution ADaptive Numeri- tra such as electron energy loss spectra (EELS) cal Environment for Scientific Simulation)1,2 is at the level of density functional theory (DFT) a general purpose numerical framework which usually relies one of two approaches: concep- combines a multiresolution approach with a tually more complex but computationally ef- parallel programming environment designed for ficient projector augmented wave based ap- petascale performance.3 The use of an adaptive proaches, or more straightforward but com- multiresolution approach allows integral and putationally more intensive all electron (AE) differential equations in many dimensions to be based approaches. In this work we present an solved with guaranteed precision. Furthermore, alternative method, which aims to find a mid- the code has been structured so that develop- dle ground between the two. Specifically, we ers can focus on the high level implementation have implemented an approach in the multi- of new functionalities, without needing detailed wavelet madness molecular DFT code which knowledge of the low level technicalities. These permits a combination of atoms treated at the features have facilitated the development of var- AE and pseudopotential (PSP) level. Atoms for ious scientific applications using madness, in- arXiv:1811.08397v2 [physics.chem-ph] 7 May 2019 which one wishes to calculate the core edges are cluding a molecular density functional theory thus treated at an AE level, while the remainder (DFT) code4–6, and many other applications can be treated at the PSP level. This is made spanning a range of fields, many of which are possible thanks to the multiresolution approach concerned with quantum chemistry7–19. of madness, which permits accurate and effi- The molecular DFT code (hereafter referred cient calculations at both the AE and PSP level. to as moldft) provides a setup for the pre- Through examples of a small molecule and a cise treatment of electronic systems with an carbon nanotube we demonstrate the potential excellent cost to accuracy ratio. Nonetheless, applications of our approach. the cost of treating heavy atoms – or large molecules containing many light atoms – re-

1 mains high, inhibiting the ability to study tech- behind the madness molecular DFT code, be- nologically interesting systems such as those fore briefly discussing the implementation of a containing transition metals. The most popular mixed AE/PSP approach. We then present way to alleviate this problem is the replacement the method used to calculate ELNES, includ- of the exact all electron (AE) atomic potential ing the calculation of the virtual Kohn Sham with a smoother pseudopotential (PSP), which (KS) eigenstates. Finally, we validate the ap- has the dual advantage of reducing the number proach through examples of two systems which of electrons requiring explicit treatment (as the benefit from a mixed PSP/AE representation. core electrons are incorporated implicitly), and reducing the number of basis functions needed to represent the wavefunctions close to the nu- Theory clei, thanks to increased smoothness. This en- ables heavy atoms to be treated with a much Molecular DFT with MADNESS lower computational cost and would extend the Both the madness code as a whole and the applicability of moldft. moldft code in particular have already been Beyond these advantages, the multiresolution described elsewhere2,4–6, and so here we give approach of madness also facilitates the im- only an outline. One of the central compo- plementation of a mixed representation, namely nents of madness is the use of a disjoint “multi- the treatment of only select atoms with PSPs, wavelet” basis set, which is constructed from a with others retaining the full AE potential. set of (shifted and scaled) Legendre polynomi- While this is also possible in basis sets als represented in a non-uniform grid. The grid, using effective core potentials (ECP), a mul- therefore the basis, is dynamically adapted to tiresolution approach permits a similar method give higher resolution where needed (e.g. close using a systematic basis, since the automatic to the atoms where the KS wavefunctions are refinement ensures that both full and pseudo- more rapidly varying), giving rise to a computa- atoms are treated at a resolution which is high tionally efficient yet highly accurate multireso- enough to maintain accuracy without loss of ef- lution analysis (MRA). Indeed, each KS orbital ficiency. has its own individual adaptively refined repre- One application where this is of particular sentation. The exploitation of MRA techniques use is core level spectroscopy, e.g. electron en- allows the code to reach a finite arbitrary pre- ergy loss spectra (EELS), specifically energy cision, while relieving the user of the need to loss near edge structure (ELNES), which is the manually converge the basis set. region of the spectrum immediately after the In contrast to other DFT codes, the central edge onset. ELNES is able to probe the local eigenvalue equation to be solved is recast from electronic structure of a sample and is thus an a differential equation of the form invaluable experimental technique. Theoretical calculations (often based on DFT) are required  1  − ∇2 + V (x) ψ (x) = Eψ (x) , (1) to help interpret experimental spectra. The de- 2 velopment and application of methods for sim- ulating ELNES is therefore an active area of re- to an integral equation of the form 20 search . However, one is often only interested Z in calculating spectra for a subset of a system, ψ (x) = −2 dx −∇2 − 2E−1 V (x) ψ (x) . e.g. a group of atoms or single atomic species (2) within a molecule, or a molecule in an environ- This form is well-suited to the madness frame- ment. In such cases, core states need only be work and has the advantage of being able to be explicitly calculated for the atoms of interest, solved iteratively without the need for a precon- which can easily be achieved by treating only ditioner. In practice, an initial guess for the KS these atoms at the AE level. wavefunctions is first generated by projecting In this paper we first outline the key concepts

2 an atomic orbital basis, typically 6-31G, into well in the wavelet-based BigDFT code28, for the multiwavelet basis. This approach takes ad- calculations in both open and periodic bound- vantage of the underlying madness numerical ary conditions. This also provides a means of and parallel runtime to efficiently solve the KS validating our implementation. equations to a guaranteed precision, while re- The implementation in madness was rela- quiring only minimal input from the user con- tively straightforward, since the underlying ma- cerning the basis set or parallel setup. chinery used to solve the KS equations remains A wide range of LDA, GGA and hybrid the same, only the definition of the atomic po- functionals are available in moldft through the tential need be modified. In the first instance LibXC library21. Although we have not ex- we have not implemented either relativistic ef- ploited the capability in this work, in addi- fects or non-linear core corrections, which have tion to standard canonical orbitals, moldft has demonstrated an accuracy of similar quality to the option to use localized molecular orbitals18, AE calculations27. In the future this might eas- where the Pipek-Mezy scheme22 is used to lo- ily be extended. calize the orbitals. This gives rise to a quasi- linear scaling, reducing the computational cost Mixed AE/PSP Calculations of treating larger systems. As discussed, an adaptive multi-wavelet ap- proach is also highly suitable for a mixed Pseudopotentials in MADNESS AE/PSP representation. Both the implemen- Despite the advantages of an MRA approach tation and application of such an approach is for DFT calculations, the computational cost of straightforward. Consider two opposing sce- treating heavy atoms or indeed of large systems narios: calculations using PWs and those using containing light elements is high, due in part to Gaussian-type basis sets. For the former, aside the explicit treatment of core electrons. The ap- from the prohibitive cost of AE calculations in plicability of moldft could therefore be extended PW basis sets, the delocalized nature of the ba- to new materials by implementing PSPs. Al- sis functions also prevents them from being spa- though most commonly used in periodic plane tially varied to be more or less dense around wave (PW) DFT codes, PSPs are also effec- different atoms. Any mixed AE/PSP approach tively employed in combination with other ba- would therefore also necessitate a mixed basis sis sets. Given such extensive use for DFT cal- set approach, e.g. combining PWs with a local- 29,30 culations, it is of no surprise that PSPs exist ized basis set . in a number of varieties, generally categorized In the case of Gaussian basis sets, the number as “hard” or “soft”, depending on the smooth- of functions associated with each atom could ness of the pseudized-wavefunctions. Indeed, be directly modified depending on the level the development of ever cheaper and more ac- of theory used. Such a mixed representation curate PSPs continues to be an active area of has previously been implemented using Gaus- research. It is also worth mentioning the pro- sian basis sets and used to assess the accu- jector augmented wave (PAW) approach23, an racy of individual PSPs for molecular proper- alternative approach to more traditional PSPs, ties including binding energies and vibrational 31 which aims to reproduce the correct AE be- properties . This approach has been used to haviour near the nuclei, while still avoiding the treat select groups of atoms at the AE level, for explicit treatment of core states. example H atoms in molecules or clusters for 31,32 We have chosen to implement norm- the calculation of Raman spectra , only the conserving HGH-GTH24,25 PSPs in moldft, as molecule for the study of adsorption on a sur- 33 they are available for the majority of elements face and for M¨ossbauer-active Sn atoms for and have demonstrated a consistently high ac- the calculation of M¨ossbauerspectra in chalco- 34 curacy and transferability (see e.g. Refs.26,27). genide glasses . Furthermore, they have already proven to work While a mixed approach can therefore clearly

3 be employed using Gaussian basis sets, this by nonetheless increases the burden on the user to 1 X 2 ensure that the simulation remains both accu- ε (ω) = |hψ |q · r|ψ i| δ (E − E − ω) , 2 Ω v c v c rate and computationally efficient by tuning the c,v basis for each atom according to chemical intu- (3) ition. Furthermore, the use of the same under- where ω is the transition energy, Ω is the volume lying approach to e.g. the calculation of Pois- of the unit cell, q is the momentum transfer, r son’s equation for PSP and AE approaches did is the position operator and ψc (ψv) is a core not guarantee a reduction in computational cost (virtual) state with associated energy Ec (Ev). for mixed AE/PSP compared to pure AE calcu- In practice, the δ-function is usually replaced by lations31. The key advantage of a multi-wavelet a Gaussian or Lorentzian function to simulate approach is therefore that the same high accu- broadening effects or lifetime of the transition. racy and computational efficiency is achieved If one assumes that the excitation of a core for the mixed mode as for pure AE and PSP electron to a virtual state is “sudden”, i.e. the approaches. Crucially, this does not require virtual states are unaffected by creation of an any additional fine-tuning of parameters – to instantaneous core hole (and neglecting rela- perform a calculation in mixed mode, the only tivistic effects), one can directly calculate the thing the user must do is specify which atoms matrix elements of Eq. 3 between core and vir- are to be treated at the PSP level. tual KS eigenstates from a ground state cal- culation. This provides a first approximation, Calculating ELNES however more quantitative comparison with ex- periment generally requires the inclusion of core One way of maximizing the information that hole effects. Different approaches may be used, can be extracted from DFT simulations is by the most basic being the Z + 1 approximation, calculating experimental quantities like spectra. wherein the excited atom is replaced by an atom For example, core spectra such as ELNES can with atomic number one higher than its actual be used to extract information concerning the atomic number. This has met with mixed suc- chemical bonding environment, valence state cess, see e.g. Ref.37. Alternatively, a PSP may and nearest neighbour distances. The simula- be generated with a missing core electron38, tion of such spectra is invaluable both for un- while for AE calculations a constraint may be derstanding and interpreting experimental re- applied to maintain a core hole. Irrespective sults and predicting and guiding future exper- of the approach used, a separate calculation is iments on new materials. To give an exam- needed for each atom one wishes to excite. ple, a combined theoretical and experimental For AE-based DFT approaches, the calcula- approach allowed the identification of individ- tion of matrix elements between core and vir- ual fullerene molecules encapsulated in a carbon tual states is straightforward. For PSP ap- nanotube35. Here we summarize the different proaches where there are no explicit core states, approaches to calculating ELNES within AE one could instead use core states originating and PSP DFT calculations. For a more thor- from an isolated atom. However the calcu- ough discussion of the calculation of ELNES see lated (valence and) virtual states are pseudo- e.g. Refs.20,36. wavefunctions and therefore only match the The most straightforward method of calcu- true wavefunctions outside of the core region. lating ELNES within DFT (beyond the simple This can have a noticeable impact on the accu- site- and angular-momentum-projected density racy of the matrix elements. If one assumes that of states approach) is via Fermi’s golden rule the core wavefunctions are themselves unaf- in conjunction with the dipole approximation. fected by their environment, one could nonethe- In this formalism the imaginary part of the di- less calculate accurate matrix elements if the electric function, ε2, in atomic units, is given correct behaviour of the virtual states could be recovered in the core regions. This can be

4 achieved using the PAW approach, which is able energy onsets from PAW calculations by also to recover the AE valence and virtual wavefunc- calculating the effect of core holes on isolated tions, resulting in matrix elements which are atom calculations42. comparable in accuracy to AE approaches while The mixed AE/PSP approach provides an requiring significantly less computational effort. interesting compromise between the AE and In contrast, ELNES calculations using standard PAW approaches for calculating ELNES. In PSPs (i.e. without PAW), generally do not give cases where one is only interested in calculating accurate values for the matrix elements36,38. excitations for few atoms of interest, the com- PAW has been successfully employed for putational cost is significantly reduced com- ELNES calculations using a PW basis set36,38,39 pared to a pure AE approach, while the direct for systems which are larger than could be ac- access to select core states allows for the accu- cessed using AE approaches, where PAW is ei- rate and straightforward calculation of transi- ther used in place of PSPs or as a correction to tion matrix elements and energies. the ELNES matrix elements following a PSP Since the goal of this paper is a demonstra- calculation. Indeed, more than 1000 atoms tion of the benefits of a mixed PSP/AE rep- have been treated using a PAW approach within resentation within a multiresolution approach, the context of linear scaling DFT calculations rather than the explicit comparison of calcu- with a psinc basis40. This allows the treat- lated ELNES spectra with experiment, the im- ment of more complex materials, while also per- plementation of core hole effects is left as a fu- mitting supercell calculations which are large ture extension, where the constrained approach enough to minimize interactions between core mentioned above should be used – note that it holes in periodic images. would already be possible to employ the Z + 1 The absolute energies of the core levels for a approach. Since we have not included core hole given atomic species are affected by their lo- effects we calculate the transition energies by cal chemical environment. The magnitude of taking the difference between KS eigenvalues. such variations, i.e. the chemical shift, depends on the species in question – e.g. for the C 1s Calculation of KS States state this can be as much as 12 eV41. Ex- cept in trivial cases where all atoms of a given The KS core and virtual (unoccupied) states species within a molecule have the same chem- are a key ingredient of Eq. 3. In moldft, a ical environment, such shifts must therefore be given number of virtual states can be calculated taken into account in order to correctly combine alongside the occupied KS states. We note that spectra originating from different atoms of the the approach is not designed to allow access to same species within a system. This cannot be unbound states – with positive energies the ker- 2 −1 achieved by manually aligning theoretical and nel of Eq. 2 (−(∇ − 2E) ) diverges – while in experimental spectra, instead one must calcu- any case such states might strongly depend on late the absolute energy onsets. the simulation cell size. We therefore avoid cal- A first approximation to calculating such en- culating such eigenstates in this work. However, ergies would be to take the difference between there is also another subtlety relating to the ini- the corresponding KS eigenvalues. This relies tial ordering of the (bound) virtual states. This on having access to the energies of the core is similar to a situation which arises in the con- 43 states, so that such an approach is only appli- text of the linear-scaling DFT code , cable within an AE calculation. A better ap- wherein the virtual states are represented in a proach would be to also include core hole effects localized orbital basis set, which is itself rep- in the calculated energies, by taking the dif- resented in an underlying systematic basis set. ference between the total energy of the excited Starting from an initial atomic orbital guess, (core hole) and ground state calculations, which these localized orbitals are optimized to repre- relies on the explicit inclusion of core states. sent a set of low lying virtual states. However, However, it is possible to estimate the absolute the virtual states can be incorrectly ordered in

5 the initial basis, so that some high energy vir- is not to present a new approach for the cal- tual states are selected in favour of states which culation of core spectra, but to demonstrate would be lower in energy in an optimized (i.e. the potential advantages of using a multireso- more complete) localized orbital basis, resulting lution approach for calculating such quantities in some “missing” virtual states44. in a straightforward and computationally inex- While we are not applying any localization to pensive manner. Our motivation behind cal- the KS states, the initial guess is nonetheless culating ELNES is to show an example of a generated from a localized atomic basis set, so type of calculation where the use of a mixed that the same energy ordering problems can oc- AE/PSP scheme within a multiresolution ap- cur. Fortunately, the same solution can also be proach is advantageous. As such, we have not used: a larger number of virtual states than re- presented any comparisons with experiment, as quired must initially be requested to allow the many such comparisons, including the impact virtual states to attain the correct energy order- of whether of not core hole effects are incorpo- ing. After this initial stage the higher energy rated, can be found elsewhere; see for example KS states are eliminated and the calculation a recent review article on the subject20. proceeds with the actual number of states re- quired. In order to reduce the user effort, this Computational Details process has been semi-automated so that the code will gradually reduce the number of calcu- All ELNES spectra were generated for an lated virtual states, however the user must still isotropic average of q. For madness, pay careful attention to ensure no virtual states BigDFT28 and NWChem45 we used explicit have been neglected. free boundary conditions, while for castep46 There are also some subtleties regarding core we used large cubic supercells with sides of states. When multiple atoms are treated as AE, 30 A˚ to minimize interactions between periodic it is possible for mixing to occur between core images. For madness and BigDFT we used wavefunctions. For standard DFT calculations the same PSP parameters, ensuring that the this does not pose a problem, however when we employed PSPs were generated with the cor- are interested in probing excitations originating rect functional, while for we used the on specific atoms this is problematic. One way on-the-fly PSP generator using default param- to minimize this mixing is by explicitly local- eters. Following a PSP calculation in castep, izing the core states, with the aim of ensuring PAW is used to correct the ELNES matrix ele- that the core states remain associated with a ments, as described in Refs.36,38. For cysteine single atom. In some cases it might be neces- we used the LDA exchange correlation func- sary to impose a more strict localization crite- tional47, while for the SWCNT we used the rion, however in the following examples this was PBE functional48. not needed. Furthermore for core hole calcula- madness calculations were initially con- tions one could always treat only a single atom verged using a threshold of 10−4 and wavelet at the AE level, avoiding such problems. order k = 6, following which 10−6 and k = 8 were used to achieve a well converged result. For NWChem we used aug-cc-pVnZ basis sets Results with varying n, which we abbreviate to aVnZ in the following. For BigDFT we employed We present in the following benchmark calcu- a small wavelet grid spacing of 0.08 A˚ and lations demonstrating the accuracy of our ap- coarse and fine radius multipliers of 12 and 15 proach for cysteine and a single walled carbon respectively to obtain well converged energies. nanotube (SWCNT) by comparing the PSP, For castep we used PW cutoffs of 1000 eV mixed and AE approaches with results from and 600 eV for cysteine and the SWCNT re- other codes employing different basis sets and spectively. In all codes we calculated the five approaches. We emphasize here that the goal lowest energy virtual states for cysteine and

6 the fourteen lowest energy virtual states for the latter, ECP were used for all elements except SWCNT. H, for which the aVTZ basis was used. This approach gives the largest errors compared to Cysteine the madness AE results, which might be at- tributed to the fact that they have been devel- We first take the amino acid cysteine, for which oped for Hartree Fock calculations rather than the atomic structure is depicted in Fig. 1. We DFT. The next biggest discrepancies are for use this example to verify the correctness of castep. This is unsurprising given the greater the PSP implementation and assess the mixed differences in computational setup, including AE/PSP scheme. In order to put the results the use of a periodic supercell and different PSP into context we also compare with other codes type. However the differences are small – less using different basis sets. than 50 meV. The error due to using the small- est Gaussian basis set (aVDZ) is of a similar magnitude, while for the largest Gaussian basis O1 set (av5Z) the difference with respect to mad- S C3 C1 ness AE has reduced to around 1 meV. We also compare different approaches to C2 O2 ELNES calculations. This includes those ob- N tained using Gaussian basis sets in NWChem and using the PW code castep. As with moldft, the dipole approximation is used in Figure 1: Atomic structure of the cysteine both castep and NWChem to generate the molecule, with H atoms in white, C in grey, transition matrix elements. Since we are inter- N in blue, O in red and S in gold. The atom ested in comparing like-for-like, we do not in- labels refer to those used in Table 2 and Fig. 2. troduce a core hole into any of the calculations. Fig. 2 shows the ELNES spectra for transitions We first compare select eigenvalues close from each atom in the system. Since the core to the HOMO (highest occupied molecular states are not accessible in the PW approach, orbital) and the LUMO (lowest unoccupied the spectra have been manually aligned, while molecular orbital) – results are shown in Ta- in all other cases the transition energies are ex- ble 1. In the first instance, we compare the plicitly calculated. There is excellent agreement AE and PSP approaches in moldft with the between the PW results and madness for all PSP implementation in BigDFT, which, as cases except the S 2p spectrum, which is due to previously mentioned, employs the same type the splitting in the core energy levels which can- of PSPs. The PSP results from the two codes not be captured with the PW approach. The are in excellent agreement, with differences of Gaussian results converge rather slowly with re- at most a few tenths of a meV, confirming the spect to basis size, especially in the case of S. correctness of our PSP implementation. Com- However, the shape is already similar for small paring the AE and PSP values, as expected the basis sets. Furthermore, a closer examination differences are more significant, but nonetheless of the core energies, which are given in Table 2, remain small, of the order of 10 meV. Such a shows that while the core energies themselves high level of agreement is more than sufficient converge slowly, the splitting between core lev- given typical smearing applied when calculating els converges quickly. ELNES. In order to test the mixed scheme, we next To put the results in context, we have also investigated several scenarios, which are listed calculated the energies using the castep PW in Table 3. In each case we calculated the occu- code and with various Gaussian basis sets using pied and negative energy unoccupied KS states. NWChem, as well as the Stuttgart relativis- The error in the eigenvalues compared to the tic large core ECP49 in NWChem. For the AE values is of the same order of magnitude

7 Table 1: Comparison of select eigenvalues (eV), for the cysteine molecule using the AE and PSP approaches in MADNESS, PSP implementations in BigDFT and CASTEP, various Gaussian basis sets using the AE approach and the Stuttgart relativistic large core (SRLC) ECP using NWChem, as described in the text.

madness BigDFT castep NWChem AE PSP PSP PSP AE ECP aVDZ aVTZ aVQZ aV5Z SRLC HOMO-3 -7.8867 -7.8915 -7.8916 -7.8619 -7.8750 -7.8804 -7.8859 -7.8859 -7.8287 HOMO-2 -6.9024 -6.9099 -6.9095 -6.8869 -6.8654 -6.8954 -6.9008 -6.9008 -6.9933 HOMO-1 -6.0708 -6.0652 -6.0652 -6.0436 -6.0355 -6.0654 -6.0709 -6.0709 -5.9838 HOMO -5.7905 -5.7812 -5.7813 -5.7503 -5.7688 -5.7933 -5.7933 -5.7906 -5.7715 LUMO -1.7365 -1.7263 -1.7263 -1.7128 -1.7116 -1.7252 -1.7334 -1.7361 -1.8232

Table 2: Core energies and energy splittings between states (eV) calculated using the AE and appropriate mixed approach as defined in Table 3 as well as various Gaussian basis sets. The atom labels are those indicated in Fig. 1. For the S 2p energy levels there is significant mixing between the states, particularly between y and z. The specific orbital has therefore not been labelled.

madness NWChem Atom State AE Mixed aVDZ aVTZ aVQZ aV5Z 1s -2387.00 -2387.00 -2387.64 -2387.33 -2386.65 -2386.75 2s -207.82 -207.82 -208.16 -208.00 -207.85 -207.82 S -154.91 -154.91 -155.31 -155.13 -154.95 -154.91 2p -154.79 -154.79 -155.18 -154.80 -154.80 -154.80 -154.61 -154.61 -154.97 -154.82 -154.65 -154.61 C1 1s -270.02 -270.04 -270.28 -270.03 -270.03 -270.03 C2 1s -267.86 -267.87 -268.13 -267.86 -267.86 -267.86 C3 1s -267.21 -267.21 -267.53 -267.23 -267.22 -267.22 C3 - C1 1s 2.16 2.17 2.15 2.17 2.17 2.17 C3 - C2 1s 2.81 2.83 2.75 2.80 2.81 2.81 N 1s -377.15 -377.16 -377.63 -377.18 -377.16 -377.15 O1 1s -508.08 -508.09 -508.73 -508.14 -508.10 -508.09 O2 1s -506.33 -506.33 -506.99 -506.38 -506.34 -506.32 O2 - O1 1s 1.76 1.76 1.75 1.76 1.76 1.76 as for the PSP calculation – around 10 meV mize the implementation of PSPs in madness. for the set of states considered in Table 1. In It is therefore likely that further decreases in other words, the mixed formalism works as an- computational cost could be achieved in the fu- ticipated, with the quality of results only being ture, e.g. by optimizing the calculation of the limited by the quality of the PSP. In each of the PSP projectors in the multi-wavelet basis. mixed cases, the total wall time was reduced by Finally, we also calculate ELNES spectra us- around a factor of two compared to pure AE. ing the mixed approach. In this case, the spec- However, no particular effort was made to opti- tra can only be calculated where we have access

8 PW Energy (eV) PW Energy (eV) PW Energy (eV) -4 -2 0 2 -4 -2 0 -2 0 2 the average of all transitions from atoms of that S 1s C1 1s N 1s AE species. As can be seen, the PW results show PW aVDZ noticeable differences for the C and O 1s spec- aVTZ aVQZ tra, for the same reasons discussed above for the aV5Z

Intensity (arb. units) Intensity (arb. units) Intensity (arb. units) S 2p spectrum. This is not surprising given that 2383 2385 2387 2389 265 267 269 271 374 376 378 380 AE Energy (eV) AE Energy (eV) AE Energy (eV) the splittings between core states are of the or- PW Energy (eV) PW Energy (eV) PW Energy (eV) -2 0 2 -2 0 2 -4 -2 0 der of 2 eV. On the other hand, the mixed and S 2s C2 1s O1 1s AE results are virtually identical at the applied smearing level, as are the Gaussian results. The only exception is that the Gaussian results dif- fer for the S 1s spectrum, which in any case Intensity (arb. units) Intensity (arb. units) Intensity (arb. units) 204 206 208 210 265 267 269 271 503 505 507 509 AE Energy (eV) AE Energy (eV) AE Energy (eV) would not be measured experimentally. Indeed, PW Energy (eV) PW Energy (eV) PW Energy (eV) the absolute core energy levels calculated using -2 0 2 -2 0 2 -2 0 2 S 2p C3 1s O2 1s the different mixed approaches, (given in Ta- ble 2) show excellent agreement with the pure AE results, with the induced error on the order of 0.01 eV. Thus, should one be interested for Intensity (arb. units) Intensity (arb. units) Intensity (arb. units) 151 153 155 157 265 267 269 271 503 505 507 509 AE Energy (eV) AE Energy (eV) AE Energy (eV) example in only the core edge for C, one could easily treat all other atoms at the PSP level at a Figure 2: ELNES spectra for the different reduced computational cost, without noticeable atoms of the cysteine molecule as labelled in loss of accuracy, and indeed with an accuracy Fig. 1, using the AE approach in madness, the comparable to that of a very large Gaussian ba- PW approach in castep and various Gaussian sis set. basis sets in NWChem. Gaussian smearing of 0.1 eV was applied and the intensities were scaled for easier comparison. Carbon Nanotube As our second example, we take a short, Table 3: The different setups for the cys- hydrogen-terminated (4,0) single walled carbon teine molecule, where  () denotes the nanotube, depicted in Fig. 4. For this system treatment of all atoms of that species at we are interested in calculating the full ELNES the AE (PSP) level. The column denoted spectrum, however since there are only three “ELNES” indicates whether the calcula- C atoms which could be considered to be dis- tion of an ELNES spectra is possible. tinct (i.e. different chemical environment, unre- H C N O S ELNES lated by symmetry), we might hope to calcu- late the core excitations from only one atom of AE       each type, and use this to reconstruct the total PSP       spectrum. This can be achieved using a mixed mixed (H)       calculation with only three atoms treated at the mixed (C)       AE level and the remainder at the PSP level. mixed (N)       The AE atoms are labelled A, B and C and mixed (O)       indicated in Fig. 4. For the mixed moldft cal- mixed (S)       culation, it was not necessary to explicitly im- pose any localization on any of the core states, to at least one core state, which is only possible since they remained disentangled. As well as when at least one atom was treated at the AE comparing the spectra originating from the dif- level. Table 3 indicates which of the calculation ferent atoms, we are also interested in the core setups were used, while Fig. 3 shows the respec- energies of atoms A, B and C, i.e. to what ex- tive spectra, which are also compared with PW tent there is splitting in the energy levels due and aVQZ results. Each curve corresponds to to the differing bonding environments. As with

9

O 1s AE mixed (O) aVQZ PW

503 504 505 506 507 508 509

N 1s AE mixed (N) aVQZ PW

374 375 376 377 378 379 380

C 1s AE Figure 4: Atomic structure of the SWCNT, mixed (C) aVQZ with H atoms in white, generic C atoms treated PW at the PSP level in grey and the atoms with 265 266 267 268 269 270 271 different environments which are treated at the

S 2p AE mixed (S) AE level and labelled A, B and C highlighted aVQZ PW

Intensity (arb. units) in red, yellow and blue respectively.

151 152 153 154 155 156 157

S 2s AE mixed (S) electronic structure of the different calculations aVQZ PW is in agreement, and thus any discrepancies in the calculated ELNES spectra result from the 204 205 206 207 208 209 210 differing approaches to calculating the spectra, S 1s AE mixed (S) aVQZ rather than as a result of more fundamental dif- PW ferences between the codes.

2383 2384 2385 2386 2387 2388 2389 Energy (eV) AE mixed aVTZ PW Figure 3: ELNES spectra for the cysteine molecule, for the AE approach and various mixed setups (defined in Table 3) in madness, ÷8 as well as using the PW approach in castep and the AE approach from NWChem using the

aVQZ basis set. The core state is indicated for DOS (arb. units) each plot, and where more than one atom of a ÷8 given species is present, the average spectrum is shown. The PW spectra have been manually aligned and intensities have been scaled to facil- −267 −262 −20 −15 −10 −5 0 5 itate comparison. Gaussian smearing of 0.1 eV Energy (eV) was applied. Figure 5: DOS for a SWCNT, calculated using the AE and mixed setup of moldft as described in the text, with a PW approach in cysteine, we also compare results with PW and castep and with a Gaussian basis set in . Gaussian basis set approaches. NWChem Gaussian smearing of 0.1 eV has been applied, In the first instance we calculated the density while the energies have been shifted so that the of states (DOS) for the different approaches, HOMO of each setup is at zero. The core ener- shown in Fig. 5. As can be seen, the four gies for the AE and Gaussian calculations (in- curves are virtually identical within the level of dicated by the arrow in the figure) have been smearing for the valence and conduction states. divided by eight to facilitate comparison with Furthermore, despite the varying setups (dif- the mixed mode DOS. ferent basis sets, type of PSP if used, boundary conditions etc.), the calculated HOMO-LUMO band gaps differ by at most a few meV. We Considering now the core energies, we com- can therefore be confident that the calculated pare the mixed and AE results. There are eight atoms each of types A, B and C and thus we

10 1 have scaled the core AE DOS by 8 for com- atoms treated at the AE level, it is possible to parison with the mixed DOS. Aside from the generate the correct averaged spectra without need for scaling, there is excellent agreement needing to treat all the core states explicitly. between the two setups. In order to be more Such an approach could be applied to larger quantitative, in Table 4 we give the core ener- systems which contain atoms which are equiv- gies for the different approaches. There is non- alent by symmetry. On the other hand, the to- negligible splitting between the core energy lev- tal PW spectrum shows significant differences els, with that of atom A around 0.7 eV lower in with the other approaches. Upon examining the energy. All methods are in good agreement for separate contributions from the three types of the splittings, although a larger Gaussian basis atoms, which are plotted in the top three panels set is required to also obtain well converged ab- of Fig. 6, it can be seen that the spectra for the solute energies. As with cysteine, such a level different atoms are very similar, with only small of splitting, which mainly arises due to the edge differences in the relative peak heights and lo- of the SWCNT, could have a potentially impor- cations. As with cysteine, the difference in the tant affect on the ELNES spectrum. total spectra is therefore almost entirely due to the core level splitting which has not been cap- Table 4: Core energies and energy split- tured in the PW calculation. tings (eV) associated with a particular atom type for the SWCNT calculated us- mixed A mixed B ing the AE and mixed approaches as well mixed C as two Gaussian basis sets. For the AE and Gaussian values, the energies have been averaged over all instances of atoms PW A PW B with the same symmetry. The atom la- PW C bels are those indicated in Fig. 4.

madness NWChem Intensity (arb. units) AE tot. Atom AE Mixed aVDZ aVTZ mixed tot. aVTZ tot. A -270.48 -270.46 -270.81 -270.49 PW tot. B -269.78 -269.79 -270.12 -269.80 C -269.64 -269.64 -269.96 -269.65 266 267 268 269 270 271 B - A 0.69 0.66 0.68 0.69 Energy (eV) C - A 0.84 0.82 0.84 0.84 Figure 6: ELNES spectra for the C K edge of a SWCNT, calculated in AE and mixed modes We now turn to the ELNES spectra, which in madness, the PW approach in castep and are shown in Fig. 6. Alongside the spectra for using a Gaussian basis set in NWChem. In the the three atom types, the total spectra is also lower panel the total spectra are plotted (com- shown. In the case of the AE, PW and Gaus- bining the spectra of each atom), while the top sian calculations this is merely the sum of the two panels show the core edges for atoms A, C K edge spectra of each C atom in the sys- B and C for the mixed and PW approaches. tem. For the mixed calculation, we take the Gaussian smearing of 0.1 eV has been applied. three representative spectra and weight them Each of the PW spectra have been manually accordingly. The AE and mixed spectra are shifted along the energy axis by a single energy in excellent agreement, demonstrating that our value such that the total spectra can be com- method is able to distinguish between the dif- pared. Similarly, the intensities have also been ferent carbon atoms, with the relative heights of scaled to facilitate comparison. the different peaks significantly affected by the local environment. Through judicial choice of As previously discussed, only the bound vir-

11 tual states can be calculated using madness. of the same species with differing local chemi- Using the aVTZ basis in NWChem, we there- cal environments, it is essential to calculate the fore also explore the convergence with respect absolute energy onset of different atoms. In to the number of virtual states by calculating the future, it would be interesting to perform ELNES spectra for an increasing number of vir- a similar comparison taking into account core tual states, beyond Nv = 14, which was used in hole effects, for example in order to assess to the above. The results are shown in Fig. 7. It what extent the estimation of absolute energy can be seen that the spectrum is already con- onsets in a PAW approach recovers the values verged up to around 270 eV, after which an of an AE calculation. Nonetheless, the mixed increasing number of (unbound) virtual states AE/PSP approach presented in this work might are required. We emphasize that the unbound offer an appealing alternative to both PAW and states converge slowly with respect to both the pure AE approaches, given the possibility of ac- simulation cell size and basis set size50, so that cessing the core states without the full cost of the higher energy part of the spectrum requires an AE calculation. careful convergence irrespective of the method used. Nonetheless, provided care is taken to en- sure that the number of accessible virtual states Conclusion is sufficient to converge the spectrum in the re- In this paper we have introduced the im- gion of interest, the restriction to only bound plementation of norm-conserving HGH-GTH states does not prevent the ability to generate pseudopentials in the multi-wavelet well converged ELNES spectra in a low energy madness molecular DFT code. We have validated our window. implementation through comparison with both

50 PSP and AE calculations using other basis 45 sets. The difference between the KS energies 40 calculated using the AE and PSP approaches 35

v in madness are shown to be well below the 30 N desired accuracy for many applications. In 25 the first instance, the introduction of such a Intensity (arb. units) 20 15 functionality opens up new possibilities for the 266 267 268 269 270 271 272 273 treatment of heavy elements or larger molecules Energy (eV) in madness. Figure 7: ELNES spectra for the C K edge We have also presented a mixed AE/PSP ap- of a SWCNT, calculated using the aVTZ basis proach, wherein atoms within a single calcula- set in NWChem. The line colour refers to the tion may be treated at different levels of theory. number of virtual states, Nv, used to generate The multiresolution approach of madness au- the spectrum. The spectrum for Nv = 14 has tomatically refines the basis in areas requiring a been highlighted in thicker black lines. Gaus- greater resolution, thereby achieving a balance sian smearing of 0.1 eV has been applied. between the competing requirements of accu- racy and computational efficiency, irrespective Finally, we note that the level of smearing ap- of the choice of PSP or AE. Crucially, this does plied is small compared to typical experimental not require any input from the user. energy resolutions – this was chosen to allow The availability of a mixed approach is partic- for a precise comparison between the different ularly useful in cases where one requires a high methods. The impact of core splitting might degree of accuracy in a particular subset of a be less significant for a larger smearing level, system. For example, for the simulation of a however it would still have a noticeable impact molecule on a surface, where one might choose on both the position and shape of the peaks. to treat the molecule and upper layer(s) of the Therefore, for systems where there exist atoms surface at the AE level, and lower layers of the

12 surface at a PSP level. Furthermore, such an opportunities for benchmarking new flavours or approach is particularly suited to the calcula- parameterizations of PSPs. There has been tion of ELNES spectra, where explicit access a recent investment within the community in to the core states is highly desirable, but only benchmarking different DFT approaches and required for a subset of a system. codes, notably in comparing a wide range of pe- We have implemented the calculation of riodic DFT codes26, while multi-wavelets have ELNES in madness employing the dipole ap- also been used to benchmark AE basis sets for proximation and Fermi’s golden rule. Using calculations of molecules51. In a similar spirit, examples of a small molecule and short fi- one could use madness to separate errors re- nite SWCNT, we have shown how our method sulting from different basis sets or other code compares with ELNES spectra calculated using features from those coming from the choice of both a PW approach wherein PAW is used to PSP. generate the matrix elements, and with Gaus- Furthermore, in order to test the accuracy sian basis sets. Through these examples we of a particular PSP, one must typically per- have demonstrated how one might only treat ei- form benchmarks for a material containing only ther select atomic species or select (symmetry- one atomic species, e.g. elemental solids26,52, unrelated) atoms at an AE level. This offers since otherwise it is difficult to disentangle er- a compromise between the high computational rors resulting from the different PSPs. How- cost of AE ELNES calculations and the inabil- ever, using the mixed approach, one could also ity to directly access the core states in PAW consider materials containing more than one based approaches. In each case we show ex- atomic species by treating only the element of cellent agreement between pure AE and mixed interest at the PSP level and all other species calculations. In both systems the different lo- at the AE level. This would allow one to disen- cal chemical environments of atoms of the same tangle the errors resulting from different PSPs, species resulted in a splitting in the core en- without additional approximations due to the ergies, which needs to be explicitly calculated basis set. The work presented above could to correctly generate the ELNES spectra. A therefore represent a powerful tool for future method which has direct access to the core benchmarking endeavours. states at a much lower cost than a full AE cal- Acknowledgement This material is based culation is highly useful for such a task. upon work supported by Laboratory Directed The examples presented suggest future areas Research and Development (LDRD) funding of applicability, as well as avenues for further from Argonne National Laboratory, provided development. In particular, it would be de- by the Director, Office of Science, of the sirable in future to also incorporate core hole U.S. Department of Energy under Contract effects, which in the majority of cases signifi- No. DE-AC02-06CH11357. LER acknowledges cantly improves the agreement between theo- an EPSRC Early Career Research Fellowship retical and experimental ELNES spectra. Fur- (EP/P033253/1). An award of computer time thermore, the current approach to calculating was provided by the Innovative and Novel Com- the virtual states in moldft is not very robust – putational Impact on Theory and Experiment in some cases the inclusion of too many virtual (INCITE) program. This research used re- states leads to a failure to converge. In addi- sources of the Argonne Leadership Comput- tion, the energy range is limited due to the fact ing Facility, which is a DOE Office of Science that the unbound (i.e. continuum) virtual states User Facility supported under Contract DE- are ill-defined in the multi-wavelet basis. Alter- AC02-06CH11357. Calculations were also per- native approaches to calculating virtual states formed on the Imperial College High Perfor- should therefore be explored in future. mance Computing Service. LER thanks Dr. There are also other potential areas of appli- Anna Regoutz for useful discussions. Simula- cation – the availability of a high precision code tion data are available from the author on re- which can operate as AE or PSP introduces new

13 quest. Wave Function for the Ground State of Helium Atom. J. Chem. Phys. 2012, 137, 104103. References (8) Bischoff, F. A.; Valeev, E. F. Comput- (1) madness Code Repository, ing Molecular Correlation Energies with https://github.com/m-a-d-n-e-s-s/madness. Guaranteed Precision. J. Chem. Phys. 2013, 139, 114106. (2) Harrison, R. J.; Beylkin, G.; Bischoff, F. A.; Calvin, J. A.; Fann, G. I.; (9) Bischoff, F. A. Analytic Second Nuclear Fosso-Tande, J.; Galindo, D.; Ham- Derivatives of Hartree-Fock and DFT us- mond, J. R.; Hartman-Baker, R.; ing Multi-Resolution Analysis. J. Chem. Hill, J. C. et al. MADNESS: A Multireso- Phys. 2017, 146, 124126. lution, Adaptive Numerical Environment for Scientific Simulation. SIAM J. Sci. (10) Fann, G. I.; Pei, J.; Harrison, R. J.; Jia, J.; Comput. 2016, 38, S123–S142. Hill, J.; Ou, M.; Nazarewicz, W.; Shel- ton, W. A.; Schunck, N. Fast Multiresolu- (3) V´azquez-Mayagoitia, A.; Thornton, W. S.; tion Methods for Density Functional The- Hammond, J. R.; Harrison, R. J. In ory in Nuclear Physics. J. Phys.: Conf. Annual Reports in Computational Chem- Ser. 2009, 180, 012080. istry; Wheeler, R. A., Ed.; Elsevier, 2014; Vol. 10; pp 3 – 24. (11) Fosso-Tande, J.; Harrison, R. J. Im- plicit Solvation Models in a Multireso- (4) Harrison, R. J.; Fann, G. I.; Yanai, T.; lution Multiwavelet Basis. Chem. Phys. Beylkin, G. In Computational Science — Lett. 2013, 561–562, 179 – 184. ICCS 2003: International Conference, Melbourne, Australia and St. Petersburg, (12) Kottmann, J. S.; Hofener, S.; Russia, June 2–4, 2003 Proceedings, Part Bischoff, F. A. Numerically Accurate IV ; Sloot, P. M. A., Abramson, D., Bog- Linear Response-Properties in the danov, A. V., Gorbachev, Y. E., Don- Configuration-Interaction Singles (CIS) garra, J. J., Zomaya, A. Y., Eds.; Springer Approximation. Phys. Chem. Chem. Berlin Heidelberg: Berlin, Heidelberg, Phys. 2015, 17, 31453–31462. 2003; pp 103–110. (13) Reuter, M. G.; Hill, J. C.; Harrison, R. J. (5) Harrison, R. J.; Fann, G. I.; Yanai, T.; Solving PDEs in Irregular Geometries Gan, Z.; Beylkin, G. Multiresolution with Multiresolution mMthods I: Embed- : Basic Theory and ded Dirichlet Boundary Conditions. Com- Initial Applications. J. Chem. Phys. 2004, put. Phys. Commun. 2012, 183, 1 – 7. 121, 11587–11598. (14) Reuter, M. G.; Ratner, M. A.; Seide- (6) Yanai, T.; Fann, G. I.; Gan, Z.; Har- man, T. Laser Alignment as a Route to rison, R. J.; Beylkin, G. Multireso- Ultrafast Control of Electron Transport lution Quantum Chemistry in Multi- Through Junctions. Phys. Rev. A 2012, wavelet Bases: Analytic Derivatives for 86, 013426. Hartree–Fock and Density Functional Theory. J. Chem. Phys. 2004, 121, 2866– (15) Sekino, H.; Maeda, Y.; Yanai, T.; Harri- 2876. son, R. J. Basis Set Limit Hartree–Fock and Density Functional Theory Response (7) Bischoff, F. A.; Harrison, R. J.; Property Evaluation by Multiresolution Valeev, E. F. Computing Many-Body Multiwavelet Basis. J. Chem. Phys. 2008, Wave Functions with Guaranteed Pre- 129, 034111. cision: The First-Order Møller-Plesset

14 (16) Sullivan, B. D.; Weerapurage, D.; (25) Hartwigsen, C.; Goedecker, S.; Hutter, J. Gro¨er,C. Parallel Algorithms for Graph Relativistic Separable Dual-Space Gaus- Optimization Using Tree Decompositions. sian Pseudopotentials from H to Rn. Phys. 2013 IEEE International Symposium Rev. B 1998, 58, 3641–3662. on Parallel Distributed Processing, Workshops and Phd Forum. 2013; pp (26) Lejaeghere, K.; Bihlmayer, G.; Bj¨ork- 1838–1847. man, T.; Blaha, P.; Bl¨ugel,S.; Blum, V.; Caliste, D.; Castelli, I. E.; Clark, S. J.; (17) Vence, N.; Harrison, R.; Krsti´c, P. At- Dal Corso, A. et al. Reproducibility in tosecond Electron Dynamics: A Multires- Density Functional Theory Calculations of olution Approach. Phys. Rev. A 2012, 85, Solids. Science 2016, 351 . 033403. (27) Willand, A.; Kvashnin, Y. O.; Gen- (18) Yanai, T.; Fann, G. I.; Gan, Z.; Har- ovese, L.; V´azquez-Mayagoitia, A.; rison, R. J.; Beylkin, G. Multiresolu- Deb, A. K.; Sadeghi, A.; Deutsch, T.; tion Quantum Chemistry in Multiwavelet Goedecker, S. Norm-Conserving Pseu- Bases: Hartree–Fock Exchange. J. Chem. dopotentials with Chemical Accuracy Phys. 2004, 121, 6680–6688. Compared to All-Electron Calculations. J. Chem. Phys. 2013, 138, 104109. (19) Yanai, T.; Harrison, R. J.; Handy, N. C. Multiresolution Quantum Chemistry in (28) Genovese, L.; Neelov, A.; Goedecker, S.; Multiwavelet Bases: Time-Dependent Deutsch, T.; Ghasemi, S. A.; Willand, A.; Density Functional Theory with Asymp- Caliste, D.; Zilberberg, O.; Rayson, M.; totically Corrected Potentials in Local Bergman, A. et al. Daubechies Wavelets as Density and Generalized Gradient Ap- a Basis Set for Density Functional Pseu- proximations. Mol. Phys. 2005, 103, 413– dopotential Calculations. J. Chem. Phys. 424. 2008, 129, 014109.

(20) Ikeno, H.; Mizoguchi, T. Basics and Ap- (29) Louie, S. G.; Ho, K.-M.; Cohen, M. L. Self- plications of ELNES Calculations. Mi- Consistent Mixed-Basis Approach to the croscopy 2017, 1–23. Electronic Structure of Solids. Phys. Rev. B 1979, 19, 1774–1782. (21) Marques, M. A.; Oliveira, M. J.; Bur- (30) VandeVondele, J.; Krack, M.; Mo- nus, T. Libxc: A Library of Exchange and hamed, F.; Parrinello, M.; Chassaing, T.; Correlation Functionals for Density Func- Hutter, J. Quickstep: Fast and Accurate tional Theory. Comput. Phys. Commun. Density Functional Calculations using a 2012, 183, 2272 – 2281. Mixed Gaussian and Plane Waves Ap- (22) Pipek, J.; Mezey, P. G. A Fast Intrinsic proach. Comput. Phys. Commun. 2005, Localization Procedure Applicable for Ab 167, 103 – 128. Initio and Semiempirical Linear Combina- (31) Briley, A.; Pederson, M. R.; Jack- tion of Atomic Orbital Wave Functions. J. son, K. A.; Patton, D. C.; Porezag, D. V. Chem. Phys. 1989, 90, 4916–4926. Vibrational Frequencies and Intensities of (23) Bl¨ochl, P. E. Projector Augmented-Wave Small Molecules: All-Electron, Pseudopo- Mmethod. Phys. Rev. B 1994, 50, 17953– tential, and Mixed-Potential Methodolo- 17979. gies. Phys. Rev. B 1998, 58, 1786–1793.

(24) Goedecker, S.; Teter, M.; Hutter, J. Sepa- (32) Jackson, K.; Grossman, S. Chain Forma- rable Dual-Space Gaussian Pseudopoten- tion and the Origin of Structure in the Ra- tials. Phys. Rev. B 1996, 54, 1703–1710. man Spectrum of a − SiSe2. Phys. Rev. B 2001, 65, 012206.

15 (33) Porezag, D.; Pederson, M. R.; Liu, A. Y. (42) Mizoguchi, T.; Tanaka, I.; Gao, S.-P.; Adsorption and Dissociation of Hydrazoic Pickard, C. J. First-Principles Calcula- Acid on Al(111). Phys. Rev. B 2000, 61, tion of Spectral Features, Chemical Shift 13230–13234. and Absolute Threshold of ELNES and XANES using a Plane Wave Pseudopoten- (34) Jackson, K.; Srinivas, S.; Kortus, J.; Ped- tial Method. J. Phys.: Condens. Matter 119 erson, M. Modeling the Sn M¨ossbauer 2009, 21, 104204. Spectra of Chalcogenide Glasses using Density-Functional Theory Calculations. (43) Skylaris, C.-K.; Haynes, P. D.; Phys. Rev. B 2002, 65, 214201. Mostofi, A. A.; Payne, M. C. Intro- ducing ONETEP: Linear-Scaling Density (35) Tizei, L. H. G.; Liu, Z.; Koshino, M.; Functional Simulations on Parallel Com- Iizumi, Y.; Okazaki, T.; Suenaga, K. Sin- puters. J. Chem. Phys. 2005, 122, gle Molecular Spectroscopy: Identification 84119. of Individual Fullerene Molecules. Phys. Rev. Lett. 2014, 113, 185502. (44) Ratcliff, L. E.; Hine, N. D. M.; Haynes, P. D. Calculating Optical (36) Pickard, C. J. Ab initio Electron Energy Absorption Spectra for Large Systems Loss Spectroscopy. Ph.D. thesis, Univer- using Linear-Scaling Density Functional sity of Cambridge, 1997. Theory. Phys. Rev. B 2011, 84, 165131.

(37) Duscher, G.; Buczko, R.; Pennycook, S.; (45) Valiev, M.; Bylaska, E.; Govind, N.; Pantelides, S. Core-Hole Effects on Kowalski, K.; Straatsma, T.; Dam, H. V.; Energy-Loss Near-Edge Structure. Ultra- Wang, D.; Nieplocha, J.; Apra, E.; Win- microscopy 2001, 86, 355 – 362. dus, T. et al. NWChem: A Comprehensive (38) Gao, S.-P.; Pickard, C. J.; Perlov, A.; Mil- and Scalable Open-Source Solution for man, V. Core-Level Spectroscopy Calcu- Large Scale Molecular Simulations. Com- lation and the Plane Wave Pseudopoten- put. Phys. Commun. 2010, 181, 1477 – tial Method. J. Phys.: Condens. Matter 1489. 2009, 21, 104203. (46) Clark, S. J.; Segall, M. D.; Pickard, C. J.; (39) Mazevet, S.; Torrent, M.; Recoules, V.; Hasnip, P. J.; Probert, M. J.; Refson, K.; Jollet, F. Calculations of the Transport Payne, M. First Principles Methods us- Properties within the PAW Formalism. ing CASTEP. Z. Kristall. 2005, 220, 567– High En. Den. Phys. 2010, 6, 84 – 88. 570.

(40) Tait, E. W.; Ratcliff, L. E.; Payne, M. C.; (47) Ceperley, D. M.; Alder, B. J. Ground Haynes, P. D.; Hine, N. D. M. Simula- State of the Electron Gas by a Stochastic tion of Electron Energy Loss Spectra of Method. Phys. Rev. Lett. 1980, 45, 566– Nanomaterials with Linear-Scaling Den- 569. sity Functional Theory. J. Phys.: Con- (48) Perdew, J. P.; Burke, K.; Ernzer- dens. Matter 2016, 28, 195202. hof, M. Generalized Gradient Approxima- (41) Gelius, U.; Hed´en, P. F.; Hedman, J.; tion Made Simple. Phys. Rev. Lett. 1996, Lindberg, B. J.; Manne, R.; Nord- 77, 3865–3868. berg, R.; Nordling, C.; Siegbahn, K. (49) Bergner, A.; Dolg, M.; K¨uchle, W.; Molecular Spectroscopy by Means of Stoll, H.; Preuß, H. Ab Initio Energy- ESCA III.Carbon compounds. Phys. Scr. Adjusted Pseudopotentials for Elements 1970, 2, 70–80. of Groups 13-17. Mol. Phys. 1993, 80, 1431–1441.

16 (50) Boffi, N. M.; Jain, M.; Natan, A. Asymp- totic Behavior and Interpretation of Vir- tual States: The Effects of Confinement and of Basis Sets. J. Chem. Phys. 2016, 144, 084104.

(51) Jensen, S. R.; Saha, S.; Flores-Livas, J. A.; Huhn, W.; Blum, V.; Goedecker, S.; Fre- diani, L. The Elephant in the Room of Density Functional Theory Calculations. J. Phys. Chem. Lett. 2017, 8, 1449–1457.

(52) Prandini, G.; Marrazzo, A.; Castelli, I. E.; Mounet, N.; Marzari, N. Precision and Efficiency in Solid-State Pseudopoten- tial Calculations. Npj Computat. Mater. 2018, 4, 72.

17