GPAW: An open Python package for electronic-structure calculations

Jens Jørgen Mortensen Corresponding author: jjmo@dtu.dk CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Ask Hjorth Larsen CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Mikael Kuisma CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Aleksei V. Ivanov Riverlane Ltd, St Andrews House, 59 St Andrews Street, Cambridge, CB2 3BZ, United Kingdom    Alireza Taghizadeh CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Andrew Peterson School of Engineering, Brown University, Providence, Rhode Island, USA    Anubhab Haldar Department of Electrical and Computer Engineering, Boston University, United States of America.    Asmus Ougaard Dohn Department of Physics, Technical University of Denmark, 2800 Lyngby, Denmark; Science Institute and Faculty of Physical Sciences, VR-III, University of Iceland, Reykjavík 107, Iceland    Christian Schäfer Department of Physics, Chalmers University of Technology, SE-412 96 Gothenburg, Sweden    Elvar Örn Jónsson Science Institute and Faculty of Physical Sciences, University of Iceland, VR-III, 107 Reykjavík, Iceland    Eric D. Hermes Quantum-Si, 29 Business Park Drive, Branford, CT 06405, USA    Fredrik Andreas Nilsson CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Georg Kastlunger CatTheory, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Gianluca Levi Science Institute and Faculty of Physical Sciences, University of Iceland, VR-III, 107 Reykjavík, Iceland    Hannes Jónsson Science Institute and Faculty of Physical Sciences, University of Iceland, VR-III, 107 Reykjavík, Iceland    Hannu Häkkinen Departments of Physics and Chemistry, Nanoscience Center, University of Jyväskylä, FI-40014 Jyväskylä, Finland    Jakub Fojt Department of Physics, Chalmers University of Technology, SE-412 96 Gothenburg, Sweden    Jiban Kangsabanik CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Joachim Sødequist CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Jouko Lehtomäki Department of Applied Physics, Aalto University, P.O. Box 11100, 00076 Aalto, Finland    Julian Heske CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Jussi Enkovaara CSC – IT Center for Science Ltd., P.O. Box 405, FI-02101 Espoo, Finland    Kirsten Trøstrup Winther SUNCAT Center for Interface Science and Catalysis, SLAC National Accelerator Laboratory, Menlo Park, California 94025, United States    Marcin Dulak CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Marko M. Melander Department of Chemistry, Nanoscience Center, University of Jyväskylä, FI-40014 Jyväskylä, Finland    Martin Ovesen CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Martti Louhivuori CSC – IT Center for Science Ltd., P.O. Box 405, FI-02101 Espoo, Finland    Michael Walter University of Freiburg, FIT Freiburg Centre for Interactive Materials and Bioinspired Technologies, Georges-Köhler-Allee 105, 79110 Freiburg, Germany    Morten Gjerding CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Olga Lopez-Acevedo Biophysics of Tropical Diseases, Max Planck Tandem Group, University of Antioquia UdeA, 050010 Medellin, Colombia    Paul Erhart Department of Physics, Chalmers University of Technology, SE-412 96 Gothenburg, Sweden    Robert Warmbier School of Physics and Mandelstam Institute for Theoretical Physics, University of the Witwatersrand, 1 Jan Smuts Avenue, 2001, Johannesburg, South Africa    Rolf Würdemann Freiburger Materialforschungszentrum, Universität Freiburg, Stefan-Meier-Straße 21, D-79104 Freiburg, Germany    Sami Kaappa Computational Physics Laboratory, Tampere University, P.O. Box 692, FI-33014 Tampere, Finland    Simone Latini Nanomade, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Tara Maria Boland CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Thomas Bligaard Department of Energy Conversion and Storage, Technical University of Denmark, DK-2800 Lyngby, Denmark    Thorbjørn Skovhus CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Toma Susi University of Vienna, Faculty of Physics, Boltzmanngasse 5, 1090 Vienna, Austria    Tristan Maxson Department of Chemical and Biological Engineering, The University of Alabama, Tuscaloosa, AL 35487, USA    Tuomas Rossi CSC – IT Center for Science Ltd., P.O. Box 405, FI-02101 Espoo, Finland    Xi Chen School of Physical Science and Technology, Lanzhou University, Lanzhou, Gansu 730000, China    Yorick Leonard A. Schmerwitz Science Institute and Faculty of Physical Sciences, University of Iceland, VR-III, 107 Reykjavík, Iceland    Jakob Schiøtz CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Thomas Olsen CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Karsten Wedel Jacobsen CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark    Kristian Sommer Thygesen CAMd, Department of Physics, Technical University of Denmark, 2800 Kgs. Lyngby, Denmark
(May 1, 2024)
Abstract

We review the GPAW open-source Python package for electronic structure calculations. GPAW is based on the projector-augmented wave method and can solve the self-consistent density functional theory (DFT) equations using three different wave-function representations, namely real-space grids, plane waves, and numerical atomic orbitals. The three representations are complementary and mutually independent and can be connected by transformations via the real-space grid. This multi-basis feature renders GPAW highly versatile and unique among similar codes. By virtue of its modular structure, the GPAW code constitutes an ideal platform for implementation of new features and methodologies. Moreover, it is well integrated with the Atomic Simulation Environment (ASE) providing a flexible and dynamic user interface. In addition to ground-state DFT calculations, GPAW supports many-body GW band structures, optical excitations from the Bethe–Salpeter Equation (BSE), variational calculations of excited states in molecules and solids via direct optimization, and real-time propagation of the Kohn–Sham equations within time-dependent DFT. A range of more advanced methods to describe magnetic excitations and non-collinear magnetism in solids are also now available. In addition, GPAW can calculate non-linear optical tensors of solids, charged crystal point defects, and much more. Recently, support of GPU acceleration has been achieved with minor modifications of the GPAW code thanks to the CuPy library. We end the review with an outlook describing some future plans for GPAW.

I Introduction

The electronic-structure (ES) problem, i.e. the solution to the time-independent Schrödinger equation for a collection of electrons and atomic nuclei, forms the starting point for the quantum-mechanical treatment of matter. Indeed, all chemical and physical properties of any substance (solid, molecule, surface, etc.) can in principle be obtained from the energies and wave functions that constitute the solution. A pioneering step towards solving the many-body ES problem was the formulation and formal proof of density functional theory (DFT) by Hohenberg and Kohn in 1964 [1], and a practical scheme for its solution by Kohn and Sham in 1965 [2]. Today, most codes solving the ES problem from first principles are based on DFT. Such codes are extremely powerful and allow one to determine the atomic structure of solids and molecules containing hundreds of atoms with a relative error below 1% [3, 4, 5]. Once the atomic structure of the compound has been solved, its properties (electronic, magnetic, optical, topological, etc.) can in principle be determined. The evaluation of properties often involves theories beyond the formal DFT framework to account for effects such as temperature and lattice vibrations [6, 7], many-body interactions in excited states [8, 9], or time dependence [10, 11]. As such, first-principles atomistic calculations often involve two successive phases: the solution of the ground-state ES problem (including ion dynamics) and the subsequent evaluation of physical properties. This review is structured accordingly as Secs. III-IV deal with the first phase while Secs. V-IX are devoted to the second.

In recent years, the scientific significance of ES codes has shifted from a useful tool to describe and understand matter at the atomic scale to an independent driver of the discovery and development of new materials [12, 13, 14, 15, 16]. This change in scope has been fueled by the exponential increase in computer power accompanied by improved numerical algorithms [17, 18] as well as the use of workflow management software for high-throughput computations [19, 20, 21, 22] and the adoption of machine-learning techniques to leverage the rapidly growing data generated by ES codes [23, 24, 25]. In parallel with these capacity-extending developments, continuous progress in the fundamental description of exchange–correlation effects has advanced the predictive power of ES calculations to a level where they rival experiments in terms of accuracy for many important properties [26, 27, 28, 29, 30, 31].

The GPAW code was originally intended as a Python-based multigrid solver of the basic DFT equations within the projector-augmented wave (PAW) formalism [32]. The name GPAW accordingly was an abbreviation for “grid-based projector-augmented waves”. Today, other choices than regular grids for representations of the wave functions exist in GPAW, but the name has stuck. During the years 2005–2010, GPAW evolved to a full-blown DFT package [33] supporting most of the functionality expected from a modern ES code, in addition to a few more specialised features including real-time propagation of wave functions [34] and an alternative basis of numerical atomic orbitals (referred to as the LCAO basis) [35] to supplement the real-space grid. In 2011, a plane-wave (PW) basis set was also implemented. Today, the possibility to use three different types of basis sets and even combining them within a single run remains a unique feature of GPAW, rendering the code very versatile.

The implementation of the PW basis set laid the groundwork for GPAW’s linear-response module, which today supports the calculation of linear response functions [36], total energies from the adiabatic connection fluctuation-dissipation theorem [29, 37], the GW self-energy method for quasiparticle band structures [38], the Bethe–Salpeter Equation (BSE) for optical excitations [39], and more. The code also supports a wide range of features related to the calculation of magnetism and spin–orbit effects. Examples include spin-spiral calculations using the generalized Bloch theorem [40], external magnetic fields, orbital magnetization, magnetic anisotropy [41], adiabatic magnon dispersions from the magnetic force theorem [42], and dynamic magnetic response from TDDFT [43]. For solids, the k-space Berry phases can be computed directly from the Bloch orbitals and may be used to obtain the spontaneous polarization [44], Born effective charges, piezoelectric response tensors [45] and various indices characterising the band topology [46].

In addition, GPAW can compute the localisation matrices forming the basis for the construction of Wannier functions with e.g. the Atomic Simulation Environment (ASE) [47] or Wannier90 [48]. Electrostatic corrections to the formation energies of charged point defects in insulators are implemented as are calculations of the hyperfine coupling and zero-field splitting for localised electron spins. GPAW also offers the possibility to perform time-independent, variational calculations of localised electronic excitations, in e.g. molecules or at crystal point defects, using direct orbital optimisation strategies implemented for all three types of basis sets [49, 50, 51]. This provides an efficient and robust alternative to traditional “ΔΔ\Deltaroman_ΔSCF” approaches. GPAW can also be used to describe ultrafast electron dynamics within time-dependent density functional theory (TDDFT) with wave functions represented either on a real space grid [34] or in the LCAO basis [52]. The latter can provide a significant speed-up due to the relatively small size of the basis [53, 54, 55]. The LCAO representation also forms the basis for calculation of electron–phonon couplings as well as non-linear optical spectra such as Raman scattering [56] (which can alternatively be obtained in the PW mode as a finite difference of the dielectric tensor), second-harmonics generation [57], and shift currents [58] using higher-order perturbation theory.

II Why GPAW?

II.1 User’s perspective

There are dozens of electronic-structure codes available for the interested user. The codes differ in their license (in particular, whether open or proprietary), the underlying programming language (e.g. Fortran, C, Python), their treatment of core electrons (all-electron versus pseudopotentials), the employed representations of the wave functions (plane waves, atom-centered orbitals, real-space grids), and the beyond-DFT features they support. Why should one choose GPAW?

In this section, we describe some of the features that make GPAW interesting from the point of view of a common user who wants to perform electronic-structure calculations. The next section focuses on its possibilities for more advanced users, who perhaps want to modify the code or implement completely new functionalities.

A first point to note is that GPAW is written almost exclusively in Python and is directly integrated with the Atomic Simulation Environment. This integration with ASE makes the setup, control, and analysis of calculations easy and flexible. The programming language is of course a key issue for developers, but also the common user benefits from Python and the ASE/GPAW integration. A typical stand-alone program only offers a fixed (though of course possibly large) set of tasks that it can perform, while Python scripting allows for a more flexible use of the code. This could for example mean combining several different GPAW calculations in new ways. Another advantage is that “inner parts” of the code like the density or the Kohn–Sham eigenvalues are directly accessible in a structured format within Python for further analysis. It is even possible to “open up the main loop” of GPAW and have access to, inspect, and also modify key quantities during program execution (see Fig. 1).

As already mentioned in the introduction, GPAW distinguishes itself from other available ES codes by supporting three different ways of representing the wave functions. The most commonly used basis set is plane waves (PW), which is appropriate for small or medium-size systems, where high precision is required. Convergence is easily and systematically controlled by tuning the cut-off energy. A large number of advanced features and “beyond-DFT” methods are available in the PW mode. These include the calculation of hybrid functionals, RPA total energies, linear-response TDDFT, and many-body perturbation theory techniques like GW and the Bethe–Salpeter equations. The new GPU implementation also uses the PW mode.

The wave functions can alternatively be represented on real-space grids, which was the original approach in GPAW. The implementation of this so-called finite-difference (FD) mode relies on multi-grid solutions of the Poisson and Kohn–Sham equations. The FD mode allows for more flexible boundary conditions than the PW mode, which is restricted to periodic supercells. The boundary conditions may for example be taken to reflect the charge distribution in the unit cell. Calculations in the FD mode can be systematically converged through lowering of the grid spacing, but the approach to full convergence is slower than in the PW mode. The FD mode is particularly well suited for large systems because the wave-function representation allows for large-scale parallelization through real-space decomposition. Furthermore, it is possible to perform time-propagation TDDFT including Ehrenfest dynamics in this mode.

The third representation of the wave functions is a basis of numerical atom-centered orbitals in the linear combination of atomic orbitals (LCAO) mode. The size of the basis set can be varied through inclusion of more angular momentum channels, additional orbitals within a channel, or polarization functions. GPAW comes with a standard set of orbitals, but a basis-set generator is included with the code so that users may construct different basis sets depending on their needs and requirements. The LCAO mode is generally less accurate than the PW and FD modes, but it allows for the treatment of considerably larger systems – more than ten thousand atoms. It is also possible to study electron dynamics through a fast implementation of time-propagation DFT, and Ehrenfest dynamics is under development.

As explained, the different modes have different virtues and limitations, and it can therefore be an advantage to apply several modes in a project. For larger systems, it is for example possible to divide a structure optimization into two steps. First, an optimization is performed with the fast LCAO basis leading to an approximately correct structure. This is then followed by an optimization in either the PW or FD mode, which now requires much fewer steps because of the good initial configuration. Due to the ASE/Python interface this combined calculation can easily be performed within a single script.

Since GPAW was originally created with the FD mode only, and the LCAO mode was added next, some features have been implemented for only those modes. Examples are real-time TDDFT (see section VII) and electron–phonon coupling (see section VI.7). Conversely, some new features only work for the PW mode, which was added after the real-space modes. Examples are RPA total energies (see section VI.3) and calculation of the stress tensor. To summarize, given the limitations just mentioned, users should most of the time use PW or LCAO mode and the choice will depend on the accuracy needed and the resources available.

II.2 Developer’s perspective

The GPAW source code is written in the Python and C languages and is hosted on GitLab [59] licensed under the GNU General Public License v3.0. This ensures the transparency of all features and allows developers to fully customise their experience and contribute new features to the community.

An advantage of having a Python code is that the Python script you write to carry out your calculations will have access to everything inside a GPAW calculation. An example showing the power and flexibility this affords is the possibility to have user-code inserted inside the self-consistent field (SCF) loop as demonstrated in Fig. 1.

Refer to caption                                           

Figure 1: The variable calc is the ground-state DFT calculator object and its icalculate method yields a context object at every self-consistent field (SCF) step. As seen, one can use this in a for-loop to implement special logic for termination of the SCF iterations or for diagnostics. In this example, the memory usage is written to the log-file for the first 15 SCF iterations.

At the time of this writing (July 2023), GPAW has two versions of the ground-state DFT code in the main branch of the code. There is the older version that has grown organically since the birth of GPAW: it has many features, but also a lot of technical debt that makes it harder to maintain and less ideal to build new features on top of. The newer ground-state code addresses these issues by having a better overall design.

The new design greatly improves the ease of implementation of new features. The goal is to have the new code be feature-complete so that it can pass the complete test suite and then delete the old code once that is achieved. At the moment, we recommend that all production calculations are done with the old code and that work on new features is done on top of the new code even though certain features are not yet production-ready. Three new features, not present in the old code base, have already been implemented based on the new code: GPU implementation of PW mode calculations (see section III.2.9), reuse of the wave functions after unit-cell changes during cell optimization, and spin-spiral calculations (see section V.5).

GPAW uses pytest [60] for its test suite that currently consists of approximately 1600 unit and integration tests (see Table 1). A subset of those tests runs as part of GitLab’s continuous integration (CI) thereby checking the correctness of every code change. Unfortunately, the full test suite is too time-consuming to run as part of CI, so we run that nightly both in serial as well as in parallel using MPI.

Many of the code examples in GPAW’s documentation, exercises and tutorials [61] require resources (time and number of CPUs) beyond what would make sense to run as part of the pytest test suite. For that, we use MyQueue [21] to submit those scripts as jobs to a local supercomputer every weekend. At the moment this amounts to approximately 5200 core-hours of calculations.

As can be seen from Table 1, the majority of the code is written in Python, which is an interpreted language that is easy to read, write and debug.

Table 1: Number of files and number of lines of code in the git repository of GPAW. The Python source-code files are split into three parts: the actual code, the test suite, and code examples in the documentation.
Type of file Files Lines
Python (the code) 513 146,604
C 80 19,719
Python (test suite) 681 47,147
Python (documentation) 744 32,014

Interpreter-executed code will not run as efficiently as code that is compiled to native machine code. It is therefore important to make sure that the places in the code where most of the time is spent (hot spots) are in native machine code and not in the interpreter. GPAW achieves this by implementing the hot spots in C-code with Python wrappers that can be called from the Python code. Examples of such computationally intensive tasks are applying a finite-difference stencil to a uniform grid, interpolating from one uniform grid to another, or calculation of overlaps between projector functions and wave functions. In addition, we have Python interfaces to the numerical libraries FFTW [62], ScaLAPACK [63], ELPA [17], BLAS, Libxc [64, 65], libvdwxc [66], and MPI. Finally, GPAW makes heavy use of the NumPy [67] and Scipy [68] Python packages. NumPy provides us with the numpy.ndarray data type which is an N𝑁Nitalic_N-dimensional array that we use for storing wave functions, electron densities, potentials, matrices like the overlap matrix or the LCAO wave function coefficients, and much more. The use of NumPy arrays allows us to use the many sub-modules of SciPy to manipulate data. This also gives us an efficient memory layout allowing us to simply pass a pointer to the memory whenever we need to call the C-code from the Python code. With this strategy, we can get away with having most of the code written in a relatively slow interpreted language and still have most of the time spent in highly efficient C-code or optimized numerical libraries.

The advantage of the original FD-mode, where there are no Fourier transforms of the wave functions, is that the algorithms should parallelize well for large systems. In practice, it has turned out that FD-mode has a number of disadvantages: 1) Due to integrals over the unit cell being done as sums over grid-points, there will be a small periodic energy variation as you translate atoms and the period of the variation will be equal to the grid-spacing used (the so-called egg-box error); 2) The system sizes that are typically most interesting for applications of DFT are too small for the parallel scalability to be the decisive advantage; 3) The memory used to store the wave functions on uniform grids in real-space is significant. In contrast, the PW mode has practically no egg-box error, is very efficient for the most typical system sizes and often uses a factor of 10 less memory compared to an FD mode calculation of similar accuracy. The main advantages for LCAO mode are low memory usage and high efficiency for large systems; for small unit cells with many 𝐤𝐤\mathbf{k}bold_k-points the PW mode is most efficient. One disadvantage of LCAO-mode is egg-box errors: LCAO-mode uses the same uniform grids as used in FD-mode for integration of matrix elements like Φμ|v~|Φνquantum-operator-productsubscriptΦ𝜇~𝑣subscriptΦ𝜈\langle\Phi_{\mu}|\tilde{v}|\Phi_{\nu}\rangle⟨ roman_Φ start_POSTSUBSCRIPT italic_μ end_POSTSUBSCRIPT | over~ start_ARG italic_v end_ARG | roman_Φ start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT ⟩ and therefore has similar egg-box energy variation. A second disadvantage of LCAO-mode is that as for any localized basis-set, reaching the complete basis-set limit is more involved compared to PW and FD modes. This can have severe consequences even for ground state calculations of difficult systems such as Cr2 for example[wurdemann_density_2015]. In PW or FD modes the complete basis set limit is easy to reach by simply increasing the number of plane-waves or grid-points, respectively, which leads to a smooth convergence[32]. At the moment we only provide double-ζ𝜁\zetaitalic_ζ polarized (DZP) basis sets and going beyond DZP is left for users to do themselves.

III Ground-state DFT

III.1 Projector augmented-wave method

The diverging Coulomb potential causes rapid oscillations in electronic wave functions near the nuclei, and special care is required to be able to work with smooth wave functions. The projector augmented-wave (PAW) method by Blöchl [69] is a widely adopted generalization of pseudopotential methods, utilizing their strength of smooth pseudo wave functions while retaining a mapping from all-electron wave functions (|ψnketsubscript𝜓𝑛|\psi_{n}\rangle| italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩) to pseudo wave functions (|ψ~nketsubscript~𝜓𝑛|\tilde{\psi}_{n}\rangle| over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩).

The crux is to define a linear transformation T^^𝑇\hat{T}over^ start_ARG italic_T end_ARG from pseudo to all-electron space,

T^|ψ~=|ψ,^𝑇ket~𝜓ket𝜓\hat{T}|\tilde{\psi}\rangle=|\psi\rangle,over^ start_ARG italic_T end_ARG | over~ start_ARG italic_ψ end_ARG ⟩ = | italic_ψ ⟩ , (1)

where

T^=1+ai(|ϕia|ϕ~ia)p~ia|.^𝑇1subscript𝑎subscript𝑖ketsubscriptsuperscriptitalic-ϕ𝑎𝑖ketsubscriptsuperscript~italic-ϕ𝑎𝑖brasubscriptsuperscript~𝑝𝑎𝑖\hat{T}=1+\sum_{a}\sum_{i}\left(|\phi^{a}_{i}\rangle-|\tilde{\phi}^{a}_{i}% \rangle\right)\langle\tilde{p}^{a}_{i}|.over^ start_ARG italic_T end_ARG = 1 + ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( | italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟩ - | over~ start_ARG italic_ϕ end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟩ ) ⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | . (2)

Here p~ia(𝐫)subscriptsuperscript~𝑝𝑎𝑖𝐫\tilde{p}^{a}_{i}(\mathbf{r})over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ), ϕia(𝐫)subscriptsuperscriptitalic-ϕ𝑎𝑖𝐫\phi^{a}_{i}(\mathbf{r})italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) and ϕ~ia(𝐫)subscriptsuperscript~italic-ϕ𝑎𝑖𝐫\tilde{\phi}^{a}_{i}(\mathbf{r})over~ start_ARG italic_ϕ end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) are called projectors, partial waves and pseudo-partial waves, respectively. The pseudo-partial waves and projectors are chosen to be biorthogonal, d𝐫ϕ~ia(𝐫)p~ja(𝐫)=δijdifferential-d𝐫subscriptsuperscript~italic-ϕ𝑎𝑖𝐫subscriptsuperscript~𝑝𝑎𝑗𝐫subscript𝛿𝑖𝑗\int{\rm d}{\mathbf{r}}\,\tilde{\phi}^{a}_{i}(\mathbf{r})\tilde{p}^{a}_{j}(% \mathbf{r})=\delta_{ij}∫ roman_d bold_r over~ start_ARG italic_ϕ end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( bold_r ) = italic_δ start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT, allowing for an approximate closure relation

iϕ~ia(𝐫)p~ia(𝐫)δ(𝐫𝐫),subscript𝑖subscriptsuperscript~italic-ϕ𝑎𝑖𝐫subscriptsuperscript~𝑝𝑎𝑖superscript𝐫𝛿𝐫superscript𝐫\sum_{i}\tilde{\phi}^{a}_{i}(\mathbf{r})\tilde{p}^{a}_{i}(\mathbf{r}^{\prime})% \approx\delta(\mathbf{r}-\mathbf{r}^{\prime}),∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT over~ start_ARG italic_ϕ end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ≈ italic_δ ( bold_r - bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) , (3)

which is utilized heavily to obtain an efficient, but all-electron, picture. In addition to biorthogonality, the pseudo and all-electron partial waves are chosen to be equal outside the PAW augmentation sphere cutoff radius ϕ~i(𝐫)=ϕi(𝐫)subscript~italic-ϕ𝑖𝐫subscriptitalic-ϕ𝑖𝐫\tilde{\phi}_{i}(\mathbf{r})=\phi_{i}(\mathbf{r})over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) = italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ), r>rc.𝑟subscript𝑟𝑐r>r_{c}.italic_r > italic_r start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT .

The basic recipe for converting an operator O^^𝑂\hat{O}over^ start_ARG italic_O end_ARG is ψn|O^ψn=ψ~n|T^O^T^O~^ψ~ninner-productsubscript𝜓𝑛^𝑂subscript𝜓𝑛inner-productsubscript~𝜓𝑛subscriptsuperscript^𝑇^𝑂^𝑇^~𝑂subscript~𝜓𝑛\langle\psi_{n}|\hat{O}\psi_{n}\rangle=\langle\tilde{\psi}_{n}|\underbrace{% \hat{T}^{\dagger}\hat{O}\hat{T}}_{\hat{\tilde{O}}}\tilde{\psi}_{n}\rangle⟨ italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | over^ start_ARG italic_O end_ARG italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ = ⟨ over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | under⏟ start_ARG over^ start_ARG italic_T end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT over^ start_ARG italic_O end_ARG over^ start_ARG italic_T end_ARG end_ARG start_POSTSUBSCRIPT over^ start_ARG over~ start_ARG italic_O end_ARG end_ARG end_POSTSUBSCRIPT over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩. For example, the all-electron Kohn–Sham equations

H^[n(𝐫)]|ψn=ϵn|ψn,^𝐻delimited-[]𝑛𝐫ketsubscript𝜓𝑛subscriptitalic-ϵ𝑛ketsubscript𝜓𝑛\hat{H}[n({\mathbf{r}})]|\psi_{n}\rangle=\epsilon_{n}|\psi_{n}\rangle,over^ start_ARG italic_H end_ARG [ italic_n ( bold_r ) ] | italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ = italic_ϵ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ , (4)

where H^^𝐻\hat{H}over^ start_ARG italic_H end_ARG is the single-particle all-electron Kohn–Sham Hamiltonian operator, can be transformed to their PAW counterparts:

T^H^[n(𝐫)]T^|ψ~n=ϵnT^T^|ψ~n.superscript^𝑇^𝐻delimited-[]𝑛𝐫^𝑇ketsubscript~𝜓𝑛subscriptitalic-ϵ𝑛superscript^𝑇^𝑇ketsubscript~𝜓𝑛\hat{T}^{\dagger}\hat{H}[n({\mathbf{r}})]\hat{T}|\tilde{\psi}_{n}\rangle=% \epsilon_{n}\hat{T}^{\dagger}\hat{T}|\tilde{\psi}_{n}\rangle.over^ start_ARG italic_T end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT over^ start_ARG italic_H end_ARG [ italic_n ( bold_r ) ] over^ start_ARG italic_T end_ARG | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ = italic_ϵ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT over^ start_ARG italic_T end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT over^ start_ARG italic_T end_ARG | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ . (5)

We have used Eq. 1, and also multiplied with T^superscript^𝑇\hat{T}^{\dagger}over^ start_ARG italic_T end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT from left to make its dual space the pseudo one, i.e. ψ~|bra~𝜓superscript\langle\tilde{\psi}|\in\mathcal{H}^{*}⟨ over~ start_ARG italic_ψ end_ARG | ∈ caligraphic_H start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT can act from left. This results in a PAW Hamiltonian and in PAW overlap operators as follows:

H~^^~𝐻\displaystyle\hat{\tilde{H}}over^ start_ARG over~ start_ARG italic_H end_ARG end_ARG =T^H^[n(𝐫)]T^absentsuperscript^𝑇^𝐻delimited-[]𝑛𝐫^𝑇\displaystyle=\hat{T}^{\dagger}\hat{H}[n({\mathbf{r}})]\hat{T}= over^ start_ARG italic_T end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT over^ start_ARG italic_H end_ARG [ italic_n ( bold_r ) ] over^ start_ARG italic_T end_ARG
=122+v~KS(𝐫)+aii|p~iaΔHiiap~ia|,absent12superscript2subscript~𝑣KS𝐫subscript𝑎subscript𝑖superscript𝑖ketsubscriptsuperscript~𝑝𝑎𝑖Δsubscriptsuperscript𝐻𝑎𝑖superscript𝑖brasubscriptsuperscript~𝑝𝑎superscript𝑖\displaystyle=-\frac{1}{2}\nabla^{2}+\tilde{v}_{\rm KS}(\mathbf{r})+\sum_{a}% \sum_{ii^{\prime}}|\tilde{p}^{a}_{i}\rangle\Delta H^{a}_{ii^{\prime}}\langle% \tilde{p}^{a}_{i^{\prime}}|,= - divide start_ARG 1 end_ARG start_ARG 2 end_ARG ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + over~ start_ARG italic_v end_ARG start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT ( bold_r ) + ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT | over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟩ roman_Δ italic_H start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT | , (6)
S~^^~𝑆\displaystyle\hat{\tilde{S}}over^ start_ARG over~ start_ARG italic_S end_ARG end_ARG =T^T^=1+aii|p~iaΔSiiap~ia|.absentsuperscript^𝑇^𝑇1subscript𝑎subscript𝑖superscript𝑖ketsubscriptsuperscript~𝑝𝑎𝑖Δsubscriptsuperscript𝑆𝑎𝑖superscript𝑖brasubscriptsuperscript~𝑝𝑎superscript𝑖\displaystyle=\hat{T}^{\dagger}\hat{T}=1+\sum_{a}\sum_{ii^{\prime}}|\tilde{p}^% {a}_{i}\rangle\Delta S^{a}_{ii^{\prime}}\langle\tilde{p}^{a}_{i^{\prime}}|.= over^ start_ARG italic_T end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT over^ start_ARG italic_T end_ARG = 1 + ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT | over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟩ roman_Δ italic_S start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT | . (7)

Terms such as ΔHiiaΔsubscriptsuperscript𝐻𝑎𝑖superscript𝑖\Delta H^{a}_{ii^{\prime}}roman_Δ italic_H start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT and ΔSiiaΔsubscriptsuperscript𝑆𝑎𝑖superscript𝑖\Delta S^{a}_{ii^{\prime}}roman_Δ italic_S start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT represent so-called PAW-corrections. In each part of the description, which handles a particular kind of operators, such as kinetic energy, spin-operators, or the electrostatic potential, respective PAW-corrections must be calculated. The most crucial ones are precalculated, such as overlap, kinetic energy, Coulomb, and stored in the ‘setup’-file, which also stores the partial waves and projectors. As an example, the overlap PAW corrections are precalculated to setup as follows:

ΔSiia=d𝐫ϕia(𝐫)ϕia(𝐫)d𝐫ϕ~ia(𝐫)ϕ~ia(𝐫).Δsubscriptsuperscript𝑆𝑎𝑖𝑖differential-d𝐫superscriptsubscriptitalic-ϕ𝑖𝑎𝐫superscriptsubscriptitalic-ϕsuperscript𝑖𝑎𝐫differential-d𝐫superscriptsubscript~italic-ϕ𝑖𝑎𝐫superscriptsubscript~italic-ϕsuperscript𝑖𝑎𝐫\Delta S^{a}_{ii}=\int{\rm d}{\mathbf{r}}\,\phi_{i}^{a}(\mathbf{r})\phi_{i^{% \prime}}^{a}(\mathbf{r})-\int{\rm d}{\mathbf{r}}\tilde{\phi}_{i}^{a}(\mathbf{r% })\tilde{\phi}_{i^{\prime}}^{a}(\mathbf{r}).roman_Δ italic_S start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_i end_POSTSUBSCRIPT = ∫ roman_d bold_r italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) italic_ϕ start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) - ∫ roman_d bold_r over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) . (8)

We further define the atomic density matrices as

Dσiia=nfnψ~σn|p~iap~ia|ψ~σn.subscriptsuperscript𝐷𝑎𝜎𝑖superscript𝑖subscript𝑛subscript𝑓𝑛inner-productsubscript~𝜓𝜎𝑛subscriptsuperscript~𝑝𝑎𝑖inner-productsubscriptsuperscript~𝑝𝑎superscript𝑖subscript~𝜓𝜎𝑛D^{a}_{\sigma ii^{\prime}}=\sum_{n}f_{n}\langle\tilde{\psi}_{\sigma n}|\tilde{% p}^{a}_{i}\rangle\langle\tilde{p}^{a}_{i^{\prime}}|\tilde{\psi}_{\sigma n}\rangle.italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_σ italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT = ∑ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟨ over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_σ italic_n end_POSTSUBSCRIPT | over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟩ ⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_σ italic_n end_POSTSUBSCRIPT ⟩ . (9)

The atomic density matrix contains all information required to construct PAW corrections to any local all-electron expectation value:

O=nψ~n|O~|ψ~n+aiiDiiaΔOiia.delimited-⟨⟩𝑂subscript𝑛quantum-operator-productsubscript~𝜓𝑛~𝑂subscript~𝜓𝑛subscript𝑎subscript𝑖superscript𝑖subscriptsuperscript𝐷𝑎𝑖superscript𝑖Δsubscriptsuperscript𝑂𝑎superscript𝑖𝑖\langle O\rangle=\sum_{n}\langle\tilde{\psi}_{n}|\tilde{O}|\tilde{\psi}_{n}% \rangle+\sum_{a}\sum_{ii^{\prime}}D^{a}_{ii^{\prime}}\Delta O^{a}_{i^{\prime}i}.⟨ italic_O ⟩ = ∑ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟨ over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | over~ start_ARG italic_O end_ARG | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ + ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT roman_Δ italic_O start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_i end_POSTSUBSCRIPT . (10)

The all-electron atomic density can be constructed as

nσa(𝐫)=iiDσiiaϕia(𝐫)ϕia(𝐫)+ncorea,subscriptsuperscript𝑛𝑎𝜎𝐫subscript𝑖superscript𝑖subscriptsuperscript𝐷𝑎𝜎𝑖superscript𝑖subscriptsuperscriptitalic-ϕ𝑎𝑖𝐫subscriptsuperscriptitalic-ϕ𝑎superscript𝑖𝐫superscriptsubscript𝑛core𝑎n^{a}_{\sigma}(\mathbf{r})=\sum_{ii^{\prime}}D^{a}_{\sigma ii^{\prime}}\phi^{a% *}_{i}(\mathbf{r})\phi^{a}_{i^{\prime}}(\mathbf{r})+n_{\text{core}}^{a},italic_n start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_σ end_POSTSUBSCRIPT ( bold_r ) = ∑ start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_σ italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_ϕ start_POSTSUPERSCRIPT italic_a ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_r ) + italic_n start_POSTSUBSCRIPT core end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT , (11)

and the corresponding equation for pseudo-densities holds with nn~𝑛~𝑛n\rightarrow\tilde{n}italic_n → over~ start_ARG italic_n end_ARG and ϕϕ~italic-ϕ~italic-ϕ\phi\rightarrow\tilde{\phi}italic_ϕ → over~ start_ARG italic_ϕ end_ARG.

Since the exchange–correlation (xc) potential is non-linear, the PAW corrections must be evaluated explicitly. The xc PAW corrections are performed by constructing the atomic all-electron and pseudo-electron densities as given by Eq. 11:

ΔHxc,iiaΔsubscriptsuperscript𝐻𝑎xc𝑖superscript𝑖\displaystyle\Delta H^{a}_{{\rm xc},ii^{\prime}}roman_Δ italic_H start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_xc , italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT =\displaystyle== d𝐫ϕia(𝐫)vxc[na](𝐫)ϕia(𝐫)differential-d𝐫superscriptsubscriptitalic-ϕ𝑖𝑎𝐫subscript𝑣xcdelimited-[]superscript𝑛𝑎𝐫superscriptsubscriptitalic-ϕsuperscript𝑖𝑎𝐫\displaystyle\int{\rm d}{\mathbf{r}}\phi_{i}^{a}(\mathbf{r})v_{\rm xc}[n^{a}](% \mathbf{r})\phi_{i^{\prime}}^{a}(\mathbf{r})∫ roman_d bold_r italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) italic_v start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT [ italic_n start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ] ( bold_r ) italic_ϕ start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) (12)
d𝐫ϕ~ia(𝐫)vxc[n~a](𝐫)ϕ~ia(𝐫).differential-d𝐫superscriptsubscript~italic-ϕ𝑖𝑎𝐫subscript𝑣xcdelimited-[]superscript~𝑛𝑎𝐫superscriptsubscript~italic-ϕsuperscript𝑖𝑎𝐫\displaystyle-\int{\rm d}{\mathbf{r}}\tilde{\phi}_{i}^{a}(\mathbf{r})v_{\rm xc% }[\tilde{n}^{a}](\mathbf{r})\tilde{\phi}_{i^{\prime}}^{a}(\mathbf{r}).- ∫ roman_d bold_r over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) italic_v start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT [ over~ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ] ( bold_r ) over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) .

This integral is numerically evaluated in a Cartesian product of a Lebedev angular grid and a non-uniform radial grid (denser mesh closer to the nucleus) for each atom.

III.2 Numerical implementation

III.2.1 Wave-function representations

GPAW supports three representations for smooth wave functions. The plane wave (PW)

ψ~𝐤n(r)=𝐆Cn𝐆ei(𝐤+𝐆)𝐫subscript~𝜓𝐤𝑛𝑟subscript𝐆subscript𝐶𝑛𝐆superscript𝑒𝑖𝐤𝐆𝐫\tilde{\psi}_{{\mathbf{k}}n}(r)=\sum_{\mathbf{G}}C_{n{\mathbf{G}}}e^{i({% \mathbf{k}+\mathbf{G}})\cdot\mathbf{r}}over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT bold_k italic_n end_POSTSUBSCRIPT ( italic_r ) = ∑ start_POSTSUBSCRIPT bold_G end_POSTSUBSCRIPT italic_C start_POSTSUBSCRIPT italic_n bold_G end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT italic_i ( bold_k + bold_G ) ⋅ bold_r end_POSTSUPERSCRIPT (13)

and linear combination of atomic orbitals (LCAO)

ψ~𝐤n(r)=μCn𝐤μΦ𝐤μ(𝐫)subscript~𝜓𝐤𝑛𝑟subscript𝜇subscript𝐶𝑛𝐤𝜇subscriptΦ𝐤𝜇𝐫\tilde{\psi}_{{\mathbf{k}}n}(r)=\sum_{\mu}C_{n{\mathbf{k}}\mu}\Phi_{\mathbf{k}% \mu}(\mathbf{r})over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT bold_k italic_n end_POSTSUBSCRIPT ( italic_r ) = ∑ start_POSTSUBSCRIPT italic_μ end_POSTSUBSCRIPT italic_C start_POSTSUBSCRIPT italic_n bold_k italic_μ end_POSTSUBSCRIPT roman_Φ start_POSTSUBSCRIPT bold_k italic_μ end_POSTSUBSCRIPT ( bold_r ) (14)

representations rely on basis functions. The finite difference (FD) mode relies on a representation of kinetic energy operator on a uniform Cartesian grid.

III.2.2 All-electron quantities

The beauty of the PAW method is that you never need to transform the pseudo wave functions to all-electron wave functions, but you can do it if you want to. GPAW has tools for interpolating the pseudo wave functions to a fine real-space grid and adding the PAW corrections. A fine real-space grid is needed to properly represent the cusp and all the oscillations necessary for the wave function to be orthogonal to all the frozen core states.

GPAW also has tools for calculating the all-electron electrostatic potential. This is useful for transmission electron microscopy (TEM) simulations [70]. Most TEM simulations have relied on the so-called independent atom model (IAM), where the specimen potential is described as a superposition of isolated atomic potentials. While this is often sufficient, there is increasing interest in understanding the influence of valence bonding [71]. This can be investigated by a TEM simulation code such as abTEM [72], which can directly use ab initio scattering potentials from GPAW.

III.2.3 Solving the Kohn–Sham equation

The default method for solving the Kohn–Sham equation for PW and FD modes is to do iterative diagonalization combined with density mixing; for LCAO mode we do a full diagonalization of the Hamiltonian. Alternatively, one can do direct minimization as described in the next section.

For PW and FD modes, we need an initial guess of the wave functions. For this, we calculate the effective potential from a superposition of atomic densities and diagnonalize an LCAO Hamiltonian in a small basis set consisting of all the pseudo partial waves corresponding to bound atomic states.

Each step in the self-consistent field (SCF) loop consists of the following operations: 1) Diagonalization of the Hamiltonian in the subspace of the current wave functions (skipped for LCAO). 2) One or more steps through the iterative eigensolver (except for LCAO, where a full diagonalization is performed). 3) Update of eigenvalues and occupation numbers. 4) Density mixing and symmetrization. See previous work [32, 33] and Ref. [73] for details.

GPAW has two kinds of Poisson equation solvers: direct solvers based on Fourier transforms or Fourier-sine transforms, and iterative multi-grid solvers (Jacobi or Gauss-Seidel). The default is to use a direct solver whereas the iterative solvers may be chosen for larger systems where they can be more efficient.

For 0-, 1- and 2-dimensional systems, the default boundary conditions are to have the potential go to zero on the cell boundaries. This becomes a problem for systems involving large dipole moments. The potential due to the dipole is long-ranged and, thus, the converged potential requires large vacuum sizes. For molecules (0D systems), the boundary conditions can be improved by adding multipole moment corrections to the density so that the corresponding multipoles of the density vanish. The potential of these corrections is added to the obtained potential. The same trick is used to handle charged systems. For slabs (2D systems), a dipole layer can be added to account for differences in the work functions on the two sides of the slab.

Methods for calculating occupation numbers are the Fermi-Dirac, Marzari-Vanderbilt [74] and Methfessel-Paxton distributions as well as the tetrahedron method and the improved tetrahedron method [75].

III.2.4 Updating wavefunctions in dynamics

Simulations commonly move the atoms without changing other parameters. If an atom moves only slightly, we would expect most of the charge in its immediate vicinity to move along with it. We use this to compute an improved guess for the wave functions in the next self-consistency loop with FD or PW mode where the eigensolver is iterative.

Near the atoms, the dual basis of pseudo-partial waves and projectors is almost complete, i.e.

i|ϕiap~ia|=1(near atom a).subscript𝑖ketsuperscriptsubscriptitalic-ϕ𝑖𝑎brasuperscriptsubscript~𝑝𝑖𝑎1(near atom a)\sum_{i}|\phi_{i}^{a}\rangle\langle\tilde{p}_{i}^{a}|=1\quad\textrm{(near atom% {\hbox{a}})}.∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ⟩ ⟨ over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | = 1 (near atom roman_a ) . (15)

If an atom moves by Δ𝐑aΔsuperscript𝐑𝑎\Delta\mathbf{R}^{a}roman_Δ bold_R start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT, the wave functions ψ~n(𝐫)subscript~𝜓𝑛𝐫\tilde{\psi}_{n}(\mathbf{r})over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r ) are updated by rigidly moving the projection iϕ~ia(𝐫)p~ia|ψ~nsubscript𝑖superscriptsubscript~italic-ϕ𝑖𝑎𝐫inner-productsuperscriptsubscript~𝑝𝑖𝑎subscript~𝜓𝑛\sum_{i}\tilde{\phi}_{i}^{a}(\mathbf{r})\langle\tilde{p}_{i}^{a}|\tilde{\psi}_% {n}\rangle∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) ⟨ over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ along with it, i.e.,

ψ~nnew(𝐫)=ψ~n(𝐫)superscriptsubscript~𝜓𝑛new𝐫subscript~𝜓𝑛𝐫\displaystyle\tilde{\psi}_{n}^{\mathrm{new}}(\mathbf{r})=\tilde{\psi}_{n}(% \mathbf{r})over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_new end_POSTSUPERSCRIPT ( bold_r ) = over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r ) +\displaystyle++ aiϕ~ia(𝐫Δ𝐑a)p~ia|ψ~nsubscript𝑎𝑖superscriptsubscript~italic-ϕ𝑖𝑎𝐫Δsuperscript𝐑𝑎inner-productsuperscriptsubscript~𝑝𝑖𝑎subscript~𝜓𝑛\displaystyle\sum_{ai}\tilde{\phi}_{i}^{a}(\mathbf{r}-\Delta\mathbf{R}^{a})% \langle\tilde{p}_{i}^{a}|\tilde{\psi}_{n}\rangle∑ start_POSTSUBSCRIPT italic_a italic_i end_POSTSUBSCRIPT over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r - roman_Δ bold_R start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ) ⟨ over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ (16)
\displaystyle-- aiϕ~ia(𝐫)p~ia|ψ~n.subscript𝑎𝑖superscriptsubscript~italic-ϕ𝑖𝑎𝐫inner-productsuperscriptsubscript~𝑝𝑖𝑎subscript~𝜓𝑛\displaystyle\sum_{ai}\tilde{\phi}_{i}^{a}(\mathbf{r})\langle\tilde{p}_{i}^{a}% |\tilde{\psi}_{n}\rangle.∑ start_POSTSUBSCRIPT italic_a italic_i end_POSTSUBSCRIPT over~ start_ARG italic_ϕ end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) ⟨ over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ .

As the partial waves on different atoms are not orthonormal, this expression generally “double-counts” contributions, resulting in wave functions that are to some extent unphysical. Nevertheless, we have found that this simple method achieves a significant speedup (similar-to\sim15% in realistic structure optimisations) compared to not updating the wave functions.

The method could be further improved by using the LCAO basis set and the overlap matrix to prevent double-counting.

III.2.5 Direct minimization

Direct orbital minimization [76, 77, 78, 79] is a robust alternative to the conventional eigensolver and density mixing routines. The orbitals can be expressed as a unitary transformation of a set of reference, or auxiliary, orbitals 𝚿0subscript𝚿0\mathbf{\Psi}_{0}bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT:

𝚿=𝐔𝚿0𝚿𝐔subscript𝚿0\mathbf{\Psi}=\mathbf{U}\mathbf{\Psi}_{0}bold_Ψ = bold_U bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT (17)

In the direct minimization (DM) method implemented in GPAW [80, 50], the unitary matrix 𝐔𝐔\mathbf{U}bold_U is parametrized as an exponential transformation, i.e. 𝐔=e𝐀𝐔superscript𝑒𝐀\mathbf{U}=e^{\mathbf{A}}bold_U = italic_e start_POSTSUPERSCRIPT bold_A end_POSTSUPERSCRIPT, where 𝐀𝐀{\mathbf{A}}bold_A is an anti-Hermitian matrix (𝐀=𝐀𝐀superscript𝐀{\mathbf{A}}=-{\mathbf{A}^{\dagger}}bold_A = - bold_A start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT). The energy can be considered as a functional of both 𝐀𝐀\mathbf{A}bold_A and 𝚿0subscript𝚿0\mathbf{\Psi}_{0}bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT:

E[𝚿]=[𝐀,𝚿0]𝐸delimited-[]𝚿𝐀subscript𝚿0E[\mathbf{\Psi}]=\mathcal{F}[\mathbf{A},\mathbf{\Psi}_{0}]italic_E [ bold_Ψ ] = caligraphic_F [ bold_A , bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ] (18)

Thus, in general, the optimal orbitals corresponding to the minimum of the energy functional can be found in a dual loop procedure. First, the energy is minimized with respect to the elements of 𝐀𝐀\mathbf{A}bold_A, and second, the functional [𝚿0]=min𝐀[𝐀,𝚿0]delimited-[]subscript𝚿0𝐀min𝐀subscript𝚿0\mathcal{L}[\mathbf{\Psi}_{0}]=\underset{\mathbf{A}}{\rm min\,}\mathcal{F}[% \mathbf{A},\mathbf{\Psi}_{0}]caligraphic_L [ bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ] = underbold_A start_ARG roman_min end_ARG caligraphic_F [ bold_A , bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ] is minimized with respect to 𝚿0subscript𝚿0\mathbf{\Psi}_{0}bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT:

min𝚿E[𝚿]=min𝚿0min𝐀[𝐀,𝚿0]𝚿minEdelimited-[]𝚿subscript𝚿0min𝐀min𝐀subscript𝚿0\underset{\mathbf{\Psi}}{\rm min\,}E[\mathbf{\Psi}]=\underset{\mathbf{\Psi}_{0% }}{\rm min\,}\underset{\mathbf{A}}{\rm min\,}\mathcal{F}[{\mathbf{A}},\mathbf{% \Psi}_{0}]underbold_Ψ start_ARG roman_min end_ARG roman_E [ bold_Ψ ] = start_UNDERACCENT bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_UNDERACCENT start_ARG roman_min end_ARG underbold_A start_ARG roman_min end_ARG caligraphic_F [ bold_A , bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ] (19)

Since anti-Hermitian matrices form a linear space, the inner loop minimization can use well-established local minimization strategies such as efficient quasi-Newton methods with inexact line search, e.g. the limited-memory Broyden–Fletcher–Goldfarb–Shanno (L-BFGS) algorithm. The outer loop minimization follows the gradient /𝚿0subscript𝚿0\partial\mathcal{L}/\partial\mathbf{\Psi}_{0}∂ caligraphic_L / ∂ bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT projected on the tangent space at 𝚿0subscript𝚿0\mathbf{\Psi}_{0}bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT.

The GPAW formulation of DM is applicable with all representations of the orbitals available in GPAW, as well as Kohn–Sham (unitary invariant) and orbital density dependent (nonunitary invariant) energy functionals, and can be used for both finite and extended systems. In LCAO calculations, the reference orbitals are expressed as a linear combination of the atomic basis functions 𝚽𝚽\mathbf{\Phi}bold_Φ, 𝚿0=𝚽𝐂0subscript𝚿0𝚽subscript𝐂0\mathbf{\Psi}_{0}=\mathbf{\Phi}\mathbf{C}_{0}bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = bold_Φ bold_C start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, where the matrix of coefficients 𝐂0subscript𝐂0\mathbf{C}_{0}bold_C start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is fixed. Therefore, only a minimization with respect to the elements of the matrix 𝐀𝐀\mathbf{A}bold_A is required [80]. For plane wave and real-space grid representations, a minimization in the space tangent to the reference orbitals is sufficient if the functional is unitary invariant. Otherwise, if the functional is nonunitary invariant, such as when self-interaction correction is used (see section III.3.5), an inner loop minimization in the occupied–occupied block of the matrix 𝐀𝐀\mathbf{A}bold_A is performed to make the energy stationary with respect to unitary transfomation of the occupied orbitals [50].

The DM method avoids diagonalization of the Hamiltonian at each step and as a result it usually involves a smaller computational effort. The DM method has also been shown to be more robust than conventional eigensolvers and density mixing in calculations of molecules and extended systems [80]. However, the current implementation does not support finite-temperature distribution of occupation numbers and thus can only be used for systems with a finite band gap.

III.2.6 Convergence criteria

The modular architecture of GPAW allows the user to have precise control over how the SCF loop decides that the electronic structure has converged to sufficient precision. GPAW contains simple keywords for common convergence criteria, such as “energy”, “forces”, (electron) “density”, and “work function”, which are sufficient for the most common use cases.

Internally, all convergence criteria are instances of convergence classes, and for each step through the SCF loop, each convergence class is called. When any convergence class is called, it is passed a context that contains the current state of the calculation, such as the wavefunctions and the Hamiltonian. The criterion can thus pull relevant data from the calculation to decide if it is converged. Because the convergence criterion itself is an object, it can store information, such as previous values of the energy for comparison to the new value. When all convergence criteria report that they are converged, the calculation as a whole is considered to be converged and terminates.

This modular nature gives the user full control over how each convergence criterion operates. For example, the user can easily ask the energy criterion to check the differences in the last four values of the energy, rather than the last three. If a convergence criterion itself is expensive to calculate, it can make sense to not check it until the rest of the convergence criteria are met. This can be accomplished by activating an internal “calculate_last” flag within the convergence criterion.

Users can easily add their own custom convergence criteria to the SCF loop. If a user would like to use a criterion not included by default with GPAW, it is straightforward to write a new criterion as a Python class, and pass this to the convergence dictionary of GPAW. For example, if one wanted to be sure the bandgap of a semiconductor was converged, the criterion could check the bandgap at each iteration and compare it to stored values from previous iterations, and report that the calculation is converged when the peak-to-peak variance among the last n𝑛nitalic_n iterations is below a given threshold.

III.2.7 PAW data sets and pseudopotentials

GPAW can read PAW datasets from (possibly compressed) XML-files following the PAW-XML specification [81]. Dataset files for most of the periodic table can be downloaded from the GPAW webpage or installed with the gpaw install-data command-line tool. The datasets are available for the LDA, PBE, revPBE, RPBE and GLLBSC functionals. The electronic structure code Abinit [82] also reads the PAW-XML format allowing GPAW and Abinit to share PAW dataset collections such as the Jollet-Torrent-Holzwarth collection [83].

Specialized datasets can be generated with the gpaw dataset command-line tool. This allows one to tweak the properties of a dataset. Some examples could be: 1) add more/less semi-core states; 2) increase/decrease the augmentation sphere radius to make the pseudo wave functions more/less smooth; 3) add/remove projector functions and corresponding pseudo and all-electron partial waves; or 4) base the PAW dataset on a different XC-functional. These changes will affect the accuracy and cost of the calculations.

GPAW is also able to use norm-conserving pseudopotentials (NCPP) such as HGH [84] and pseudopotentials in the UPF format, such as SG15 [85]. Non-local NCPPs can be considered an approximation to PAW: in the PAW description, the non-local part of the Hamiltonian (the term containing ΔHijaΔsuperscriptsubscript𝐻𝑖𝑗𝑎\Delta H_{ij}^{a}roman_Δ italic_H start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT in Eq. (6)) will adapt to the environment, whereas for a NCPP, ΔHijaΔsuperscriptsubscript𝐻𝑖𝑗𝑎\Delta H_{ij}^{a}roman_Δ italic_H start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT will be diagonal and have a fixed value taken from a reference atom. Because of the norm-conservation, NCPPs will have ΔSija=0Δsuperscriptsubscript𝑆𝑖𝑗𝑎0\Delta S_{ij}^{a}=0roman_Δ italic_S start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT = 0.

III.2.8 Parallelization

GPAW can parallelize over various degrees of freedoms depending on the type of calculation, and implements multiple algorithms for achieving good parallel performance and scalability. In calculations involving k-points, parallelization over them is typically the most efficient, as little communication is needed during the summation of wave functions to calculate the density and any derived quantities. As the number of k-points is often limited especially in large systems, parallelization is also possible over real-space grids in the FD and LCAO modes, as well as over plane waves in the PW mode. All modes also support parallelization over electronic bands, which is particularly efficient for real-time TDDFT where the time-propagation of each band can be carried out independently. Additional parallelization possibilities exist depending on calculations, such as over electron–hole pairs in linear-respose TDDFT calculations.

Parallelization is done mainly with MPI. In the FD and LCAO modes, it is possible in addition to use also OpenMP within shared-memory nodes, which can improve performance when the number of CPU cores per node is large. Dense linear algebra, such as matrix diagonalization and Cholesky decomposition, can be carried out with the parallel ScaLAPACK or ELPA libraries. This applies to both the direct diagonalization in the LCAO mode as well as to subspace diagonalizations in iterative Davidson and RMM-DIIS methods in the FD and PW modes.

For ground-state calculations, GPAW will divide the cores into three MPI-communicators: k-points, bands and domain. When parallelizing over k-points and/or bands, all the cores of the k-point and/or band communicators will have a copy of the density (possibly distributed over the domain communicator). GPAW has the option to redistribute the density from the domain-communicator to all cores so that operations such as evaluating the XC-energy and solving the Poisson equation can be done more efficiently.

For each k-point, all the cores in the band and domain communicators will cooperate on calculating matrix elements of the Hamiltonian and the overlap operators. Dense-matrix linear-algebra operations on those matrices can be done on a single core (most efficient for small systems) or with ScaLAPACK where the matrices are distributed over either all or some of the cores from the pool of cores in the band and domain communicators.

One drawback of Python is that in large parallel calculations its import mechanism may incur a heavy load on the filesystem because all the parallel processes are trying to read the same Python files. GPAW tries to alleviate this by a special “broadcast imports” mechanism: during initial module imports only a single process loads the modules, afterwards MPI is used to broadcast the data to all the processes.

Parallel scalability depends strongly on the calculation mode and the system. The FD mode offers the best scalability for high core counts as only nearest-neighbour communication is needed across domains over a domain decomposition. In PW mode, the limiting factor is all-to-all communication in parallelization over plane waves. In LCAO mode, communications arise from multi-center integrals of basis functions across domains. At best, GPAW scales to tens or hundreds of nodes in supercomputers.

III.2.9 GPU implementation

The GPU implementation of GPAW works both on NVIDIA and AMD GPUs, targeting either CUDA or HIP backends, respectively. GPAW uses a combination of manually written GPU kernels, external GPU libraries (such as cuBLAS / hipBLAS), and CuPy [86]. CuPy offers an easy-to-use Python interface for GPUs centered around a NumPy-like GPU array and makes many hardware details completely transparent to the end-user.

In the manually written GPU kernels, both GPU backends (CUDA and HIP) are targeted using a header-only porting approach [87] in which generic GPU identifiers are translated to vendor-specific identifiers at compile time. For example, to allocate GPU memory, the identifier gpuMalloc is used in the code, that is then translated either to cudaMalloc or hipMalloc depending on which GPU backend is targeted. This allows us to avoid unnecessary code duplication and still target multiple hardware platforms natively.

An earlier GPU implementation of GPAW [88, 89] served as the starting point for the recent work on a new GPU code based on the rewritten ground-state code. The objects that store quantities like ψ~n(𝐫)subscript~𝜓𝑛𝐫\tilde{\psi}_{n}(\mathbf{r})over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r ), p~ia(𝐫)superscriptsubscript~𝑝𝑖𝑎𝐫\tilde{p}_{i}^{a}(\mathbf{r})over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ), p~ia|ψ~ninner-productsuperscriptsubscript~𝑝𝑖𝑎subscript~𝜓𝑛\langle\tilde{p}_{i}^{a}|\tilde{\psi}_{n}\rangle⟨ over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩, Diiasuperscriptsubscript𝐷𝑖superscript𝑖𝑎D_{ii^{\prime}}^{a}italic_D start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT, n~(𝐫)~𝑛𝐫\tilde{n}(\mathbf{r})over~ start_ARG italic_n end_ARG ( bold_r ) and v~(𝐫)~𝑣𝐫\tilde{v}(\mathbf{r})over~ start_ARG italic_v end_ARG ( bold_r ), use Numpy arrays for the CPU code and CuPy arrays when running on a GPU. At the moment, GPUs can be used for total-energy calculations with LDA/GGA in the PW mode.

Parallelization to multiple GPUs is done using MPI. Each MPI rank is assigned a single GPU and communication between the GPUs is handled by MPI. Support for GPU-aware MPI makes it possible to do direct GPU-to-GPU communication without unnecessary memory copies between the GPU device and the host CPU.

III.3 XC-functionals

Exchange–correlation (XC) functionals provide a mapping between the interacting and the non-interacting system of electrons. In Kohn–Sham DFT, the density is built from a set of occupied non-interacting single-particle orbitals ψisubscript𝜓𝑖\psi_{i}italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT: n=ifi|ψi|2𝑛subscript𝑖subscript𝑓𝑖superscriptsubscript𝜓𝑖2n=\sum_{i}f_{i}\left|\psi_{i}\right|^{2}italic_n = ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT, with fisubscript𝑓𝑖f_{i}italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT denoting the occupation numbers, leading to the same density as the interacting system. The total energy in DFT is expressed as a sum of density functionals for the different contributions:

Etot[n]=TS[n]+Vext[n]+UH[n]+Exc[n],subscript𝐸totdelimited-[]𝑛subscript𝑇Sdelimited-[]𝑛subscript𝑉extdelimited-[]𝑛subscript𝑈Hdelimited-[]𝑛subscript𝐸xcdelimited-[]𝑛\displaystyle E_{\mathrm{tot}}[n]=T_{\mathrm{S}}[n]+V_{\mathrm{ext}}[n]+U_{% \mathrm{H}}[n]+E_{\mathrm{xc}}[n],italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT [ italic_n ] = italic_T start_POSTSUBSCRIPT roman_S end_POSTSUBSCRIPT [ italic_n ] + italic_V start_POSTSUBSCRIPT roman_ext end_POSTSUBSCRIPT [ italic_n ] + italic_U start_POSTSUBSCRIPT roman_H end_POSTSUBSCRIPT [ italic_n ] + italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT [ italic_n ] , (20)

where TS[n]subscript𝑇Sdelimited-[]𝑛T_{\mathrm{S}}[n]italic_T start_POSTSUBSCRIPT roman_S end_POSTSUBSCRIPT [ italic_n ] denotes the kinetic energy of the non-interacting system, Vext[n]subscript𝑉extdelimited-[]𝑛V_{\mathrm{ext}}[n]italic_V start_POSTSUBSCRIPT roman_ext end_POSTSUBSCRIPT [ italic_n ] the energy of the density in the external potential, UH[n]subscript𝑈Hdelimited-[]𝑛U_{\mathrm{H}}[n]italic_U start_POSTSUBSCRIPT roman_H end_POSTSUBSCRIPT [ italic_n ] the classical Coulomb energy of the density with itself, and Exc[n]subscript𝐸xcdelimited-[]𝑛E_{\mathrm{xc}}[n]italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT [ italic_n ] the so called exchange–correlation energy, which collects all energy contributions missing in the prior terms and therefore provides a mapping between the interacting and the non-interacting system of electrons. While the first three terms can be calculated exactly, even the form of Excsubscript𝐸xcE_{\text{xc}}italic_E start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT is unknown and although proven to exist and be exact in principle, it has to be approximated in practice. A huge number of approaches belonging to several families exists [1, 2, 90]. Several of these approximations are available in GPAW, and an overview is given in the following.

III.3.1 Libxc and Libvdwxc

The libxc library [65] provides implementations of several (semi-)local variants of the XC functional, given by the LDA, GGA, and MGGA families. These are available in GPAW by a combination of their names from libxc as, e.g. “GGA_X_PBE+GGA_C_PBE” for PBE [3]. Additionally, GPAW provides its own implementation of several (semi-)local functionals called by their short-names, e.g. TPSS [91], PBE [3] and LDA, the latter with the correlation of Perdew and Wang [92]. Several hybrids, see below, are implemented in GPAW with the support of the libxc library for their local parts.

For fully non-local van der Waals functionals, like the vdW-DF functional [31], GPAW uses the efficient fast Fourier-transform convolution algorithm by Roman-Perez and Soler [93] as implemented in the libvdwxc library [66].

III.3.2 GLLB-sc

GPAW has an implementation of the solid-state modification of the Gritsenko–van Leeuwen–van Lenthe–Baerends exchange–correlation model potential (GLLB-sc) [94, 95]. This potential has been shown to improve the description of the band gap [16] and the d𝑑ditalic_d-electron states in noble metals [52, 96, 97, 98].

III.3.3 Hubbard U

DFT+U calculations using a Hubbard-like correction can be performed in GPAW to improve the treatment of Coulombic interactions of localized electrons. This correction is most commonly applied to the valence orbitals of transition metals to assist with obtaining experimental band gaps of oxides [99], which may otherwise be underestimated [100, 101]. Also, formation energies and magnetic states are often improved due to a more correct description of the electronic structure. It may also be applied to main-group elements such as N, O, P, or S, but this is less commonly done [102].

In the formalism chosen in GPAW [103], one uses a single Ueffsuperscript𝑈effU^{\text{eff}}italic_U start_POSTSUPERSCRIPT eff end_POSTSUPERSCRIPT parameter rather than seperate U𝑈Uitalic_U and J𝐽Jitalic_J parameters for on-site Coulombic and on-site exchange, respectively [104]. The correction influences the calculation by applying an energy penalty to the system:

Ueff=UJ,superscript𝑈eff𝑈𝐽U^{\text{eff}}=U-J,italic_U start_POSTSUPERSCRIPT eff end_POSTSUPERSCRIPT = italic_U - italic_J , (21)
EDFT+U=EDFT+a,iUieff2Tr(ρiaρiaρia),subscript𝐸DFT+Usubscript𝐸DFTsubscript𝑎𝑖subscriptsuperscript𝑈eff𝑖2Trsubscriptsuperscript𝜌𝑎𝑖subscriptsuperscript𝜌𝑎𝑖subscriptsuperscript𝜌𝑎𝑖E_{\text{DFT+U}}=E_{\text{DFT}}+\sum_{a,i}\frac{U^{\text{eff}}_{i}}{2}\textup{% Tr}\left(\rho^{a}_{i}-\rho^{a}_{i}\rho^{a}_{i}\right),italic_E start_POSTSUBSCRIPT DFT+U end_POSTSUBSCRIPT = italic_E start_POSTSUBSCRIPT DFT end_POSTSUBSCRIPT + ∑ start_POSTSUBSCRIPT italic_a , italic_i end_POSTSUBSCRIPT divide start_ARG italic_U start_POSTSUPERSCRIPT eff end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG start_ARG 2 end_ARG Tr ( italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT - italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) , (22)

where the sum runs over the atoms a𝑎aitalic_a and orbitals i𝑖iitalic_i for which the correction should be applied. EDFTsubscript𝐸DFTE_{\text{DFT}}italic_E start_POSTSUBSCRIPT DFT end_POSTSUBSCRIPT is calculated by a standard GPAW calculation and is corrected to EDFT+Usubscript𝐸DFT+UE_{\text{DFT+U}}italic_E start_POSTSUBSCRIPT DFT+U end_POSTSUBSCRIPT by penalizing the energy such that fully occupied or fully unoccupied orbitals are stabilized. The magnitude of the correction depends on Uieffsubscriptsuperscript𝑈eff𝑖U^{\text{eff}}_{i}italic_U start_POSTSUPERSCRIPT eff end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT, and the atomic orbital occupation matrix (ρiasubscriptsuperscript𝜌𝑎𝑖\rho^{a}_{i}italic_ρ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT) controls which orbitals contribute to the correction based on their occupation. In principle, any orbital on any element that is partially occupied can be corrected.

GPAW supports normalization of the occupation matrix, accounting for the truncated portion of the wave function outside the augmentation sphere. To maintain consistency with other codes that do not support normalization, this normalization can be disabled, but large disagreements are expected when applied to p𝑝pitalic_p orbitals. GPAW is one of the few codes that currently supports multiple simultaneous corrections to orbitals on the same atom; this is useful when two types of orbitals, such as p𝑝pitalic_p and d𝑑ditalic_d orbitals, are nearly degenerate but both are partially occupied.

There is no Ueffsuperscript𝑈effU^{\text{eff}}italic_U start_POSTSUPERSCRIPT eff end_POSTSUPERSCRIPT that is strictly correct, but methods such as RPA [105] or linear response [106, 107] can allow for a value to be calculated from first principles. More commonly, Ueffsuperscript𝑈effU^{\text{eff}}italic_U start_POSTSUPERSCRIPT eff end_POSTSUPERSCRIPT is chosen semi-empirically to fit experimental properties such as formation energy [108], band gap [109], or more recently by machine learning predictions [110].

III.3.4 Hybrids

Hybrid functionals, especially range-separated functionals (see below), correct problems present in calculations utilizing (semi-)local functionals such as the wrong asymptotic behavior of the effective potential leading to an improper description of Rydberg excitations [111], the improper calculation of the total energy against fractional charges leading to the charge delocalization error [112], and the wrong description of (long-range) charge transfer excitations due to the locality of the exchange hole [113, 114, 115].

The exchange–correlation energy Excsubscript𝐸xcE_{\mathrm{xc}}italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT, can be split into the contributions from exchange, Exsubscript𝐸xE_{\mathrm{x}}italic_E start_POSTSUBSCRIPT roman_x end_POSTSUBSCRIPT, and from correlation, Ecsubscript𝐸cE_{\mathrm{c}}italic_E start_POSTSUBSCRIPT roman_c end_POSTSUBSCRIPT [2, 116]. Hybrid functionals combine the exchange from the (semi-)local functionals with the exchange from Hartree–Fock theory (HF). Global hybrids such as PBE0 [117] mix the exchange from DFT with the exchange from HF by a global fixed amount. Range-separated functionals (RSF) add a separation function ωRSFsubscript𝜔RSF\omega_{\mathrm{RSF}}italic_ω start_POSTSUBSCRIPT roman_RSF end_POSTSUBSCRIPT [118, 119] to express the Coulomb kernel in the exchange integrals as

1r121subscript𝑟12\displaystyle\frac{1}{r_{12}}divide start_ARG 1 end_ARG start_ARG italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT end_ARG =1[α+β(1ωRSF(γ,r12))]r12SRabsentsubscript1delimited-[]𝛼𝛽1subscript𝜔RSF𝛾subscript𝑟12subscript𝑟12SR\displaystyle=\underbrace{\frac{1-\left[\alpha+\beta\left(1-\omega_{\mathrm{% RSF}}\left(\gamma,r_{12}\right)\right)\right]}{r_{12}}}_{\mathrm{SR}}= under⏟ start_ARG divide start_ARG 1 - [ italic_α + italic_β ( 1 - italic_ω start_POSTSUBSCRIPT roman_RSF end_POSTSUBSCRIPT ( italic_γ , italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT ) ) ] end_ARG start_ARG italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT end_ARG end_ARG start_POSTSUBSCRIPT roman_SR end_POSTSUBSCRIPT
+[α+β(1ωRSF(γ,r12))]r12LR,subscriptdelimited-[]𝛼𝛽1subscript𝜔RSF𝛾subscript𝑟12subscript𝑟12LR\displaystyle+\underbrace{\frac{\left[\alpha+\beta\left(1-\omega_{\mathrm{RSF}% }\left(\gamma,r_{12}\right)\right)\right]}{r_{12}}}_{\mathrm{LR}},+ under⏟ start_ARG divide start_ARG [ italic_α + italic_β ( 1 - italic_ω start_POSTSUBSCRIPT roman_RSF end_POSTSUBSCRIPT ( italic_γ , italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT ) ) ] end_ARG start_ARG italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT end_ARG end_ARG start_POSTSUBSCRIPT roman_LR end_POSTSUBSCRIPT , (23)

where r12=|r1r2|subscript𝑟12subscript𝑟1subscript𝑟2r_{12}=|\vec{r}_{1}-\vec{r}_{2}|italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT = | over→ start_ARG italic_r end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT - over→ start_ARG italic_r end_ARG start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT |. Here α𝛼\alphaitalic_α and β𝛽\betaitalic_β are mixing parameters for global and range-separated mixing, respectively. ωRSFsubscript𝜔RSF\omega_{\mathrm{RSF}}italic_ω start_POSTSUBSCRIPT roman_RSF end_POSTSUBSCRIPT is a soft function with values ranging from one for r12=0subscript𝑟120r_{12}=0italic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT = 0 to zero for r12subscript𝑟12r_{12}\to\inftyitalic_r start_POSTSUBSCRIPT 12 end_POSTSUBSCRIPT → ∞, where the decay is controlled by the parameter γ𝛾\gammaitalic_γ. Long-range-corrected RSFs such as LCY-PBE [120] use (semi-)local approximations for short-range (SR) interaction and apply HF exchange for long-range (LR) interaction. Short-range-corrected RSFs such as HSE [5] reverse this approach. The parameter γ𝛾\gammaitalic_γ is either fixed or can be varied to match criteria of the ideal functional, e.g. that the energy of the highest occupied molecular orbital matches the ionization potential [121, 116].

Details on the FD-mode implementation of long-range corrected RSF can be found in Refs. [122, 123]. In general, the FD-mode implementation of hybrids is limited to molecules, and forces have not been implemented. The PW-mode implementation of hybrids handles 𝐤𝐤\mathbf{k}bold_k-points, exploits symmetries and can calculate forces.

III.3.5 SIC

A fully self-consistent and variational implementation of the Perdew-Zunger self-interaction correction [124] (PZ-SIC) is available in GPAW. It corrects the various problems with (semi-)local Kohn–Sham functionals mentioned above in the context of hybrid functionals. Atomic forces are available in the GPAW implementation with all three types of basis sets. A corrected KS functional has the form

ESIC[n1,,nn]=EKS[n]αiocc(UH[ni]+Exc[ni,0])superscript𝐸SICsubscript𝑛1subscript𝑛𝑛superscript𝐸KSdelimited-[]𝑛𝛼superscriptsubscript𝑖occsubscript𝑈Hdelimited-[]subscript𝑛𝑖subscript𝐸xcsubscript𝑛𝑖0E^{\mathrm{SIC}}[n_{1},\dots,n_{n}]=E^{\mathrm{KS}}[n]-\alpha\sum_{i}^{\mathrm% {occ}}\left(U_{\mathrm{H}}[n_{i}]+E_{\mathrm{xc}}[n_{i},0]\right)italic_E start_POSTSUPERSCRIPT roman_SIC end_POSTSUPERSCRIPT [ italic_n start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_n start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] = italic_E start_POSTSUPERSCRIPT roman_KS end_POSTSUPERSCRIPT [ italic_n ] - italic_α ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_occ end_POSTSUPERSCRIPT ( italic_U start_POSTSUBSCRIPT roman_H end_POSTSUBSCRIPT [ italic_n start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ] + italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT [ italic_n start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , 0 ] ) (24)

where the self-Coulomb and self-XC of each occupied orbital density is subtracted from the Kohn–Sham energy functional. Due to the explicit dependence on the orbital densities, the corrected energy functional is not invariant under a unitary transformation among occupied orbitals and thereby not a KS functional. As a result, the minimization of ESICsuperscript𝐸SICE^{\mathrm{SIC}}italic_E start_POSTSUPERSCRIPT roman_SIC end_POSTSUPERSCRIPT requires special direct minimization techniques (see section III.2.5) and delivers a specific set of (typically localized) optimal orbitals. The calculations should be carried out using complex orbitals [125, 126, 127]. The full PZ-SIC has been shown to give an over-correction to binding energy as well as band gaps and improved results for these properties are obtained by scaling the SIC by α=1/2𝛼12\alpha=1/2italic_α = 1 / 2 [128, 129], while the long-range form of the effective potential, necessary for Rydberg state calculations, requires the full correction [130].

PZ-SIC has been shown to give accurate results in cases where commonly used KS functionals fail. This includes, for example, the Mn dimer where the PBE functional gives qualitatively incorrect results while the corrected functional gives close agreement with high-level quantum chemistry results as well as experimental measurements [131]. Another example is the defect state of a substitutional Al atom in α𝛼\alphaitalic_α-quartz [132]. Also, PZ-SIC has been shown to improve values of the excitation energy of molecules obtained in variational calculations of excited states [50, 133] (see section VIII.2).

III.3.6 BEEF

A great strength of Kohn–Sham DFT and its extensions is that a reasonably high accuracy of physical, material, and chemical properties can be obtained at a relatively moderate computational cost. DFT is thus often used to simulate materials, reactions, and properties, where there de facto exists no “better” alternative. Even though more accurate electronic structure methods in principle might exist for a given application, the poor scaling of systematically more accurate methods often makes these computationally infeasible at the given system size that is being studied using DFT. One is therefore often in the situation that the accuracy of a given DFT calculation of some materials or chemical property cannot be verified against e.g. a more accurate solution of the Schrödinger equation, even on the biggest available supercomputers.

On the other hand, the wealth of available XC functionals naturally allows one to look at how sensitive a DFT result is on the choice of functional, and often accuracy is therefore being judged primarily by applying a small set of different XC functions, especially if no accurate benchmark theoretical simulation or experimental measurement is available. A challenge, however, is that the different available functionals are often known to be particularly good at simulating certain properties and poor at others. It is thus not at all clear how much one should trust a given functional for a given simulated property. The Bayesian Error Estimation (BEE) class of functionals [134] attempts to develop a practical framework to establishing an error estimate from a selected set of functional “ingredients”.

Assume that the XC model M(a)𝑀𝑎M(a)italic_M ( italic_a ) is a function of a set of parameters, a𝑎aitalic_a, that can be varied freely. If a benchmark data set, D𝐷Ditalic_D, of highly accurate properties established from experiments or higher-accuracy electronic structure simulations is available, we can attempt to identify the ensemble of models given by some distribution function, P(M(a))𝑃𝑀𝑎P(M(a))italic_P ( italic_M ( italic_a ) ), such that the most likely model in the ensemble, M(a0)𝑀subscript𝑎0M(a_{0})italic_M ( italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ), makes an accurate predictions for the benchmark data set, while the spread of ensemble reproduces the spread between the predictions of the most likely model and the benchmark data.

Bayes’ theorem provides a natural framework to search for the ensemble distribution. If a joint distribution between M(a)𝑀𝑎M(a)italic_M ( italic_a ) and D𝐷Ditalic_D exists, which we would assume, then Bayes’ theorm gives

P(M(a)|D)P(D|M(a))P0(M(a)),proportional-to𝑃conditional𝑀𝑎𝐷𝑃conditional𝐷𝑀𝑎subscript𝑃0𝑀𝑎P(M(a)|D)\propto P(D|M(a))P_{0}(M(a)),italic_P ( italic_M ( italic_a ) | italic_D ) ∝ italic_P ( italic_D | italic_M ( italic_a ) ) italic_P start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_M ( italic_a ) ) , (25)

where P0(M(a))subscript𝑃0𝑀𝑎P_{0}(M(a))italic_P start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_M ( italic_a ) ) is the prior expectation to the distribution of models before looking at the data, D𝐷Ditalic_D, and P(D|M(a))𝑃conditional𝐷𝑀𝑎P(D|M(a))italic_P ( italic_D | italic_M ( italic_a ) ) is a likelihood of seeing the data given the model. To achieve a useful ensemble, much care has to be put into finding a large enough set of varied and accurate data for different materials and chemical properties, and much care has to be applied as to how the ensemble is regularized to avoid overfitting [135, 136].

In all the BEE functionals, choices are made such that ultimately the XC functional is linear in a𝑎aitalic_a, and such that the distribution of a𝑎aitalic_a ends up following a multidimensional Normal distribution given by a regularized covariance matrix ΓΓ\Gammaroman_Γ:

P(a)exp((aa0)Γ(aa0)),proportional-to𝑃𝑎𝑎subscript𝑎0Γ𝑎subscript𝑎0P(a)\propto\exp(-(a-a_{0})\Gamma(a-a_{0})),italic_P ( italic_a ) ∝ roman_exp ( - ( italic_a - italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) roman_Γ ( italic_a - italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) ) , (26)

where ΓΓ\Gammaroman_Γ has been scaled in such a way that the ensemble reproduce the observed standard deviation between M(a0)𝑀subscript𝑎0M(a_{0})italic_M ( italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) and D𝐷Ditalic_D.

Refer to caption
Figure 2: Bayesian ensemble of XC functionals around BEEF–vdW. Orange solid line is the BEEF–vdW exchange enhancement factor, while the blue lines depict Fx(s)subscript𝐹x𝑠F_{\text{x}}(s)italic_F start_POSTSUBSCRIPT x end_POSTSUBSCRIPT ( italic_s ) for 50 samples of the randomly generated ensemble. Dotted black lines mark the exchange model perturbations that yield DFT results ±1 standard deviation away from BEEF–vdW results.

Figure 2 shows an ensemble of exchange enhancement factors Fx(s)subscript𝐹𝑥𝑠F_{x}(s)italic_F start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT ( italic_s ) from the BEEF-vdW functional, where s=|n|/(2kFn)𝑠𝑛2subscript𝑘𝐹𝑛s=|\nabla n|/(2k_{F}n)italic_s = | ∇ italic_n | / ( 2 italic_k start_POSTSUBSCRIPT italic_F end_POSTSUBSCRIPT italic_n ) is the reduced density gradient. The approach has given rise to several functionals BEEF-vdW [135], mBEEF [136], and mBEEF-vdW [137], which all include error estimation and are readily available in GPAW. Through the ASE interface, one can for example utilize the error ensembles to establish error estimates on Python-implemented models that are using DFT simulations for their parametrization. An example of this is the application to error estimates on adsorption scaling relations, microkinetics, and materials selection [138].

One risk to the approach of establishing error estimates from a small selected “ensemble” of XC-functionals is clearly that if the simulated property in question is poorly described by all functionals in the ensemble, then the error estimate might be also become poor. This could for example be the case if one tried to establish an error estimate for band gaps in oxides or van der Waals bonding of adsorbates on surfaces based on an ensemble of GGA XC-functionals, since no GGA functional may be accurate for simulating either property.

IV Ion dynamics

GPAW can be employed as a ‘black-box’ calculator, supplying energies and forces to other programs such as e.g. ASE, which then perform optimization of ground state geometries and reaction paths or carry out molecular dynamics. In fact, this is a key design principle behind GPAW. Methodological developments and general implementations that are not directly dependent on fast access to detailed electronic structure information should preferably be implemented externally to GPAW. This lead to maximal simplicity of the GPAW code itself, while also allowing for the external code to be utilized and tested with other electronic structure codes and atomistic potentials. A key to the high efficiency of GPAW simulations involving ionic displacements is the versatile implementation of constraints in ASE. Here many types of constraints are readily accessible, from the simple removal of degrees of freedom to more exotic constraints allowing for rigid molecule dynamics [139], to harmonic restoring forces [140], spacegroup preservation and combined ionic–unit cell dynamics [141]. Many algorithms are available for various structure optimization and molecular dynamics tasks.

IV.1 Structure relaxation

Local structure optimization in GPAW is typically achieved through the use of an optimizer from ASE. Here a larger range of standard optimizers are available such as quasi-Newton algorithms including BFGS [142, 143, 144, 145] and limited-memory BFGS [146], or Newtonian dynamics-based algorithms such as MDMin and FIRE [147]. That the optimizers have been implemented externally to GPAW provides benefits in terms of simple procedures for restarting long simulations and monitoring their convergence. Some optimizers from SciPy [68] are also available through the open-source ASE package, which provides a simple way to interface any optimizer in the SciPy format to GPAW. Preconditioning is implemented in an accessible way [148], which often leads to significant performance improvements.

Of the classical optimization methods, the quasi–Newton algorithms are often highly competitive. Here one builds up information on the Hessian or inverse Hessian matrix from calculated forces, ultimately leading to an accurate harmonic model of the potential energy surface in the vicinity of the local minimum. Such algorithms can, however, have problems both dealing with anharmonicity in the potential energy surface and with any noise in the electronic structure simulations. It often makes sense instead to fit a Gaussian process to the calculated energies and forces, and minimize within this model potential. This is implemented as the so-called GPmin method in ASE and often converges on the order of three times faster than the best quasi–Newton optimizers. [149]

IV.2 Reaction paths and barriers

Reliable calculations of energy barriers are of key importance for determining the rate of atomistic processes. In many quantum-chemical codes utilizing accurate atom-centered basis functions, this is achieved using analytical second derivatives in the direct search for first-order saddle points. This approach is less useful in the plane-wave based or grid-based modes of GPAW. The Dimer method [150] is implemented in ASE and can be used with GPAW, but often one would like to have an overview of the entire reaction path of an atomic-scale process to verify that the correct energy barrier for a process has been determined, and to obtain a full overview of the atomistic mechanism. For this purpose, the Nudged Elastic Band (NEB) method is typically employed through the ASE interface to GPAW. Both the original method [151] and a range of later improvements are available [152, 153, 154, 155, 156, 157]. Special care has to be taken in selecting the optimizer for a NEB algorithm, as this choice can have drastic influence on the convergence rate. For optimization of the reaction path, drastic performance improvements can be obtained by carrying out the optimization in a surrogate machine-learning model fitted to the potential energy surface [158, 159, 160]. GPAW has been used to drive NEB calculations on both surface systems [161, 162, 163, 164] as well as in molecules [164, 165].

IV.3 Global structure optimization

GPAW is integrated with various tools for global optimization of structures, compositions, as well as materials morphologies. Some quite generally applicable global optimization tools available are Basin Hopping [166], Minima Hopping [167], and Genetic Algorithms [168]. Some of the most powerful global optimization problems addressed using GPAW rely on machine-learning accelerated global-optimization strategies. These strategies have for example been applied to surfaces, clusters [169], and crystal structures in general [170]. In other machine-learning accelerated global-optimization routines, GPAW was used to generate initial databases of surface and bulk systems, and for later model validation in a strategy that uses Gaussian processes to generate surrogate potential-energy surfaces. These were then explored with Bayesian-optimization techniques, achieving speed-ups over more conventional methods of several orders of magnitude in finding optimal structures of the systems under investigation [171, 172, 173]. The method has been augmented through introducing extra (hyper)dimensions by interpolating between chemical elements, which speeds up the efficiency of the global search [174]. GPAW has been integrated with a Covariance Matrix Adaptation Evolution Strategy (CMA-ES) framework, providing energies and forces, generating training data, and evaluating CMA-ES candidate structures [175].

IV.4 Molecular dynamics and QM/MM

Ab initio molecular dynamics (MD) can be performed and analyzed through the ASE interface to GPAW. This include standard simulations such as constant-NVE, constant-NVT, and constant-NPT simulations. There is access to e.g. Langevin-, Andersen-, Nose-Hoover-, and Berendsen-dynamics. Due to the externalization of the dynamics, the development of novel algorithms and analysis tools becomes facile. Some examples of the use of GPAW span ab initio MD studies that have explored the liquid structure of water [176] and the water/Au(111) electrochemical interface [177].

Furthermore, GPAW is capable of working with external electrostatic potential terms from user-supplied point charge values and positions, enabling Quantum Mechanical (QM) / Molecular Mechanical (MM) simulations. Since GPAW is from the outset designed around highly efficient grid operations, the computational overhead of evaluating this potential as well as the resulting forces on the MM point charges from the QM density is kept low [178]. GPAW has been central in a range studies of ion dynamics in solution, both in and out of equilibrium. By using the molecular-dynamics functionality of ASE, researchers have performed QM/MM MD simulations of excited-state bond formation in photocatalyst model systems [179, 180, 181, 182], and electron transfer as well as coupled solute-solvent conformational dynamics in photosensitizer systems [183, 165]. Work on polarizable embedding QM/MM within GPAW is ongoing [184, 185].

V Magnetism and spin

Many important technological applications utilize magnetic order or manipulation of spin in materials. GPAW has a wide range of functionalities that faciliate the analysis of magnetic properties. This includes calculations with non-collinear spin, inclusion of external magnetic fields, spin–orbit coupling and spin spiral calculations within the generalized Bloch theorem. The implementaton of these features is described below while additional methods for calculating magnetic excitations are described in section VI.4.

V.1 Spin–orbit coupling

The spin–orbit coupling is typically completely dominated by regions close to the nuclei where the electrostatic potential becomes strong. Within the PAW augmentation sphere of atom a𝑎aitalic_a, the spin-σ𝜎\sigmaitalic_σ component of orbital n𝑛nitalic_n is given by

ψnσ(𝐫)=ip~ia|ψ~nσϕia(𝐫).subscript𝜓𝑛𝜎𝐫subscript𝑖inner-productsubscriptsuperscript~𝑝𝑎𝑖subscript~𝜓𝑛𝜎superscriptsubscriptitalic-ϕ𝑖𝑎𝐫\psi_{n\sigma}(\mathbf{r})=\sum_{i}\langle\tilde{p}^{a}_{i}|\tilde{\psi}_{n% \sigma}\rangle\phi_{i}^{a}(\mathbf{r}).italic_ψ start_POSTSUBSCRIPT italic_n italic_σ end_POSTSUBSCRIPT ( bold_r ) = ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n italic_σ end_POSTSUBSCRIPT ⟩ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ( bold_r ) . (27)

Assuming a spherically symmetric potential, the spin–orbit Hamiltonian for atom a𝑎aitalic_a is then written as

H^SOCa=μBmeec21rdVradr𝐋^𝐒^,superscriptsubscript^𝐻SOC𝑎subscript𝜇BPlanck-constant-over-2-pisubscript𝑚e𝑒superscript𝑐21𝑟dsuperscriptsubscript𝑉𝑟𝑎d𝑟^𝐋^𝐒\hat{H}_{\mathrm{SOC}}^{a}=\frac{\mu_{\mathrm{B}}}{\hbar m_{\mathrm{e}}ec^{2}}% \frac{1}{r}\frac{\mathrm{d}V_{r}^{a}}{\mathrm{d}r}\hat{\mathbf{L}}\cdot\hat{% \mathbf{S}},over^ start_ARG italic_H end_ARG start_POSTSUBSCRIPT roman_SOC end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT = divide start_ARG italic_μ start_POSTSUBSCRIPT roman_B end_POSTSUBSCRIPT end_ARG start_ARG roman_ℏ italic_m start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT italic_e italic_c start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG divide start_ARG 1 end_ARG start_ARG italic_r end_ARG divide start_ARG roman_d italic_V start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT end_ARG start_ARG roman_d italic_r end_ARG over^ start_ARG bold_L end_ARG ⋅ over^ start_ARG bold_S end_ARG , (28)

where Vrasuperscriptsubscript𝑉𝑟𝑎V_{r}^{a}italic_V start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT is the radial electrostatic potential of atom a𝑎aitalic_a. We evaluate Vrasuperscriptsubscript𝑉𝑟𝑎V_{r}^{a}italic_V start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT as the spherical part of the XC- and Hartree-potential from the local expansion of the density given by Eq. 11. Since the partial waves ϕiasubscriptsuperscriptitalic-ϕ𝑎𝑖\phi^{a}_{i}italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT are eigenstates of the scalar-relativistic Hamiltonian, these are independent of spin and it is straightforward to evaluate the action of 𝐋^^𝐋\hat{\mathbf{L}}over^ start_ARG bold_L end_ARG on them.

The eigenenergies can be accurately calculated in a non-selfconsistent treatment of the spin–orbit coupling and may be obtained by diagonalizing the full Hamiltonian in a basis of scalar-relativistic orbitals [186]:

Hmn=εm0δmn+aijσσψ~mσ0|p~iaϕia|H^SOC,σσa|ϕjap~ja|ψ~nσ0.subscript𝐻𝑚𝑛subscriptsuperscript𝜀0𝑚subscript𝛿𝑚𝑛subscript𝑎𝑖𝑗𝜎superscript𝜎inner-productsuperscriptsubscript~𝜓𝑚𝜎0subscriptsuperscript~𝑝𝑎𝑖quantum-operator-productsuperscriptsubscriptitalic-ϕ𝑖𝑎subscriptsuperscript^𝐻𝑎SOC𝜎superscript𝜎superscriptsubscriptitalic-ϕ𝑗𝑎inner-productsubscriptsuperscript~𝑝𝑎𝑗superscriptsubscript~𝜓𝑛superscript𝜎0H_{mn}=\varepsilon^{0}_{m}\delta_{mn}+\sum_{aij\sigma\sigma^{\prime}}\langle% \tilde{\psi}_{m\sigma}^{0}|\tilde{p}^{a}_{i}\rangle\langle\phi_{i}^{a}|\hat{H}% ^{a}_{\mathrm{SOC,\sigma\sigma^{\prime}}}|\phi_{j}^{a}\rangle\langle\tilde{p}^% {a}_{j}|\tilde{\psi}_{n\sigma^{\prime}}^{0}\rangle.italic_H start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT = italic_ε start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT italic_δ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT + ∑ start_POSTSUBSCRIPT italic_a italic_i italic_j italic_σ italic_σ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ⟨ over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_m italic_σ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT | over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟩ ⟨ italic_ϕ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | over^ start_ARG italic_H end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_SOC , italic_σ italic_σ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT | italic_ϕ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ⟩ ⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n italic_σ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ⟩ . (29)

Here εm0subscriptsuperscript𝜀0𝑚\varepsilon^{0}_{m}italic_ε start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT and ψm0superscriptsubscript𝜓𝑚0\psi_{m}^{0}italic_ψ start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT represent the scalar-relativistic eigenenergies and eigenstates, respectively. This constitutes a fast post-processing step for any scalar-relativistic calculation and only requires the projector overlaps p~ja|ψ~nσ0inner-productsubscriptsuperscript~𝑝𝑎𝑗superscriptsubscript~𝜓𝑛superscript𝜎0\langle\tilde{p}^{a}_{j}|\tilde{\psi}_{n\sigma^{\prime}}^{0}\rangle⟨ over~ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n italic_σ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 0 end_POSTSUPERSCRIPT ⟩. It should be noted that this approach in principle requires convergence with respect to the number of scalar-relativistic states included in the basis, but the eigenvalues typically converge rather rapidly with respect to the basis. In Fig. 3, we show the band structure of a WS2 monolayer obtained from PBE with non-self-consistent spin–orbit coupling. The W atoms introduce strong spin–orbit coupling in this material and the valence band is split by 0.45 eV at the K point. The spin degeneracy is retained along the ΓΓ\Gammaroman_Γ-M line, which is left invariant by two non-commuting mirror symmetries.

Refer to caption
Figure 3: Band structure of WS2 monolayer obtained from PBE with non-selfconsistent spin–orbit coupling. The colors indicate the expectation value of Szsubscript𝑆𝑧S_{z}italic_S start_POSTSUBSCRIPT italic_z end_POSTSUBSCRIPT for each state. The grey lines show the band structure without spin–orbit coupling.

For magnetic materials the non-selfconsistent treatment of spin–orbit coupling is convenient for evaluating the magnetic anisotropy. The magnetic force theorem [187] implies that rotating the magnetic moments away from the ground state configuration yields a contribution to the energy, which is well approximated by the change in Kohn–Sham eigenvalues. The change in energy for a given orientation of the magnetization density can thus be obtained as

ΔEθ,φ=nfnθ,φεnθ,φ,Δsuperscript𝐸𝜃𝜑subscript𝑛superscriptsubscript𝑓𝑛𝜃𝜑superscriptsubscript𝜀𝑛𝜃𝜑\Delta E^{\theta,\varphi}=\sum_{n}f_{n}^{\theta,\varphi}\varepsilon_{n}^{% \theta,\varphi},roman_Δ italic_E start_POSTSUPERSCRIPT italic_θ , italic_φ end_POSTSUPERSCRIPT = ∑ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_θ , italic_φ end_POSTSUPERSCRIPT italic_ε start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_θ , italic_φ end_POSTSUPERSCRIPT , (30)

where εnθ,φsuperscriptsubscript𝜀𝑛𝜃𝜑\varepsilon_{n}^{\theta,\varphi}italic_ε start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_θ , italic_φ end_POSTSUPERSCRIPT are the eigenvalues obtained from diagonalizing Eq. (29) with the spins rotated to a direction defined by the angles (θ,φ)𝜃𝜑(\theta,\varphi)( italic_θ , italic_φ ) and fnθ,φsuperscriptsubscript𝑓𝑛𝜃𝜑f_{n}^{\theta,\varphi}italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_θ , italic_φ end_POSTSUPERSCRIPT are the associated occupation numbers. This corresponds to rotating the xc-magnetic field (defined below), which will lead to different eigenvalues when spin–orbit coupling is included. In two-dimensional magnets, an easy-axis anisotropy is decisive for magnetic order [188, 189, 41] and Eq. (30) is easily applied to high throughput computations of magnetic properties [190, 191].

V.2 Self-consistent non-collinear magnetism

The Kohn–Sham framework for treating non-collinear magnetism was developed by Barth and Hedin [192] and involves the spin density matrix

ρσσ(𝐫)=nfnψnσ(𝐫)ψnσ(𝐫)subscript𝜌𝜎superscript𝜎𝐫subscript𝑛subscript𝑓𝑛subscriptsuperscript𝜓𝑛𝜎𝐫subscript𝜓𝑛superscript𝜎𝐫\rho_{\sigma\sigma^{\prime}}(\mathbf{r})=\sum_{n}f_{n}\psi^{*}_{n\sigma}(% \mathbf{r})\psi_{n\sigma^{\prime}}(\mathbf{r})italic_ρ start_POSTSUBSCRIPT italic_σ italic_σ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_r ) = ∑ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n italic_σ end_POSTSUBSCRIPT ( bold_r ) italic_ψ start_POSTSUBSCRIPT italic_n italic_σ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_r ) (31)

as the basic variable. The electronic density and magnetization are then given by n=Tr[ρ]𝑛Trdelimited-[]𝜌n=\mathrm{Tr}[\rho]italic_n = roman_Tr [ italic_ρ ] and 𝐦=Tr[𝝈ρ]𝐦Trdelimited-[]𝝈𝜌\mathbf{m}=\mathrm{Tr}[\boldsymbol{\sigma}\rho]bold_m = roman_Tr [ bold_italic_σ italic_ρ ] respectively. The XC-potential acquires four components, which are the functional derivatives of the XC-energy with respect to the density matrix and may be represented as a 2×2222\times 22 × 2 matrix acting on spinor Kohn–Sham states. These can be expressed in terms of the density and magnetization, which lead to the XC-part of the Kohn–Sham Hamiltonian

Hxc=vxc+𝐁xc𝝈,subscript𝐻xcsubscript𝑣xcsubscript𝐁xc𝝈H_{\mathrm{xc}}=v_{\mathrm{xc}}+\mathbf{B}_{\mathrm{xc}}\cdot\boldsymbol{% \sigma},italic_H start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT = italic_v start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT + bold_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ⋅ bold_italic_σ , (32)

where the scalar potential and XC-magnetic field are given by

vxc(𝐫)=δExcδn(𝐫)𝐁xc(𝐫)=δExcδ𝐦(𝐫).formulae-sequencesubscript𝑣xc𝐫𝛿subscript𝐸xc𝛿𝑛𝐫subscript𝐁xc𝐫𝛿subscript𝐸xc𝛿𝐦𝐫v_{\mathrm{xc}}(\mathbf{r})=\frac{\delta E_{\mathrm{xc}}}{\delta n(\mathbf{r})% }\qquad\mathbf{B}_{\mathrm{xc}}(\mathbf{r})=\frac{\delta E_{\mathrm{xc}}}{% \delta\mathbf{m}(\mathbf{r})}.italic_v start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r ) = divide start_ARG italic_δ italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT end_ARG start_ARG italic_δ italic_n ( bold_r ) end_ARG bold_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r ) = divide start_ARG italic_δ italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT end_ARG start_ARG italic_δ bold_m ( bold_r ) end_ARG . (33)

In GPAW, the self-consistent treatment of non-collinear spin is implemented within LDA where 𝐁xcsubscript𝐁xc\mathbf{B}_{\mathrm{xc}}bold_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT is approximated as

𝐁xcLDA(𝐫)=δExcLDAδm(𝐫)𝐦^(𝐫).superscriptsubscript𝐁xcLDA𝐫𝛿superscriptsubscript𝐸xcLDA𝛿𝑚𝐫^𝐦𝐫\mathbf{B}_{\mathrm{xc}}^{\mathrm{LDA}}(\mathbf{r})=\frac{\delta E_{\mathrm{xc% }}^{\mathrm{LDA}}}{\delta m(\mathbf{r})}\mathbf{\hat{m}}(\mathbf{r}).bold_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_LDA end_POSTSUPERSCRIPT ( bold_r ) = divide start_ARG italic_δ italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_LDA end_POSTSUPERSCRIPT end_ARG start_ARG italic_δ italic_m ( bold_r ) end_ARG over^ start_ARG bold_m end_ARG ( bold_r ) . (34)

Here m(𝐫)=|𝐦(𝐫)|𝑚𝐫𝐦𝐫m(\mathbf{r})=|\mathbf{m}(\mathbf{r})|italic_m ( bold_r ) = | bold_m ( bold_r ) | is the magnitude and 𝐦^(𝐫)^𝐦𝐫\mathbf{\hat{m}}(\mathbf{r})over^ start_ARG bold_m end_ARG ( bold_r ) is the direction of the magnetization. The generalization of Eq. 34 to GGAs are plagued by formal as well as numerical problems [193, 194] and the self-consistent solution of the non-collinear Kohn–Sham equations is presently restricted to LDA. It should be emphasized that the PAW formalism allows for a fully non-collinear treatment that does not rely on intra-atomic collinearity, which is often imposed in other electronic structure packages.

Spin–orbit coupling may be included by adding Eq. 28 to the Kohn–Sham Hamiltonian and this constitutes a fully self-consistent framework for spin–orbit calculations within LDA.

V.3 Orbital magnetization

Current ab initio methods for determining the orbital magnetization of a material involve either the modern theory, i.e. a Berry-phase formula, or the atom-centered approximation (ACA), where contributions to the expectation value of the angular momentum operator are restricted within atom-centered muffin-tin (MT) spheres with specified cutoff radii. The PAW formulation of the wave functions allows for an approximation similar to the MT-ACA where only the PAW expansion of the wave functions is assumed to contribute significantly to the expectation value of the angular momentum. The orbital magnetic moments can then be calculated through

𝐦orba=e2meaiiσDσiiaϕia|𝐋^|ϕia,subscriptsuperscript𝐦𝑎orb𝑒2subscript𝑚𝑒subscript𝑎subscript𝑖superscript𝑖subscript𝜎subscriptsuperscript𝐷𝑎𝜎𝑖superscript𝑖quantum-operator-productsubscriptsuperscriptitalic-ϕ𝑎𝑖^𝐋subscriptsuperscriptitalic-ϕ𝑎superscript𝑖\mathbf{m}^{a}_{\mathrm{orb}}=-\frac{e}{2m_{e}}\sum_{a}\sum_{ii^{\prime}}\sum_% {\sigma}D^{a}_{\sigma ii^{\prime}}\left<\phi^{a}_{i}\middle|\widehat{\mathbf{L% }}\middle|\phi^{a}_{i^{\prime}}\right>,bold_m start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_orb end_POSTSUBSCRIPT = - divide start_ARG italic_e end_ARG start_ARG 2 italic_m start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT end_ARG ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_σ end_POSTSUBSCRIPT italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_σ italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ⟨ italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | over^ start_ARG bold_L end_ARG | italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ⟩ , (35)

where Dσiiasubscriptsuperscript𝐷𝑎𝜎𝑖superscript𝑖D^{a}_{\sigma ii^{\prime}}italic_D start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_σ italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT are elements of the atomic density matrix as defined in Eq. (9), ϕia(𝐫)subscriptsuperscriptitalic-ϕ𝑎𝑖𝐫\phi^{a}_{i}(\mathbf{r})italic_ϕ start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) are the bound all-electron partial waves of atom a𝑎aitalic_a, and 𝐋^^𝐋\hat{\mathbf{L}}over^ start_ARG bold_L end_ARG is the angular-momentum operator.

We note that this expression does not entail cutoff radii for the atomic contributions to the orbital magnetic moments; instead, the entire all-electron partial waves are included although the all-electron atomic expansion is only formally exact inside the PAW spheres. Additionally, this means that the unbounded, i.e. non-normalisable, all-electron partial waves must be excluded in Eq. (35)

A prerequisite for nonzero orbital magnetization is broken time-reversal symmetry as represented by a complex Hamiltonian that is not unitarily equivalent to a real counterpart. Practically this means that a finite orbital magnetization requires magnetic order and either inclusion of spin–orbit coupling or non-coplanar spin textures. In GPAW, the spin–orbit interaction can be included either self-consistently in a non-collinear calculation or as a non-self-consistent post-processing step following a collinear calculation.

Crystal bcc-Fe fcc-Ni fcc-Co hcp-Co
Easy axis [001]delimited-[]001[001][ 001 ] [111]delimited-[]111[111][ 111 ] [111]delimited-[]111[111][ 111 ] [001]delimited-[]001[001][ 001 ]
PAW-ACA 0.06110.06110.06110.0611 0.05460.05460.05460.0546 0.08450.08450.08450.0845 0.08860.08860.08860.0886
MT-ACA [195] 0.04330.04330.04330.0433 0.05110.05110.05110.0511 0.06340.06340.06340.0634 0.08680.08680.08680.0868
Modern theory [195] 0.06580.06580.06580.0658 0.05190.05190.05190.0519 0.07560.07560.07560.0756 0.09570.09570.09570.0957
Experiment [196] 0.0810.0810.0810.081 0.0530.0530.0530.053 0.1200.1200.1200.120 0.1330.1330.1330.133
Table 2: Calculated and measured values for the orbital magnetization in units of μBsubscript𝜇B\mu_{\mathrm{B}}italic_μ start_POSTSUBSCRIPT roman_B end_POSTSUBSCRIPT per atom.

The orbital magnetization has been calculated using Eq. (35) for the simple ferromagnets bcc-Fe, fcc-Ni, fcc-Co, and hcp-Co, where the spin–orbit interaction is included non-self-consistently. The PAW-ACA results are displayed in Table 2 along with MT-ACA results, modern theory results, and measurements from experiment, demonstrating mainly that the PAW-ACA can be an improvement over the MT-ACA and secondly that there is decent agreement between the PAW-ACA and the modern theory for these systems.

V.4 Constant B-field

The coupling of the electronic spin magnetic moments to a constant external magnetic field 𝐁𝐁\mathbf{B}bold_B can be included by the addition of a Zeeman term in the Kohn–Sham Hamiltonian:

ΔHB=𝐁𝝈.Δsubscript𝐻B𝐁𝝈\Delta H_{\mathrm{B}}=\mathbf{B}\cdot\boldsymbol{\sigma}.roman_Δ italic_H start_POSTSUBSCRIPT roman_B end_POSTSUBSCRIPT = bold_B ⋅ bold_italic_σ . (36)

As an example, we can consider the spin-flop transition in Cr2O3. The ground state is anti-ferromagnetic with a weak anisotropy that prefers alignment of the spins with the z𝑧zitalic_z-axis, and if a magnetic field is applied along the z𝑧zitalic_z-direction, it becomes favorable to align the spins along a perpendicular direction (with a small ferromagnetic component) at the critical field where the Zeeman energy overcomes the anisotropy. This is clearly a spin–orbit effect and one has to carry out the calculations in a fully non-collinear framework with self-consistent spin–orbit coupling. In Fig. 4 we show the energy of the two alignments of spin as a function of external magnetic field obtained with LDA+U (U=2𝑈2U=2italic_U = 2 eV). The minimum energy configuration changes from Szsubscript𝑆𝑧S_{z}italic_S start_POSTSUBSCRIPT italic_z end_POSTSUBSCRIPT to Sxsubscript𝑆𝑥S_{x}italic_S start_POSTSUBSCRIPT italic_x end_POSTSUBSCRIPT alignment at 6 T, i.e., the spin flips at this critical field value. This is in excellent agreement with the experimental value of Ref. [197]. The critical field is, however, rather strongly dependent on the chosen value of U𝑈Uitalic_U and increases by a factor of two in the absence of U𝑈Uitalic_U. The magnetic anisotropy (per unit cell) can be read off from the energy difference at B=0𝐵0B=0italic_B = 0 T.

Refer to caption
Figure 4: Spin-flop transition in Cr2O3. The alignment of the spins with respect to the magnetic field is sketched for small and large magnitudes of the field. The canting (small ferromagnetic component after the spin flop) is exaggerated for visualization. The actual canting is roughly 1superscript11^{\circ}1 start_POSTSUPERSCRIPT ∘ end_POSTSUPERSCRIPT.

V.5 Spin spirals

The ground-state magnetic structure of frustrated and/or chiral magnets is often non-collinear and may be incommensurate with the chemical unit cell. In the classical isotropic Heisenberg model, the energy is always minimized by a planar spin spiral [198]. The energy of a general planar spin spiral can be evaluated efficiently within the chemical unit cell using the Generalized Bloch’s Theorem (GBT) [199]. In the GBT implementation of GPAW [40], there is no restriction on interatomic collinearity and thus it encodes a rotation of the all-electron magnetization density by an angle φ=𝐪𝐑i𝜑𝐪subscript𝐑𝑖\varphi=\mathbf{q}\cdot\mathbf{R}_{i}italic_φ = bold_q ⋅ bold_R start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT upon translations of a lattice vector 𝐑isubscript𝐑𝑖\mathbf{R}_{i}bold_R start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. The Kohn–Sham equations can then be solved self-consistently for a fixed wave vector 𝐪𝐪\mathbf{q}bold_q,

H^𝐪(𝐤)|u𝐪,n𝐤=ε𝐪,n𝐤|u𝐪,n𝐤,subscript^𝐻𝐪𝐤ketsubscript𝑢𝐪𝑛𝐤subscript𝜀𝐪𝑛𝐤ketsubscript𝑢𝐪𝑛𝐤\displaystyle\hat{H}_{\mathbf{q}}(\mathbf{k})\left|u_{\mathbf{q},n\mathbf{k}}% \right\rangle=\varepsilon_{\mathbf{q},n\mathbf{k}}\left|u_{\mathbf{q},n\mathbf% {k}}\right\rangle,over^ start_ARG italic_H end_ARG start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT ( bold_k ) | italic_u start_POSTSUBSCRIPT bold_q , italic_n bold_k end_POSTSUBSCRIPT ⟩ = italic_ε start_POSTSUBSCRIPT bold_q , italic_n bold_k end_POSTSUBSCRIPT | italic_u start_POSTSUBSCRIPT bold_q , italic_n bold_k end_POSTSUBSCRIPT ⟩ , (37)

using only the periodic part of the generalized Bloch orbitals, |ψ𝐪,n𝐤=U𝐪(𝐫)ei𝐤𝐫|u𝐪,n𝐤ketsubscript𝜓𝐪𝑛𝐤superscriptsubscript𝑈𝐪𝐫superscript𝑒𝑖𝐤𝐫ketsubscript𝑢𝐪𝑛𝐤|\psi_{\mathbf{q},n\mathbf{k}}\rangle=U_{\mathbf{q}}^{\dagger}(\mathbf{r})e^{i% \mathbf{k}\cdot\mathbf{r}}|u_{\mathbf{q},n\mathbf{k}}\rangle| italic_ψ start_POSTSUBSCRIPT bold_q , italic_n bold_k end_POSTSUBSCRIPT ⟩ = italic_U start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT ( bold_r ) italic_e start_POSTSUPERSCRIPT italic_i bold_k ⋅ bold_r end_POSTSUPERSCRIPT | italic_u start_POSTSUBSCRIPT bold_q , italic_n bold_k end_POSTSUBSCRIPT ⟩, where U𝐪subscript𝑈𝐪U_{\mathbf{q}}italic_U start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT denotes the generator of spin rotations about the z𝑧zitalic_z-axis:

U𝐪(𝐫)=(ei𝐪𝐫/200ei𝐪𝐫/2).subscript𝑈𝐪𝐫matrixsuperscript𝑒𝑖𝐪𝐫200superscript𝑒𝑖𝐪𝐫2\displaystyle U_{\mathbf{q}}(\mathbf{r})=\begin{pmatrix}e^{i\mathbf{q}\cdot% \mathbf{r}/2}&0\\ 0&e^{-i\mathbf{q}\cdot\mathbf{r}/2}\end{pmatrix}.italic_U start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT ( bold_r ) = ( start_ARG start_ROW start_CELL italic_e start_POSTSUPERSCRIPT italic_i bold_q ⋅ bold_r / 2 end_POSTSUPERSCRIPT end_CELL start_CELL 0 end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL italic_e start_POSTSUPERSCRIPT - italic_i bold_q ⋅ bold_r / 2 end_POSTSUPERSCRIPT end_CELL end_ROW end_ARG ) . (38)

The generalized Bloch Hamiltonian without spin–orbit coupling is given by

H^𝐪(𝐤)subscript^𝐻𝐪𝐤\displaystyle\hat{H}_{\mathbf{q}}(\mathbf{k})over^ start_ARG italic_H end_ARG start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT ( bold_k ) =ei𝐤𝐫U𝐪(𝐫)H^U𝐪(𝐫)ei𝐤𝐫,absentsuperscript𝑒𝑖𝐤𝐫subscript𝑈𝐪𝐫^𝐻superscriptsubscript𝑈𝐪𝐫superscript𝑒𝑖𝐤𝐫\displaystyle=e^{-i\mathbf{k}\cdot\mathbf{r}}U_{\mathbf{q}}(\mathbf{r})\hat{H}% U_{\mathbf{q}}^{\dagger}(\mathbf{r})e^{i\mathbf{k}\cdot\mathbf{r}},= italic_e start_POSTSUPERSCRIPT - italic_i bold_k ⋅ bold_r end_POSTSUPERSCRIPT italic_U start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT ( bold_r ) over^ start_ARG italic_H end_ARG italic_U start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT ( bold_r ) italic_e start_POSTSUPERSCRIPT italic_i bold_k ⋅ bold_r end_POSTSUPERSCRIPT , (39)

and once Eq. (37) has been solved self-consistently for a given 𝐪𝐪\mathbf{q}bold_q, the corresponding spin-spiral energy is evaluated as usual, ESS(𝐪)=E𝐪DFT[n,𝐦]subscript𝐸SS𝐪superscriptsubscript𝐸𝐪DFT𝑛𝐦E_{\mathrm{SS}}(\mathbf{q})=E_{\mathbf{q}}^{\mathrm{DFT}}[n,\mathbf{m}]italic_E start_POSTSUBSCRIPT roman_SS end_POSTSUBSCRIPT ( bold_q ) = italic_E start_POSTSUBSCRIPT bold_q end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_DFT end_POSTSUPERSCRIPT [ italic_n , bold_m ].

Refer to caption
Figure 5: LSDA spin-spiral spectrum of the NiBr2 monolayer (structure taken from the C2DB [15]). The ground state has an incommensurate wave vector 𝐐[0.1,0.1,0]similar-to-or-equals𝐐0.10.10\mathbf{Q}\simeq[0.1,0.1,0]bold_Q ≃ [ 0.1 , 0.1 , 0 ]. The magnetic moment displays only weak longitudinal fluctuations and the band gap remains finite for all wave vectors 𝐪𝐪\mathbf{q}bold_q, indicating that a Heisenberg model description of the material would be appropriate. The inset shows the spin–orbit correction to the spin-spiral energies (in meV) as a function of the normal vector 𝐧𝐧\mathbf{n}bold_n of the planar spin spiral. 𝐧𝐧\mathbf{n}bold_n is depicted in terms of its stereographic projection in the upper hemisphere above the monolayer plane. The spiral plane is found to be orthogonal to 𝐐𝐐\mathbf{Q}bold_Q and tilted slightly with respect to the out-of-plane direction.

Using the GPAW functionality to compute the spin-spiral energy as a function of 𝐪𝐪\mathbf{q}bold_q, one can then search for the ground-state wave vector 𝐐𝐐\mathbf{Q}bold_Q that minimizes the energy. In Fig. 5, we show that the monolayer NiBr2 has an incommensurate spin-spiral ground state, and that the local magnetic moment on the Ni atom depends only weakly on the wave vector 𝐪𝐪\mathbf{q}bold_q.

Furthermore, the orientation of the ground state spin spiral can be obtained by including spin–orbit coupling non-self-consistently in the projected spin–orbit approximation [200] and search for the orientation that minimizes the energy. The ordering vector 𝐐𝐐\mathbf{Q}bold_Q and the normal vector 𝐧𝐧\mathbf{n}bold_n of the spiral plane thus constitute a complete specification of the magnetic ground state within the class of single-𝐪𝐪\mathbf{q}bold_q states. The normal vector is of particular interest since spin spirals may lead to spontaneous breaking of the crystal symmetry, and the normal vector largely determines the direction of magnetically induced spontaneous polarization [40]. In Fig. 5, we show that 𝐧𝐧\mathbf{n}bold_n is perpendicular to the wavevector 𝐐𝐐\mathbf{Q}bold_Q in the monolayer NiBr2 ground state, corresponding to a cycloidal spin spiral.

VI Response functions and excitations

Linear response functions are the bread and butter of condensed matter physics. Their applications include the description of dielectric screening, optical and electron energy loss spectra, many-body excitations, and ground state correlation energies. In this section we describe the methods available in GPAW for calculating electronic response functions as well as GW quasiparticle band structures and optical excitations from the Bethe-Salpeter Equation (BSE). In addition to electronic response function, GPAW can also calculate the transverse magnetic susceptibility, which holds information about the magnetic excitations, e.g. magnons, and can be used to derive parameters for classical Heisenberg spin models and to estimate magnetic transition temperatures. Finally, we present methods to calculate Raman spectra of solids and quadratic optical response tensors for describing second harmonics generation and the Pockels electro-optical effect.

VI.1 Linear-response TDDFT

To linear order, the change in electron density induced by a time-dependent external (scalar) potential Vext(𝐫,t)subscript𝑉ext𝐫𝑡V_{\mathrm{ext}}(\mathbf{r},t)italic_V start_POSTSUBSCRIPT roman_ext end_POSTSUBSCRIPT ( bold_r , italic_t ) is governed by the electronic susceptibility, χ𝜒\chiitalic_χ:

δn(𝐫,t)=𝑑t𝑑𝐫χ(𝐫,𝐫,tt)Vext(𝐫,t).𝛿𝑛𝐫𝑡superscriptsubscriptdifferential-dsuperscript𝑡differential-dsuperscript𝐫𝜒𝐫superscript𝐫𝑡superscript𝑡subscript𝑉extsuperscript𝐫superscript𝑡\delta n(\mathbf{r},t)=\int_{-\infty}^{\infty}dt^{\prime}\int d\mathbf{r}^{% \prime}\,\chi(\mathbf{r},\mathbf{r}^{\prime},t-t^{\prime})V_{\mathrm{ext}}(% \mathbf{r}^{\prime},t^{\prime}).italic_δ italic_n ( bold_r , italic_t ) = ∫ start_POSTSUBSCRIPT - ∞ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∞ end_POSTSUPERSCRIPT italic_d italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ∫ italic_d bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_χ ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_V start_POSTSUBSCRIPT roman_ext end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) . (40)

The susceptibility is itself given by the Kubo formula [201]

χ(𝐫,𝐫,tt)=iθ(tt)[n^0(𝐫,t),n^0(𝐫,t)]0,𝜒𝐫superscript𝐫𝑡superscript𝑡𝑖Planck-constant-over-2-pi𝜃𝑡superscript𝑡subscriptdelimited-⟨⟩subscript^𝑛0𝐫𝑡subscript^𝑛0superscript𝐫superscript𝑡0\chi(\mathbf{r},\mathbf{r}^{\prime},t-t^{\prime})=-\frac{i}{\hbar}\theta(t-t^{% \prime})\langle\left[\hat{n}_{0}(\mathbf{r},t),\hat{n}_{0}(\mathbf{r}^{\prime}% ,t^{\prime})\right]\rangle_{0},italic_χ ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = - divide start_ARG italic_i end_ARG start_ARG roman_ℏ end_ARG italic_θ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟨ [ over^ start_ARG italic_n end_ARG start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r , italic_t ) , over^ start_ARG italic_n end_ARG start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ] ⟩ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , (41)

where the expectation value is taken with respect to the ground state at zero temperature and the density operators are cast in the interaction picture.

In the noninteracting Kohn–Sham system, the susceptibility can be evaluated explicitly from the Kohn–Sham orbitals, eigenvalues and occupations:

χ0(𝐫,𝐫,ω)=subscript𝜒0𝐫superscript𝐫𝜔absent\displaystyle\chi_{0}(\mathbf{r},\mathbf{r}^{\prime},\omega)=italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) = limη0+2n𝐤m𝐤(fn𝐤fm𝐤)subscript𝜂superscript02subscript𝑛𝐤subscript𝑚superscript𝐤subscript𝑓𝑛𝐤subscript𝑓𝑚superscript𝐤\displaystyle\lim_{\eta\rightarrow 0^{+}}2\,\sum_{n\mathbf{k}}\sum_{m\mathbf{k% }^{\prime}}\left(f_{n\mathbf{k}}-f_{m\mathbf{k}^{\prime}}\right)roman_lim start_POSTSUBSCRIPT italic_η → 0 start_POSTSUPERSCRIPT + end_POSTSUPERSCRIPT end_POSTSUBSCRIPT 2 ∑ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_f start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT - italic_f start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT )
×ψn𝐤(𝐫)ψm𝐤(𝐫)ψm𝐤(𝐫)ψn𝐤(𝐫)ω(ϵm𝐤ϵn𝐤)+iη.absentsubscriptsuperscript𝜓𝑛𝐤𝐫subscript𝜓𝑚superscript𝐤𝐫subscriptsuperscript𝜓𝑚superscript𝐤superscript𝐫subscript𝜓𝑛𝐤superscript𝐫Planck-constant-over-2-pi𝜔subscriptitalic-ϵ𝑚superscript𝐤subscriptitalic-ϵ𝑛𝐤𝑖Planck-constant-over-2-pi𝜂\displaystyle\times\frac{\psi^{*}_{n\mathbf{k}}(\mathbf{r})\psi_{m\mathbf{k}^{% \prime}}(\mathbf{r})\psi^{*}_{m\mathbf{k}^{\prime}}(\mathbf{r}^{\prime})\psi_{% n\mathbf{k}}(\mathbf{r}^{\prime})}{\hbar\omega-(\epsilon_{m\mathbf{k}^{\prime}% }-\epsilon_{n\mathbf{k}})+i\hbar\eta}.× divide start_ARG italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ( bold_r ) italic_ψ start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_r ) italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_ψ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) end_ARG start_ARG roman_ℏ italic_ω - ( italic_ϵ start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT - italic_ϵ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ) + italic_i roman_ℏ italic_η end_ARG . (42)

Based on the Kohn–Sham susceptibility, χ0subscript𝜒0\chi_{0}italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, the many-body susceptibility can be calculated via a Dyson-like equation [202]:

χ(𝐫,𝐫,ω)=χ0(𝐫,𝐫,ω)+𝜒𝐫superscript𝐫𝜔limit-fromsubscript𝜒0𝐫superscript𝐫𝜔\displaystyle\chi(\mathbf{r},\mathbf{r}^{\prime},\omega)=\chi_{0}(\mathbf{r},% \mathbf{r}^{\prime},\omega)+italic_χ ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) = italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) + 𝑑𝐫1𝑑𝐫2χ0(𝐫,𝐫1,ω)double-integraldifferential-dsubscript𝐫1differential-dsubscript𝐫2subscript𝜒0𝐫subscript𝐫1𝜔\displaystyle\iint d\mathbf{r}_{1}d\mathbf{r}_{2}\,\chi_{0}(\mathbf{r},\mathbf% {r}_{1},\omega)∬ italic_d bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_d bold_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω )
×KHxc(𝐫1,𝐫2,ω)χ(𝐫2,𝐫,ω).absentsubscript𝐾Hxcsubscript𝐫1subscript𝐫2𝜔𝜒subscript𝐫2superscript𝐫𝜔\displaystyle\times K_{\mathrm{Hxc}}(\mathbf{r}_{1},\mathbf{r}_{2},\omega)\chi% (\mathbf{r}_{2},\mathbf{r}^{\prime},\omega).× italic_K start_POSTSUBSCRIPT roman_Hxc end_POSTSUBSCRIPT ( bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , bold_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_ω ) italic_χ ( bold_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) . (43)

Here, electronic interactions are accounted for via the Hartree-XC kernel, which is defined in terms of the effective potentials of time-dependent DFT (TDDFT) [203]:

KHxc(𝐫,𝐫,tt)=vc(𝐫𝐫)+fxc(𝐫,𝐫,tt)subscript𝐾Hxc𝐫superscript𝐫𝑡superscript𝑡subscript𝑣𝑐𝐫superscript𝐫subscript𝑓xc𝐫superscript𝐫𝑡superscript𝑡K_{\mathrm{Hxc}}(\mathbf{r},\mathbf{r}^{\prime},t-t^{\prime})=v_{c}(\mathbf{r}% -\mathbf{r}^{\prime})+f_{\mathrm{xc}}(\mathbf{r},\mathbf{r}^{\prime},t-t^{% \prime})italic_K start_POSTSUBSCRIPT roman_Hxc end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = italic_v start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT ( bold_r - bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) + italic_f start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) (44)

where vcsubscript𝑣𝑐v_{c}italic_v start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT is the Coulomb interaction and fxcsubscript𝑓xcf_{\mathrm{xc}}italic_f start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT is the XC-kernel defined as

fxc(𝐫,𝐫,tt)=δvxc(𝐫,t)δn(𝐫,t).subscript𝑓xc𝐫superscript𝐫𝑡superscript𝑡𝛿subscript𝑣xc𝐫𝑡𝛿𝑛superscript𝐫superscript𝑡f_{\mathrm{xc}}(\mathbf{r},\mathbf{r}^{\prime},t-t^{\prime})=\frac{\delta v_{% \mathrm{xc}}(\mathbf{r},t)}{\delta n(\mathbf{r}^{\prime},t^{\prime})}.italic_f start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = divide start_ARG italic_δ italic_v start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r , italic_t ) end_ARG start_ARG italic_δ italic_n ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) end_ARG . (45)

In prototypical linear-response TDDFT (LR-TDDFT) calculations, the exchange–correlation part of the kernel is either neglected (leading to the random phase approximation (RPA)) or approximated via the adiabatic local density approximation (ALDA),

vxc(𝐫,t)[ϵxc(n)n]n|n(𝐫,t),similar-to-or-equalssubscript𝑣xc𝐫𝑡evaluated-atdelimited-[]subscriptitalic-ϵxc𝑛𝑛𝑛𝑛𝐫𝑡v_{\mathrm{xc}}(\mathbf{r},t)\simeq\left.\frac{\partial[\epsilon_{\mathrm{xc}}% (n)n]}{\partial n}\right|_{n(\mathbf{r},t)},italic_v start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r , italic_t ) ≃ divide start_ARG ∂ [ italic_ϵ start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( italic_n ) italic_n ] end_ARG start_ARG ∂ italic_n end_ARG | start_POSTSUBSCRIPT italic_n ( bold_r , italic_t ) end_POSTSUBSCRIPT , (46)

where ϵxc(n)subscriptitalic-ϵxc𝑛\epsilon_{\mathrm{xc}}(n)italic_ϵ start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( italic_n ) denotes the XC-energy per electron of the homogeneous electron gas of density n𝑛nitalic_n. The ALDA is in fact rather restricted as it only ensures a correct description of the kernel for metals in the long wave length limit. This implies that it cannot account for excitons in extended systems and furthermore it leads to a divergent XC-hole. The latter problem can be resolved by a simple renormalization of the ALDA, that regulates the ontop XC-hole and drastically improves the description of local correlations over the ALDA (and RPA) [37].

VI.1.1 Implementation for periodic systems

In crystalline systems, the susceptibility is periodic with respect to translations on the Bravais lattice, χ(𝐫+𝐑,𝐫+𝐑,ω)=χ(𝐫,𝐫,ω)𝜒𝐫𝐑superscript𝐫𝐑𝜔𝜒𝐫superscript𝐫𝜔\chi(\mathbf{r}+\mathbf{R},\mathbf{r}^{\prime}+\mathbf{R},\omega)=\chi(\mathbf% {r},\mathbf{r}^{\prime},\omega)italic_χ ( bold_r + bold_R , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + bold_R , italic_ω ) = italic_χ ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ). Consequently, the susceptibility can be Fourier-transformed according to

χ𝐆𝐆(𝐪,ω)=d𝐫d𝐫Ωei(𝐆+𝐪)𝐫χ(𝐫,𝐫,ω)ei(𝐆+𝐪)𝐫,subscript𝜒superscript𝐆𝐆𝐪𝜔double-integral𝑑𝐫𝑑superscript𝐫Ωsuperscript𝑒𝑖𝐆𝐪𝐫𝜒𝐫superscript𝐫𝜔superscript𝑒𝑖superscript𝐆𝐪superscript𝐫\chi_{\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega)=\iint\frac{d\mathbf{r}% d\mathbf{r}^{\prime}}{\Omega}e^{-i(\mathbf{G}+\mathbf{q})\cdot\mathbf{r}}\chi(% \mathbf{r},\mathbf{r}^{\prime},\omega)e^{i(\mathbf{G}^{\prime}+\mathbf{q})% \cdot\mathbf{r}^{\prime}},italic_χ start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) = ∬ divide start_ARG italic_d bold_r italic_d bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_ARG start_ARG roman_Ω end_ARG italic_e start_POSTSUPERSCRIPT - italic_i ( bold_G + bold_q ) ⋅ bold_r end_POSTSUPERSCRIPT italic_χ ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) italic_e start_POSTSUPERSCRIPT italic_i ( bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + bold_q ) ⋅ bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT , (47)

translating the Dyson equation (43) into a plane-wave matrix equation, which is diagonal in the wave vector 𝐪𝐪\mathbf{q}bold_q and can be inverted numerically.

By using a plane-wave representation, the crux of the implementation then becomes to calculate the reciprocal-space pair densities

nn𝐤,m𝐤+𝐪(𝐆+𝐪)=ψn𝐤|ei(𝐆+𝐪)𝐫|ψm𝐤+𝐪,subscript𝑛𝑛𝐤𝑚𝐤𝐪𝐆𝐪quantum-operator-productsubscript𝜓𝑛𝐤superscript𝑒𝑖𝐆𝐪𝐫subscript𝜓𝑚𝐤𝐪n_{n\mathbf{k},m\mathbf{k}+\mathbf{q}}(\mathbf{G}+\mathbf{q})=\langle\psi_{n% \mathbf{k}}|e^{-i(\mathbf{G}+\mathbf{q})\cdot\mathbf{r}}|\psi_{m\mathbf{k}+% \mathbf{q}}\rangle,italic_n start_POSTSUBSCRIPT italic_n bold_k , italic_m bold_k + bold_q end_POSTSUBSCRIPT ( bold_G + bold_q ) = ⟨ italic_ψ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT | italic_e start_POSTSUPERSCRIPT - italic_i ( bold_G + bold_q ) ⋅ bold_r end_POSTSUPERSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_m bold_k + bold_q end_POSTSUBSCRIPT ⟩ , (48)

and to Fourier transform the XC-kernel

fLDA(𝐆)=Ωcell𝑑𝐫ei𝐆𝐫2[ϵxc(n)n]n2|n(𝐫).subscript𝑓LDA𝐆evaluated-atsubscriptsubscriptΩcelldifferential-d𝐫superscript𝑒𝑖𝐆𝐫superscript2delimited-[]subscriptitalic-ϵxc𝑛𝑛superscript𝑛2𝑛𝐫f_{\mathrm{LDA}}(\mathbf{G})=\int_{\Omega_{\mathrm{cell}}}d\mathbf{r}\,e^{-i% \mathbf{G}\cdot\mathbf{r}}\left.\frac{\partial^{2}[\epsilon_{\mathrm{xc}}(n)n]% }{\partial n^{2}}\right|_{n(\mathbf{r})}.italic_f start_POSTSUBSCRIPT roman_LDA end_POSTSUBSCRIPT ( bold_G ) = ∫ start_POSTSUBSCRIPT roman_Ω start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_d bold_r italic_e start_POSTSUPERSCRIPT - italic_i bold_G ⋅ bold_r end_POSTSUPERSCRIPT divide start_ARG ∂ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT [ italic_ϵ start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( italic_n ) italic_n ] end_ARG start_ARG ∂ italic_n start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG | start_POSTSUBSCRIPT italic_n ( bold_r ) end_POSTSUBSCRIPT . (49)

Crucially, both can be evaluated by adding a PAW correction to the analogous pseudo quantity, which itself can be evaluated by means of a fast Fourier transform (FFT). Implementational details hereto are reported in Refs. [43] and [36].

The Hartree contribution to the kernel (44) is simply given by the bare Coulomb interaction (here given in atomic units)

vc,𝐆𝐆(𝐪)=4π|𝐆+𝐪|2δ𝐆,𝐆,subscript𝑣csuperscript𝐆𝐆𝐪4𝜋superscript𝐆𝐪2subscript𝛿𝐆superscript𝐆v_{\mathrm{c},\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q})=\frac{4\pi}{|\mathbf{% G}+\mathbf{q}|^{2}}\delta_{\mathbf{G},\mathbf{G}^{\prime}},italic_v start_POSTSUBSCRIPT roman_c , bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q ) = divide start_ARG 4 italic_π end_ARG start_ARG | bold_G + bold_q | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG italic_δ start_POSTSUBSCRIPT bold_G , bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT , (50)

and can be evaluated analytically when 𝐪𝐪\mathbf{q}bold_q is finite. However, in the optical limit, the 𝐆=𝟎𝐆0\mathbf{G}=\mathbf{0}bold_G = bold_0 component diverges and one needs to be careful when inverting the Dyson equation (43). In GPAW, this is handled by expanding the pair densities within kp𝑘𝑝kpitalic_k italic_p-perturbation theory:

ψn𝐤|ei(𝐆+𝐪)𝐫|ψm𝐤+𝐪𝐪𝟎,𝐆=𝟎=i𝐪ψn𝐤||ψm𝐤ϵm𝐤ϵn𝐤.subscriptquantum-operator-productsubscript𝜓𝑛𝐤superscript𝑒𝑖𝐆𝐪𝐫subscript𝜓𝑚𝐤𝐪formulae-sequence𝐪0𝐆0𝑖𝐪quantum-operator-productsubscript𝜓𝑛𝐤bold-∇subscript𝜓𝑚𝐤subscriptitalic-ϵ𝑚𝐤subscriptitalic-ϵ𝑛𝐤\displaystyle\langle\psi_{n\mathbf{k}}|e^{-i(\mathbf{G}+\mathbf{q})\cdot% \mathbf{r}}|\psi_{m\mathbf{k}+\mathbf{q}}\rangle_{\mathbf{q}\rightarrow\mathbf% {0},\mathbf{G}=\mathbf{0}}=-i\mathbf{q}\cdot\frac{\langle\psi_{n\mathbf{k}}|% \boldsymbol{\nabla}|\psi_{m\mathbf{k}}\rangle}{\epsilon_{m\mathbf{k}}-\epsilon% _{n\mathbf{k}}}.⟨ italic_ψ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT | italic_e start_POSTSUPERSCRIPT - italic_i ( bold_G + bold_q ) ⋅ bold_r end_POSTSUPERSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_m bold_k + bold_q end_POSTSUBSCRIPT ⟩ start_POSTSUBSCRIPT bold_q → bold_0 , bold_G = bold_0 end_POSTSUBSCRIPT = - italic_i bold_q ⋅ divide start_ARG ⟨ italic_ψ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT | bold_∇ | italic_ψ start_POSTSUBSCRIPT italic_m bold_k end_POSTSUBSCRIPT ⟩ end_ARG start_ARG italic_ϵ start_POSTSUBSCRIPT italic_m bold_k end_POSTSUBSCRIPT - italic_ϵ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT end_ARG . (51)

In the expansion, the diverging Coulomb term is exactly cancelled by the 𝐪𝐪\mathbf{q}bold_q-dependence of the pair densities, so that the product χ0vcsubscript𝜒0subscript𝑣c\chi_{0}v_{\mathrm{c}}italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_v start_POSTSUBSCRIPT roman_c end_POSTSUBSCRIPT remains finite. For additional details, see Ref. [36].

VI.1.2 Spectral representation

GPAW offers two different ways of dealing with the frequency dependence of the Kohn–Sham susceptibility (42). One is to evaluate the expression explicitly for the frequencies of interest. This is advantageous if one is interested in a few specific frequencies. The other is to evaluate the associated spectral function

S0,𝐆𝐆(𝐪,ω)=subscript𝑆0superscript𝐆𝐆𝐪𝜔absent\displaystyle S_{0,\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega)=italic_S start_POSTSUBSCRIPT 0 , bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) = 2Ω𝐤n,m(fn𝐤fm𝐤+𝐪)2Ωsubscript𝐤subscript𝑛𝑚subscript𝑓𝑛𝐤subscript𝑓𝑚𝐤𝐪\displaystyle\frac{2}{\Omega}\sum_{\mathbf{k}}\sum_{n,m}(f_{n\mathbf{k}}-f_{m% \mathbf{k}+\mathbf{q}})divide start_ARG 2 end_ARG start_ARG roman_Ω end_ARG ∑ start_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_n , italic_m end_POSTSUBSCRIPT ( italic_f start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT - italic_f start_POSTSUBSCRIPT italic_m bold_k + bold_q end_POSTSUBSCRIPT )
×nn𝐤,m𝐤+𝐪(𝐆+𝐪)nm𝐤+𝐪,n𝐤(𝐆𝐪)absentsubscript𝑛𝑛𝐤𝑚𝐤𝐪𝐆𝐪subscript𝑛𝑚𝐤𝐪𝑛𝐤superscript𝐆𝐪\displaystyle\times n_{n\mathbf{k},m\mathbf{k}+\mathbf{q}}(\mathbf{G}+\mathbf{% q})n_{m\mathbf{k}+\mathbf{q},n\mathbf{k}}(-\mathbf{G}^{\prime}-\mathbf{q})× italic_n start_POSTSUBSCRIPT italic_n bold_k , italic_m bold_k + bold_q end_POSTSUBSCRIPT ( bold_G + bold_q ) italic_n start_POSTSUBSCRIPT italic_m bold_k + bold_q , italic_n bold_k end_POSTSUBSCRIPT ( - bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT - bold_q )
×δ(ω[ϵm𝐤+𝐪ϵn𝐤])absent𝛿Planck-constant-over-2-pi𝜔delimited-[]subscriptitalic-ϵ𝑚𝐤𝐪subscriptitalic-ϵ𝑛𝐤\displaystyle\times\delta\left(\hbar\omega-\left[\epsilon_{m\mathbf{k}+\mathbf% {q}}-\epsilon_{n\mathbf{k}}\right]\right)× italic_δ ( roman_ℏ italic_ω - [ italic_ϵ start_POSTSUBSCRIPT italic_m bold_k + bold_q end_POSTSUBSCRIPT - italic_ϵ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ] ) (52)

from which the susceptibility can be obtained via a Hilbert transform,

χ0,𝐆𝐆(𝐪,ω)=limη0+𝑑ωS0,𝐆𝐆(𝐪,ω)ωω+iη.subscript𝜒0superscript𝐆𝐆𝐪𝜔subscript𝜂superscript0superscriptsubscriptdifferential-dsuperscript𝜔subscript𝑆0superscript𝐆𝐆𝐪superscript𝜔superscript𝜔𝜔𝑖𝜂\displaystyle\chi_{0,\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega)=\lim_{% \eta\rightarrow 0^{+}}\int_{-\infty}^{\infty}d\omega^{\prime}\,\frac{S_{0,% \mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega^{\prime})}{\omega^{\prime}-% \omega+i\eta}.italic_χ start_POSTSUBSCRIPT 0 , bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) = roman_lim start_POSTSUBSCRIPT italic_η → 0 start_POSTSUPERSCRIPT + end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ∫ start_POSTSUBSCRIPT - ∞ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∞ end_POSTSUPERSCRIPT italic_d italic_ω start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT divide start_ARG italic_S start_POSTSUBSCRIPT 0 , bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) end_ARG start_ARG italic_ω start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT - italic_ω + italic_i italic_η end_ARG . (53)

To converge the Hilbert transform, the spectral function is evaluated on a nonlinear frequency grid spanning the range of eigenenergy differences included in Eq. (52). Although the calculation becomes more memory-intensive as a result, it is usually faster to compute χ0subscript𝜒0\chi_{0}italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT via its spectral function. Furthermore, since S0subscript𝑆0S_{0}italic_S start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is linearly interpolatable, the tetrahedron method can be employed to improve the convergence with respect to 𝐤𝐤\mathbf{k}bold_k-points.

VI.2 Dielectric function

The longitudinal part of the dielectric tensor is related to the susceptibility χ𝜒\chiitalic_χ as

ε𝐆𝐆1(𝐪,ω)=δ𝐆𝐆+vc,𝐆𝐆(𝐪)χ𝐆𝐆(𝐪,ω).subscriptsuperscript𝜀1superscript𝐆𝐆𝐪𝜔subscript𝛿superscript𝐆𝐆subscript𝑣𝑐superscript𝐆𝐆𝐪subscript𝜒superscript𝐆𝐆𝐪𝜔\displaystyle\varepsilon^{-1}_{\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},% \omega)=\delta_{\mathbf{G}\mathbf{G}^{\prime}}+v_{c,\mathbf{G}\mathbf{G}^{% \prime}}(\mathbf{q})\chi_{\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega).italic_ε start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) = italic_δ start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT + italic_v start_POSTSUBSCRIPT italic_c , bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q ) italic_χ start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) . (54)

From the dielectric matrix, the macroscopic dielectric function, including local field corrections, is given by

εM(𝐪,ω)=1ε001(𝐪,ω)subscript𝜀𝑀𝐪𝜔1subscriptsuperscript𝜀100𝐪𝜔\displaystyle\varepsilon_{M}(\mathbf{q},\omega)=\frac{1}{\varepsilon^{-1}_{00}% (\mathbf{q},\omega)}italic_ε start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT ( bold_q , italic_ω ) = divide start_ARG 1 end_ARG start_ARG italic_ε start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 00 end_POSTSUBSCRIPT ( bold_q , italic_ω ) end_ARG (55)

from which it is straightforward to extract the optical absorption spectrum

ABS=ImεM(𝐪0,ω)ABSImsubscript𝜀𝑀𝐪0𝜔\displaystyle\mathrm{ABS}=\mathrm{Im}\>\varepsilon_{M}(\mathbf{q}\rightarrow 0% ,\omega)roman_ABS = roman_Im italic_ε start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT ( bold_q → 0 , italic_ω ) (56)

as well as the electron energy-loss spectrum

EELS=Im1εM(𝐪,ω).EELSIm1subscript𝜀𝑀𝐪𝜔\displaystyle\mathrm{EELS}=-\mathrm{Im}\>\frac{1}{\varepsilon_{M}(\mathbf{q},% \omega)}.roman_EELS = - roman_Im divide start_ARG 1 end_ARG start_ARG italic_ε start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT ( bold_q , italic_ω ) end_ARG . (57)

It is also possible to define a symmetrized version of the dielectric matrix as

ε~𝐆𝐆(𝐪,ω)=v𝐆1/2(𝐪)ε𝐆𝐆(ω,𝐪)v𝐆1/2(𝐪).subscript~𝜀superscript𝐆𝐆𝐪𝜔subscriptsuperscript𝑣12𝐆𝐪subscript𝜀superscript𝐆𝐆𝜔𝐪subscriptsuperscript𝑣12superscript𝐆𝐪\displaystyle\tilde{\varepsilon}_{\mathbf{GG}^{\prime}}(\mathbf{q},\omega)=v^{% -1/2}_{\mathbf{G}}(\mathbf{q})\varepsilon_{\mathbf{GG}^{\prime}}(\omega,% \mathbf{q})v^{1/2}_{\mathbf{G}^{\prime}}(\mathbf{q}).over~ start_ARG italic_ε end_ARG start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) = italic_v start_POSTSUPERSCRIPT - 1 / 2 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_G end_POSTSUBSCRIPT ( bold_q ) italic_ε start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_ω , bold_q ) italic_v start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q ) . (58)

The susceptibility can be evaluated at the RPA level (by setting Vxcsubscript𝑉xcV_{\text{xc}}italic_V start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT in Eq. 43 to zero) or using one of the XC-kernels implemented in GPAW such as the the local ALDA, the non-local rALDA [37], or the bootstrap kernel [204].

The evaluation χ0subscript𝜒0\chi_{0}italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is computationally demanding since it involves an integration over the Brillouin zone (BZ) as well as a summation over occupied and unoccupied states. The 𝐤𝐤\mathbf{k}bold_k-point convergence can be increased substantially with the tetrahedron method [205]. Contrary to the simple point integration, where the δ𝛿\deltaitalic_δ-function in Eq. 52 is replaced by a smeared-out Lorentzian, the tetrahedron method utilizes linear interpolation of the eigenvalues and matrix elements.

In Fig. 6 we compare the dielectric function computed using the two different integration methods for two prototypical cases: (semiconducting) Si and (metallic) Ag. Since Si is semiconducting there are no low-energy excitations and consequently the imaginary part of the dielectric function is zero while the real part is flat for low frequencies. The point integration and tetrahedron integration yield the same value for ω0𝜔0\omega\rightarrow 0italic_ω → 0, but the tetrahedron integration avoids the unphysical oscillations of ε𝜀\varepsilonitalic_ε at higher frequencies, exhibited by the point integration due to the finite 𝐤𝐤\mathbf{k}bold_k-point sampling. For metals, the 𝐤𝐤\mathbf{k}bold_k-point convergence is even slower and the difference between the point integration and tetrahedron integration is thus even more pronounced for Ag. By increasing the 𝐤𝐤\mathbf{k}bold_k-point sampling, the point integration results will eventually approach the results obtained with the tetrahedron method, but at a much higher computational cost.

Refer to caption
Figure 6: Real and imaginary parts of the dielectric function for Ag (solid) and Si (dashed) using the tetrahedron and point integration methods.

VI.2.1 Screening in low-dimensional systems

In a three dimensional (3D) bulk crystal, the macroscopic dielectric function is related to the macroscopic polarizability αMsubscript𝛼𝑀\alpha_{M}italic_α start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT of the material as

εM(𝐪,ω)=1+4παM(𝐪,ω).subscript𝜀𝑀𝐪𝜔14𝜋subscript𝛼𝑀𝐪𝜔\displaystyle\varepsilon_{M}(\mathbf{q},\omega)=1+4\pi\alpha_{M}(\mathbf{q},% \omega).italic_ε start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT ( bold_q , italic_ω ) = 1 + 4 italic_π italic_α start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT ( bold_q , italic_ω ) . (59)

Since εMsubscript𝜀𝑀\varepsilon_{M}italic_ε start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT is related to the macroscopic average of the induced potential, it will depend on the unit cell in low-dimensional systems and tend to unity when increasing the cell in the non-periodic direction. In contrast, it is straighforward to generalize the definition of the polarizability to such that it measures the induced dipole moment per length or area rather than volume. The d𝑑ditalic_d-dimensional polarizability is thus defined as αMd=ΩdαMsuperscriptsubscript𝛼𝑀𝑑superscriptΩ𝑑subscript𝛼𝑀\alpha_{M}^{d}=\Omega^{d}\alpha_{M}italic_α start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT = roman_Ω start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT italic_α start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT where ΩdsuperscriptΩ𝑑\Omega^{d}roman_Ω start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT is the cell volume with the periodic directions projected out. For example, for a 2D material ΩdsuperscriptΩ𝑑\Omega^{d}roman_Ω start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT is simply the length of the unit cell in the non-periodic direction. To improve convergence with respect to the size of the unit cell, the Coulomb kernel is truncated using the reciprocal-space method introduced in Ref. [206]. This enables efficient calculations of dielectric properties of low-dimensional materials materials [207, 208]. This does, however, imply that the polarizability cannot be evaluated directly from the dielectric constant (which is just one), but one may obtain it directly from the susceptibility as

αM=lim𝐪0Ωdq2χ00(𝐪).subscript𝛼𝑀subscript𝐪0superscriptΩ𝑑superscript𝑞2subscript𝜒00𝐪\displaystyle\alpha_{M}=-\lim\limits_{\mathbf{q}\to 0}\frac{\Omega^{d}}{q^{2}}% \chi_{00}(\mathbf{q}).italic_α start_POSTSUBSCRIPT italic_M end_POSTSUBSCRIPT = - roman_lim start_POSTSUBSCRIPT bold_q → 0 end_POSTSUBSCRIPT divide start_ARG roman_Ω start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT end_ARG start_ARG italic_q start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG italic_χ start_POSTSUBSCRIPT 00 end_POSTSUBSCRIPT ( bold_q ) . (60)

VI.3 Adiabatic-connection fluctuation-dissipation theorem

The adiabatic-connection fluctuation-dissipation theorem (ACFDT) is a highly promising approach for constructing accurate correlation functionals with non-local characteristics. Unlike regular XC-functionals, the ACFDT correlation functionals do not rely on error cancellation between exchange and correlation. Instead, the ACFDT provides an exact theory for the electronic correlation energy Ecsubscript𝐸cE_{\text{c}}italic_E start_POSTSUBSCRIPT c end_POSTSUBSCRIPT in terms of the interacting electronic suseptibility, which can be combined with the exact exchange:

Ec=0dω2π01dλTr[vcχλ(w)vcχKS(w)].subscript𝐸csuperscriptsubscript0d𝜔2𝜋superscriptsubscript01differential-d𝜆Trdelimited-[]subscript𝑣csuperscript𝜒𝜆𝑤subscript𝑣csuperscript𝜒KS𝑤E_{\text{c}}=-\int_{0}^{\infty}\frac{\mathrm{d}\omega}{2\pi}\int_{0}^{1}% \mathrm{d}\lambda\mathrm{Tr}\left[v_{\text{c}}\chi^{\lambda}\left(w\right)-v_{% \text{c}}\chi^{\text{KS}}(w)\right].italic_E start_POSTSUBSCRIPT c end_POSTSUBSCRIPT = - ∫ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∞ end_POSTSUPERSCRIPT divide start_ARG roman_d italic_ω end_ARG start_ARG 2 italic_π end_ARG ∫ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT roman_d italic_λ roman_Tr [ italic_v start_POSTSUBSCRIPT c end_POSTSUBSCRIPT italic_χ start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT ( italic_w ) - italic_v start_POSTSUBSCRIPT c end_POSTSUBSCRIPT italic_χ start_POSTSUPERSCRIPT KS end_POSTSUPERSCRIPT ( italic_w ) ] . (61)

The response function can be expressed in terms of the Kohn–Sham response function and the exchange–correlation kernel fxcsubscript𝑓xcf_{\text{xc}}italic_f start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT

χλ(ω)=χKS(ω)+χKS(ω)[λvc+fxc(ω)]χλ(ω).superscript𝜒𝜆𝜔superscript𝜒KS𝜔superscript𝜒KS𝜔delimited-[]𝜆subscript𝑣𝑐subscript𝑓xc𝜔superscript𝜒𝜆𝜔\chi^{\lambda}(\omega)=\chi^{\text{KS}}(\omega)+\chi^{\text{KS}}(\omega)\left[% \lambda v_{c}+f_{\text{xc}}(\omega)\right]\chi^{\lambda}(\omega).italic_χ start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT ( italic_ω ) = italic_χ start_POSTSUPERSCRIPT KS end_POSTSUPERSCRIPT ( italic_ω ) + italic_χ start_POSTSUPERSCRIPT KS end_POSTSUPERSCRIPT ( italic_ω ) [ italic_λ italic_v start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT + italic_f start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT ( italic_ω ) ] italic_χ start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT ( italic_ω ) . (62)

The random phase approximation (RPA) can be derived from ACFDT if the XC-kernel fxcsubscript𝑓xcf_{\text{xc}}italic_f start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT is neglected. RPA has the strength of capturing non-local correlation effects and provides high accuracy across different bonding types including van der Waals interaction [209, 210, 29, 211].

Simple exchange–correlation kernels can also be incorporated into the response function, such as the adiabatic LDA (ALDA) kernel. However, the locality of adiabatic kernels leads to divergent characteristics of the pair-correlation function [212]. This issue can be overcome by a renormalization (r) scheme [37], which is implemented in GPAW as rALDA. This class of renormalized kernels provides a significantly better description of the short-range correlations and hence also yield highly accurate total correlation energies [213, 214, 215, 216].

VI.4 Magnetic response

The LR-TDDFT framework described in Sec. VI.1 can be generalized to include spin degrees of freedom [43, 217]. Using the four-component density as the basic variable, nμ(𝐫)superscript𝑛𝜇𝐫n^{\mu}(\mathbf{r})italic_n start_POSTSUPERSCRIPT italic_μ end_POSTSUPERSCRIPT ( bold_r ) (where μ{0,x,y,z}𝜇0𝑥𝑦𝑧\mu\in\{0,x,y,z\}italic_μ ∈ { 0 , italic_x , italic_y , italic_z }), one can define the four-component susceptibility tensor:

χμν(𝐫,𝐫,tt)=iθ(tt)[n^0μ(𝐫,t),n^0ν(𝐫,t)]0.superscript𝜒𝜇𝜈𝐫superscript𝐫𝑡superscript𝑡𝑖Planck-constant-over-2-pi𝜃𝑡superscript𝑡subscriptdelimited-⟨⟩subscriptsuperscript^𝑛𝜇0𝐫𝑡subscriptsuperscript^𝑛𝜈0superscript𝐫superscript𝑡0\chi^{\mu\nu}(\mathbf{r},\mathbf{r}^{\prime},t-t^{\prime})=-\frac{i}{\hbar}% \theta(t-t^{\prime})\langle\left[\hat{n}^{\mu}_{0}(\mathbf{r},t),\hat{n}^{\nu}% _{0}(\mathbf{r}^{\prime},t^{\prime})\right]\rangle_{0}.italic_χ start_POSTSUPERSCRIPT italic_μ italic_ν end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = - divide start_ARG italic_i end_ARG start_ARG roman_ℏ end_ARG italic_θ ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ⟨ [ over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_μ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r , italic_t ) , over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ] ⟩ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT . (63)

In a similar fashion to Eq. (43), the many-body χμνsuperscript𝜒𝜇𝜈\chi^{\mu\nu}italic_χ start_POSTSUPERSCRIPT italic_μ italic_ν end_POSTSUPERSCRIPT can be calculated from the corresponding susceptibility tensor of the Kohn–Sham system, χKSμνsubscriptsuperscript𝜒𝜇𝜈KS\chi^{\mu\nu}_{\mathrm{KS}}italic_χ start_POSTSUPERSCRIPT italic_μ italic_ν end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT. In the most general case, the Dyson equation for χμνsuperscript𝜒𝜇𝜈\chi^{\mu\nu}italic_χ start_POSTSUPERSCRIPT italic_μ italic_ν end_POSTSUPERSCRIPT is a matrix equation in the μ𝜇\muitalic_μ and ν𝜈\nuitalic_ν indices, explicitly coupling the charge and spin degrees of freedom. However, for collinear magnetic systems, the transverse components of the susceptibility decouple from the rest in the absence of spin–orbit coupling.

VI.4.1 Transverse magnetic susceptibility

Taking the spins to be polarized along the z𝑧zitalic_z-direction, the transverse magnetic susceptibility of collinear nonrelativistic systems may be expressed in terms of the spin-raising and spin-lowering density operators n^+(𝐫)=(n^x(𝐫)+in^y(𝐫))/2=ψ^(𝐫)ψ^(𝐫)superscript^𝑛𝐫superscript^𝑛𝑥𝐫𝑖superscript^𝑛𝑦𝐫2subscriptsuperscript^𝜓𝐫subscript^𝜓𝐫\hat{n}^{+}(\mathbf{r})=(\hat{n}^{x}(\mathbf{r})+i\hat{n}^{y}(\mathbf{r}))/2=% \hat{\psi}^{\dagger}_{\uparrow}(\mathbf{r})\hat{\psi}_{\downarrow}(\mathbf{r})over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT + end_POSTSUPERSCRIPT ( bold_r ) = ( over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_x end_POSTSUPERSCRIPT ( bold_r ) + italic_i over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_y end_POSTSUPERSCRIPT ( bold_r ) ) / 2 = over^ start_ARG italic_ψ end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT start_POSTSUBSCRIPT ↑ end_POSTSUBSCRIPT ( bold_r ) over^ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT ↓ end_POSTSUBSCRIPT ( bold_r ) and n^(𝐫)=(n^x(𝐫)in^y(𝐫))/2=ψ^(𝐫)ψ^(𝐫)superscript^𝑛𝐫superscript^𝑛𝑥𝐫𝑖superscript^𝑛𝑦𝐫2subscriptsuperscript^𝜓𝐫subscript^𝜓𝐫\hat{n}^{-}(\mathbf{r})=(\hat{n}^{x}(\mathbf{r})-i\hat{n}^{y}(\mathbf{r}))/2=% \hat{\psi}^{\dagger}_{\downarrow}(\mathbf{r})\hat{\psi}_{\uparrow}(\mathbf{r})over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT - end_POSTSUPERSCRIPT ( bold_r ) = ( over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_x end_POSTSUPERSCRIPT ( bold_r ) - italic_i over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT italic_y end_POSTSUPERSCRIPT ( bold_r ) ) / 2 = over^ start_ARG italic_ψ end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT start_POSTSUBSCRIPT ↓ end_POSTSUBSCRIPT ( bold_r ) over^ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT ↑ end_POSTSUBSCRIPT ( bold_r ). In the ALDA, the Dyson equation for χ+superscript𝜒absent\chi^{+-}italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT then becomes a scalar one [43],

χ+(𝐫,𝐫,ω)=superscript𝜒absent𝐫superscript𝐫𝜔absent\displaystyle\chi^{+-}(\mathbf{r},\mathbf{r}^{\prime},\omega)=italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) = χKS+(𝐫,𝐫,ω)+d𝐫1subscriptsuperscript𝜒absentKS𝐫superscript𝐫𝜔differential-dsubscript𝐫1\displaystyle\chi^{+-}_{\mathrm{KS}}(\mathbf{r},\mathbf{r}^{\prime},\omega)+% \int\mathrm{d}\mathbf{r}_{1}italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) + ∫ roman_d bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT
×χKS+(𝐫,𝐫1,ω)fLDA+(𝐫1)χ+(𝐫1,𝐫,ω),absentsubscriptsuperscript𝜒absentKS𝐫subscript𝐫1𝜔subscriptsuperscript𝑓absentLDAsubscript𝐫1superscript𝜒absentsubscript𝐫1superscript𝐫𝜔\displaystyle\times\chi^{+-}_{\mathrm{KS}}(\mathbf{r},\mathbf{r}_{1},\omega)f^% {-+}_{\mathrm{LDA}}(\mathbf{r}_{1})\chi^{+-}(\mathbf{r}_{1},\mathbf{r}^{\prime% },\omega),× italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω ) italic_f start_POSTSUPERSCRIPT - + end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_LDA end_POSTSUBSCRIPT ( bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) , (64)

where the transverse XC-kernel is given by fLDA+=2WLDA(𝐫)/nz(𝐫)subscriptsuperscript𝑓absentLDA2subscript𝑊LDA𝐫superscript𝑛𝑧𝐫f^{-+}_{\mathrm{LDA}}=2W_{\mathrm{LDA}}(\mathbf{r})/n^{z}(\mathbf{r})italic_f start_POSTSUPERSCRIPT - + end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_LDA end_POSTSUBSCRIPT = 2 italic_W start_POSTSUBSCRIPT roman_LDA end_POSTSUBSCRIPT ( bold_r ) / italic_n start_POSTSUPERSCRIPT italic_z end_POSTSUPERSCRIPT ( bold_r ). The susceptibilities χ+superscript𝜒absent\chi^{+-}italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT and χKS+subscriptsuperscript𝜒absentKS\chi^{+-}_{\mathrm{KS}}italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT are themselves defined via the Kubo formula (63), where the latter can be evaluated explicitly in complete analogy to Eq. (42):

χKS+(𝐫,𝐫,ω)=subscriptsuperscript𝜒absentKS𝐫superscript𝐫𝜔absent\displaystyle\chi^{+-}_{\mathrm{KS}}(\mathbf{r},\mathbf{r}^{\prime},\omega)=italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) = limη0+n𝐤m𝐤(fn𝐤fm𝐤)subscript𝜂superscript0subscript𝑛𝐤subscript𝑚superscript𝐤subscript𝑓𝑛𝐤absentsubscript𝑓𝑚superscript𝐤absent\displaystyle\lim_{\eta\rightarrow 0^{+}}\sum_{n\mathbf{k}}\sum_{m\mathbf{k}^{% \prime}}\left(f_{n\mathbf{k}\uparrow}-f_{m\mathbf{k}^{\prime}\downarrow}\right)roman_lim start_POSTSUBSCRIPT italic_η → 0 start_POSTSUPERSCRIPT + end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_f start_POSTSUBSCRIPT italic_n bold_k ↑ end_POSTSUBSCRIPT - italic_f start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ↓ end_POSTSUBSCRIPT )
×ψn𝐤(𝐫)ψm𝐤(𝐫)ψm𝐤(𝐫)ψn𝐤(𝐫)ω(ϵm𝐤ϵn𝐤)+iη.absentsubscriptsuperscript𝜓𝑛𝐤absent𝐫subscript𝜓𝑚superscript𝐤absent𝐫subscriptsuperscript𝜓𝑚superscript𝐤absentsuperscript𝐫subscript𝜓𝑛𝐤absentsuperscript𝐫Planck-constant-over-2-pi𝜔subscriptitalic-ϵ𝑚superscript𝐤absentsubscriptitalic-ϵ𝑛𝐤absent𝑖Planck-constant-over-2-pi𝜂\displaystyle\times\frac{\psi^{*}_{n\mathbf{k}\uparrow}(\mathbf{r})\psi_{m% \mathbf{k}^{\prime}\downarrow}(\mathbf{r})\psi^{*}_{m\mathbf{k}^{\prime}% \downarrow}(\mathbf{r}^{\prime})\psi_{n\mathbf{k}\uparrow}(\mathbf{r}^{\prime}% )}{\hbar\omega-(\epsilon_{m\mathbf{k}^{\prime}\downarrow}-\epsilon_{n\mathbf{k% }\uparrow})+i\hbar\eta}.× divide start_ARG italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n bold_k ↑ end_POSTSUBSCRIPT ( bold_r ) italic_ψ start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ↓ end_POSTSUBSCRIPT ( bold_r ) italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ↓ end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_ψ start_POSTSUBSCRIPT italic_n bold_k ↑ end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) end_ARG start_ARG roman_ℏ italic_ω - ( italic_ϵ start_POSTSUBSCRIPT italic_m bold_k start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ↓ end_POSTSUBSCRIPT - italic_ϵ start_POSTSUBSCRIPT italic_n bold_k ↑ end_POSTSUBSCRIPT ) + italic_i roman_ℏ italic_η end_ARG . (65)

In GPAW, the transverse magnetic susceptibility is calculated using a plane-wave basis as described in Sec. VI.1.1, with the notable exception that no special care is needed to treat the optical limit, since the Hartree kernel plays no role in the Dyson equation (64). In terms of the temporal representation, it is at the time of this writing only possible to do a literal evaluation of Eq. (65) at the frequencies of interest. For metals, this means that η𝜂\etaitalic_η has to be left as a finite broadening parameter, which has to be carefully chosen depending on the 𝐤𝐤\mathbf{k}bold_k-point sampling, see [43].

VI.4.2 The spectrum of transverse magnetic excitations

Based on the transverse magnetic susceptibility, one may calculate the corresponding spectral function [43]

S+(𝐫,𝐫,ω)superscript𝑆absent𝐫superscript𝐫𝜔\displaystyle S^{+-}(\mathbf{r},\mathbf{r}^{\prime},\omega)italic_S start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) =12πi[χ+(𝐫,𝐫,ω)χ+(𝐫,𝐫,ω)],absent12𝜋𝑖delimited-[]superscript𝜒absent𝐫superscript𝐫𝜔superscript𝜒absentsuperscript𝐫𝐫𝜔\displaystyle=-\frac{1}{2\pi i}\left[\chi^{+-}(\mathbf{r},\mathbf{r}^{\prime},% \omega)-\chi^{-+}(\mathbf{r}^{\prime},\mathbf{r},-\omega)\right],= - divide start_ARG 1 end_ARG start_ARG 2 italic_π italic_i end_ARG [ italic_χ start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) - italic_χ start_POSTSUPERSCRIPT - + end_POSTSUPERSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , bold_r , - italic_ω ) ] , (66)

which directly governs the energy dissipation in a collinear magnet relating to induced changes in the spin projection along the z𝑧zitalic_z-axis Szsubscript𝑆𝑧S_{z}italic_S start_POSTSUBSCRIPT italic_z end_POSTSUBSCRIPT. In particular, one can decompose the spectrum into contributions from majority and minority spin excitations, S+(𝐫,𝐫,ω)=A+(𝐫,𝐫,ω)A+(𝐫,𝐫,ω)superscript𝑆absent𝐫superscript𝐫𝜔superscript𝐴absent𝐫superscript𝐫𝜔superscript𝐴absentsuperscript𝐫𝐫𝜔S^{+-}(\mathbf{r},\mathbf{r}^{\prime},\omega)=A^{+-}(\mathbf{r},\mathbf{r}^{% \prime},\omega)-A^{-+}(\mathbf{r}^{\prime},\mathbf{r},-\omega)italic_S start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) = italic_A start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) - italic_A start_POSTSUPERSCRIPT - + end_POSTSUPERSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , bold_r , - italic_ω ), that is, into spectral functions for the excited states where Szsubscript𝑆𝑧S_{z}italic_S start_POSTSUBSCRIPT italic_z end_POSTSUBSCRIPT has been lowered or raised by one unit of spin angular momentum respectively:

A+(𝐫,𝐫,ω)=α>0superscript𝐴absent𝐫superscript𝐫𝜔subscript𝛼0\displaystyle A^{+-}(\mathbf{r},\mathbf{r}^{\prime},\omega)=\sum_{\alpha>0}italic_A start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_ω ) = ∑ start_POSTSUBSCRIPT italic_α > 0 end_POSTSUBSCRIPT 0|n^+(𝐫)|αα|n^(𝐫)|0quantum-operator-product0superscript^𝑛𝐫𝛼quantum-operator-product𝛼superscript^𝑛superscript𝐫0\displaystyle\langle 0|\hat{n}^{+}(\mathbf{r})|\alpha\rangle\langle\alpha|\hat% {n}^{-}(\mathbf{r}^{\prime})|0\rangle⟨ 0 | over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT + end_POSTSUPERSCRIPT ( bold_r ) | italic_α ⟩ ⟨ italic_α | over^ start_ARG italic_n end_ARG start_POSTSUPERSCRIPT - end_POSTSUPERSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) | 0 ⟩
×δ(ω[EαE0]).absent𝛿Planck-constant-over-2-pi𝜔delimited-[]subscript𝐸𝛼subscript𝐸0\displaystyle\times\delta\left(\hbar\omega-\left[E_{\alpha}-E_{0}\right]\right).× italic_δ ( roman_ℏ italic_ω - [ italic_E start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT - italic_E start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ] ) . (67)

Here, α𝛼\alphaitalic_α iterates the system eigenstates with α=0𝛼0\alpha=0italic_α = 0 denoting the ground state.

Refer to caption
Figure 7: Spectrum of transverse magnetic excitations for ferromagnetic hcp-Co evaluated at 𝐪=5𝐪M/6𝐪5subscript𝐪M6\mathbf{q}=5\mathbf{q}_{\mathrm{M}}/6bold_q = 5 bold_q start_POSTSUBSCRIPT roman_M end_POSTSUBSCRIPT / 6. The spectrum was calculated using 8 empty-shell bands per atom, a plane-wave cutoff of 800 eV, a (60,60,36)606036(60,60,36)( 60 , 60 , 36 ) 𝐤𝐤\mathbf{k}bold_k-point mesh and a spectral broadening of η=50𝜂50\eta=50italic_η = 50 meV. In the upper panel, the spectrum diagonal is depicted for the 1st and 2nd Brillouin zone out of the hexagonal plane, from which the acoustic and optical magnon frequencies can be respectively extracted. In the lower panel, the spectrum of majority excitations is shown. The full spectral weight A(ω)𝐴𝜔A(\omega)italic_A ( italic_ω ) is calculated as the sum of all positive eigenvalues of S+superscript𝑆absentS^{+-}italic_S start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT, the acoustic and optical mode lineshapes a0(ω)subscript𝑎0𝜔a_{0}(\omega)italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_ω ) and a1(ω)subscript𝑎1𝜔a_{1}(\omega)italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( italic_ω ) are obtained via the two largest eigenvalues (which are significantly larger than the rest) and the Stoner spectrum is extracted as the difference AS(ω)=A(ω)a0(ω)a1(ω)subscript𝐴S𝜔𝐴𝜔subscript𝑎0𝜔subscript𝑎1𝜔A_{\mathrm{S}}(\omega)=A(\omega)-a_{0}(\omega)-a_{1}(\omega)italic_A start_POSTSUBSCRIPT roman_S end_POSTSUBSCRIPT ( italic_ω ) = italic_A ( italic_ω ) - italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_ω ) - italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( italic_ω ).

For collinear magnetic systems, the spectrum S+superscript𝑆absentS^{+-}italic_S start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT is composed of two types of excitations: collective spin-wave excitations (referred to as magnons) and excitations in the Stoner-pair continuum (electron–hole pairs of opposite spin). Since GPAW employs a plane-wave representation of the spectrum, S𝐆𝐆+(𝐪,ω)subscriptsuperscript𝑆absentsuperscript𝐆𝐆𝐪𝜔S^{+-}_{\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega)italic_S start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ), one can directly compare the calculational output to the inelastic neutron scattering cross-section measured in experiments [218]. In particular, one can extract the magnon dispersion directly by identifying the position of the peaks in the spectrum diagonal, see Fig. 7. In this way, GPAW allows the user to study various magnon phenomena in magnetic systems of arbitrary collinear order, such as nonanalytic dispersion effects in itinerant ferromagnets [43], correlation-driven magnetic phase transitions [219] and emergence of distinct collective modes inside the Stoner continuum of an antiferromagnet [220].

Additionally, one can analyze the spectrum more intricately by extracting the majority and minority eigenmodes from S+superscript𝑆absentS^{+-}italic_S start_POSTSUPERSCRIPT + - end_POSTSUPERSCRIPT as the positive and negative eigenvalues respectively. Contrary to analysis of the plane-wave diagonal, this makes it possible to completely separate the analysis of each individual magnon lineshape as well as the many-body Stoner continuum, see Fig. 7.

VI.4.3 Liechtenstein MFT

Not only can the transverse magnetic susceptibility be used to study magnetic excitations in a literal sense, but one can also use it to map the spin-degrees of freedom to a classical Heisenberg model,

EH=12i,ja,bJijab𝐮ia𝐮jb,subscript𝐸H12subscript𝑖𝑗subscript𝑎𝑏superscriptsubscript𝐽𝑖𝑗𝑎𝑏subscript𝐮𝑖𝑎subscript𝐮𝑗𝑏E_{\mathrm{H}}=-\frac{1}{2}\sum_{i,j}\sum_{a,b}J_{ij}^{ab}\,\mathbf{u}_{ia}% \cdot\mathbf{u}_{jb},italic_E start_POSTSUBSCRIPT roman_H end_POSTSUBSCRIPT = - divide start_ARG 1 end_ARG start_ARG 2 end_ARG ∑ start_POSTSUBSCRIPT italic_i , italic_j end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_a , italic_b end_POSTSUBSCRIPT italic_J start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a italic_b end_POSTSUPERSCRIPT bold_u start_POSTSUBSCRIPT italic_i italic_a end_POSTSUBSCRIPT ⋅ bold_u start_POSTSUBSCRIPT italic_j italic_b end_POSTSUBSCRIPT , (68)

where i,j𝑖𝑗i,jitalic_i , italic_j and a,b𝑎𝑏a,bitalic_a , italic_b denote the indices of the Bravais lattice and the magnetic sublattice, respectively, 𝐮iasubscript𝐮𝑖𝑎\mathbf{u}_{ia}bold_u start_POSTSUBSCRIPT italic_i italic_a end_POSTSUBSCRIPT being the direction of spin-polarization of the given magnetic site. Based on the magnetic force theorem (MFT), the LSDA Heisenberg exchange parameters Jijabsuperscriptsubscript𝐽𝑖𝑗𝑎𝑏J_{ij}^{ab}italic_J start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a italic_b end_POSTSUPERSCRIPT can be calculated from the reactive part of the static Kohn–Sham susceptibility [42] and the effective magnetic field Bxc(𝐫)=δExc/δm(𝐫)subscript𝐵xc𝐫𝛿subscript𝐸xc𝛿𝑚𝐫B_{\mathrm{xc}}(\mathbf{r})=\delta E_{\mathrm{xc}}/\delta m(\mathbf{r})italic_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r ) = italic_δ italic_E start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT / italic_δ italic_m ( bold_r ), using the well-known Liechtenstein MFT formula [187]:

Jijab=2Ωiad𝐫Ωjbd𝐫Bxc(𝐫)χKS+(𝐫,𝐫)Bxc(𝐫).superscriptsubscript𝐽𝑖𝑗𝑎𝑏2subscriptsubscriptΩ𝑖𝑎differential-d𝐫subscriptsubscriptΩ𝑗𝑏differential-dsuperscript𝐫subscript𝐵xc𝐫subscriptsuperscript𝜒absentKS𝐫superscript𝐫subscript𝐵xcsuperscript𝐫J_{ij}^{ab}=-2\int_{\Omega_{ia}}\mathrm{d}\mathbf{r}\int_{\Omega_{jb}}\mathrm{% d}\mathbf{r}^{\prime}\,B_{\mathrm{xc}}(\mathbf{r})\chi^{\prime+-}_{\mathrm{KS}% }(\mathbf{r},\mathbf{r}^{\prime})B_{\mathrm{xc}}(\mathbf{r}^{\prime}).italic_J start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a italic_b end_POSTSUPERSCRIPT = - 2 ∫ start_POSTSUBSCRIPT roman_Ω start_POSTSUBSCRIPT italic_i italic_a end_POSTSUBSCRIPT end_POSTSUBSCRIPT roman_d bold_r ∫ start_POSTSUBSCRIPT roman_Ω start_POSTSUBSCRIPT italic_j italic_b end_POSTSUBSCRIPT end_POSTSUBSCRIPT roman_d bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r ) italic_χ start_POSTSUPERSCRIPT ′ + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT ( bold_r , bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) . (69)

Here ΩiasubscriptΩ𝑖𝑎\Omega_{ia}roman_Ω start_POSTSUBSCRIPT italic_i italic_a end_POSTSUBSCRIPT denotes the site volume, which effectively defines the Heisenberg model (68).

Using GPAW’s plane-wave representation of χKS+subscriptsuperscript𝜒absentKS\chi^{\prime+-}_{\mathrm{KS}}italic_χ start_POSTSUPERSCRIPT ′ + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT, one can directly compute the lattice Fourier-transformed exchange parameters [42],

J¯ab(𝐪)superscript¯𝐽𝑎𝑏𝐪\displaystyle\bar{J}^{ab}(\mathbf{q})over¯ start_ARG italic_J end_ARG start_POSTSUPERSCRIPT italic_a italic_b end_POSTSUPERSCRIPT ( bold_q ) =iJ0iabei𝐪𝐑iabsentsubscript𝑖superscriptsubscript𝐽0𝑖𝑎𝑏superscript𝑒𝑖𝐪subscript𝐑𝑖\displaystyle=\sum_{i}J_{0i}^{ab}e^{i\mathbf{q}\cdot\mathbf{R}_{i}}= ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_J start_POSTSUBSCRIPT 0 italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a italic_b end_POSTSUPERSCRIPT italic_e start_POSTSUPERSCRIPT italic_i bold_q ⋅ bold_R start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT (70a)
=2ΩcellBxcKa(𝐪)χKS+(𝐪)Kb(𝐪)Bxc,absent2subscriptΩcellsuperscriptsubscript𝐵xcsuperscript𝐾𝑎𝐪subscriptsuperscript𝜒absentKS𝐪superscript𝐾𝑏𝐪subscript𝐵xc\displaystyle=-\frac{2}{\Omega_{\mathrm{cell}}}B_{\mathrm{xc}}^{\dagger}K^{a% \dagger}(\mathbf{q})\chi^{\prime+-}_{\mathrm{KS}}(\mathbf{q})K^{b}(\mathbf{q})% B_{\mathrm{xc}},= - divide start_ARG 2 end_ARG start_ARG roman_Ω start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT end_ARG italic_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT italic_K start_POSTSUPERSCRIPT italic_a † end_POSTSUPERSCRIPT ( bold_q ) italic_χ start_POSTSUPERSCRIPT ′ + - end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_KS end_POSTSUBSCRIPT ( bold_q ) italic_K start_POSTSUPERSCRIPT italic_b end_POSTSUPERSCRIPT ( bold_q ) italic_B start_POSTSUBSCRIPT roman_xc end_POSTSUBSCRIPT , (70b)

where the right-hand side of the second equality is written in a plane-wave basis and Kasubscript𝐾𝑎K_{a}italic_K start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT denotes the sublattice site-kernel:

K𝐆𝐆a(𝐪)=1ΩcellΩ0ad𝐫ei(𝐆𝐆+𝐪)𝐫.subscriptsuperscript𝐾𝑎superscript𝐆𝐆𝐪1subscriptΩcellsubscriptsubscriptΩ0𝑎differential-d𝐫superscript𝑒𝑖𝐆superscript𝐆𝐪𝐫K^{a}_{\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q})=\frac{1}{\Omega_{\mathrm{% cell}}}\int_{\Omega_{0a}}\mathrm{}\mathrm{d}\mathbf{r}\,e^{-i(\mathbf{G}-% \mathbf{G}^{\prime}+\mathbf{q})\cdot\mathbf{r}}.italic_K start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q ) = divide start_ARG 1 end_ARG start_ARG roman_Ω start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT end_ARG ∫ start_POSTSUBSCRIPT roman_Ω start_POSTSUBSCRIPT 0 italic_a end_POSTSUBSCRIPT end_POSTSUBSCRIPT roman_d bold_r italic_e start_POSTSUPERSCRIPT - italic_i ( bold_G - bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + bold_q ) ⋅ bold_r end_POSTSUPERSCRIPT . (71)

Since an a priori definition for the magnetic site volumes does not exist, GPAW supplies functionality to calculate exchange parameters based on spherical, cylindrical and/or parallelepipedic site configurations of variable size.

Refer to caption
Figure 8: Magnon spectrum of ferromagnetic hcp-Co calculated using ALDA LR-TDDFT (shown as a heat map), compared to the spin-wave dispersion of Liechtenstein MFT. The acoustic magnon mode a0(ω)subscript𝑎0𝜔a_{0}(\omega)italic_a start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_ω ) is shown to the left of the A-point, while the optical magnon mode a1(ω)subscript𝑎1𝜔a_{1}(\omega)italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ( italic_ω ) is shown to the right. Please note that the two modes are degenerate in both the AA\mathrm{A}roman_A and KK\mathrm{K}roman_K high-symmetry points. The calculations were carried out using 8 empty-shell bands per atom, a plane-wave cutoff of 800 eV and a (36,36,24)363624(36,36,24)( 36 , 36 , 24 ) 𝐤𝐤\mathbf{k}bold_k-point mesh. A finite value of η=100𝜂100\eta=100italic_η = 100 meV was used to broaden the ALDA spectrum. For the MFT calculations, the dispersion was calculated using linear spin-wave theory based on a Heisenberg model of closed-packed spherical sites centered at each of the Co atoms.

Upon calculation of the exchange parameters J¯ab(𝐪)superscript¯𝐽𝑎𝑏𝐪\bar{J}^{ab}(\mathbf{q})over¯ start_ARG italic_J end_ARG start_POSTSUPERSCRIPT italic_a italic_b end_POSTSUPERSCRIPT ( bold_q ), it is straight-forward to compute the magnon dispersion within the classical Heisenberg model using linear spin-wave theory and to estimate thermal quantities such as the Curie temperature, see e.g. [42]. In Fig. 8 the MFT magnon dispersion of hcp-Co is compared to majority magnon spectrum calculated within LR-TDDFT. For Co, the two are in excellent agreement except for the dispersion of the optical magnon mode along the KMΓKMΓ\mathrm{K}-\mathrm{M}-\Gammaroman_K - roman_M - roman_Γ high-symmetry path, where MFT underestimates the magnon frequency and neglects the fine structure of the spectrum. The fine structure of the ALDA spectrum appears due to the overlap between the magnon mode and the Stoner continuum. This gives rise to so-called Kohn anomalies (nonanalytical points in the magnon dispersion), which is a trademark of itinerant electron magnetism. Since the itinerancy is largely ignored in a localized spin model such as (68), one cannot generally expect to capture such effects.

VI.5 GW approximation

GPAW supports standard G0W0 quasiparticle (QP) calculations based on a first-order perturbative treatment of the linearized QP equation [9]

En𝐤σQP=εn𝐤σ+Zn𝐤σψn𝐤σ|ΣGW(εn𝐤σ)+vxvxc|ψn𝐤σ,superscriptsubscript𝐸𝑛𝐤𝜎QPsubscript𝜀𝑛𝐤𝜎subscript𝑍𝑛𝐤𝜎quantum-operator-productsubscript𝜓𝑛𝐤𝜎subscriptΣGWsubscript𝜀𝑛𝐤𝜎subscript𝑣xsubscript𝑣xcsubscript𝜓𝑛𝐤𝜎\displaystyle E_{n\mathbf{k}\sigma}^{\text{QP}}=\varepsilon_{n\mathbf{k}\sigma% }+Z_{n\mathbf{k}\sigma}\langle\psi_{n\mathbf{k}\sigma}|\Sigma_{\mathrm{GW}}(% \varepsilon_{n\mathbf{k}\sigma})+v_{\text{x}}-v_{\text{xc}}|\psi_{n\mathbf{k}% \sigma}\rangle,italic_E start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT QP end_POSTSUPERSCRIPT = italic_ε start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT + italic_Z start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT ⟨ italic_ψ start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT | roman_Σ start_POSTSUBSCRIPT roman_GW end_POSTSUBSCRIPT ( italic_ε start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT ) + italic_v start_POSTSUBSCRIPT x end_POSTSUBSCRIPT - italic_v start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT ⟩ , (72)

where εn𝐤σsubscript𝜀𝑛𝐤𝜎\varepsilon_{n\mathbf{k}\sigma}italic_ε start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT and ψn𝐤σsubscript𝜓𝑛𝐤𝜎\psi_{n\mathbf{k}\sigma}italic_ψ start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT are Kohn–Sham eigenvalues and wave functions, and vxcsubscript𝑣xcv_{\text{xc}}italic_v start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT and vxsubscript𝑣xv_{\text{x}}italic_v start_POSTSUBSCRIPT x end_POSTSUBSCRIPT are the local XC-potential and nonlocal exchange potential, respectively. ΣGWsubscriptΣGW\Sigma_{\mathrm{GW}}roman_Σ start_POSTSUBSCRIPT roman_GW end_POSTSUBSCRIPT is the (dynamical part of) the GW self-energy whose frequency-dependence is accounted to first order by the renormalization factor Zn𝐤σ=(1ReΣGW(εn𝐤σ))1subscript𝑍𝑛𝐤𝜎superscript1ResuperscriptsubscriptΣGWsubscript𝜀𝑛𝐤𝜎1Z_{n\mathbf{k}\sigma}=(1-\mathrm{Re}\>\Sigma_{\mathrm{GW}}^{\prime}(% \varepsilon_{n\mathbf{k}\sigma}))^{-1}italic_Z start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT = ( 1 - roman_Re roman_Σ start_POSTSUBSCRIPT roman_GW end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ( italic_ε start_POSTSUBSCRIPT italic_n bold_k italic_σ end_POSTSUBSCRIPT ) ) start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT. As indicated by the σ𝜎\sigmaitalic_σ-index, spin-polarized G0W0 calculations are supported.

The GW self-energy is calculated in a plane-wave basis using full frequency integration along the real axis to evaluate the convolution between G𝐺Gitalic_G and W𝑊Witalic_W [38]. Compared to alternative schemes employing contour deformation techniques or analytical continuation [221, 222, 223], this approach is time- consuming but numerically accurate and can provide the full spectral function. A highly efficient and accurate evaluation of the self-energy based on a multipole expansion of the screened interaction, W𝑊Witalic_W [224], is currently being implemented, and a GPU version of the full GW code is under development.

An important technical issue concerns the treatment of the head and wings of W𝑊Witalic_W (𝐆=0𝐆0\mathbf{G}=0bold_G = 0 and/or 𝐆=0superscript𝐆0\mathbf{G}^{\prime}=0bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = 0, respectively) in the 𝐪0𝐪0\mathbf{q}\rightarrow 0bold_q → 0 limit. The divergence of the Coulomb interaction appears both in the evaluation of the inverse dielectric matrix ε𝐆𝐆1subscriptsuperscript𝜀1superscript𝐆𝐆\varepsilon^{-1}_{\mathbf{GG}^{\prime}}italic_ε start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT and in the subsequent evaluation of the screened interaction

W𝐆𝐆(𝐪,ω)=𝐆′′ε𝐆𝐆′′1(𝐪,ω)vc,𝐆′′𝐆(𝐪).subscript𝑊superscript𝐆𝐆𝐪𝜔subscriptsuperscript𝐆′′subscriptsuperscript𝜀1superscript𝐆𝐆′′𝐪𝜔subscript𝑣𝑐superscript𝐆′′superscript𝐆𝐪\displaystyle W_{\mathbf{GG}^{\prime}}(\mathbf{q},\omega)=\sum_{\mathbf{G}^{% \prime\prime}}\varepsilon^{-1}_{\mathbf{GG}^{\prime\prime}}(\mathbf{q},\omega)% v_{c,\mathbf{G}^{\prime\prime}\mathbf{G}^{\prime}}(\mathbf{q}).italic_W start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) = ∑ start_POSTSUBSCRIPT bold_G start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_ε start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q , italic_ω ) italic_v start_POSTSUBSCRIPT italic_c , bold_G start_POSTSUPERSCRIPT ′ ′ end_POSTSUPERSCRIPT bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_q ) .

For 3D bulk crystals, GPAW obtains these components by evaluating ε𝐆𝐆1subscriptsuperscript𝜀1superscript𝐆𝐆\varepsilon^{-1}_{\mathbf{GG}^{\prime}}italic_ε start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT start_POSTSUBSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT on a dense 𝐤𝐤\mathbf{k}bold_k-grid centered at 𝐤=0𝐤0\mathbf{k}=0bold_k = 0 while vc,𝐆𝐆subscript𝑣𝑐superscript𝐆𝐆v_{c,\mathbf{G}\mathbf{G}^{\prime}}italic_v start_POSTSUBSCRIPT italic_c , bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT can be integrated numerically or analytically around the ΓΓ\Gammaroman_Γ-point.

For low-dimensional structures, in particular atomically thin 2D semiconductors, GPAW can use a truncated Coulomb interaction to avoid interactions between periodical images when evaluating W𝑊Witalic_W [206]. It has been shown that the use of a truncated Coulomb kernel leads to slower 𝐤𝐤\mathbf{k}bold_k-point convergence [207]. To mitigate this drawback, a special 2D treatment of W(q)𝑊𝑞W(q)italic_W ( italic_q ) at q=0𝑞0q=0italic_q = 0, can be applied to significantly improve the 𝐤𝐤\mathbf{k}bold_k-point convergence [225]. A detailed account of the GW implementation in GPAW can be found in Ref. [38].

Refer to caption
Figure 9: The real (Re) and imaginary (Im) parts of the self-energy matrix elements at the Gamma point for valence (top) and conduction (bottom) bands evaluated with Yambo and GPAW. Both codes are using full frequency integration with a broadening of 0.1 eV. Yambo is using norm conserving pseudo potentials, and GPAW its standard PAW setup. The k-point grid was 12×12×1212121212\times 12\times 1212 × 12 × 12, the plane wave cutoff was 200 eV, and the number of bands 200 for both codes. The results are virtually indistinguishable.

Figure 9 shows two matrix elements of the dynamical GW self-energy for the valence and conduction band states at the Gamma point. As can be seen, the agreement with the corresponding quantities obtained with the Yambo GW code [226] is striking.

VI.6 Bethe–Salpeter Equation (BSE)

In addition to the LR-TDDFT discussed in Sec. VI.1, the interacting response function may be approximated by solving the Bethe–Salpeter equation (BSE) [11]. In particular, for a certain wave vector 𝐪𝐪\mathbf{q}bold_q, one may obtain the two-particle excitations by diagonalizing the Hamiltonian

H𝐤2m1m2𝐤4m3m4(𝐪)subscript𝐻subscript𝐤2subscript𝑚1subscript𝑚2subscript𝐤4subscript𝑚3subscript𝑚4𝐪\displaystyle H_{\begin{subarray}{c}\mathbf{k}_{2}m_{1}m_{2}\\ \mathbf{k}_{4}m_{3}m_{4}\end{subarray}}(\mathbf{q})italic_H start_POSTSUBSCRIPT start_ARG start_ROW start_CELL bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_CELL end_ROW start_ROW start_CELL bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT end_CELL end_ROW end_ARG end_POSTSUBSCRIPT ( bold_q ) =δm1m3δm2m4δ𝐤2𝐤4(εm1𝐤2+𝐪εm2𝐤2)absentsubscript𝛿subscript𝑚1subscript𝑚3subscript𝛿subscript𝑚2subscript𝑚4subscript𝛿subscript𝐤2subscript𝐤4subscript𝜀subscript𝑚1subscript𝐤2𝐪subscript𝜀subscript𝑚2subscript𝐤2\displaystyle=\delta_{m_{1}m_{3}}\delta_{m_{2}m_{4}}\delta_{\mathbf{k}_{2}% \mathbf{k}_{4}}(\varepsilon_{m_{1}\mathbf{k}_{2}+\mathbf{q}}-\varepsilon_{m_{2% }\mathbf{k}_{2}})= italic_δ start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_δ start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_δ start_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT end_POSTSUBSCRIPT ( italic_ε start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_q end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUBSCRIPT ) (73)
(fm1𝐤2+𝐪fm2𝐤2)Km2𝐤2m1𝐤2+𝐪m3𝐤4+𝐪m4𝐤4,subscript𝑓subscript𝑚1subscript𝐤2𝐪subscript𝑓subscript𝑚2subscript𝐤2subscript𝐾subscript𝑚2subscript𝐤2subscript𝑚1subscript𝐤2𝐪subscript𝑚3subscript𝐤4𝐪subscript𝑚4subscript𝐤4\displaystyle-(f_{m_{1}\mathbf{k}_{2}+\mathbf{q}}-f_{m_{2}\mathbf{k}_{2}})K_{m% _{2}\mathbf{k}_{2}m_{1}\mathbf{k}_{2}+\mathbf{q}m_{3}\mathbf{k}_{4}+\mathbf{q}% m_{4}\mathbf{k}_{4}},- ( italic_f start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_q end_POSTSUBSCRIPT - italic_f start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUBSCRIPT ) italic_K start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_q italic_m start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT + bold_q italic_m start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT end_POSTSUBSCRIPT ,

where ε𝐤msubscript𝜀𝐤𝑚\varepsilon_{\mathbf{k}m}italic_ε start_POSTSUBSCRIPT bold_k italic_m end_POSTSUBSCRIPT are the Kohn–Sham eigenvalues and f𝐤msubscript𝑓𝐤𝑚f_{\mathbf{k}m}italic_f start_POSTSUBSCRIPT bold_k italic_m end_POSTSUBSCRIPT the associated occupation numbers. The kernel is defined by K=vcW𝐾subscript𝑣c𝑊K=v_{\mathrm{c}}-Witalic_K = italic_v start_POSTSUBSCRIPT roman_c end_POSTSUBSCRIPT - italic_W with

vc=subscript𝑣𝑐absent\displaystyle v_{c}=italic_v start_POSTSUBSCRIPT italic_c end_POSTSUBSCRIPT = m2𝐤2,m3𝐤4+𝐪|v^c|m1𝐤2+𝐪,m4𝐤4quantum-operator-productsubscript𝑚2subscript𝐤2subscript𝑚3subscript𝐤4𝐪subscript^𝑣csubscript𝑚1subscript𝐤2𝐪subscript𝑚4subscript𝐤4\displaystyle\langle m_{2}\mathbf{k}_{2},m_{3}\mathbf{k}_{4}+\mathbf{q}|\hat{v% }_{\mathrm{c}}|m_{1}\mathbf{k}_{2}+\mathbf{q},m_{4}\mathbf{k}_{4}\rangle⟨ italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_m start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT + bold_q | over^ start_ARG italic_v end_ARG start_POSTSUBSCRIPT roman_c end_POSTSUBSCRIPT | italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_q , italic_m start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT ⟩ (74)
W=𝑊absent\displaystyle W=italic_W = m2𝐤2,m3𝐤4+𝐪|W^|m4𝐤4,m1𝐤2+𝐪,quantum-operator-productsubscript𝑚2subscript𝐤2subscript𝑚3subscript𝐤4𝐪^𝑊subscript𝑚4subscript𝐤4subscript𝑚1subscript𝐤2𝐪\displaystyle\langle m_{2}\mathbf{k}_{2},m_{3}\mathbf{k}_{4}+\mathbf{q}|\hat{W% }|m_{4}\mathbf{k}_{4},m_{1}\mathbf{k}_{2}+\mathbf{q}\rangle,⟨ italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_m start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT + bold_q | over^ start_ARG italic_W end_ARG | italic_m start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT , italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_q ⟩ , (75)

where W^=ε1vc^𝑊superscript𝜀1subscript𝑣c\hat{W}=\varepsilon^{-1}v_{\mathrm{c}}over^ start_ARG italic_W end_ARG = italic_ε start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_v start_POSTSUBSCRIPT roman_c end_POSTSUBSCRIPT is the static screened Coulomb interaction. The matrix elements of the kernel are evaluated in a plane-wave basis where they are easily expressed in terms of the pair densities (48) and the reciprocal-space representation of the dielectric matrix (54).

In the Tamm–Dancoff approximation, one only includes states with εm1𝐤2+𝐪εm2𝐤2>0subscript𝜀subscript𝑚1subscript𝐤2𝐪subscript𝜀subscript𝑚2subscript𝐤20\varepsilon_{m_{1}\mathbf{k}_{2}+\mathbf{q}}-\varepsilon_{m_{2}\mathbf{k}_{2}}>0italic_ε start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT + bold_q end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUBSCRIPT > 0 in Eq. (73) and the BSE Hamiltonian becomes Hermitian [11]. The interacting retarded response function may then be written as

χ𝐆𝐆(𝐪,ω)=1ΩλBλ(𝐪,𝐆)Cλ(𝐪,𝐆)ωEλ(𝐪)+iη,superscript𝜒superscript𝐆𝐆𝐪𝜔1Ωsubscript𝜆subscript𝐵𝜆𝐪𝐆superscriptsubscript𝐶𝜆𝐪superscript𝐆𝜔subscript𝐸𝜆𝐪𝑖𝜂\displaystyle\chi^{\mathbf{G}\mathbf{G}^{\prime}}(\mathbf{q},\omega)=\frac{1}{% \Omega}\sum_{\lambda}\frac{B_{\lambda}(\mathbf{q},\mathbf{G})C_{\lambda}^{*}(% \mathbf{q},\mathbf{G}^{\prime})}{\omega-E_{\lambda}(\mathbf{q})+i\eta},italic_χ start_POSTSUPERSCRIPT bold_GG start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT ( bold_q , italic_ω ) = divide start_ARG 1 end_ARG start_ARG roman_Ω end_ARG ∑ start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT divide start_ARG italic_B start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT ( bold_q , bold_G ) italic_C start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT ( bold_q , bold_G start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) end_ARG start_ARG italic_ω - italic_E start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT ( bold_q ) + italic_i italic_η end_ARG , (76)

where

Bλ(𝐪,𝐆)=𝐤m1m2nm2𝐤m1𝐤+𝐪(𝐆+𝐪)Am1m2𝐤λ(𝐪),subscript𝐵𝜆𝐪𝐆subscript𝐤subscript𝑚1subscript𝑚2subscript𝑛subscript𝑚2𝐤subscript𝑚1𝐤𝐪𝐆𝐪subscriptsuperscript𝐴𝜆subscript𝑚1subscript𝑚2𝐤𝐪\displaystyle B_{\lambda}(\mathbf{q},\mathbf{G})=\sum_{\mathbf{k}m_{1}m_{2}}n_% {m_{2}\mathbf{k}m_{1}\mathbf{k}+\mathbf{q}}(\mathbf{G}+\mathbf{q})A^{\lambda}_% {m_{1}m_{2}\mathbf{k}}(\mathbf{q}),italic_B start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT ( bold_q , bold_G ) = ∑ start_POSTSUBSCRIPT bold_k italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_n start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k + bold_q end_POSTSUBSCRIPT ( bold_G + bold_q ) italic_A start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT ( bold_q ) , (77)
Cλ(𝐪,𝐆)=𝐤m1m2nm2𝐤m1𝐤+𝐪(𝐆+𝐪)Am1m2𝐤λ(𝐪)subscript𝐶𝜆𝐪𝐆subscript𝐤subscript𝑚1subscript𝑚2subscript𝑛subscript𝑚2𝐤subscript𝑚1𝐤𝐪𝐆𝐪subscriptsuperscript𝐴𝜆subscript𝑚1subscript𝑚2𝐤𝐪\displaystyle C_{\lambda}(\mathbf{q},\mathbf{G})=\sum_{\mathbf{k}m_{1}m_{2}}n_% {m_{2}\mathbf{k}m_{1}\mathbf{k}+\mathbf{q}}(\mathbf{G}+\mathbf{q})A^{\lambda}_% {m_{1}m_{2}\mathbf{k}}(\mathbf{q})italic_C start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT ( bold_q , bold_G ) = ∑ start_POSTSUBSCRIPT bold_k italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_n start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k + bold_q end_POSTSUBSCRIPT ( bold_G + bold_q ) italic_A start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT ( bold_q )
×(fm1𝐤+𝐪fm2𝐤),absentsubscript𝑓subscript𝑚1𝐤𝐪subscript𝑓subscript𝑚2𝐤\displaystyle\qquad\qquad\qquad\qquad\times(f_{m_{1}\mathbf{k+q}}-f_{m_{2}% \mathbf{k}}),× ( italic_f start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT bold_k + bold_q end_POSTSUBSCRIPT - italic_f start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT ) , (78)

and Eλ(𝐪)subscript𝐸𝜆𝐪E_{\lambda}(\mathbf{q})italic_E start_POSTSUBSCRIPT italic_λ end_POSTSUBSCRIPT ( bold_q ) denotes the eigenvalue of the Hamiltonian (73) corresponding to the eigenvector Am1m2𝐤λ(𝐪)subscriptsuperscript𝐴𝜆subscript𝑚1subscript𝑚2𝐤𝐪A^{\lambda}_{m_{1}m_{2}\mathbf{k}}(\mathbf{q})italic_A start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT ( bold_q ).

In GPAW, the construction of the BSE Hamiltonian (73) proceeds in two steps [39]. First, the static screened interaction is calculated at all inequivalent 𝐪𝐪\mathbf{q}bold_q-points in a plane-wave basis and the Kernel is then subsequently expressed in a basis of two-particle KS states. The first step is efficiently parallelized over either states or 𝐤𝐤\mathbf{k}bold_k-points and the second step is parallelized over pair densities. The Hamiltonian elements are thus distributed over all CPUs and the diagonalization is carried out using ScaLAPACK such that the full Hamiltonian is never collected on a single CPU. The dimension of the BSE Hamiltonian and memory requirements are, therefore, only limited by the number of CPUs used for the calculation. We note that the implementation is not limited to the Tamm–Dancoff approximation, but calculations become more demanding without it. The response function may be calculated for spin-paired as well as spin-polarized systems and spin–orbit coupling can be included non-selfconsistently [227, 45]. In low-dimensional systems it is important to eliminate the spurious screening from periodic images of the structure, which is accomplished with the truncated Coulomb interaction of Ref. [206].

The most important application of BSE is arguably the calculation of optical absorption spectra of solids where BSE provides an accurate account of the excitonic effects that are not captured by semi-local approximations for KHxcsubscript𝐾HxcK_{\mathrm{Hxc}}italic_K start_POSTSUBSCRIPT roman_Hxc end_POSTSUBSCRIPT (44). In 2D systems, the excitonic effects are particularly pronounced due to inefficient screening [207, 227] and in Fig. 10 we show the 2D polarizability of WS2 calculated from BSE with 𝐪=𝟎𝐪0\mathbf{q}=\mathbf{0}bold_q = bold_0. Comparing with Fig. 3, it is observed that the absorption edge is expected to be located at the K𝐾Kitalic_K point, where spin–orbit coupling splits the highest valence band by 0.45 eV. This splitting is seen as two excitonic peaks below the band gap, which is interpreted as distinct excitons originating from the highest and next-highest valence bands (the splitting of the lowest conduction band is negligible in this regard). For comparison, we also show the RPA polarizabilty obtained with the BSE module by neglecting the screened interaction in the kernel and this shows the expected absorption edge at the band gap. This yields identical results to the Dyson equation approach of Sec. VI.1, but has the advantage that the eigenvalues and weights of Eq. (76) are obtained directly such that the artificial broadening η𝜂\etaitalic_η may be varied without additional computational cost. The eigenstate decomposition also allows one to access “dark states” and the BSE calculation reveals two (one for each valley) triplet-like excitons that are situated 70 meV below the lowest bright exciton in Fig. 10.

Refer to caption
Figure 10: 2D polarizability of WS2 calculated from the BSE and the RPA. For this calculation, we included spin–orbit coupling and used the 2D Coulomb truncation to eliminate screening from periodic images. A gamma-centered uniform 𝐤𝐤\mathbf{k}bold_k-point grid of 48×48484848\times 4848 × 48 was applied and 8 valence states and 8 conduction states (shifted by 1 eV to match the GW band gap [45]) was included in the Tamm–Dancoff approximation. This yields a BSE Hamiltonian of size N×N𝑁𝑁N\times Nitalic_N × italic_N with N=147456𝑁147456N=147456italic_N = 147456, which is easily diagonalized with ScaLAPACK on 240 CPUs.

In addition to optical properties, GPAW allows for solving the BSE at finite 𝐪𝐪\mathbf{q}bold_q, which can used to obtain plasmon dispersion relations from the EELS (57) and magnon dispersions from the transverse magnetic susceptibility of Sec. VI.4 [228].

VI.7 Electron–phonon coupling

The electron-phonon coupling is the origin of several important materials properties, ranging from electrical and thermal conductivity to superconductivity. In addition it provides access to the deformation potential, which can be used to obtain transport properties for electrons and holes in solids [229].

The first-order electron–phonon coupling matrix gmnν(𝐤,𝐪)superscriptsubscript𝑔𝑚𝑛𝜈𝐤𝐪g_{mn}^{\nu}(\mathbf{k},\mathbf{q})italic_g start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( bold_k , bold_q ) measures the strength of the coupling between a phonon branch ν𝜈\nuitalic_ν with wave vector 𝐪𝐪\mathbf{q}bold_q and frequency ωνsubscript𝜔𝜈\omega_{\nu}italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT and the electronic states m(𝐤+𝐪)𝑚𝐤𝐪m(\mathbf{k}+\mathbf{q})italic_m ( bold_k + bold_q ) and n(𝐤)𝑛𝐤n(\mathbf{k})italic_n ( bold_k ) [230, 231]:

gmnν(𝐤,𝐪)=2m0ωνMmnν(𝐤,𝐪)superscriptsubscript𝑔𝑚𝑛𝜈𝐤𝐪Planck-constant-over-2-pi2subscript𝑚0subscript𝜔𝜈superscriptsubscript𝑀𝑚𝑛𝜈𝐤𝐪g_{mn}^{\nu}(\mathbf{k},\mathbf{q})=\sqrt{\frac{\hbar}{2m_{0}\omega_{\nu}}}M_{% mn}^{\nu}(\mathbf{k},\mathbf{q})italic_g start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( bold_k , bold_q ) = square-root start_ARG divide start_ARG roman_ℏ end_ARG start_ARG 2 italic_m start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT end_ARG end_ARG italic_M start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( bold_k , bold_q ) (79)

with

Mmnν(𝐤,𝐪)=ψm𝐤+𝐪|uvKS𝐞ν|ψn𝐤.superscriptsubscript𝑀𝑚𝑛𝜈𝐤𝐪quantum-operator-productsubscript𝜓𝑚𝐤𝐪subscript𝑢superscript𝑣KSsubscript𝐞𝜈subscript𝜓𝑛𝐤M_{mn}^{\nu}(\mathbf{k},\mathbf{q})=\langle\psi_{m\mathbf{k}+\mathbf{q}}|% \nabla_{u}v^{\text{KS}}\cdot\mathbf{e}_{\nu}|\psi_{n\mathbf{k}}\rangle.italic_M start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( bold_k , bold_q ) = ⟨ italic_ψ start_POSTSUBSCRIPT italic_m bold_k + bold_q end_POSTSUBSCRIPT | ∇ start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT KS end_POSTSUPERSCRIPT ⋅ bold_e start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ⟩ . (80)

Here m0subscript𝑚0m_{0}italic_m start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is the sum of the masses of all the atoms in the unit cell, usubscript𝑢\nabla_{u}∇ start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT denotes the gradient with respect to atomic displacements and 𝐞νsubscript𝐞𝜈\mathbf{e}_{\nu}bold_e start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT projects the gradient onto the direction of the phonon displacements. In the case of the three translational modes at |𝐪|=0𝐪0|\mathbf{q}|=0| bold_q | = 0, the matrix elements gmnνsuperscriptsubscript𝑔𝑚𝑛𝜈g_{mn}^{\nu}italic_g start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT vanishes as a consequence of the acoustic sum rule [231].

In GPAW, uvKS(𝐫)subscript𝑢superscript𝑣KS𝐫\nabla_{u}v^{\text{KS}}(\mathbf{r})∇ start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT KS end_POSTSUPERSCRIPT ( bold_r ) is determined using a finite-difference method with a super cell description of the system. This step can be performed in any of the wave function representations available in GPAW. The derivative is then projected onto a set of atomic orbitals from an LCAO basis ϕNMsubscriptitalic-ϕ𝑁𝑀\phi_{NM}italic_ϕ start_POSTSUBSCRIPT italic_N italic_M end_POSTSUBSCRIPT, where N𝑁Nitalic_N denotes the cell index and M𝑀Mitalic_M the orbital index:

𝐠NMNMsc=FT[ϕNM(𝐤)|uvKS|ϕNM(𝐤)].superscriptsubscript𝐠𝑁𝑀superscript𝑁superscript𝑀𝑠𝑐𝐹𝑇delimited-[]quantum-operator-productsubscriptitalic-ϕ𝑁𝑀𝐤subscript𝑢superscript𝑣KSsubscriptitalic-ϕsuperscript𝑁superscript𝑀𝐤\displaystyle\mathbf{g}_{\begin{subarray}{c}NM\\ N^{\prime}M^{\prime}\end{subarray}}^{sc}=FT\left[\langle\phi_{NM}(\mathbf{k})|% \nabla_{u}v^{\text{KS}}|\phi_{N^{\prime}M^{\prime}}(\mathbf{k})\rangle\right].bold_g start_POSTSUBSCRIPT start_ARG start_ROW start_CELL italic_N italic_M end_CELL end_ROW start_ROW start_CELL italic_N start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_M start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_CELL end_ROW end_ARG end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s italic_c end_POSTSUPERSCRIPT = italic_F italic_T [ ⟨ italic_ϕ start_POSTSUBSCRIPT italic_N italic_M end_POSTSUBSCRIPT ( bold_k ) | ∇ start_POSTSUBSCRIPT italic_u end_POSTSUBSCRIPT italic_v start_POSTSUPERSCRIPT KS end_POSTSUPERSCRIPT | italic_ϕ start_POSTSUBSCRIPT italic_N start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_M start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_k ) ⟩ ] . (81)

The Fourier transform from the Bloch to the real space representation makes it possible to compute Mmnνsuperscriptsubscript𝑀𝑚𝑛𝜈M_{mn}^{\nu}italic_M start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT for arbitrary 𝐪𝐪\mathbf{q}bold_q. Finally, the electron–phonon coupling matrix is obtained by projecting the matrix corresponding to the supercell into the primitive unit cell bands m,n𝑚𝑛m,nitalic_m , italic_n and phonon modes ν𝜈\nuitalic_ν:

Mmnν(𝐤,𝐪)=NMNMCmMCnM𝐠NMNMsc𝐮qνei[(𝐤+𝐪)𝐑N𝐤𝐑N],superscriptsubscript𝑀𝑚𝑛𝜈𝐤𝐪subscript𝑁𝑀superscript𝑁superscript𝑀superscriptsubscript𝐶𝑚𝑀subscript𝐶𝑛superscript𝑀superscriptsubscript𝐠𝑁𝑀superscript𝑁superscript𝑀𝑠𝑐subscript𝐮𝑞𝜈superscript𝑒𝑖delimited-[]𝐤𝐪subscript𝐑𝑁𝐤superscriptsubscript𝐑𝑁M_{mn}^{\nu}(\mathbf{k},\mathbf{q})=\sum_{\begin{subarray}{c}NM\\ N^{\prime}M^{\prime}\end{subarray}}C_{mM}^{*}C_{nM^{\prime}}\mathbf{g}_{\begin% {subarray}{c}NM\\ N^{\prime}M^{\prime}\end{subarray}}^{sc}\cdot\mathbf{u}_{q\nu}e^{i[(\mathbf{k}% +\mathbf{q})\cdot\mathbf{R}_{N}-\mathbf{k}\cdot\mathbf{R}_{N}^{\prime}]},italic_M start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( bold_k , bold_q ) = ∑ start_POSTSUBSCRIPT start_ARG start_ROW start_CELL italic_N italic_M end_CELL end_ROW start_ROW start_CELL italic_N start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_M start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_CELL end_ROW end_ARG end_POSTSUBSCRIPT italic_C start_POSTSUBSCRIPT italic_m italic_M end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT italic_C start_POSTSUBSCRIPT italic_n italic_M start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT bold_g start_POSTSUBSCRIPT start_ARG start_ROW start_CELL italic_N italic_M end_CELL end_ROW start_ROW start_CELL italic_N start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_M start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_CELL end_ROW end_ARG end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_s italic_c end_POSTSUPERSCRIPT ⋅ bold_u start_POSTSUBSCRIPT italic_q italic_ν end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT italic_i [ ( bold_k + bold_q ) ⋅ bold_R start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT - bold_k ⋅ bold_R start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ] end_POSTSUPERSCRIPT , (82)

where CnMsubscript𝐶𝑛𝑀C_{nM}italic_C start_POSTSUBSCRIPT italic_n italic_M end_POSTSUBSCRIPT are the LCAO coefficients and 𝐮qνsubscript𝐮𝑞𝜈\mathbf{u}_{q\nu}bold_u start_POSTSUBSCRIPT italic_q italic_ν end_POSTSUBSCRIPT are mass-scaled phonon displacement vectors.

VI.8 Raman spectrum

The Raman effect describes inelastic light scattering, where vibrational modes are excited within the material. Resonant and non-resonant Raman spectra of finite systems such as molecules can be calculated in various approximations [232] using the corresponding interfaces in ASE. The Stokes Raman intensity is then written as

I(ω)=I0νnν+1ων|α,βuinαRαβνuoutβ|2δ(ωων),𝐼𝜔subscript𝐼0subscript𝜈subscript𝑛𝜈1subscript𝜔𝜈superscriptsubscript𝛼𝛽superscriptsubscript𝑢in𝛼superscriptsubscript𝑅𝛼𝛽𝜈superscriptsubscript𝑢out𝛽2𝛿𝜔subscript𝜔𝜈I(\omega)=I_{0}\sum_{\nu}\frac{n_{\nu}+1}{\omega_{\nu}}|\sum_{\alpha,\beta}u_{% \mathrm{in}}^{\alpha}R_{\alpha\beta}^{\nu}u_{\mathrm{out}}^{\beta}|^{2}\delta(% \omega-\omega_{\nu}),italic_I ( italic_ω ) = italic_I start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT divide start_ARG italic_n start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT + 1 end_ARG start_ARG italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT end_ARG | ∑ start_POSTSUBSCRIPT italic_α , italic_β end_POSTSUBSCRIPT italic_u start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_R start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT italic_u start_POSTSUBSCRIPT roman_out end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_δ ( italic_ω - italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT ) , (83)

where ν𝜈\nuitalic_ν denotes phonon mode at 𝐪=0𝐪0\mathbf{q}=0bold_q = 0 with frequency of ωνsubscript𝜔𝜈\omega_{\nu}italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT and nνsubscript𝑛𝜈n_{\nu}italic_n start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT is the corresponding Bose-Einstein distribution. Furthermore, uinαsuperscriptsubscript𝑢in𝛼u_{\mathrm{in}}^{\alpha}italic_u start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT and uoutβsuperscriptsubscript𝑢out𝛽u_{\mathrm{out}}^{\beta}italic_u start_POSTSUBSCRIPT roman_out end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT are the polarization vectors of the incoming and outgoing light, and Rαβνsuperscriptsubscript𝑅𝛼𝛽𝜈R_{\alpha\beta}^{\nu}italic_R start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT denotes the Raman tensor for phonon mode ν𝜈\nuitalic_ν.

The predominant approach for calculating Rαβνsuperscriptsubscript𝑅𝛼𝛽𝜈R_{\alpha\beta}^{\nu}italic_R start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT involves the use of the Kramers-Heisenberg-Dirac (KHD) method. Within the KHD framework, the Raman tensor is determined by taking the derivative (utilizing a finite-difference method) of the electric polarizability concerning the vibrational normal modes. Alternatively, one can employ time-dependent third-order perturbation theory to compute Raman tensors. These two approaches are equivalent when local field effect are negligible [56]. However, each approach comes with its own set of advantages and drawbacks. The KHD method is computationally more efficient but is limited to computing first-order Raman processes. The perturbative approach can be extended to higher-order Raman processes involving multiple phonons, but it is more computationally demanding, necessitating a greater number of bands and a finer k-mesh grid to achieve convergence. The perturbative approach has been implemented in GPAW and is elaborated below while the KHD method has been implemented in the ASR package [22], utilizing GPAW as the computational backend.

In the perturbative approach, the Raman tensor Rαβνsuperscriptsubscript𝑅𝛼𝛽𝜈R_{\alpha\beta}^{\nu}italic_R start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT is given by [233, 56]

Rαβνijmn𝐤[pijα(MjmνδinMniνδjm)pmnβ(ωinεji)(ωoutεmn)\displaystyle R_{\alpha\beta}^{\nu}\equiv\sum_{ijmn\mathbf{k}}\left[\frac{p_{% ij}^{\alpha}(M_{jm}^{\nu}\delta_{in}-M_{ni}^{\nu}\delta_{jm})p_{mn}^{\beta}}{(% \hbar\omega_{\mathrm{in}}-\varepsilon_{ji})(\hbar\omega_{\mathrm{out}}-% \varepsilon_{mn})}\right.italic_R start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ≡ ∑ start_POSTSUBSCRIPT italic_i italic_j italic_m italic_n bold_k end_POSTSUBSCRIPT [ divide start_ARG italic_p start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ( italic_M start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT - italic_M start_POSTSUBSCRIPT italic_n italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT ) italic_p start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT end_ARG start_ARG ( roman_ℏ italic_ω start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) ( roman_ℏ italic_ω start_POSTSUBSCRIPT roman_out end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG (84)
+pijα(pjmβδinpniβδjm)Mmnν(ωinεji)(ωνεmn)superscriptsubscript𝑝𝑖𝑗𝛼superscriptsubscript𝑝𝑗𝑚𝛽subscript𝛿𝑖𝑛superscriptsubscript𝑝𝑛𝑖𝛽subscript𝛿𝑗𝑚superscriptsubscript𝑀𝑚𝑛𝜈Planck-constant-over-2-pisubscript𝜔insubscript𝜀𝑗𝑖Planck-constant-over-2-pisubscript𝜔𝜈subscript𝜀𝑚𝑛\displaystyle+\frac{p_{ij}^{\alpha}(p_{jm}^{\beta}\delta_{in}-p_{ni}^{\beta}% \delta_{jm})M_{mn}^{\nu}}{(\hbar\omega_{\mathrm{in}}-\varepsilon_{ji})(\hbar% \omega_{\nu}-\varepsilon_{mn})}+ divide start_ARG italic_p start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ( italic_p start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT - italic_p start_POSTSUBSCRIPT italic_n italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT ) italic_M start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT end_ARG start_ARG ( roman_ℏ italic_ω start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) ( roman_ℏ italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG
+pijβ(MjmνδinMniνδjm)pmnα(ωoutεji)(ωinεmn)superscriptsubscript𝑝𝑖𝑗𝛽superscriptsubscript𝑀𝑗𝑚𝜈subscript𝛿𝑖𝑛superscriptsubscript𝑀𝑛𝑖𝜈subscript𝛿𝑗𝑚superscriptsubscript𝑝𝑚𝑛𝛼Planck-constant-over-2-pisubscript𝜔outsubscript𝜀𝑗𝑖Planck-constant-over-2-pisubscript𝜔insubscript𝜀𝑚𝑛\displaystyle+\frac{p_{ij}^{\beta}(M_{jm}^{\nu}\delta_{in}-M_{ni}^{\nu}\delta_% {jm})p_{mn}^{\alpha}}{(-\hbar\omega_{\mathrm{out}}-\varepsilon_{ji})(-\hbar% \omega_{\mathrm{in}}-\varepsilon_{mn})}+ divide start_ARG italic_p start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT ( italic_M start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT - italic_M start_POSTSUBSCRIPT italic_n italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT ) italic_p start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT end_ARG start_ARG ( - roman_ℏ italic_ω start_POSTSUBSCRIPT roman_out end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) ( - roman_ℏ italic_ω start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG
+pijβ(pjmαδinpniαδjm)Mmnν(ωoutεji)(ωνεmn)superscriptsubscript𝑝𝑖𝑗𝛽superscriptsubscript𝑝𝑗𝑚𝛼subscript𝛿𝑖𝑛superscriptsubscript𝑝𝑛𝑖𝛼subscript𝛿𝑗𝑚superscriptsubscript𝑀𝑚𝑛𝜈Planck-constant-over-2-pisubscript𝜔outsubscript𝜀𝑗𝑖Planck-constant-over-2-pisubscript𝜔𝜈subscript𝜀𝑚𝑛\displaystyle+\frac{p_{ij}^{\beta}(p_{jm}^{\alpha}\delta_{in}-p_{ni}^{\alpha}% \delta_{jm})M_{mn}^{\nu}}{(-\hbar\omega_{\mathrm{out}}-\varepsilon_{ji})(\hbar% \omega_{\nu}-\varepsilon_{mn})}+ divide start_ARG italic_p start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT ( italic_p start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT - italic_p start_POSTSUBSCRIPT italic_n italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT ) italic_M start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT end_ARG start_ARG ( - roman_ℏ italic_ω start_POSTSUBSCRIPT roman_out end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) ( roman_ℏ italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG
+Mijν(pjmαδinpniαδjm)pmnβ(ωνεji)(ωoutεmn)superscriptsubscript𝑀𝑖𝑗𝜈superscriptsubscript𝑝𝑗𝑚𝛼subscript𝛿𝑖𝑛superscriptsubscript𝑝𝑛𝑖𝛼subscript𝛿𝑗𝑚superscriptsubscript𝑝𝑚𝑛𝛽Planck-constant-over-2-pisubscript𝜔𝜈subscript𝜀𝑗𝑖Planck-constant-over-2-pisubscript𝜔outsubscript𝜀𝑚𝑛\displaystyle+\frac{M_{ij}^{\nu}(p_{jm}^{\alpha}\delta_{in}-p_{ni}^{\alpha}% \delta_{jm})p_{mn}^{\beta}}{(-\hbar\omega_{\nu}-\varepsilon_{ji})(\hbar\omega_% {\mathrm{out}}-\varepsilon_{mn})}+ divide start_ARG italic_M start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( italic_p start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT - italic_p start_POSTSUBSCRIPT italic_n italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT ) italic_p start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT end_ARG start_ARG ( - roman_ℏ italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) ( roman_ℏ italic_ω start_POSTSUBSCRIPT roman_out end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG
+Mijν(pjmβδinpniβδjm)pmnα(ωνεji)(ωinεmn)]\displaystyle+\left.\frac{M_{ij}^{\nu}(p_{jm}^{\beta}\delta_{in}-p_{ni}^{\beta% }\delta_{jm})p_{mn}^{\alpha}}{(-\hbar\omega_{\nu}-\varepsilon_{ji})(-\hbar% \omega_{\mathrm{in}}-\varepsilon_{mn})}\right]+ divide start_ARG italic_M start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT ( italic_p start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT - italic_p start_POSTSUBSCRIPT italic_n italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_δ start_POSTSUBSCRIPT italic_j italic_m end_POSTSUBSCRIPT ) italic_p start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT end_ARG start_ARG ( - roman_ℏ italic_ω start_POSTSUBSCRIPT italic_ν end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) ( - roman_ℏ italic_ω start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG ]
×fi(1fj)fn(1fm),absentsubscript𝑓𝑖1subscript𝑓𝑗subscript𝑓𝑛1subscript𝑓𝑚\displaystyle\times f_{i}(1-f_{j})f_{n}(1-f_{m}),× italic_f start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( 1 - italic_f start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( 1 - italic_f start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ) ,

where the first term is referred to as the resonant part and the remaining terms represent different time orderings of the interaction in terms of Feynman diagrams. pnmα=ψn𝐤|p^α|ψm𝐤superscriptsubscript𝑝𝑛𝑚𝛼quantum-operator-productsubscript𝜓𝑛𝐤superscript^𝑝𝛼subscript𝜓𝑚𝐤p_{nm}^{\alpha}=\langle\psi_{n\mathbf{k}}|\hat{p}^{\alpha}|\psi_{m\mathbf{k}}\rangleitalic_p start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT = ⟨ italic_ψ start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT | over^ start_ARG italic_p end_ARG start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT | italic_ψ start_POSTSUBSCRIPT italic_m bold_k end_POSTSUBSCRIPT ⟩ is the momentum matrix element between electronic bands m𝑚mitalic_m and n𝑛nitalic_n, with transition energy εnm=EnEmsubscript𝜀𝑛𝑚subscript𝐸𝑛subscript𝐸𝑚\varepsilon_{nm}=E_{n}-E_{m}italic_ε start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT = italic_E start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT - italic_E start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT in polarization direction α𝛼\alphaitalic_α and Mnmνsuperscriptsubscript𝑀𝑛𝑚𝜈M_{nm}^{\nu}italic_M start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_ν end_POSTSUPERSCRIPT is the electron–phonon coupling strength in the optical limit |𝐪|=0𝐪0|\mathbf{q}|=0| bold_q | = 0 as defined in Eq. (82).

Fig. 11 shows the polarization-resolved Raman spectrum of bulk MoS2 in the 2H phase as computed with a laser frequency of ωin=488subscript𝜔in488\omega_{\mathrm{in}}=488italic_ω start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT = 488 nm. This example uses only the resonant term, as the other contributions are small in this case. It’s worth noting that we have conducted a comparison of the calculated spectra using the ASR package and observed a high level of agreement for several materials, for example MoS2. The results obtained from both methods closely align with each other in terms of peak positions and dominant peaks and minor disagreements between the two methods can be attributed to differences in implementation details and the distinct approximations employed by each. Specifically, within the ASR package, we utilized the phonopy package [234] to compute phonon frequencies and eigenvectors, whereas in GPAW, we directly computed phonon frequencies and eigenvectors using ASE’s phonon module. Furthermore, in the ASR implementation, we rigorously enforced the symmetry of the polarizability tensor and the ASR results therefore typically exhibit a more accurate adherence to the required symmetry of the Raman tensor compared to the GPAW implementation.

Refer to caption
Figure 11: Polarization-resolved Raman spectrum of bulk MoS2 in the 2H phase at ω=488𝜔488\omega=488italic_ω = 488 nm. Phonons and potential changes were computed using a 700 eV plane wave cutoff and 2×2×22222\times 2\times 22 × 2 × 2 𝐤𝐤\mathbf{k}bold_k-point mesh in a 3×3×23323\times 3\times 23 × 3 × 2 supercell. Each peak has been labeled according to its irreducible representation.

VI.9 Quadratic optical response functions

The nonlinear optical response of materials can be obtained by going beyond first order perturbation theory. Presently, the GPAW implementation is restricted to second-order response within the dipole approximation and without inclusion of local field effects. We apply the independent particle approximation, which cannot capture collective behavior such as excitonic effects [57]. A spatially homogeneous incident electric field can be written in terms of its Fourier components as

𝓔(t)=α,ω1α(ω1)𝐞αeiω1t,𝓔𝑡subscript𝛼subscript𝜔1subscript𝛼subscript𝜔1subscript𝐞𝛼superscript𝑒𝑖subscript𝜔1𝑡\bm{\mathcal{E}}(t)=\sum_{\alpha,\omega_{1}}\mathcal{E}_{\alpha}(\omega_{1})% \mathbf{e}_{\alpha}e^{-i\omega_{1}t}\,,bold_caligraphic_E ( italic_t ) = ∑ start_POSTSUBSCRIPT italic_α , italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT end_POSTSUBSCRIPT caligraphic_E start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) bold_e start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT - italic_i italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_t end_POSTSUPERSCRIPT , (85)

where ω1subscript𝜔1\omega_{1}italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT runs over positive and negative frequencies, 𝐞αsubscript𝐞𝛼\mathbf{e}_{\alpha}bold_e start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT denotes the unit vector along the α𝛼\alphaitalic_α-direction, and α(ω1)subscript𝛼subscript𝜔1\mathcal{E}_{\alpha}(\omega_{1})caligraphic_E start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) is the electric field at frequency ω1subscript𝜔1\omega_{1}italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT. The induced quadratic polarization density 𝒫γ(2)(t)superscriptsubscript𝒫𝛾2𝑡\mathcal{P}_{\gamma}^{(2)}(t)caligraphic_P start_POSTSUBSCRIPT italic_γ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_t ) can then be expressed as

𝒫γ(2)(t)=superscriptsubscript𝒫𝛾2𝑡absent\displaystyle\mathcal{P}_{\gamma}^{(2)}(t)=caligraphic_P start_POSTSUBSCRIPT italic_γ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_t ) = ϵ0ω1ω2αβχγαβ(2)(ω1,ω2)subscriptitalic-ϵ0subscriptsubscript𝜔1subscript𝜔2subscript𝛼𝛽superscriptsubscript𝜒𝛾𝛼𝛽2subscript𝜔1subscript𝜔2\displaystyle\epsilon_{0}\sum_{\omega_{1}\omega_{2}}\sum_{\alpha\beta}\chi_{% \gamma\alpha\beta}^{(2)}(\omega_{1},\omega_{2})italic_ϵ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT )
×α(ω1)β(ω2)ei(ω1+ω2)t,absentsubscript𝛼subscript𝜔1subscript𝛽subscript𝜔2superscript𝑒𝑖subscript𝜔1subscript𝜔2𝑡\displaystyle\qquad\qquad\times\mathcal{E}_{\alpha}(\omega_{1})\mathcal{E}_{% \beta}(\omega_{2})e^{-i(\omega_{1}+\omega_{2})t}\,,× caligraphic_E start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ) caligraphic_E start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT ( italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) italic_e start_POSTSUPERSCRIPT - italic_i ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) italic_t end_POSTSUPERSCRIPT , (86)

where χγαβ(2)superscriptsubscript𝜒𝛾𝛼𝛽2\chi_{\gamma\alpha\beta}^{(2)}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT is the rank-3 quadratic susceptibility tensor. Due to intrinsic permutation symmetry, i.e. χγαβ(2)(ω1,ω2)=χγβα(2)(ω2,ω1)superscriptsubscript𝜒𝛾𝛼𝛽2subscript𝜔1subscript𝜔2superscriptsubscript𝜒𝛾𝛽𝛼2subscript𝜔2subscript𝜔1\chi_{\gamma\alpha\beta}^{(2)}(\omega_{1},\omega_{2})=\chi_{\gamma\beta\alpha}% ^{(2)}(\omega_{2},\omega_{1})italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) = italic_χ start_POSTSUBSCRIPT italic_γ italic_β italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ), χγαβ(2)superscriptsubscript𝜒𝛾𝛼𝛽2\chi_{\gamma\alpha\beta}^{(2)}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT has at most 18 independent elements which may be further reduced by the Neumann principle and point group symmetries [235]. We note that the corresponding quadratic conductivity tensor is readily derived from χγαβ(2)superscriptsubscript𝜒𝛾𝛼𝛽2\chi_{\gamma\alpha\beta}^{(2)}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT as σγαβ(2)(ω1,ω2)=iϵ0χγαβ(2)(ω1,ω2)(ω1+ω2)superscriptsubscript𝜎𝛾𝛼𝛽2subscript𝜔1subscript𝜔2𝑖subscriptitalic-ϵ0superscriptsubscript𝜒𝛾𝛼𝛽2subscript𝜔1subscript𝜔2subscript𝜔1subscript𝜔2\sigma_{\gamma\alpha\beta}^{(2)}(\omega_{1},\omega_{2})=-i\epsilon_{0}\chi_{% \gamma\alpha\beta}^{(2)}(\omega_{1},\omega_{2})(\omega_{1}+\omega_{2})italic_σ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) = - italic_i italic_ϵ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT + italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) due to relationship between current density and polarization density [236].

Among the various response functions that can be calculated from χγαβ(2)(ω1,ω2)superscriptsubscript𝜒𝛾𝛼𝛽2subscript𝜔1subscript𝜔2\chi_{\gamma\alpha\beta}^{(2)}(\omega_{1},\omega_{2})italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT ( italic_ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ), we have implemented second-harmonics generation (SHG) and the shift current tensor. The implementation currently requires time-reversal symmetry, which limits the application to non-magnetic systems. For SHG, the susceptibility tensor is separated into a pure interband term χγαβ(2e)superscriptsubscript𝜒𝛾𝛼𝛽2𝑒\chi_{\gamma\alpha\beta}^{(2e)}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 italic_e ) end_POSTSUPERSCRIPT and a mixed term χγαβ(2i)superscriptsubscript𝜒𝛾𝛼𝛽2𝑖\chi_{\gamma\alpha\beta}^{(2i)}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 italic_i ) end_POSTSUPERSCRIPT that read

χγαβ(2e)C0𝐤,nmlRe{rnmγ(rmlαrlnβ+rmlβrlnα)}2(εlnεml)superscriptsubscript𝜒𝛾𝛼𝛽2𝑒subscript𝐶0subscriptsuperscript𝐤𝑛𝑚𝑙Resuperscriptsubscript𝑟𝑛𝑚𝛾superscriptsubscript𝑟𝑚𝑙𝛼superscriptsubscript𝑟𝑙𝑛𝛽superscriptsubscript𝑟𝑚𝑙𝛽superscriptsubscript𝑟𝑙𝑛𝛼2subscript𝜀𝑙𝑛subscript𝜀𝑚𝑙\displaystyle\chi_{\gamma\alpha\beta}^{(2e)}\equiv C_{0}\sideset{}{{}^{\prime}% }{\sum}_{\mathbf{k},nml}\dfrac{\mathrm{Re}\{r_{nm}^{\gamma}(r_{ml}^{\alpha}r_{% ln}^{\beta}+r_{ml}^{\beta}r_{ln}^{\alpha})\}}{2(\varepsilon_{ln}-\varepsilon_{% ml})}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 italic_e ) end_POSTSUPERSCRIPT ≡ italic_C start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT SUPERSCRIPTOP start_ARG ∑ end_ARG ′ start_POSTSUBSCRIPT bold_k , italic_n italic_m italic_l end_POSTSUBSCRIPT divide start_ARG roman_Re { italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_γ end_POSTSUPERSCRIPT ( italic_r start_POSTSUBSCRIPT italic_m italic_l end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_l italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_m italic_l end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_l italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ) } end_ARG start_ARG 2 ( italic_ε start_POSTSUBSCRIPT italic_l italic_n end_POSTSUBSCRIPT - italic_ε start_POSTSUBSCRIPT italic_m italic_l end_POSTSUBSCRIPT ) end_ARG
×(2fnm2ωεmnfnlωεln+fmlωεml),absent2subscript𝑓𝑛𝑚2Planck-constant-over-2-pi𝜔subscript𝜀𝑚𝑛subscript𝑓𝑛𝑙Planck-constant-over-2-pi𝜔subscript𝜀𝑙𝑛subscript𝑓𝑚𝑙Planck-constant-over-2-pi𝜔subscript𝜀𝑚𝑙\displaystyle\qquad\times\bigg{(}\frac{2f_{nm}}{2\hbar\omega-\varepsilon_{mn}}% -\frac{f_{nl}}{\hbar\omega-\varepsilon_{ln}}+\frac{f_{ml}}{\hbar\omega-% \varepsilon_{ml}}\bigg{)}\,,× ( divide start_ARG 2 italic_f start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT end_ARG start_ARG 2 roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT end_ARG - divide start_ARG italic_f start_POSTSUBSCRIPT italic_n italic_l end_POSTSUBSCRIPT end_ARG start_ARG roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_l italic_n end_POSTSUBSCRIPT end_ARG + divide start_ARG italic_f start_POSTSUBSCRIPT italic_m italic_l end_POSTSUBSCRIPT end_ARG start_ARG roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_l end_POSTSUBSCRIPT end_ARG ) , (87)
χγαβ(2i)iC0𝐤,nmfnm[2Im{rnmγ(rmn;βα+rmn;αβ)}εmn(2ωεmn)\displaystyle\chi_{\gamma\alpha\beta}^{(2i)}\equiv iC_{0}\sideset{}{{}^{\prime% }}{\sum}_{\mathbf{k},nm}f_{nm}\Bigg{[}\frac{2\mathrm{Im}\{r_{nm}^{\gamma}(r_{% mn;\beta}^{\alpha}+r_{mn;\alpha}^{\beta})\}}{\varepsilon_{mn}(2\hbar\omega-% \varepsilon_{mn})}italic_χ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 italic_i ) end_POSTSUPERSCRIPT ≡ italic_i italic_C start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT SUPERSCRIPTOP start_ARG ∑ end_ARG ′ start_POSTSUBSCRIPT bold_k , italic_n italic_m end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT [ divide start_ARG 2 roman_I roman_m { italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_γ end_POSTSUPERSCRIPT ( italic_r start_POSTSUBSCRIPT italic_m italic_n ; italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_m italic_n ; italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT ) } end_ARG start_ARG italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ( 2 roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG
+Im{rmnαrnm;βγ+rmnβrnm;αγ}εmn(ωεmn)Imsuperscriptsubscript𝑟𝑚𝑛𝛼superscriptsubscript𝑟𝑛𝑚𝛽𝛾superscriptsubscript𝑟𝑚𝑛𝛽superscriptsubscript𝑟𝑛𝑚𝛼𝛾subscript𝜀𝑚𝑛Planck-constant-over-2-pi𝜔subscript𝜀𝑚𝑛\displaystyle\qquad+\frac{\mathrm{Im}\{r_{mn}^{\alpha}r_{nm;\beta}^{\gamma}+r_% {mn}^{\beta}r_{nm;\alpha}^{\gamma}\}}{\varepsilon_{mn}(\hbar\omega-\varepsilon% _{mn})}+ divide start_ARG roman_Im { italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_γ end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_γ end_POSTSUPERSCRIPT } end_ARG start_ARG italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ( roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG
+Im{rnmγ(rmnαΔmnβ+rmnβΔmnα)}εmn2Imsuperscriptsubscript𝑟𝑛𝑚𝛾superscriptsubscript𝑟𝑚𝑛𝛼superscriptsubscriptΔ𝑚𝑛𝛽superscriptsubscript𝑟𝑚𝑛𝛽superscriptsubscriptΔ𝑚𝑛𝛼superscriptsubscript𝜀𝑚𝑛2\displaystyle\qquad+\frac{\mathrm{Im}\{r_{nm}^{\gamma}(r_{mn}^{\alpha}\Delta_{% mn}^{\beta}+r_{mn}^{\beta}\Delta_{mn}^{\alpha})\}}{\varepsilon_{mn}^{2}}+ divide start_ARG roman_Im { italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_γ end_POSTSUPERSCRIPT ( italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT roman_Δ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT roman_Δ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ) } end_ARG start_ARG italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG
×(1ωεmn42ωεmn)absent1Planck-constant-over-2-pi𝜔subscript𝜀𝑚𝑛42Planck-constant-over-2-pi𝜔subscript𝜀𝑚𝑛\displaystyle\qquad\qquad\qquad\times\bigg{(}\frac{1}{\hbar\omega-\varepsilon_% {mn}}-\frac{4}{2\hbar\omega-\varepsilon_{mn}}\bigg{)}× ( divide start_ARG 1 end_ARG start_ARG roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT end_ARG - divide start_ARG 4 end_ARG start_ARG 2 roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT end_ARG )
Im{rmnαrnm;γβ+rmnβrnm;γα}2εmn(ωεmn)].\displaystyle\qquad-\frac{\mathrm{Im}\{r_{mn}^{\alpha}r_{nm;\gamma}^{\beta}+r_% {mn}^{\beta}r_{nm;\gamma}^{\alpha}\}}{2\varepsilon_{mn}(\hbar\omega-% \varepsilon_{mn})}\Bigg{]}\,.- divide start_ARG roman_Im { italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_γ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_γ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT } end_ARG start_ARG 2 italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ( roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) end_ARG ] . (88)

Here, C0e3/(2ϵ0V)subscript𝐶0superscript𝑒32subscriptitalic-ϵ0𝑉C_{0}\equiv e^{3}/(2\epsilon_{0}V)italic_C start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ≡ italic_e start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT / ( 2 italic_ϵ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_V ) where V𝑉Vitalic_V is the crystal volume, Δmnα(pmmαpnnα)/msuperscriptsubscriptΔ𝑚𝑛𝛼superscriptsubscript𝑝𝑚𝑚𝛼superscriptsubscript𝑝𝑛𝑛𝛼𝑚\Delta_{mn}^{\alpha}\equiv(p_{mm}^{\alpha}-p_{nn}^{\alpha})/mroman_Δ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ≡ ( italic_p start_POSTSUBSCRIPT italic_m italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT - italic_p start_POSTSUBSCRIPT italic_n italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ) / italic_m denotes the velocity difference between bands n𝑛nitalic_n and m𝑚mitalic_m, and rnmαsuperscriptsubscript𝑟𝑛𝑚𝛼r_{nm}^{\alpha}italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT is the interband (nm𝑛𝑚n\neq mitalic_n ≠ italic_m) position matrix element, obtained from imrnmα=pnmα/εnm𝑖𝑚superscriptsubscript𝑟𝑛𝑚𝛼Planck-constant-over-2-pisuperscriptsubscript𝑝𝑛𝑚𝛼subscript𝜀𝑛𝑚imr_{nm}^{\alpha}=\hbar p_{nm}^{\alpha}/\varepsilon_{nm}italic_i italic_m italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT = roman_ℏ italic_p start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT / italic_ε start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT. All energies, occupations and matrix elements in the preceding expressions depend on the 𝐤𝐤\mathbf{k}bold_k-vector. Also, the summation over 𝐤𝐤\mathbf{k}bold_k implies an integral over the first BZ, i.e. (2π)3𝐤VBZd3𝐤superscript2𝜋3subscript𝐤𝑉subscriptBZsuperscriptd3𝐤(2\pi)^{3}\sum_{\mathbf{k}}\rightarrow V\int_{\mathrm{BZ}}\mathrm{d}^{3}{% \mathbf{k}}( 2 italic_π ) start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT ∑ start_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT → italic_V ∫ start_POSTSUBSCRIPT roman_BZ end_POSTSUBSCRIPT roman_d start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT bold_k. The primed summation signs indicate omission of terms with two or more identical indices. Finally, the generalized derivative rnm;αβsuperscriptsubscript𝑟𝑛𝑚𝛼𝛽r_{nm;\alpha}^{\beta}italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT (for nm𝑛𝑚n\neq mitalic_n ≠ italic_m) are evaluated from the sum rule [237]

rnm;αβsuperscriptsubscript𝑟𝑛𝑚𝛼𝛽\displaystyle r_{nm;\alpha}^{\beta}italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT =rnmαΔmnβ+rnmβΔmnαεnmabsentPlanck-constant-over-2-pisuperscriptsubscript𝑟𝑛𝑚𝛼superscriptsubscriptΔ𝑚𝑛𝛽superscriptsubscript𝑟𝑛𝑚𝛽superscriptsubscriptΔ𝑚𝑛𝛼subscript𝜀𝑛𝑚\displaystyle=\hbar\frac{r_{nm}^{\alpha}\Delta_{mn}^{\beta}+r_{nm}^{\beta}% \Delta_{mn}^{\alpha}}{\varepsilon_{nm}}= roman_ℏ divide start_ARG italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT roman_Δ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT roman_Δ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT end_ARG start_ARG italic_ε start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT end_ARG
+iεnmln,m(εlmrnlαrlmβεnlrnlβrlmα).𝑖Planck-constant-over-2-pisubscript𝜀𝑛𝑚subscript𝑙𝑛𝑚subscript𝜀𝑙𝑚superscriptsubscript𝑟𝑛𝑙𝛼superscriptsubscript𝑟𝑙𝑚𝛽subscript𝜀𝑛𝑙superscriptsubscript𝑟𝑛𝑙𝛽superscriptsubscript𝑟𝑙𝑚𝛼\displaystyle+\frac{i\hbar}{\varepsilon_{nm}}\sum_{l\neq n,m}(\varepsilon_{lm}% r_{nl}^{\alpha}r_{lm}^{\beta}-\varepsilon_{nl}r_{nl}^{\beta}r_{lm}^{\alpha})\,.+ divide start_ARG italic_i roman_ℏ end_ARG start_ARG italic_ε start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT end_ARG ∑ start_POSTSUBSCRIPT italic_l ≠ italic_n , italic_m end_POSTSUBSCRIPT ( italic_ε start_POSTSUBSCRIPT italic_l italic_m end_POSTSUBSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_l end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_l italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT - italic_ε start_POSTSUBSCRIPT italic_n italic_l end_POSTSUBSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_l end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_l italic_m end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ) . (89)

Here, infinite sums have been substituted with finite sums over a limited, yet sizable, set of bands. It’s important to emphasize that both sides of the equation are dependent on the 𝐤𝐤\mathbf{k}bold_k-vector, and the summation on the right-hand side pertains exclusively to bands. It should be mentioned that another implementation for the quadratic susceptibility tensor in the velocity gauge is also available in the code, but is not documented here. For sufficiently many bands, the results of the two implementations are identical [236].

Regarding the shift current, where a DC current is induced in response to an incident AC field, one needs to compute the quadratic conductivity tensor σγαβ(2)superscriptsubscript𝜎𝛾𝛼𝛽2\sigma_{\gamma\alpha\beta}^{(2)}italic_σ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT:

σγαβ(2)superscriptsubscript𝜎𝛾𝛼𝛽2\displaystyle\sigma_{\gamma\alpha\beta}^{(2)}italic_σ start_POSTSUBSCRIPT italic_γ italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 2 ) end_POSTSUPERSCRIPT =πe32V𝐤,nmfnmIm{rmnαrnm;γβ+rmnβrnm;γβ}absent𝜋superscript𝑒3superscriptPlanck-constant-over-2-pi2𝑉subscriptsuperscript𝐤𝑛𝑚subscript𝑓𝑛𝑚Imsuperscriptsubscript𝑟𝑚𝑛𝛼superscriptsubscript𝑟𝑛𝑚𝛾𝛽superscriptsubscript𝑟𝑚𝑛𝛽superscriptsubscript𝑟𝑛𝑚𝛾𝛽\displaystyle=\frac{\pi e^{3}}{\hbar^{2}V}\sideset{}{{}^{\prime}}{\sum}_{% \mathbf{k},nm}f_{nm}\mathrm{Im}\{r_{mn}^{\alpha}r_{nm;\gamma}^{\beta}+r_{mn}^{% \beta}r_{nm;\gamma}^{\beta}\}= divide start_ARG italic_π italic_e start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT end_ARG start_ARG roman_ℏ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_V end_ARG SUPERSCRIPTOP start_ARG ∑ end_ARG ′ start_POSTSUBSCRIPT bold_k , italic_n italic_m end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_n italic_m end_POSTSUBSCRIPT roman_Im { italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_γ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT + italic_r start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT italic_r start_POSTSUBSCRIPT italic_n italic_m ; italic_γ end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_β end_POSTSUPERSCRIPT }
×δ(ωεmn).absent𝛿Planck-constant-over-2-pi𝜔subscript𝜀𝑚𝑛\displaystyle\qquad\qquad\times\delta(\hbar\omega-\varepsilon_{mn})\,.× italic_δ ( roman_ℏ italic_ω - italic_ε start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT ) . (90)

In practice, the delta function is replaced by a Lorentzian with a finite broadeining η𝜂\etaitalic_η. To avoid numerical instabilities, the implementation of Eqs. (VI.9)-(VI.9) uses a tolerance, such that terms are neglected if the associated energy differences or differences in Fermi levels are smaller than a tolerance. The default value of the tolerance is 106superscript10610^{-6}10 start_POSTSUPERSCRIPT - 6 end_POSTSUPERSCRIPT eV, and 104superscript10410^{-4}10 start_POSTSUPERSCRIPT - 4 end_POSTSUPERSCRIPT for the energy and Fermi level differences, respectively.

VII Real-time TDDFT

Refer to caption
Figure 12: Photoabsorption spectrum for a Ag147 icosahedral nanoparticle and the transition contribution map at 3.8 eV. The map reveals that transitions between KS states near the Fermi level contribute constructively to the plasmon resonance, while transitions from occupied states at the d𝑑ditalic_d-band edge contribute destructively (screening).

The real-time TDDFT (RT-TDDFT) scheme, also known as time-propagation TDDFT, is implemented in FD [34] and LCAO [52] modes. It requires non-periodic boundary conditions, but is not restricted to the linear regime and can be applied to model molecules in strong fields. The metod may combined with hybrid quantum-classical modeling to simulate the dynamical interaction between molecules and plasmon resonances at metal surfaces  [238]. The LCAO-RT-TDDFT is the more recent implementation supporting versatile analyses and enabling modeling of large systems thanks to its efficiency [52, 53, 239, 54, 240, 241, 242, 243, 244, 245]. We focus on the capabilities of the LCAO version in this section, but some of the described functionalities are also available in FD mode.

The time-dependent KS equation in the PAW formalism is

iS^ddt|ψ~n(t)=(H^[n(𝐫)]+v^(t))|ψ~n(t),𝑖^𝑆dd𝑡ketsubscript~𝜓𝑛𝑡^𝐻delimited-[]𝑛𝐫^𝑣𝑡ketsubscript~𝜓𝑛𝑡\displaystyle i\hat{S}\frac{\mathrm{d}}{\mathrm{d}t}|\tilde{\psi}_{n}(t)% \rangle=\left(\hat{H}[n(\mathbf{r})]+\hat{v}(t)\right)|\tilde{\psi}_{n}(t)\rangle,italic_i over^ start_ARG italic_S end_ARG divide start_ARG roman_d end_ARG start_ARG roman_d italic_t end_ARG | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( italic_t ) ⟩ = ( over^ start_ARG italic_H end_ARG [ italic_n ( bold_r ) ] + over^ start_ARG italic_v end_ARG ( italic_t ) ) | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( italic_t ) ⟩ , (91)

where the Kohn–Sham Hamiltonian H^[n(𝐫)]^𝐻delimited-[]𝑛𝐫\hat{H}[n(\mathbf{r})]over^ start_ARG italic_H end_ARG [ italic_n ( bold_r ) ] is implicitly dependent on time through the time-dependent density and v^(t)^𝑣𝑡\hat{v}(t)over^ start_ARG italic_v end_ARG ( italic_t ) is an explicitly time-dependent external potential. We have additionally assumed that the overlap matrix S^^𝑆\hat{S}over^ start_ARG italic_S end_ARG is independent of time, i.e. there are no ion dynamics.

Starting from the ground state, Eq. (91) is propagated forward numerically. After each step, a new density is computed and H^[n(𝐫)]^𝐻delimited-[]𝑛𝐫\hat{H}[n(\mathbf{r})]over^ start_ARG italic_H end_ARG [ italic_n ( bold_r ) ] updated accordingly. The user can can freely define the external potential and implemented standard potentials include the delta-kick v^(t)=x^δ(t)^𝑣𝑡^𝑥𝛿𝑡\hat{v}(t)=\hat{x}\delta(t)over^ start_ARG italic_v end_ARG ( italic_t ) = over^ start_ARG italic_x end_ARG italic_δ ( italic_t ) and a Gaussian pulse v^(t)=x^exp[σ2(tt0)2/2]cos[ω(tt0)]^𝑣𝑡^𝑥superscript𝜎2superscript𝑡subscript𝑡022𝜔𝑡subscript𝑡0\hat{v}(t)=\hat{x}\exp[-\sigma^{2}(t-t_{0})^{2}/2]\cos[\omega(t-t_{0})]over^ start_ARG italic_v end_ARG ( italic_t ) = over^ start_ARG italic_x end_ARG roman_exp [ - italic_σ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ( italic_t - italic_t start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT / 2 ] roman_cos [ italic_ω ( italic_t - italic_t start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) ], where x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG is the dipole operator in the direction x𝑥xitalic_x.

During the propagation, different time-dependent variables can be recorded, and after the propagation they can be post-processed to quantities of physical and chemical interest. As a basic example, the time-dependent dipole moment recorded for a delta-kick perturbation can be Fourier-transformed to yield the photoabsorption spectrum [246]. Observables are recorded by attaching observers to the calculation and implemented observers include writers for the dipole moment, magnetic moment, KS density matrix in frequency space and wave functions.

RT-TDDFT calculations can be started from the ground state or continued from the last state of a previous time propagation and the time-limiter feature allows one to limit jobs to a predefined amount of wall time. Together with the continuation capability, this facilitates time propagation in short chunks, efficiently using shared high-performance resources.

In the LCAO-RT-TDDFT implementation, Eq. (91) is cast into a matrix equation and solved with ScaLAPACK [52]. The intermediate step of updating the Hartree and XC potential is performed on the real-space grid.

VII.1 Kohn–Sham decomposition

The time-dependent KS density matrix can be written as

ρnn(t)=mfm×(ψn(0)(𝐫))ψm(𝐫,t)d𝐫×ψm(𝐫,t)ψn(0)(𝐫)d𝐫,subscript𝜌𝑛superscript𝑛𝑡subscript𝑚subscript𝑓𝑚superscriptsubscriptsuperscript𝜓0𝑛𝐫subscript𝜓𝑚𝐫𝑡differential-d𝐫subscriptsuperscript𝜓𝑚superscript𝐫𝑡subscriptsuperscript𝜓0superscript𝑛superscript𝐫differential-dsuperscript𝐫\displaystyle\begin{split}\rho_{nn^{\prime}}(t)=\sum_{m}f_{m}\times&\int\left(% \psi^{(0)}_{n}(\mathbf{r})\right)^{*}\psi_{m}(\mathbf{r},t)\mathrm{d}{\mathbf{% r}}\\ \times&\int\psi^{*}_{m}(\mathbf{r}^{\prime},t)\psi^{(0)}_{n^{\prime}}(\mathbf{% r^{\prime}})\mathrm{d}{\mathbf{r}^{\prime}},\end{split}start_ROW start_CELL italic_ρ start_POSTSUBSCRIPT italic_n italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_t ) = ∑ start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT × end_CELL start_CELL ∫ ( italic_ψ start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r ) ) start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT italic_ψ start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ( bold_r , italic_t ) roman_d bold_r end_CELL end_ROW start_ROW start_CELL × end_CELL start_CELL ∫ italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t ) italic_ψ start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) roman_d bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , end_CELL end_ROW (92)

where ψm(𝐫,t)subscriptsuperscript𝜓𝑚superscript𝐫𝑡\psi^{*}_{m}(\mathbf{r}^{\prime},t)italic_ψ start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ( bold_r start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT , italic_t ) are the time-dependent KS orbitals with ground state occupation factors fmsubscript𝑓𝑚f_{m}italic_f start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT. The KS density matrix is a central quantity enabling computation of observables and may be evaluated efficiently in the LCAO mode [54].

The Fourier transform of the induced density matrix δρnn(ω)=[ρnn(t)ρnn(0)]𝛿subscript𝜌𝑛superscript𝑛𝜔delimited-[]subscript𝜌𝑛superscript𝑛𝑡subscript𝜌𝑛superscript𝑛0\delta\rho_{nn^{\prime}}(\omega)=\mathcal{F}[\rho_{nn^{\prime}}(t)-\rho_{nn^{% \prime}}(0)]italic_δ italic_ρ start_POSTSUBSCRIPT italic_n italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_ω ) = caligraphic_F [ italic_ρ start_POSTSUBSCRIPT italic_n italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_t ) - italic_ρ start_POSTSUBSCRIPT italic_n italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( 0 ) ] can be built on the fly during time propagation through the density-matrix observer. Details on the implementation are described in Ref.  [54]. The KS density matrix in frequency space is related to the Casida eigenvectors and gives similar information as the solution of the Casida equation [54]. Observables such as the polarizability can be decomposed into a sum over the electron–hole part of the KS density matrix ρnnsubscript𝜌𝑛𝑛\rho_{nn}italic_ρ start_POSTSUBSCRIPT italic_n italic_n end_POSTSUBSCRIPT, where fn>fnsubscript𝑓𝑛subscript𝑓superscript𝑛f_{n}>f_{n^{\prime}}italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT > italic_f start_POSTSUBSCRIPT italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT. This enables illustrative analyses, e.g., by visualizing ρnn(ω)subscript𝜌𝑛superscript𝑛𝜔\rho_{nn^{\prime}}(\omega)italic_ρ start_POSTSUBSCRIPT italic_n italic_n start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT ( italic_ω ) on energy axes as a transition contribution map [247], from which the nature of the localized surface plasmon resonance can be understood (Fig. 12, see Ref. [54] for detailed discussion).

VII.2 Hot-carrier analysis

The KS density matrix is a practical starting point for analyzing hot-carrier generation in plasmonic nanostructures. In the regime of weak perturbations, the KS density matrix resulting from arbitrary pulses can be obtained from delta-kick calculations by a post-processing routine [243, 244]. By decomposing the matrix into different spatial and energetic contributions, hot-carrier generation in nanostructures [243, 245] and across nanoparticle-semiconductor [241] and nanoparticle-molecule [240, 244] interfaces can be studied. Computational codes and workflows for such hot-carrier analyses are provided in Refs. [248, 249].

VII.3 Circular dichroism for molecules

Electronic circular dichroism (ECD) is a powerful spectroscopic method for investigating chiral properties at the molecular level. The quantity that characterizes the ECD is the rotatory strength, which is defined through the magnetic dipole moment m(ω)𝑚𝜔m(\omega)italic_m ( italic_ω ) as

R(ω)=1πκRe[αmα(α)(ω)],𝑅𝜔1𝜋𝜅Redelimited-[]subscript𝛼superscriptsubscript𝑚𝛼𝛼𝜔R(\omega)=\frac{1}{\pi\kappa}\mathrm{Re}\bigg{[}\sum_{\alpha}m_{\alpha}^{(% \alpha)}(\omega)\bigg{]},italic_R ( italic_ω ) = divide start_ARG 1 end_ARG start_ARG italic_π italic_κ end_ARG roman_Re [ ∑ start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_α ) end_POSTSUPERSCRIPT ( italic_ω ) ] , (93)

where the index α𝛼\alphaitalic_α enumerates Cartesian directions, the α𝛼\alphaitalic_α superscript in parenthesis indicates the δ𝛿\deltaitalic_δ-kick direction and κ𝜅\kappaitalic_κ is the strength of the kick. To resolve R(ω)𝑅𝜔R(\omega)italic_R ( italic_ω ), one needs to perform the δ𝛿\deltaitalic_δ-kick in all three Cartesian directions using a perturbing electric field 𝐄α(t)=κα^δ(t)superscript𝐄𝛼𝑡𝜅^𝛼𝛿𝑡\mathbf{E}^{\alpha}(t)=\kappa\hat{\mathbf{\alpha}}\delta(t)bold_E start_POSTSUPERSCRIPT italic_α end_POSTSUPERSCRIPT ( italic_t ) = italic_κ over^ start_ARG italic_α end_ARG italic_δ ( italic_t ). The frequency components of the dipole moment mi(i)(ω)superscriptsubscript𝑚𝑖𝑖𝜔m_{i}^{(i)}(\omega)italic_m start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_i ) end_POSTSUPERSCRIPT ( italic_ω ) are calculated by Fourier transforming mα(α)(t)superscriptsubscript𝑚𝛼𝛼𝑡m_{\alpha}^{(\alpha)}(t)italic_m start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_α ) end_POSTSUPERSCRIPT ( italic_t ), which is recorded during the propagation. Finally, the time-dependent magnetic dipole moment is obtained as the expectation value of the operator 𝐦^=i2c𝐫^×^^𝐦𝑖2𝑐^𝐫^\hat{\mathbf{m}}=-\frac{i}{2c}\hat{\mathbf{r}}\times\hat{\nabla}over^ start_ARG bold_m end_ARG = - divide start_ARG italic_i end_ARG start_ARG 2 italic_c end_ARG over^ start_ARG bold_r end_ARG × over^ start_ARG ∇ end_ARG,

𝐦(t)=nfnψn(𝐫,t)𝐦^ψn(𝐫,t)d𝐫,𝐦𝑡subscript𝑛subscript𝑓𝑛superscriptsubscript𝜓𝑛𝐫𝑡^𝐦subscript𝜓𝑛𝐫𝑡differential-d𝐫\mathbf{m}(t)=\sum_{n}f_{n}\int\psi_{n}^{*}({\mathbf{r}},t)\,\hat{\mathbf{m}}% \,\psi_{n}({\mathbf{r}},t)~{}{\rm d}\mathbf{r},bold_m ( italic_t ) = ∑ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ∫ italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT ( bold_r , italic_t ) over^ start_ARG bold_m end_ARG italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r , italic_t ) roman_d bold_r , (94)

where fnsubscript𝑓𝑛f_{n}italic_f start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT is the occupation number of KS orbital n𝑛nitalic_n and ψn(𝐫,t)subscript𝜓𝑛𝐫𝑡\psi_{n}({\bf r},t)italic_ψ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r , italic_t ) is the time-evolved KS state. The current GPAW implementation supports both the FD and LCAO mode and the computational efficiency of the LCAO mode enables calculation of the ECD of nanoscale metal-organic nanoclusters. More details on the implementation can be found in Ref. [55].

VII.4 Radiation reaction potential

Plasmonic or collective molecular excitations are strongly susceptible to any kind of optical interaction. Induced currents will couple via Maxwell’s equation of motion to the optical environment and result in radiative losses, i.e., decay towards the ground state. It is possible to solve the Maxwell problem formally by obtaining Green’s tensor G(ω)subscriptGperpendicular-to𝜔\textbf{G}_{\perp}(\omega)G start_POSTSUBSCRIPT ⟂ end_POSTSUBSCRIPT ( italic_ω ). The dipolar interaction between electric field and electronic dipole can be absorbed into a local potential vrr(r,t)=erEr,(t)=er[t1(iμ0ωG(ω))tR(t)]subscript𝑣rrr𝑡𝑒rsubscriptE𝑟perpendicular-to𝑡𝑒rdelimited-[]superscriptsubscript𝑡1𝑖subscript𝜇0𝜔subscriptGperpendicular-to𝜔subscript𝑡R𝑡v_{\text{rr}}(\textbf{r},t)=e\textbf{r}\cdot\textbf{E}_{r,\perp}(t)=e\textbf{r% }\cdot\big{[}\mathcal{F}_{t}^{-1}(i\mu_{0}\omega\textbf{G}_{\perp}(\omega))% \ast\partial_{t}\textbf{R}(t)\big{]}italic_v start_POSTSUBSCRIPT rr end_POSTSUBSCRIPT ( r , italic_t ) = italic_e r ⋅ E start_POSTSUBSCRIPT italic_r , ⟂ end_POSTSUBSCRIPT ( italic_t ) = italic_e r ⋅ [ caligraphic_F start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT ( italic_i italic_μ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT italic_ω G start_POSTSUBSCRIPT ⟂ end_POSTSUBSCRIPT ( italic_ω ) ) ∗ ∂ start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT R ( italic_t ) ] suitable for Kohn–Sham TDDFT, where R(t)R𝑡\textbf{R}(t)R ( italic_t ) is the total electronic dipole moment. A detailed discussion can be found in Ref. [250].

For many simple structures, such as free-space, one-dimensional wave-guides, or dielectric spheres, G(ω)subscriptGperpendicular-to𝜔\textbf{G}_{\perp}(\omega)G start_POSTSUBSCRIPT ⟂ end_POSTSUBSCRIPT ( italic_ω ) is analytically known and radiative losses can then be included in TDDFT without additional coimputational cost. The tutorials on the GPAW web-page [61] includes an example for one-dimensional wave-guides for which the user can specify the cross sectional area and the polarization of the propagating modes. Extending the functionality of the radiation-reaction potential to 3D free-space and collective interaction of large ensembles in Fabry-Pérot cavities from first principles [251] is essential for the understanding of polaritonic chemistry. This functionality is currently under development.

VII.5 Ehrenfest dynamics

Molecular dynamics (MD) simulations usually rely on the Born-Oppenheimer approximation, where the electronic system is assumed to react so much faster than the ionic system that it reaches its ground state at each time step. Thus, forces for the dynamics are calculated from the DFT ground-state density. While this approximation is sufficiently valid in most situations, there are cases where the explicit dynamics of the electronic system can affect the molecular dynamics, or the movement of the atoms can affect averaged spectral properties. These cases can be handled using so-called Ehrenfest dynamics, ie. time- dependent density functional theory molecular dynamics (TDDFT/MD).

Ehrenfest dynamics is implemented in the FD mode [252]. A description of the theory and a tutorial is available on the GPAW web-page [61]. This functionality has been used to model the electronic stopping of ions including core-electron excitations [253], study charge transfer at hybrid interfaces in the presence of water [254], simulate the coherent diffraction of neutral atom beams from graphene [255], model the dependence of carbon bond breaking under Ar+-ion irradiation on sp𝑠𝑝spitalic_s italic_p hybridization [256], and reveal charge-transfer dynamics at electrified sulfur cathodes [257]. An LCAO implementation, inspired by recent work in the Siesta code [258, 259], is currently under development.

VIII Excited-state DFT methods

VIII.1 Improved virtual orbitals

The linear response TDDFT approach generally provides reasonably accurate excitation energies for low-lying valence excited states, where the orbitals associated with the holes and excited electrons overlap significantly. However, it tends to fail for excitations involving spatial rearrangment of the electrons, such as charge transfer [260, 113], Rydberg [261] and doubly excited states [262].

Some of these problems can be alleviated by using range separated functionals (see section III.3.4). However, these functionals come with a significantly increased computational cost due to the evaluation of exchange integrals. Moreover, due to the missing cancellation of Coulomb and exchange terms for canonical unoccupied orbitals within Hartree-Fock theory, one obtains spurious unoccupied orbitals. This leads to slow covergence of linear-response TDDFT calculations with respect to the number of unoccuppied orbitals when hybrid and range-separated functionals are used [122, 123].

Substantial improvement in convergence with respect to unoccupied orbitals can be obtained using improved virtual orbitals as devised by Huzinaga and Arnau [263, 264]. In this approach, a modified Fock operator is used for the unoccupied orbitals, which mimics the interaction between a hole arbitrarily chosen among the occupied ground state orbitals and the excited electron. This leads to faster convergence in linear-response TDDFT calculations with hybrid and range-separated functionals, and also makes it possible to evaluate excited state properties. For example, the energetics of long-range charge transfer can be obtained by means of a ground state calculations because the difference between the energy of an improved virtual orbital and a hole tends to approximate the excitation energy. The improved virtual orbitals approach is available in GPAW and details on the implementation are described in Ref. [123].

VIII.2 Variational excited-state calculations

GPAW also offers the possibility to perform excited-state calculations using an alternative time-independent density functional approach [265] (sometimes referred to as the “ΔΔ\Deltaroman_ΔSCF” method), which does not suffer from the limitations of linear-response TDDFT mentioned in the previous section. The method involves variational optimization of the orbitals corresponding to a specific excited state by optimizing the electronic energy to a stationary point other than the ground state. The computational effort is similar to that of ground-state calculations and the variational optimization guarantees that the Hellmann–Feynman theorem is fulfilled. Therefore, all the ground-state machinery available in GPAW to evaluate atomic forces can be used for geometry optimization and for simulating the dynamics of atoms on the excited state. Furthermore, coupling this time-independent, variational approach for excited-state calculations with external MM potentials (see section IV) does not involve additional implementation efforts compared to ground-state calculations and provides a means for performing excited-state QM/MM molecular dynamics simulations that include the state-specific response of a solvent, i.e. the response due to changes in the electron density of the solute.

Variationally optimized excited states correspond to single Slater determinants of optimal orbitals with a non-aufbau occupation and are typically saddle points on the electronic energy surface. Hence, variational calculations of excited states are prone to collapsing to lower-energy solutions, which preserve the symmetry of the initial guess. A simple maximum overlap method (MOM) [266, 267] is available in GPAW to address this problem. At each SCF step, the MOM occupies those orbitals that overlap the most with the orbitals of a non-aufbau initial guess, usually obtained from a ground-state calculation. The MOM, however, does not guarantee that variational collapse is avoided, and convergence issues are common when using SCF eigensolvers with density-mixing schemes developed for ground-state calculations.

VIII.2.1 Direct orbital optimization

To alleviate the issues leading to variational collapse and achieve more robust convergence to excited-state solutions, GPAW contains two alternative strategies that are more reliable than conventional SCF eigensolvers with the MOM. They are based on direct optimization of the orbitals and use saddle point search algorithms akin to those for transition-state searches on potential energy surfaces of atomic rearrangements. These approaches also facilitate variational excited-state calculations of nonunitary invariant functionals, such as self-interaction corrected functionals (see section III.3.5).

The first of these methods is a direct orbital optimization approach supplemented with the MOM (DO-MOM). This method is an extension of the direct minimization approach using the exponential transformation illustrated in section III.2.5 where the search is for a generic stationary point of E[𝚿]𝐸delimited-[]𝚿E[\mathbf{\Psi}]italic_E [ bold_Ψ ] instead of a minimum:

stat𝚿E[𝚿]=min𝚿0stat𝐀[𝐀,𝚿0].𝚿statEdelimited-[]𝚿subscript𝚿0min𝐀stat𝐀subscript𝚿0\underset{\mathbf{\Psi}}{\rm stat\,}E[\mathbf{\Psi}]=\underset{\mathbf{\Psi}_{% 0}}{\rm min\,}\underset{\mathbf{A}}{\rm stat\,}\mathcal{F}[\mathbf{A},{\mathbf% {\Psi}_{0}}]\,.underbold_Ψ start_ARG roman_stat end_ARG roman_E [ bold_Ψ ] = start_UNDERACCENT bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_UNDERACCENT start_ARG roman_min end_ARG underbold_A start_ARG roman_stat end_ARG caligraphic_F [ bold_A , bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ] . (95)

The DO-MOM is available in GPAW for both LCAO [51, 268], real-space grid, and plane wave basis sets [50]. For the LCAO basis, the excited-state optimization only necessitates making the energy stationary with respect to the elements of the anti-Hermitian matrix 𝐀𝐀\mathbf{A}bold_A (the orbital rotation angles), while calculations using the real-space grid and plane-wave basis include an outer-loop minimization with respect to the reference orbitals 𝚿0subscript𝚿0{\mathbf{\Psi}_{0}}bold_Ψ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT. The optimization in the linear space of anti-Hermitian matrices uses efficient quasi-Newton algorithms that can handle negative Hessian eigenvalues and therefore converge on saddle points. GPAW implements a novel limited-memory SR1 (L-SR1) algorithm, which has proven to be robust for calculations of excitations in molecules [50, 51].

The DO-MOM relies on estimating the degrees of freedom along which the energy needs to be maximized starting from an initial guess. For valence and Rydberg excitations, the initial guess consisting of ground-state canonical orbitals with non-aufbau occupation numbers and preconditioning with a diagonal approximation of the electronic Hessian using the orbital energies [79] can be sufficient. However, if the excitation involves significant charge transfer, large rearrangements of the energy ordering of the orbitals can occur, and DO-MOM can struggle to converge. A second direct optimization method with generalized mode following (DO-GMF) [49] alleviates these problems and is also implemented. In DO-GMF, the components of the energy gradient 𝐠𝐠\mathbf{g}bold_g along the modes 𝐯isubscript𝐯𝑖\mathbf{v}_{i}bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT corresponding to the n𝑛nitalic_n lowest eigenvalues of the electronic Hessian are inverted yielding

𝐠mod=𝐠2i=1n𝐯i𝐯iT𝐠,superscript𝐠mod𝐠2superscriptsubscript𝑖1𝑛subscript𝐯𝑖superscriptsubscript𝐯𝑖T𝐠\mathbf{g}^{\mathrm{\,mod}}=\mathbf{g}-2\sum_{i=1}^{n}\mathbf{v}_{i}\mathbf{v}% _{i}^{\mathrm{T}}\mathbf{g}\,,bold_g start_POSTSUPERSCRIPT roman_mod end_POSTSUPERSCRIPT = bold_g - 2 ∑ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT bold_v start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_T end_POSTSUPERSCRIPT bold_g , (96)

and a minimization using the modified gradient 𝐠modsuperscript𝐠mod\mathbf{g}^{\mathrm{\,mod}}bold_g start_POSTSUPERSCRIPT roman_mod end_POSTSUPERSCRIPT is performed by following the n𝑛nitalic_n modes simultaneously. This procedure guarantees convergence to an nthsuperscript𝑛thn^{\rm th}italic_n start_POSTSUPERSCRIPT roman_th end_POSTSUPERSCRIPT-order saddle point, eliminating the risk of variational collapse altogether. While it is computationally more expensive than DO-MOM due to the need for a partial Hessian diagonalization, DO-GMF is more robust. Hence, it is particularly useful in the exploration of potential energy surfaces because it is able to follow an excited state through bond-breaking configurations, where broken-symmetry solutions appear, by targeting the solution that preserves the saddle point order. This important advantage is exemplified by the challenging double-bond twisting in ethylene [49, 133], where DO-GMF calculations of the lowest doubly excited state provide an avoided crossing with the ground state whereas other methods fail to do so.

VIII.2.2 Example applications of direct optimization

Refer to caption
Figure 13: Applications of time-independent, variational calculations of excited states to a molecule in vacuum (left), a molecule in solution (middle) and a solid-state system (right). Left: Deviation of the calculated excitation energy of a charge-transfer excited state in the N-phenylpyrrole molecule from the theoretical best estimate of 5.58 eV  [269]. The results of linear-response TDDFT calculations with hybrid functionals are from Ref. [269]. Middle: Time-evolution of the interligand angles of the [Cu(dmphen)2]+ complex upon photoexcitation to the lowest metal-to-ligand charge-transfer (MLCT) state in acetonitrile. The experimental results from femtosecond X-ray scattering measurements [270] are compared to the average over excited-state molecular dynamics trajectories obtained using the QM/MM electrostatic embedding scheme in GPAW [165] (see section IV) and convoluted with the experimental instrument-response function [270]. Right: Vertical excitation energy for excitations in the negative nitrogen-vacancy center in diamond obtained with the r2SCAN functional as compared to the results of previous calculations using an advanced quantum embedding approach [271]. The orbitals involved in the electronic transitions are visualized in the inset (C atoms are grey and the N atom is orange).

The efficiency and robustness of the direct-optimization approaches combined with the possibility of choosing different basis-set types make variational calculations of excitated states in GPAW applicable to a great variety of systems ranging from molecules in gas phase or solution to solids.

State-specific orbital relaxation enables the description of challenging excitations characterized by large density rearrangements. Figure 13 shows the error on the vertical excitation energy of a charge-transfer excitation in the twisted N-phenylpyrrole molecule [49] obtained with direct optimization in GPAW using the LDA, PBE and BLYP functionals and an sz+aug-cc-pVDZ [53] basis set as compared to the results of linear-response TDDFT calculations with the same basis set and functionals, as well as the hybrid functionals PBE0 and B3LYP (results from Ref. [269]). For the variational calculations, the energy of the singlet excited state is computed using the spin-purification formula Es=2EmEtsubscript𝐸s2subscript𝐸msubscript𝐸tE_{\mathrm{s}}=2E_{\mathrm{m}}-E_{\mathrm{t}}italic_E start_POSTSUBSCRIPT roman_s end_POSTSUBSCRIPT = 2 italic_E start_POSTSUBSCRIPT roman_m end_POSTSUBSCRIPT - italic_E start_POSTSUBSCRIPT roman_t end_POSTSUBSCRIPT, where Emsubscript𝐸mE_{\mathrm{m}}italic_E start_POSTSUBSCRIPT roman_m end_POSTSUBSCRIPT is the energy of a spin-mixed state obtained by promoting an electron in one spin channel and Etsubscript𝐸tE_{\mathrm{t}}italic_E start_POSTSUBSCRIPT roman_t end_POSTSUBSCRIPT is the energy of the triplet state with the same character. The variational calculations underestimate the theoretical best-estimate value of the excitation energy (5.58 eV) in Ref. [269] by 0.15-0.3 eV, an error that is significantly smaller than that of linear-response TDDFT calculations with the same functionals (2.02.0-2.0- 2.0 eV) or with the more computationally intensive PBE0 hybrid functional (0.850.85-0.85- 0.85 eV) [269].

The method has also been used to simulate the photoinduced structural changes of photocatalytic metal complexes and concomitant solvation dynamics [270, 165, 182, 272, 181]. Figure 13 shows an application to the prototypical copper complex photosensitizer [Cu(dmphen)2]+ (dmphen=2,9-dimethyl-1,10-phenanthroline) in acetonitrile, where QM/MM molecular dynamics simulations elucidated an intricate interplay between deformation of the ligands and rearrangement of the surrounding solvent molecules following a photoexcitation to a metal-to-ligand charge-transfer state [270, 165].

The last example of an application shown in Figure 13 is a calculation of the excited states of a solid state system [273], the negatively charged nitrogen-vacancy center in diamond, which comprises a prototypical defect for quantum applications. The system is described with a large supercell of up to 511 atoms, and the calculations use a plane-wave basis set. In contrast to previous reports, a range of different density functionals is found to give the correct energy ordering of the excited states, with the r2SCAN functional providing the best agreement with high-level many-body quantum embedding calculations with an error of less than 0.060.060.060.06 eV [273, 271]. This example shows that the direct optimization methods in GPAW are promising tools for simulating excited states in extended systems, where alternative approaches are either computationally expensive or lack accuracy.

IX Other features

IX.1 Electric polarization

The formal polarization of bulk materials may be calculated from the modern theory of polarization [274, 275] as

𝐏F=𝐏Fel+𝐏Fn,subscript𝐏Fsuperscriptsubscript𝐏Felsuperscriptsubscript𝐏Fn\mathbf{P}_{\mathrm{F}}=\mathbf{P}_{\mathrm{F}}^{\mathrm{el}}+\mathbf{P}_{% \mathrm{F}}^{\mathrm{n}},bold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT = bold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_el end_POSTSUPERSCRIPT + bold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_n end_POSTSUPERSCRIPT , (97)

where

𝐏Fel=e(2π)3ImBZd𝐤nf𝐤nu𝐤n|𝐤|u𝐤nsuperscriptsubscript𝐏Fel𝑒superscript2𝜋3ImsubscriptBZdifferential-d𝐤subscript𝑛subscript𝑓𝐤𝑛quantum-operator-productsubscript𝑢𝐤𝑛subscript𝐤subscript𝑢𝐤𝑛\mathbf{P}_{\mathrm{F}}^{\mathrm{el}}=\frac{e}{(2\pi)^{3}}\mathrm{Im}\int_{% \mathrm{BZ}}\mathrm{d}\mathbf{k}\sum_{n}f_{\mathbf{k}n}\langle u_{\mathbf{k}n}% |\nabla_{\mathbf{k}}|u_{\mathbf{k}n}\ranglebold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_el end_POSTSUPERSCRIPT = divide start_ARG italic_e end_ARG start_ARG ( 2 italic_π ) start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT end_ARG roman_Im ∫ start_POSTSUBSCRIPT roman_BZ end_POSTSUBSCRIPT roman_d bold_k ∑ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT italic_f start_POSTSUBSCRIPT bold_k italic_n end_POSTSUBSCRIPT ⟨ italic_u start_POSTSUBSCRIPT bold_k italic_n end_POSTSUBSCRIPT | ∇ start_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT | italic_u start_POSTSUBSCRIPT bold_k italic_n end_POSTSUBSCRIPT ⟩ (98)

is the electronic contribution and

𝐏Fn=1VcellaZa𝐫asuperscriptsubscript𝐏Fn1subscript𝑉cellsubscript𝑎superscript𝑍𝑎superscript𝐫𝑎\mathbf{P}_{\mathrm{F}}^{\mathrm{n}}=\frac{1}{V_{\mathrm{cell}}}\sum_{a}Z^{a}% \mathbf{r}^{a}bold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_n end_POSTSUPERSCRIPT = divide start_ARG 1 end_ARG start_ARG italic_V start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT end_ARG ∑ start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT italic_Z start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT bold_r start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT (99)

is the contribution from the nuclei. Here the sums run over atoms in the unit cell and Zasuperscript𝑍𝑎Z^{a}italic_Z start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT is the charge of nucleus a𝑎aitalic_a (including core electrons), situated at position 𝐫asuperscript𝐫𝑎\mathbf{r}^{a}bold_r start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT. The electronic contribution can be viewed as a Brillouin-zone integral of 𝐤𝐤\mathbf{k}bold_k-space Berry phases and may be evaluated from a finite-difference version of Eq. (98[276]. This involves the overlaps between Bloch orbitals at neighbouring 𝐤𝐤\mathbf{k}bold_k-points, which are straightforward to evaluate in the PAW formalism [46].

Eq. (97) is only defined modulo e𝐑𝐢/Vcell𝑒subscript𝐑𝐢subscript𝑉celle\mathbf{R_{i}}/V_{\mathrm{cell}}italic_e bold_R start_POSTSUBSCRIPT bold_i end_POSTSUBSCRIPT / italic_V start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT, which follows from the arbitrary choice of unit cell for the atomic positions as well as the choice of phases for u𝐤nsubscript𝑢𝐤𝑛u_{\mathbf{k}n}italic_u start_POSTSUBSCRIPT bold_k italic_n end_POSTSUBSCRIPT, which can shift the Berry phase by 2π2𝜋2\pi2 italic_π. The change in polarization under any adiabatic deformation is, however, well defined and may be calculated as

Δ𝐏=0λdλd𝐏Fdλ,Δ𝐏superscriptsubscript0𝜆differential-d𝜆dsubscript𝐏Fd𝜆\Delta\mathbf{P}=\int_{0}^{\lambda}\mathrm{d}\lambda\frac{\mathrm{d}\mathbf{P}% _{\mathrm{F}}}{\mathrm{d}\lambda},roman_Δ bold_P = ∫ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_λ end_POSTSUPERSCRIPT roman_d italic_λ divide start_ARG roman_d bold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT end_ARG start_ARG roman_d italic_λ end_ARG , (100)

where λ𝜆\lambdaitalic_λ is some dimensionless variable parameterizing the adiabatic path. In particular, for ferroelectrics the spontaneous polarization 𝐏Ssubscript𝐏S\mathbf{P}_{\mathrm{S}}bold_P start_POSTSUBSCRIPT roman_S end_POSTSUBSCRIPT can be evaluated by choosing a path that deforms the structure from the polar ground state at λ=1𝜆1\lambda=1italic_λ = 1 to a non-polar structure at λ=0𝜆0\lambda=0italic_λ = 0.

In Fig. 14, we show an example of this for tetragonal KNbO3, which is a well-known ferroelectric [277]. The polar structure was relaxed under the constraint of tetragonal symmetry using PBE (λ=1𝜆1\lambda=1italic_λ = 1) and then linearly interpolated to the inverted structure (λ=1𝜆1\lambda=-1italic_λ = - 1) passing through a centrosymmetric point at λ=0𝜆0\lambda=0italic_λ = 0. There are infinitely many polarization branches differing by the polarization quantum ec/Vcell𝑒𝑐subscript𝑉cellec/V_{\mathrm{cell}}italic_e italic_c / italic_V start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT (c𝑐citalic_c being the lattice constant in the z𝑧zitalic_z-direction) and the spontaneous polarization is obtained by choosing a single branch and evaluating the difference in formal polarization at λ=1𝜆1\lambda=1italic_λ = 1 and λ=0𝜆0\lambda=0italic_λ = 0. Interestingly, the centrosymmetric point has a non-vanishing polarization given by half the polarization quantum. This is allowed due to the multi-valued nature of the formal polarization and such a “topological polarization” in non-polar materials has been shown to yield gapless surface states [278, 279]. Here, however, we merely use the topological polarization to emphasize the importance of evaluating the spontaneous polarization as the change in 𝐏Fsubscript𝐏F\mathbf{P}_{\mathrm{F}}bold_P start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT along an adiabatic path.

Refer to caption
Figure 14: Formal polarization along an adiabatic path connecting two states of polarization and the energy along the path in tetragonal KNbO3. The spontaneous polarization is obtained as the difference in polarization between a polar ground state (λ=1𝜆1\lambda=1italic_λ = 1) and a non-polar reference structure (λ=0𝜆0\lambda=0italic_λ = 0). The energy along the path is also shown.

The expressions (97-100) can be applied to extract various properties of non-polar materials as well, for example the Born effective charge tensors

Zαβa=VcellPβrαa,subscriptsuperscript𝑍𝑎𝛼𝛽subscript𝑉cellsubscript𝑃𝛽superscriptsubscript𝑟𝛼𝑎Z^{a}_{\alpha\beta}=V_{\mathrm{cell}}\frac{\partial P_{\beta}}{\partial r_{% \alpha}^{a}},italic_Z start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT = italic_V start_POSTSUBSCRIPT roman_cell end_POSTSUBSCRIPT divide start_ARG ∂ italic_P start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT end_ARG start_ARG ∂ italic_r start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT end_ARG , (101)

which yield the change in polarization resulting from small shifts in atomic positions. In GPAW, these are obtained by a simple call to a module that introduces a (user-defined) shift of all atoms in the unit cell and calculates the resulting change in polarization from Eq. (97-99). The Born charges may be combined with the atomic force matrix to calculate equilibrium positions under an applied static electric field and the lattice contribution to the dynamic polarizability can be calculated from the eigenvalues and eigenvectors of the force matrix [280]. In addition, the piezoelectric response can be obtained by calculating the change in polarization in response to external strain [45]. The lattice contribution to the polarizability is typically orders of magnitude smaller than the electronic part, but for ferroelectrics the soft phonon modes associated with spontaneous polarization can give rise to significant lattice polarizabilities.

We exemplify this by the well known case of 2D ferroelectric GeS [281, 282, 283] where we obtain a spontaneous polarization of 490 pC/m [284, 44] in excellent agreement with previous calculations [283]. The lattice and electronic 2D in-plane polarizabilities are αlat2D=4.32subscriptsuperscript𝛼2Dlat4.32\alpha^{\mathrm{2D}}_{\mathrm{lat}}=4.32italic_α start_POSTSUPERSCRIPT 2 roman_D end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_lat end_POSTSUBSCRIPT = 4.32 Å and αel2D=3.75subscriptsuperscript𝛼2Del3.75\alpha^{\mathrm{2D}}_{\mathrm{el}}=3.75italic_α start_POSTSUPERSCRIPT 2 roman_D end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_el end_POSTSUBSCRIPT = 3.75 Å respectively [45]. For comparison, the non-polar case of 2D MoS2 yields αlat2D=0.09subscriptsuperscript𝛼2Dlat0.09\alpha^{\mathrm{2D}}_{\mathrm{lat}}=0.09italic_α start_POSTSUPERSCRIPT 2 roman_D end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_lat end_POSTSUBSCRIPT = 0.09 Å and αel2D=6.19subscriptsuperscript𝛼2Del6.19\alpha^{\mathrm{2D}}_{\mathrm{el}}=6.19italic_α start_POSTSUPERSCRIPT 2 roman_D end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_el end_POSTSUBSCRIPT = 6.19 Å [45].

IX.2 Berry phases and band topology

Topological phases such as the quantum spin Hall state and Chern insulator depend crucially on presence of spin–orbit coupling and the band topology may be obtained from the evolution of 𝐤𝐤\mathbf{k}bold_k-space Berry phases across the Brillouin zone. In particular, for insulators the eigenvalues of the Berry phase matrix of occupied states

γmni(𝐤)=i02πdkium(𝐤)|ki|un(𝐤)superscriptsubscript𝛾𝑚𝑛𝑖subscript𝐤perpendicular-to𝑖superscriptsubscript02𝜋differential-dsubscript𝑘𝑖quantum-operator-productsubscript𝑢𝑚𝐤subscriptsubscript𝑘𝑖subscript𝑢𝑛𝐤\gamma_{mn}^{i}(\mathbf{k}_{\perp})=i\int_{0}^{2\pi}\mathrm{d}k_{i}\langle u_{% m}(\mathbf{k})|\partial_{k_{i}}|u_{n}(\mathbf{k})\rangleitalic_γ start_POSTSUBSCRIPT italic_m italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_i end_POSTSUPERSCRIPT ( bold_k start_POSTSUBSCRIPT ⟂ end_POSTSUBSCRIPT ) = italic_i ∫ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 italic_π end_POSTSUPERSCRIPT roman_d italic_k start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⟨ italic_u start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT ( bold_k ) | ∂ start_POSTSUBSCRIPT italic_k start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUBSCRIPT | italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_k ) ⟩ (102)

must change by an integer multiple of 2π2𝜋2\pi2 italic_π when a component of 𝐤subscript𝐤perpendicular-to\mathbf{k}_{\perp}bold_k start_POSTSUBSCRIPT ⟂ end_POSTSUBSCRIPT (components of 𝐤𝐤\mathbf{k}bold_k orthogonal to kisubscript𝑘𝑖k_{i}italic_k start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT) is cycled through the Brillouin zone [285]. Here, un(𝐤)subscript𝑢𝑛𝐤u_{n}(\mathbf{k})italic_u start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_k ) are spinor Bloch states, which are typically not smooth functions of 𝐤𝐤\mathbf{k}bold_k. The evaluation of Eq. (102) thus requires the construction of a smooth gauge and in GPAW this is handled by the parallel-transport algorithm of Ref. [286].

The method has been applied to high throughput search for new topological two-dimensional materials [46] and in Fig. 15 we show the calculated Berry phases of 1T’-MoS2 [287]. Due to time-reversal symmetry, the Berry phases at ΓΓ\Gammaroman_Γ and Y𝑌Yitalic_Y are two-fold degenerate, and therefore no perturbation that conserves time-reversal symmetry can open a gap in the Berry-phase spectrum. This property is diagnostic for the quantum spin Hall insulating state and closely related to the presence of gapless edge states [285].

Refer to caption
Figure 15: Berry phases of the quantum spin Hall insulator 1T’-MoS2 obtained from PBE with non-selfconsistent spin–orbit coupling. The colors indicate the expectation value of Szsubscript𝑆𝑧S_{z}italic_S start_POSTSUBSCRIPT italic_z end_POSTSUBSCRIPT for each state as defined in Ref. [46] .

The eigenvalues of Eq. (102) may also be used to calculate the electronic contribution to the formal polarization, since the sum of all individual Berry phases yields the same value as one may obtain from Eq. (98). The present approach is, however, more involved since it requires the construction of a smooth gauge, which is not needed in Eq. (98).

IX.3 Wannier functions

Wannier functions (WFs) provide a localized representation of the electronic states of a solid. The WFs are defined by a unitary transformation of the Bloch eigenstates that minimises the spatial extent of the resultant orbitals. Specifically, the n𝑛nitalic_nth Wannier function in unit cell i𝑖iitalic_i is written as

win(𝐫)=1N𝐤𝐤ei𝐤𝐑iψ~n𝐤(𝐫),subscript𝑤𝑖𝑛𝐫1subscript𝑁𝐤subscript𝐤superscript𝑒𝑖𝐤subscript𝐑𝑖subscript~𝜓𝑛𝐤𝐫w_{in}(\mathbf{r})=\frac{1}{N_{\mathbf{k}}}\sum_{\mathbf{k}}e^{-i\mathbf{k}% \cdot\mathbf{R}_{i}}\tilde{\psi}_{n\mathbf{k}}(\mathbf{r}),italic_w start_POSTSUBSCRIPT italic_i italic_n end_POSTSUBSCRIPT ( bold_r ) = divide start_ARG 1 end_ARG start_ARG italic_N start_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT end_ARG ∑ start_POSTSUBSCRIPT bold_k end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT - italic_i bold_k ⋅ bold_R start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT ( bold_r ) , (103)

where ψ~n𝐤subscript~𝜓𝑛𝐤\tilde{\psi}_{n\mathbf{k}}over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT italic_n bold_k end_POSTSUBSCRIPT is a generalized Bloch function (a superposition of Bloch eigenstates at 𝐤𝐤\mathbf{k}bold_k).

The minimization of the spatial extent of a set of WFs {wn(𝐫)}n=1Nwsuperscriptsubscriptsubscript𝑤𝑛𝐫𝑛1subscript𝑁𝑤\{w_{n}(\mathbf{r})\}_{n=1}^{N_{w}}{ italic_w start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r ) } start_POSTSUBSCRIPT italic_n = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_w end_POSTSUBSCRIPT end_POSTSUPERSCRIPT is equivalent to the maximization of the spread functional [288]

Ω=n=1Nwα=1NqWα|Zα,nn|2,Ωsuperscriptsubscript𝑛1subscript𝑁𝑤superscriptsubscript𝛼1subscript𝑁𝑞subscript𝑊𝛼superscriptsubscript𝑍𝛼𝑛𝑛2\Omega=\sum_{n=1}^{N_{w}}\sum_{\alpha=1}^{N_{q}}W_{\alpha}|Z_{\alpha,nn}|^{2},roman_Ω = ∑ start_POSTSUBSCRIPT italic_n = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_w end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ∑ start_POSTSUBSCRIPT italic_α = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_W start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT | italic_Z start_POSTSUBSCRIPT italic_α , italic_n italic_n end_POSTSUBSCRIPT | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT , (104)

where

Zα,nn=wn|ei𝐪α𝐫|wn.subscript𝑍𝛼𝑛𝑛quantum-operator-productsubscript𝑤𝑛superscript𝑒𝑖subscript𝐪𝛼𝐫subscript𝑤𝑛Z_{\alpha,nn}=\langle w_{n}|e^{-i\mathbf{q}_{\alpha}\cdot\mathbf{r}}|w_{n}\rangle.italic_Z start_POSTSUBSCRIPT italic_α , italic_n italic_n end_POSTSUBSCRIPT = ⟨ italic_w start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | italic_e start_POSTSUPERSCRIPT - italic_i bold_q start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ⋅ bold_r end_POSTSUPERSCRIPT | italic_w start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ⟩ . (105)

The {𝐪α}subscript𝐪𝛼\{\mathbf{q}_{\alpha}\}{ bold_q start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT } is a set of at most 6 reciprocal vectors connecting a 𝐤𝐤\mathbf{k}bold_k-point to its neighbors and Wαsubscript𝑊𝛼W_{\alpha}italic_W start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT are corresponding weights accounting for the shape of the unit cell [289].

The generalized Bloch functions of Eq. (103) are determined by minimizing ΩΩ\Omegaroman_Ω using e.g. a conjugate gradient scheme as implemented in the ASE Wannier module. The inputs to this Wannierization algorithm are the matrices

Zα,ij(0),𝐤superscriptsubscript𝑍𝛼𝑖𝑗0𝐤\displaystyle Z_{\alpha,ij}^{(0),\mathbf{k}}italic_Z start_POSTSUBSCRIPT italic_α , italic_i italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( 0 ) , bold_k end_POSTSUPERSCRIPT =\displaystyle== ψ~𝐤i|ei𝐪α𝐫|ψ~𝐤+𝐪α,jquantum-operator-productsubscript~𝜓𝐤𝑖superscript𝑒𝑖subscript𝐪𝛼𝐫subscript~𝜓𝐤subscript𝐪𝛼𝑗\displaystyle\langle\tilde{\psi}_{\mathbf{k}i}|e^{-i\mathbf{q}_{\alpha}\cdot% \mathbf{r}}|\tilde{\psi}_{\mathbf{k}+\mathbf{q}_{\alpha},j}\rangle⟨ over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT bold_k italic_i end_POSTSUBSCRIPT | italic_e start_POSTSUPERSCRIPT - italic_i bold_q start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ⋅ bold_r end_POSTSUPERSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT bold_k + bold_q start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT , italic_j end_POSTSUBSCRIPT ⟩ (106)
+\displaystyle++ aiiei𝐪α𝐑aΔSiiasubscript𝑎𝑖superscript𝑖superscript𝑒𝑖subscript𝐪𝛼superscript𝐑𝑎Δsuperscriptsubscript𝑆𝑖superscript𝑖𝑎\displaystyle\sum_{aii^{\prime}}e^{-i\mathbf{q}_{\alpha}\cdot\mathbf{R}^{a}}% \Delta S_{ii^{\prime}}^{a}∑ start_POSTSUBSCRIPT italic_a italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_e start_POSTSUPERSCRIPT - italic_i bold_q start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ⋅ bold_R start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT roman_Δ italic_S start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT
×ψ~𝐤i|p~iap~ia|ψ~𝐤+𝐪α,j,absentinner-productsubscript~𝜓𝐤𝑖superscriptsubscript~𝑝𝑖𝑎inner-productsuperscriptsubscript~𝑝superscript𝑖𝑎subscript~𝜓𝐤subscript𝐪𝛼𝑗\displaystyle\times\langle\tilde{\psi}_{\mathbf{k}i}|\tilde{p}_{i}^{a}\rangle% \langle\tilde{p}_{i^{\prime}}^{a}|\tilde{\psi}_{\mathbf{k}+\mathbf{q}_{\alpha}% ,j}\rangle,× ⟨ over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT bold_k italic_i end_POSTSUBSCRIPT | over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT ⟩ ⟨ over~ start_ARG italic_p end_ARG start_POSTSUBSCRIPT italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT | over~ start_ARG italic_ψ end_ARG start_POSTSUBSCRIPT bold_k + bold_q start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT , italic_j end_POSTSUBSCRIPT ⟩ ,

where ΔSiiaΔsuperscriptsubscript𝑆𝑖superscript𝑖𝑎\Delta S_{ii^{\prime}}^{a}roman_Δ italic_S start_POSTSUBSCRIPT italic_i italic_i start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_a end_POSTSUPERSCRIPT are the PAW corrections from Eq. 8. From these matrices, the ASE Wannier module can be used to construct partially occupied Wannier functions [290, 291], which are a generalization of maximally-localized Wannier functions [286] to entangled bands and non-periodic systems. Recently, a further improvement in terms of robustness of the Wannierisation procedure was achieved using a modified spread functional containing a penalty term proportional to the variance of the spread distribution of the WFs, which leads to a more uniform spread distribution [292].

IX.4 Point defect calculations with hybrid functionals

Point defects play a crucial role in many applications of semiconductors[293, 294]. First-principles calculations can be used to determine the atomic structure, formation energy, and charge-transition levels of points defects. It is well established that the best description of point defects in semiconductors/insulators is obtained using range separated hybrids, such as the HSE06 xc-functional[5, 295]. To illustrate the use of GPAW for point defect calculations, we determine the formation energy diagrams of the CN and CB defects in the hexagonal boron nitride (hBN) crystal with the HSE06 functional. These defects have been proposed to be responsible for the deep-level luminescence signal with a zero-phonon line (ZPL) around 4.1 eV.[296, 295]. The results are compared to similar results obtained with the VASP software package.

For a point-defect DD\mathrm{D}roman_D in charge state q𝑞qitalic_q, the formation energy Ef is calculated from the formula,

Ef[Dq]=Etot[Dq]Etotbulkiniμi+qEF+Ecorr.superscript𝐸fdelimited-[]superscriptD𝑞subscript𝐸totdelimited-[]superscriptD𝑞superscriptsubscript𝐸totbulksubscript𝑖subscript𝑛𝑖subscript𝜇𝑖𝑞subscript𝐸Fsubscript𝐸corrE^{\mathrm{f}}\left[\mathrm{D}^{q}\right]=E_{\mathrm{tot}}\left[\mathrm{D}^{q}% \right]-E_{\mathrm{tot}}^{\mathrm{bulk}}-\sum_{i}n_{i}\mu_{i}+qE_{\mathrm{F}}+% E_{\mathrm{corr}}.italic_E start_POSTSUPERSCRIPT roman_f end_POSTSUPERSCRIPT [ roman_D start_POSTSUPERSCRIPT italic_q end_POSTSUPERSCRIPT ] = italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT [ roman_D start_POSTSUPERSCRIPT italic_q end_POSTSUPERSCRIPT ] - italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_bulk end_POSTSUPERSCRIPT - ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_n start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_μ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT + italic_q italic_E start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT + italic_E start_POSTSUBSCRIPT roman_corr end_POSTSUBSCRIPT . (107)

Here Etot[Dq]subscript𝐸totdelimited-[]superscriptD𝑞E_{\mathrm{tot}}\left[\mathrm{D}^{q}\right]italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT [ roman_D start_POSTSUPERSCRIPT italic_q end_POSTSUPERSCRIPT ] and Etotbulksuperscriptsubscript𝐸totbulkE_{\mathrm{tot}}^{\mathrm{bulk}}italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT start_POSTSUPERSCRIPT roman_bulk end_POSTSUPERSCRIPT are the total energies of the crystal with the point defect in charge state q𝑞qitalic_q and of the neutral pristine crystal, respectively. μisubscript𝜇𝑖\mu_{i}italic_μ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is the chemical potential of the element i𝑖iitalic_i while nisubscript𝑛𝑖n_{i}italic_n start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is the number of atoms added to (ni>0subscript𝑛𝑖0n_{i}>0italic_n start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT > 0) or removed from (ni<0subscript𝑛𝑖0n_{i}<0italic_n start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT < 0) the crystal to create the defect. EFsubscript𝐸FE_{\mathrm{F}}italic_E start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT is the chemical potential of the electrons, i.e. the Fermi level, which is written as EF=EVBM+ΔEFsubscript𝐸Fsubscript𝐸VBMΔsubscript𝐸FE_{\mathrm{F}}=E_{\mathrm{VBM}}+\Delta E_{\mathrm{F}}italic_E start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT = italic_E start_POSTSUBSCRIPT roman_VBM end_POSTSUBSCRIPT + roman_Δ italic_E start_POSTSUBSCRIPT roman_F end_POSTSUBSCRIPT, where VBM is the valence band maximum. Finally, Ecorr is a correction term which accounts for: (i) the spurious electrostatic interaction between the periodic images of the defect and their interaction with the compensating homogeneous background charge and (ii) the potential shift between the pristine and defect system.

For more details on the methodology of point defect calculations we refer the reader to the excellent review papers on the topic [297, 298, 299, 300].

Refer to caption
Figure 16: Defect formation energies for CN and CB, under N-rich and N-poor conditions, respectively. The dashed lines are reproduced from Ref. 295.

All calculations have been performed using the HSE06 functional with the default mixing parameter α𝛼\alphaitalic_α=0.25, plane wave cut-off of 800 eV, and forces converged to 0.01 eV/Å. The lattice of the hBN crystal was fixed at the experimental parameters (a=2.50𝑎2.50a=2.50italic_a = 2.50 Å and c=6.64𝑐6.64c=6.64italic_c = 6.64 Å) [301]. The band gap of the pristine crystal was determined to be 5.58 eV (using 8×8×48848\times 8\times 48 × 8 × 4 k𝑘kitalic_k-points) in good agreement with the experimental band gap of 6.08 eV [302]. The structure of the point defects were relaxed in a 4×4×24424\times 4\times 24 × 4 × 2 (128 atom) supercell using ΓΓ\Gammaroman_Γ-point k𝑘kitalic_k-point sampling. For each defect three different charge states (q=1,0,1𝑞101q=1,0,-1italic_q = 1 , 0 , - 1) were considered. The corrections (Ecorrsubscript𝐸corrE_{\mathrm{corr}}italic_E start_POSTSUBSCRIPT roman_corr end_POSTSUBSCRIPT) due to image charges and potential alignment are evaluated following Freysoldt, Neugebauer and Van de Walle [303] as implemented in GPAW.

Figure 16 shows the defect formation energies as a function of Fermi level for CN and CB, at N-rich and N-poor conditions, respectively. We can see that under N-rich conditions, CB is energetically lower, whereas CN is favorable under N-poor conditions. CB shows a 1/0 charge transition at 3.73 eV above the VBM, whereas CN has a 0/-1 charge transition 3.26 eV deep inside the band gap. We find good agreement with a similar study [295] also employing plane waves and the HSE06 functional (VASP calculations). Minor discrepancies can be attributed to use of a different supercell size and slightly higher fraction of the non-local mixing parameter (α𝛼\alphaitalic_α=0.31).

IX.5 Point-group symmetry representations

GPAW allows for the automatized assignment of point-group symmetry representations for the pre-computed Kohn–Sham wavefunctions. This can be used for determining the wave-function symmetry representations for both molecules [304] and extended structures [305] to analyze, for example, the symmetry-involved degeneracy of the bands and selection rules for dipole transitions.

The analysis follows directly from group theory [306], stating that the solutions to the Schrödinger equation inherit the symmetry group of the respective Hamiltonian, or essentially the external potential invoked by the atomic configuration. The representation matrices ΓΓ\Gammaroman_Γ are computed as

Γn(T)=ϕn(𝐫)P(T)ϕn(𝐫)d𝐫,subscriptΓ𝑛𝑇superscriptsubscriptitalic-ϕ𝑛𝐫𝑃𝑇subscriptitalic-ϕ𝑛𝐫differential-d𝐫\Gamma_{n}(T)=\int\phi_{n}^{\dagger}(\mathbf{r})P(T)\phi_{n}(\mathbf{r})% \mathrm{d}\mathbf{r},roman_Γ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( italic_T ) = ∫ italic_ϕ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT ( bold_r ) italic_P ( italic_T ) italic_ϕ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( bold_r ) roman_d bold_r , (108)

where ϕitalic-ϕ\phiitalic_ϕ is a normalized wavefunction, n𝑛nitalic_n is the eigenstate label, and P(T)𝑃𝑇P(T)italic_P ( italic_T ) is an operation that corresponds to the transformation T𝑇Titalic_T of the symmetry group of the Hamiltonian. The operations P(T)𝑃𝑇P(T)italic_P ( italic_T ) include rotations that are non-trivial for the rectangular grid that the computed wavefunctions are projected onto. The wavefunction rotations are performed on the grid by cubic interpolation. The output of the analysis contains the irreducible representation weights cα,nsubscript𝑐𝛼𝑛c_{\alpha,n}italic_c start_POSTSUBSCRIPT italic_α , italic_n end_POSTSUBSCRIPT for each eigenstate n𝑛nitalic_n as solved from

Γn(T)=αcα,nχα(T),subscriptΓ𝑛𝑇subscript𝛼subscript𝑐𝛼𝑛subscript𝜒𝛼𝑇\Gamma_{n}(T)=\sum_{\alpha}c_{\alpha,n}\chi_{\alpha}(T),roman_Γ start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( italic_T ) = ∑ start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT italic_c start_POSTSUBSCRIPT italic_α , italic_n end_POSTSUBSCRIPT italic_χ start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT ( italic_T ) , (109)

where χαsubscript𝜒𝛼\chi_{\alpha}italic_χ start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT are the character vectors of the group (i.e. rows of the character table).

When doing the analysis, the user needs to input the coordinates of the center of symmetry (typically the coordinates of a single atom), and the point group for which the analysis is run. It is possible to analyze only a part of the wave function by selecting a cutoff radius from the center of symmetry beyond which the parts of the wave function are neglected. This enables the investigation of the purity of the local symmetry even if the symmetry of the Hamiltonian is broken far from the center of symmetry [304, 305]. To date, point groups of C2, C2v, C3v, D2d, D3h, D5, D5h, I, Ih, Oh, Td, and Th are implemented.

IX.6 Band-structure unfolding

When studying defect formation, charge-ordered phases or structural phase transitions, it is often needed to perform DFT calculations on a super-cell. A super-cell (SC) calculation comes with the cost of having to account for many more electrons in the unit cell when compared to the primitive cell (PC). This implies that besides the increased computational effort, the band structure of a SC contains more bands in a smaller Brillouin zone as compared to the PC. In order to compare electronic band structures between SC and PC, unfolding the band structure of the SC into the one of the primitive cell (PC) becomes convenient.

GPAW features the possibility of performing band-structure unfolding in the real-space grid, plane wave, and LCAO modes. The implementation allows to unfold the SC band structure without the explicit calculation of the overlap between SC and PC wavefunctions, following the procedure described in Ref. [307]. The unfolded band structure is given in terms of the spectral function

A(𝐤,ϵ)=mP𝐊m(𝐤)δ(ϵ𝐊mϵ),𝐴𝐤italic-ϵsubscript𝑚subscript𝑃𝐊𝑚𝐤𝛿subscriptitalic-ϵ𝐊𝑚italic-ϵA(\mathbf{k},\epsilon)=\sum_{m}P_{\mathbf{K}m}(\mathbf{k})\delta(\epsilon_{% \mathbf{K}m}-\epsilon),italic_A ( bold_k , italic_ϵ ) = ∑ start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT italic_P start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT ( bold_k ) italic_δ ( italic_ϵ start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT - italic_ϵ ) , (110)

with 𝐤𝐤\mathbf{k}bold_k, 𝐊𝐊\mathbf{K}bold_K momenta in the PC and SC Brillouin zone respectively, ϵ𝐊msubscriptitalic-ϵ𝐊𝑚\epsilon_{\mathbf{K}m}italic_ϵ start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT the SC eigenvalues obtained for momentum 𝐊𝐊\mathbf{K}bold_K and band index m𝑚mitalic_m, and P𝐊m(𝐤)subscript𝑃𝐊𝑚𝐤P_{\mathbf{K}m}(\mathbf{k})italic_P start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT ( bold_k ) is calculated as

P𝐊m(𝐤)={𝐆}|C𝐊m(𝐆+𝐤𝐊)|2,subscript𝑃𝐊𝑚𝐤subscript𝐆superscriptsubscript𝐶𝐊𝑚𝐆𝐤𝐊2P_{\mathbf{K}m}(\mathbf{k})=\sum_{\{\mathbf{G}\}}|C_{\mathbf{K}m}(\mathbf{G}+% \mathbf{k}-\mathbf{K})|^{2},italic_P start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT ( bold_k ) = ∑ start_POSTSUBSCRIPT { bold_G } end_POSTSUBSCRIPT | italic_C start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT ( bold_G + bold_k - bold_K ) | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT , (111)

where C𝐊msubscript𝐶𝐊𝑚C_{\mathbf{K}m}italic_C start_POSTSUBSCRIPT bold_K italic_m end_POSTSUBSCRIPT are the Fourier coefficients of the eigenstate |𝐊mket𝐊𝑚|\mathbf{K}m\rangle| bold_K italic_m ⟩ and {𝐆}𝐆\{\mathbf{G}\}{ bold_G } the subset of reciprocal space vectors of the SC that match the reciprocal space vectors of the PC. A more detailed explanation and technical details on how to perform a band-structure unfolding can be found on the GPAW web-page [61].

IX.7 The QEH model

The quantum-electrostatic heterostructure (QEH) [308] model is an add-on GPAW feature for calculating the dielectric response and excitations in vertical stacks of 2D materials, also known as van der Waals (vdW) heterostructures. The QEH model can be used independently from the GPAW code, but it relies on the GPAW implementation for the calculation of the fundamental building blocks used by the model, as elaborated below.

The dielectric screening in 2D materials is particularly sensitive to changes in the environment and depends on the stacking order and thickness of the 2D heterostructure, providing a means to tune the electronic excitations, including quasi-particle band gaps and excitons. While the dielectric response of freestanding layers can be explicitly represented ab initio in GPAW at the linear-response TDDFT, GW, and BSE level of theory, lattice mismatch between different 2D layers often results in large supercells that make these many-body approaches infeasible. Since the interaction between stacked layers is generally governed by van der Waals interactions, the main modification to the non-interacting layers’ dielectric response arises from the long-range electrostatic coupling between layers.

Therefore, in the QEH model, the dielectric function of the vdW heterostructure is obtained through an electrostatic coupling of the quantum dielectric building blocks of individual 2D layers [309]. The dielectric building blocks consist of monopole and dipole components of the density-response function of the freestanding layers, χi~(𝐪,ω)~subscript𝜒𝑖subscript𝐪parallel-to𝜔\tilde{\chi_{i}}(\mathbf{q}_{\parallel},\omega)over~ start_ARG italic_χ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT , italic_ω ), calculated from ab initio on the RPA level. Subsequently, the full density-response function χi,j(𝐪,ω)subscript𝜒𝑖𝑗subscript𝐪parallel-to𝜔\chi_{i,j}(\mathbf{q}_{\parallel},\omega)italic_χ start_POSTSUBSCRIPT italic_i , italic_j end_POSTSUBSCRIPT ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT , italic_ω ) (density perturbation on layer i𝑖iitalic_i due to a monopole or dipole component of the perturbing field acting on layer j𝑗jitalic_j) is calculated by solving the Dyson equation

χi,j(𝐪,ω)subscript𝜒𝑖𝑗subscript𝐪parallel-to𝜔\displaystyle\chi_{i,j}(\mathbf{q}_{\parallel},\omega)italic_χ start_POSTSUBSCRIPT italic_i , italic_j end_POSTSUBSCRIPT ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT , italic_ω ) =χi~(𝐪,ω)δi,j+absentlimit-from~subscript𝜒𝑖subscript𝐪parallel-to𝜔subscript𝛿𝑖𝑗\displaystyle=\tilde{\chi_{i}}(\mathbf{q}_{\parallel},\omega)\delta_{i,j}+= over~ start_ARG italic_χ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT , italic_ω ) italic_δ start_POSTSUBSCRIPT italic_i , italic_j end_POSTSUBSCRIPT +
χi~(𝐪,ω)kiVi,k(𝐪)χk,j(𝐪,ω),~subscript𝜒𝑖subscript𝐪parallel-to𝜔subscript𝑘𝑖subscript𝑉𝑖𝑘subscript𝐪parallel-tosubscript𝜒𝑘𝑗subscript𝐪parallel-to𝜔\displaystyle\tilde{\chi_{i}}(\mathbf{q}_{\parallel},\omega)\sum_{k\neq i}V_{i% ,k}(\mathbf{q}_{\parallel})\chi_{k,j}(\mathbf{q}_{\parallel},\omega),over~ start_ARG italic_χ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT , italic_ω ) ∑ start_POSTSUBSCRIPT italic_k ≠ italic_i end_POSTSUBSCRIPT italic_V start_POSTSUBSCRIPT italic_i , italic_k end_POSTSUBSCRIPT ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT ) italic_χ start_POSTSUBSCRIPT italic_k , italic_j end_POSTSUBSCRIPT ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT , italic_ω ) , (112)

where the Coulomb matrix element is obtained as the real-space overlap over the density, ρ𝜌\rhoitalic_ρ, and potential, ϕitalic-ϕ\phiitalic_ϕ, basis functions on the different layers.

Vi,k(𝐪)=ρi(z,𝐪)ϕk(z,𝐪)dz.subscript𝑉𝑖𝑘subscript𝐪parallel-tosubscript𝜌𝑖𝑧subscript𝐪parallel-tosubscriptitalic-ϕ𝑘𝑧subscript𝐪parallel-todifferential-d𝑧V_{i,k}(\mathbf{q}_{\parallel})=\int\rho_{i}(z,\mathbf{q}_{\parallel})\phi_{k}% (z,\mathbf{q}_{\parallel})\mathrm{d}z.italic_V start_POSTSUBSCRIPT italic_i , italic_k end_POSTSUBSCRIPT ( bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT ) = ∫ italic_ρ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_z , bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT ) italic_ϕ start_POSTSUBSCRIPT italic_k end_POSTSUBSCRIPT ( italic_z , bold_q start_POSTSUBSCRIPT ∥ end_POSTSUBSCRIPT ) roman_d italic_z . (113)

From the density-response function, the dielectric function is obtained in the basis of monopole/dipole perturbations on each layer in the heterostructure. While building blocks pre-computed with GPAW for a large variety of 2D materials are provided with the QEH package, GPAW offers the possibility of calculating custom building blocks for any 2D material as explained in Ref. [310].

As an illustrative example of the QEH model, we show how the static dielectric function of a heterostructure can be engineered by multi-layer stacking. Fig. 17 shows the static dielectric function of a vdW heterostructure made up by stacking N𝑁Nitalic_N MoS2 layers and N𝑁Nitalic_N WSe2 layers. We see that the dielectric function increases significantly as a function of the number of layers, eventually approaching a bulk limit. The knowledge of the layer-dependence of the dielectric response for such a heterostructeres could be further exploited to investigate inter- and intra-layer excitonic properties and band-edge renormalization effects.

Refer to caption

Refer to caption       

Figure 17: The static macroscopic dielectric function of a vdW heterostructure interface as a function of the number of layers. The heterostructure is made up of N𝑁Nitalic_N MoS2 layers on one half and N𝑁Nitalic_N WSe2 layers on the other half (see inset). Increasing the number of layers eventually leads to a bulk-like limit for the chosen stacking configuration.

IX.8 Solvent models

The presence of a solvent has a large effect on the energetics and the electronic structure of molecules or extended surfaces. In particular, the arguably most important solvent, water, is able to stabilize ions or zwitterions that would not form in the gas phase. The main effect relates to the large permittivity of water (εr=78subscript𝜀𝑟78\varepsilon_{r}=78italic_ε start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT = 78) that effectively screens Coulomb interactions.

A convenient and computationally lean method to describe this effect is the inclusion of a position-dependent solvent permittivity ε(𝐫)𝜀𝐫\varepsilon(\mathbf{r})italic_ε ( bold_r ) in the electrostatics via the Poisson solver [311]. The solvent is represented solely as a polarizable continuum that averages out all movements and re-arrangements of the solvent molecules and their electrons. The computational cost is, therefore, practically the same as a calculation in vacuum.

This implementation allows the calculation of solvation free energies of neutral and ionic species in solution [311]. Further, it can be applied to periodic surfaces interfaced with an electrolyte to reproduce reasonable potential drops within the simulation of electrochemical reaction processes, as we will elaborate in the following.

IX.9 Charged electrochemical interfaces

Simulating atomistic processes at a solid–liquid interface held at a controlled electrode potential is most appropriately performed in the electronically grand-canonical ensemble [312, 313, 314, 315]. Here, electrons can be exchanged dynamically with an external electron reservoir at a well-defined electrochemical potential. In a periodic system, a non-zero net charge would lead to divergence of the energy; therefore, any fractional electrons that are added to or removed from the system must be compensated by an equal amount of counter charge. Several approaches able to account for this change in boundary conditions have recently been brought forward [316, 317, 318, 319, 320]. In GPAW, this is conveniently accomplished with the introduction of a jellium slab of equal and opposite charge to the needed electronic charge; the jellium is embedded in an implicit solvent localized in the vacuum region above the simulated surface (cf. IX.8). As a particular highlight of this Solvated Jellium Method (SJM) [321], as it is known in GPAW, we are able to localize the excess charge on only the top side of the simulated atomistic surface, which occurs naturally by introducing the jellium region solely in the top-side vacuum and electrostatically decoupling the two sides of the cell via a dipole correction. Both a purely implicit and hybrid explicit-implicit solvent can be applied.

In the SJM, the simulated electrode potential is a monotonic function of the number of electrons in the simulation; calculations can be run in either a constant-charge or a constant-potential ensemble. The electrode potential (ϕesubscriptitalic-ϕe\phi_{\mathrm{e}}italic_ϕ start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT) within SJM is defined as the Fermi level (μ𝜇\muitalic_μ) referenced to an electrostatic potential deep in the solvent (the solution inner potential ΦwsubscriptΦw\Phi_{\mathrm{w}}roman_Φ start_POSTSUBSCRIPT roman_w end_POSTSUBSCRIPT), where the whole charge on the electrode has been screened and no electric field is present,

ϕe=Φwμ.subscriptitalic-ϕesubscriptΦw𝜇\phi_{\mathrm{e}}=\Phi_{\mathrm{w}}-\mu.italic_ϕ start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT = roman_Φ start_POSTSUBSCRIPT roman_w end_POSTSUBSCRIPT - italic_μ . (114)

We can relate ϕesubscriptitalic-ϕe\phi_{\mathrm{e}}italic_ϕ start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT to the commonly used reference potentials, for example to the standard hydrogen electrode, by subtracting its absolute potential such as the experimental value of 4.44 V as reported by Trasatti [322]. In practice, the reference potentials depend on the used solvent model [323], and the reference can be calibrated using computed and measured potentials of zero charge [324].

The energy used in the analysis of electrode reactions is the grand-potential energy ΩΩ\Omegaroman_Ω,

ΩEtot+ϕeNe,Ωsubscript𝐸totsubscriptitalic-ϕesubscript𝑁e\Omega\equiv E_{\mathrm{tot}}+\phi_{\mathrm{e}}N_{\mathrm{e}},roman_Ω ≡ italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT + italic_ϕ start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT italic_N start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT , (115)

where Nesubscript𝑁eN_{\mathrm{e}}italic_N start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT are the excess electrons in the simulation. This allows for energetic comparisons between calculations with different numbers of electrons, and is the default energy returned to atomistic methods by SJM. While Etotsubscript𝐸totE_{\mathrm{tot}}italic_E start_POSTSUBSCRIPT roman_tot end_POSTSUBSCRIPT is consistent with the forces in traditional electronic-structure calculations, the grand-potential energy ΩΩ\Omegaroman_Ω is consistent with the forces in constant-potential simulations [325, 315]. This means that relaxations that follow forces will correctly find local minima in ΩΩ\Omegaroman_Ω, and any kind of structure optimization or dynamical routine can be performed on the grand-canonical potential energy surface, such as the search for saddle points [326, 327, 328] or molecular-dynamics simulations [329].

In constant-potential mode, the potential is controlled by a damped iterative technique that varies Nesubscript𝑁eN_{\mathrm{e}}italic_N start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT to find the target ϕesubscriptitalic-ϕe\phi_{\mathrm{e}}italic_ϕ start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT; in practice, a trajectory (such as a relaxation or nudged elastic band) is run, where in a first series of SCF cycles the potential equilibrates. Upon achieving a target potential within the given threshold, the code will conduct the chosen geometry-optimization routine under constant potential control.

IX.10 Constrained DFT

Constrained DFT (cDFT) [330, 331, 332] is a computationally efficient method for constructing diabatic or charge/spin-localized states. GPAW includes a real-space implementation of cDFT [333], which can be used in both the FD and LCAO modes. Compared to most cDFT implementations, in GPAW the periodicity can be chosen flexibly between isolated molecules and periodic systems in one-, two-, or three-dimensions with 𝐤𝐤\mathbf{k}bold_k-point sampling.

The key difference of cDFT compared to normal DFT is the introduction of an auxiliary potential to force a certain region (in real space around a molecule, molecular fragment, or atom) to carry a predefined charge or spin. This leads to a modified energy functional

F[n(𝐫),{Vi}]=EKS[n(𝐫)]+iViσ(d𝐫wiσ(𝐫)nσ(𝐫)Ni),𝐹𝑛𝐫subscript𝑉𝑖superscript𝐸KSdelimited-[]𝑛𝐫subscript𝑖subscript𝑉𝑖subscript𝜎differential-d𝐫subscriptsuperscript𝑤𝜎𝑖𝐫superscript𝑛𝜎𝐫subscript𝑁𝑖\begin{split}F[n(\mathbf{r}),\{V_{i}\}]&=E^{\mathrm{KS}}[n(\mathbf{r})]+\\ &\sum_{i}V_{i}\sum_{\sigma}\left(\int\mathrm{d}\mathbf{r}w^{\sigma}_{i}(% \mathbf{r})n^{\sigma}(\mathbf{r})-N_{i}\right),\end{split}start_ROW start_CELL italic_F [ italic_n ( bold_r ) , { italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT } ] end_CELL start_CELL = italic_E start_POSTSUPERSCRIPT roman_KS end_POSTSUPERSCRIPT [ italic_n ( bold_r ) ] + end_CELL end_ROW start_ROW start_CELL end_CELL start_CELL ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_σ end_POSTSUBSCRIPT ( ∫ roman_d bold_r italic_w start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) italic_n start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT ( bold_r ) - italic_N start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) , end_CELL end_ROW (116)

where EKSsuperscript𝐸KSE^{\mathrm{KS}}italic_E start_POSTSUPERSCRIPT roman_KS end_POSTSUPERSCRIPT is the Kohn–Sham energy functional, σ𝜎\sigmaitalic_σ denotes the spin, nσ(𝐫)superscript𝑛𝜎𝐫n^{\sigma}(\mathbf{r})italic_n start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT ( bold_r ) is the spin-dependent electron density, and Nisubscript𝑁𝑖N_{i}italic_N start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is the predefined charge or spin constraint. Visubscript𝑉𝑖V_{i}italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT acts as Lagrange multiplier, which determines the strength of the auxiliary potential and needs to be determined self-consistently as discussed below. wiσ(𝐫)subscriptsuperscript𝑤𝜎𝑖𝐫w^{\sigma}_{i}(\mathbf{r})italic_w start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) is the weight function that defines how the charge or spin are to be partitioned, i.e. the regions where charge/spin is to be localised. This will be discussed in some detail below.

Introducing the constraining term in Eq. (116) leads to a new localized, spin-dependent external potential

veffσ(𝐫)=δF[n(𝐫)]δn(𝐫)=δEKS[n(𝐫)]δn(𝐫)+iViσwiσ(𝐫).superscriptsubscript𝑣eff𝜎𝐫𝛿𝐹delimited-[]𝑛𝐫𝛿𝑛𝐫𝛿superscript𝐸KSdelimited-[]𝑛𝐫𝛿𝑛𝐫subscript𝑖subscript𝑉𝑖subscript𝜎subscriptsuperscript𝑤𝜎𝑖𝐫v_{\text{eff}}^{\sigma}(\mathbf{r})=\dfrac{\delta F[n(\mathbf{r})]}{\delta n(% \mathbf{r})}=\dfrac{\delta E^{\mathrm{KS}}[n(\mathbf{r})]}{\delta n(\mathbf{r}% )}+\sum_{i}V_{i}\sum_{\sigma}w^{\sigma}_{i}(\mathbf{r}).italic_v start_POSTSUBSCRIPT eff end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT ( bold_r ) = divide start_ARG italic_δ italic_F [ italic_n ( bold_r ) ] end_ARG start_ARG italic_δ italic_n ( bold_r ) end_ARG = divide start_ARG italic_δ italic_E start_POSTSUPERSCRIPT roman_KS end_POSTSUPERSCRIPT [ italic_n ( bold_r ) ] end_ARG start_ARG italic_δ italic_n ( bold_r ) end_ARG + ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_σ end_POSTSUBSCRIPT italic_w start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) . (117)

The constraint is further enforced by demanding that the Visubscript𝑉𝑖{V_{i}}italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT need to satisfy the chosen constraints

C|σd𝐫wiσ(𝐫)nσ(𝐫)Ni|.𝐶subscript𝜎differential-d𝐫subscriptsuperscript𝑤𝜎𝑖𝐫superscript𝑛𝜎𝐫subscript𝑁𝑖C\geq\bigg{\lvert}\sum_{\sigma}\int\mathrm{d}\mathbf{r}w^{\sigma}_{i}(\mathbf{% r})n^{\sigma}(\mathbf{r})-N_{i}\bigg{\rvert}.italic_C ≥ | ∑ start_POSTSUBSCRIPT italic_σ end_POSTSUBSCRIPT ∫ roman_d bold_r italic_w start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) italic_n start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT ( bold_r ) - italic_N start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT | . (118)

In practice, the strength of the constraining potential Visubscript𝑉𝑖{V_{i}}italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT is found through a self-consistent two-stage optimization of both {Vi}subscript𝑉𝑖\{V_{i}\}{ italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT } and n(𝐫)𝑛𝐫n(\mathbf{r})italic_n ( bold_r ). As the derivatives of F[n(𝐫),{Vi}]𝐹𝑛𝐫subscript𝑉𝑖F[n(\mathbf{r}),\{V_{i}\}]italic_F [ italic_n ( bold_r ) , { italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT } ] with respect to Visubscript𝑉𝑖{V_{i}}italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT are readily available [333], gradient-based optimization algorithms in SciPy [68] are used for optimizing {Vi}subscript𝑉𝑖\{V_{i}\}{ italic_V start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT }. The weight functions are defined by a Hirshfeld-type partitioning scheme with Gaussian atomic densities, and wiσ(𝐫)subscriptsuperscript𝑤𝜎𝑖𝐫w^{\sigma}_{i}(\mathbf{r})italic_w start_POSTSUPERSCRIPT italic_σ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( bold_r ) and the resulting external potential are presented on the grid. With these definitions, the forces resulting from the cDFT external potential can be analytically computed and used in e.g. geometry optimization or molecular-dynamics simulations.

cDFT has been widely used for computing transfer rates within Marcus theory, which depends on the reorganization and reaction (free) energies and the diabatic coupling matrix element; the GPAW-cDFT implementation includes all the needed tools for obtaining these parameters for bulk, surface, and molecular systems [333, 334]. Recently, the cDFT approach has been combined with molecular-dynamics methods to compute the reorganization energy at electrochemical interfaces [335] as well as with grand-canonical DFT methods (see section IX.9) to construct fixed electron-potential diabatic states [336].

IX.11 Orbital-free DFT

Orbital-free DFT (OFDFT) approximates the DFT energy functional by modelling the kinetic energy as a direct functional of the density

EOF[n]=drn1/2(r)(122)n1/2(r)TW[n]+J[n]+V[n]+Exc[n]+Ts[n]TW[n].subscript𝐸OFdelimited-[]𝑛subscriptdrsuperscript𝑛12r12superscript2superscript𝑛12rsubscript𝑇Wdelimited-[]𝑛𝐽delimited-[]𝑛𝑉delimited-[]𝑛subscript𝐸xcdelimited-[]𝑛subscript𝑇sdelimited-[]𝑛subscript𝑇Wdelimited-[]𝑛\begin{split}E_{\text{OF}}[n]=\underbrace{\int\text{d}\textbf{r}\,n^{1/2}(% \textbf{r})\left(-\frac{1}{2}\nabla^{2}\right)\,n^{1/2}(\textbf{r})}_{T_{\text% {W}}[n]}+J[n]+V[n]\\ +E_{\text{xc}}[n]+T_{\text{s}}[n]-T_{\text{W}}[n].\end{split}start_ROW start_CELL italic_E start_POSTSUBSCRIPT OF end_POSTSUBSCRIPT [ italic_n ] = under⏟ start_ARG ∫ roman_d bold_r italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT ( r ) ( - divide start_ARG 1 end_ARG start_ARG 2 end_ARG ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT ( r ) end_ARG start_POSTSUBSCRIPT italic_T start_POSTSUBSCRIPT W end_POSTSUBSCRIPT [ italic_n ] end_POSTSUBSCRIPT + italic_J [ italic_n ] + italic_V [ italic_n ] end_CELL end_ROW start_ROW start_CELL + italic_E start_POSTSUBSCRIPT xc end_POSTSUBSCRIPT [ italic_n ] + italic_T start_POSTSUBSCRIPT s end_POSTSUBSCRIPT [ italic_n ] - italic_T start_POSTSUBSCRIPT W end_POSTSUBSCRIPT [ italic_n ] . end_CELL end_ROW (119)

Levy and colleagues showed that a Kohn–Sham-like equation derived variationally from the equation above holds for the square-root of the density [337]

(122+Veff(r))n1/2(r)=μn1/2(r).12superscript2subscript𝑉effrsuperscript𝑛12r𝜇superscript𝑛12r\left(-\frac{1}{2}\nabla^{2}+V_{\text{eff}}(\textbf{r})\right)\,n^{1/2}(% \textbf{r})=\mu\,n^{1/2}(\textbf{r}).( - divide start_ARG 1 end_ARG start_ARG 2 end_ARG ∇ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + italic_V start_POSTSUBSCRIPT eff end_POSTSUBSCRIPT ( r ) ) italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT ( r ) = italic_μ italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT ( r ) . (120)

OFDFT approximately enforces the Pauli principle, partially accounting for quantum effects in an averaged way.

The OFDFT scheme implemented in GPAW offers the advantage of accessing all-electron values while maintaining computational linear-scaling time with respect to system size. To achieve this, we employ the PAW method in conjunction with real-space methods obtaining a mean absolute error of 10 meV per atom when compared to reference all-electron values [338].

While OFDFT functionals perform better using local pseudopotentials in bulk materials, the OFDFT PAW implementation can be interesting for assessing density functionals. For example, in studying large-Z𝑍Zitalic_Z limits or semiclassical limits of density functionals, the all-electron values allow us to find highly-performing OFDFT functionals [339].

IX.12 Zero-field splitting

The zero-field splitting (ZFS) refers to the energetic splitting of the magnetic sub-levels of a localized triplet state in the absence of a magnetic field [340]. The origin of the ZFS is the magnetic dipole-dipole interactions between the two electrons of the triplet. This interaction is described by a spin Hamiltonian of the form (α,β=x,y,zformulae-sequence𝛼𝛽𝑥𝑦𝑧\alpha,\beta=x,y,zitalic_α , italic_β = italic_x , italic_y , italic_z[341, 342]

H^ZFS=αβS^aDαβS^β,subscript^𝐻ZFSsubscript𝛼𝛽subscript^𝑆𝑎subscript𝐷𝛼𝛽subscript^𝑆𝛽\hat{H}_{\mathrm{ZFS}}=\sum_{\alpha\beta}\hat{S}_{a}D_{\alpha\beta}\hat{S}_{% \beta},over^ start_ARG italic_H end_ARG start_POSTSUBSCRIPT roman_ZFS end_POSTSUBSCRIPT = ∑ start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT over^ start_ARG italic_S end_ARG start_POSTSUBSCRIPT italic_a end_POSTSUBSCRIPT italic_D start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT over^ start_ARG italic_S end_ARG start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT , (121)

where 𝐒^^𝐒\mathbf{\hat{S}}over^ start_ARG bold_S end_ARG is the total spin operator and 𝐃𝐃\mathbf{D}bold_D is the ZFS tensor given by

Dαβsubscript𝐷𝛼𝛽\displaystyle D_{\alpha\beta}italic_D start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT =12μ04πge2μB2ρ2(𝐫1,𝐫2)δαβr23rαrβr5d𝐫1d𝐫2.absent12subscript𝜇04𝜋superscriptsubscript𝑔𝑒2superscriptsubscript𝜇B2subscript𝜌2subscript𝐫1subscript𝐫2subscript𝛿𝛼𝛽superscript𝑟23subscript𝑟𝛼subscript𝑟𝛽superscript𝑟5differential-dsubscript𝐫1differential-dsubscript𝐫2\displaystyle=\frac{1}{2}\frac{\mu_{0}}{4\pi}g_{e}^{2}\mu_{\mathrm{B}}^{2}\int% \rho_{2}(\mathbf{r}_{1},\mathbf{r}_{2})\frac{\delta_{\alpha\beta}{r}^{2}-3r_{% \alpha}r_{\beta}}{r^{5}}\mathrm{d}\mathbf{r}_{1}\mathrm{d}\mathbf{r}_{2}.= divide start_ARG 1 end_ARG start_ARG 2 end_ARG divide start_ARG italic_μ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 4 italic_π end_ARG italic_g start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_μ start_POSTSUBSCRIPT roman_B end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ∫ italic_ρ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , bold_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ) divide start_ARG italic_δ start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT italic_r start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT - 3 italic_r start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT italic_r start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT end_ARG start_ARG italic_r start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT end_ARG roman_d bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT roman_d bold_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT . (122)

where rαsubscript𝑟𝛼r_{\alpha}italic_r start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT and rβsubscript𝑟𝛽r_{\beta}italic_r start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT denote the Cartesian components of 𝐫=𝐫1𝐫2𝐫subscript𝐫1subscript𝐫2\mathbf{r}=\mathbf{r}_{1}-\mathbf{r}_{2}bold_r = bold_r start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT - bold_r start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT, ρ2subscript𝜌2\rho_{2}italic_ρ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT is the two-particle density matrix of the Kohn–Sham ground-state Slater determinant, μBsubscript𝜇B\mu_{\mathrm{B}}italic_μ start_POSTSUBSCRIPT roman_B end_POSTSUBSCRIPT is the Bohr magneton and gesubscript𝑔𝑒g_{e}italic_g start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT is the Landé splitting factor. GPAW computes the 𝐃𝐃\mathbf{D}bold_D-tensor by evaluating the double integral in reciprocal space using the pseudo density including compensation charges [305].

IX.13 Hyperfine coupling

The hyperfine coupling describes the interaction between a magnetic dipole of a nuclear spin, 𝐈^Nsuperscript^𝐈𝑁\mathbf{\hat{I}}^{N}over^ start_ARG bold_I end_ARG start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT, and the magnetic dipole of the electron-spin distribution, 𝐒^(𝐫)^𝐒𝐫\mathbf{\hat{S}}(\mathbf{r})over^ start_ARG bold_S end_ARG ( bold_r ). The interaction is described by the spin Hamiltonian (α,β=x,y,zformulae-sequence𝛼𝛽𝑥𝑦𝑧\alpha,\beta=x,y,zitalic_α , italic_β = italic_x , italic_y , italic_z)

H^HFN=αβS^αAαβNI^βNsuperscriptsubscript^𝐻HF𝑁subscript𝛼𝛽subscript^𝑆𝛼superscriptsubscript𝐴𝛼𝛽𝑁subscriptsuperscript^𝐼𝑁𝛽\hat{H}_{\mathrm{HF}}^{N}=\sum_{\alpha\beta}\hat{S}_{\alpha}A_{\alpha\beta}^{N% }\hat{I}^{N}_{\beta}over^ start_ARG italic_H end_ARG start_POSTSUBSCRIPT roman_HF end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT = ∑ start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT over^ start_ARG italic_S end_ARG start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT italic_A start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT over^ start_ARG italic_I end_ARG start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT (123)

where the hyperfine tensor of nucleus N𝑁Nitalic_N at 𝐑=𝟎𝐑0\mathbf{R}=\mathbf{0}bold_R = bold_0 is given by [343]

AαβNsubscriptsuperscript𝐴𝑁𝛼𝛽\displaystyle A^{N}_{\alpha\beta}italic_A start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT =2μ03geμBgNμNδT(𝐫)ρs(𝐫)d𝐫absent2subscript𝜇03subscript𝑔𝑒subscript𝜇𝐵subscript𝑔𝑁subscript𝜇𝑁subscript𝛿𝑇𝐫subscript𝜌𝑠𝐫differential-d𝐫\displaystyle=\frac{2\mu_{0}}{3}g_{e}\mu_{B}g_{N}\mu_{N}\int\delta_{T}(\mathbf% {r})\rho_{s}(\mathbf{r})\mathrm{d}\mathbf{r}= divide start_ARG 2 italic_μ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 3 end_ARG italic_g start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT italic_μ start_POSTSUBSCRIPT italic_B end_POSTSUBSCRIPT italic_g start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT italic_μ start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT ∫ italic_δ start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT ( bold_r ) italic_ρ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ( bold_r ) roman_d bold_r (124)
+μ04πgeμBgNμN3rαrβδαβr2r5ρs(𝐫)d𝐫.subscript𝜇04𝜋subscript𝑔𝑒subscript𝜇𝐵subscript𝑔𝑁subscript𝜇𝑁3subscript𝑟𝛼subscript𝑟𝛽subscript𝛿𝛼𝛽superscript𝑟2superscript𝑟5subscript𝜌𝑠𝐫differential-d𝐫\displaystyle+\frac{\mu_{0}}{4\pi}g_{e}\mu_{B}g_{N}\mu_{N}\int\frac{3r_{\alpha% }r_{\beta}-\delta_{\alpha\beta}r^{2}}{r^{5}}\rho_{s}(\mathbf{r})\mathrm{d}% \mathbf{r}.+ divide start_ARG italic_μ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 4 italic_π end_ARG italic_g start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT italic_μ start_POSTSUBSCRIPT italic_B end_POSTSUBSCRIPT italic_g start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT italic_μ start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT ∫ divide start_ARG 3 italic_r start_POSTSUBSCRIPT italic_α end_POSTSUBSCRIPT italic_r start_POSTSUBSCRIPT italic_β end_POSTSUBSCRIPT - italic_δ start_POSTSUBSCRIPT italic_α italic_β end_POSTSUBSCRIPT italic_r start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG italic_r start_POSTSUPERSCRIPT 5 end_POSTSUPERSCRIPT end_ARG italic_ρ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ( bold_r ) roman_d bold_r .

The first term is the isotropic Fermi contact term, which is proportional to the spin density, ρs(𝐫)subscript𝜌𝑠𝐫\rho_{s}(\mathbf{r})italic_ρ start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT ( bold_r ), at the centre of the nucleus. δT(𝐫)subscript𝛿𝑇𝐫\delta_{T}(\mathbf{r})italic_δ start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT ( bold_r ) is a smeared-out δ𝛿\deltaitalic_δ-function. gesubscript𝑔𝑒g_{e}italic_g start_POSTSUBSCRIPT italic_e end_POSTSUBSCRIPT and gNsubscript𝑔𝑁g_{N}italic_g start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT are the gyromagnetic ratios for the electron and nucleus, and μNsubscript𝜇𝑁\mu_{N}italic_μ start_POSTSUBSCRIPT italic_N end_POSTSUBSCRIPT is the nuclear magneton. The second term represents the anisotropic part of the hyperfine coupling tensor and results from dipole-dipole interactions between nuclear and electronic magnetic moments. GPAW evaluates ANsuperscript𝐴𝑁A^{N}italic_A start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT using the pseudo spin density with compensation charges [305].

X Outlook

As described in this review, GPAW is a highly versatile code that is both maintenance-, user-, and developer-friendly at the same time. The continued expansion of the code requires substantial efforts and can be lifted only because of the dedicated team of developers contributing at all levels. There are currently a number of ongoing as well as planned developments for GPAW, which will further improve performance and applicability of the code. We are currently finishing a major refactoring of the code, which will make it even more developer friendly and facilitate easier implementation of new functionality.

Another priority is to improve the parallelization of hybrid functional calculations in plane wave mode by enabling parallelization over bands and 𝐤𝐤\mathbf{k}bold_k-points. In the same vein, there is ongoing work to support LCAO-based hybrid functional calculations using a resolution-of-identity approach. A natural next step would then be LCAO-based GW calculations. Such a method could potentially be very efficient compared to plane wave calculations, but it is currently unclear if the accuracy can be maintained with the limited LCAO basis. In relation to quasiparticle calculations, there are plans to implement (quasiparticle) self-consistent GW and vertex corrected GW using nonlocal xc-kernels from TDDFT. Constrained RPA calculations that provide a partially screened Coulomb interaction useful for ab initio calculation of interaction parameters in low-energy model Hamiltonians is currently being implemented.

Underlying any GPAW calculation are the PAW potentials. The current potentials date back to 2009. A new set of potentials, including both soft and norm-conserving potentials (for response function calculations), is being worked on.

As described herein, GPAW already has an efficient implementation of real time TDDFT in the LCAO basis while Ehrenfest dynamics is supported only the comparatively slower in grid mode. Work to enable Ehrenfest dynamics in LCAO mode is ongoing.

The current version of GPAW supports GPU acceleration only for standard ground state calculations. The CuPy library greatly simplifies the task of porting GPAW to GPU and we foresee that large parts of the code, including more advanced features such as linear response and GW calculations, will become GPU compatible.

XI Acknowledgements

K. S. T. acknowledges funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation program Grant No. 773122 (LIMA) and Grant agreement No. 951786 (NOMAD CoE). K. S. T. is a Villum Investigator supported by VILLUM FONDEN (grant no. 37789). Funding for A. O. D. and G. L. was provided by the Icelandic Research Fund (grant nos. 196279 and 217734, respectively). F. N has received funding from the European Union’s Horizon 2020 research and innovation program under the Marie Skłodowska-Curie grant agreement No. 899987. M. M. M. was supported by the Academy of Finland (grant #338228). T. O. acknowledges support from the Villum foundation Grant No. 00029378. S. K. and K. W. J. acknowledge support from the VILLUM Center for Science of Sustainable Fuels and Chemicals, which is funded by the VILLUM Fonden research grant (9455). T. B. was funded by the Danish National Research Foundation (DNRF 146). J. S. acknowledges funding from the Independent Research Fund Denmark (DFF- FTP) through grant no. 9041-00161B. C. S. acknowledges support from the Swedish Research Council (VR) through Grant No. 2016-06059 and funding from the Horizon Europe research and innovation program of the European Union under the Marie Skłodowska-Curie grant agreement no. 101065117. Partially funded by the European Union. Views and opinions expressed are, however, those of the author(s) only and do not necessarily reflect those of the European Union or REA. Neither the European Union nor the granting authority can be held responsible for them. T. S. received funding from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (Grant agreement No. 756277-ATMEN). O. L.-A. have been supported by Minciencias and University of Antioquia (Colombia). K. T. W. was supported by the U.S. Department of Energy, Office of Science, Office of Basic Energy Sciences, Chemical Sciences, Geosciences, and Biosciences Division, Catalysis Science Program to the SUNCAT Center for Interface Science and Catalysis. G. K. acknowledges funding from V-Sustain: The VILLUM Centre for the Science of Sustainable Fuels and Chemicals (grant no. 9455). Additional funding: Knut and Alice Wallenberg Foundation (2019.0140; J. F. and P. E.), the Swedish Research Council (2020-04935; J. F. and P. E.), the European Union’s Horizon 2020 research and innovation programme under the Marie Skłodowska-Curie grant agreement No 838996 (T. R.) and 101065117 (C. S.). Computations were enabled by resources provided by the National Academic Infrastructure for Supercomputing in Sweden (NAISS) at NSC, PDC, and C3SE partially funded by the Swedish Research Council through grant agreement no. 2022-06725.

References

  • [1] Pierre Hohenberg and Walter Kohn. Inhomogeneous electron gas. Phys. Rev., 136(3B):B864, 1964.
  • [2] Walter Kohn and Lu Jeu Sham. Self-consistent equations including exchange and correlation effects. Phys. Rev., 140(4A):A1133, 1965.
  • [3] John P Perdew, Kieron Burke, and Matthias Ernzerhof. Generalized gradient approximation made simple. Phys. Rev. Lett., 77(18):3865, 1996.
  • [4] Axel D Becke. Density-functional thermochemistry. iii. the role of exact exchange. The Journal of Chemical Physics, 98:5648–5652, 1993.
  • [5] Jochen Heyd, Gustavo E Scuseria, and Matthias Ernzerhof. Hybrid functionals based on a screened coulomb potential. The Journal of Chemical Physics, 118(18):8207–8215, 2003.
  • [6] Glenn M Torrie and John P Valleau. Nonphysical sampling distributions in monte carlo free-energy estimation: Umbrella sampling. J. Comput. Phys., 23(2):187–199, 1977.
  • [7] Petros Souvatzis, Olle Eriksson, MI Katsnelson, and SP Rudin. Entropy driven stabilization of energetically unstable crystal structures explained from first principles theory. Phys. Rev. Lett., 100(9):095901, 2008.
  • [8] Mark S. Hybertsen and Steven G. Louie. Electron correlation in semiconductors and insulators: Band gaps and quasiparticle energies. Phys. Rev. B, 34:5390–5413, Oct 1986.
  • [9] Dorothea Golze, Marc Dvorak, and Patrick Rinke. The GW compendium: A practical guide to theoretical photoemission spectroscopy. Front. Chem., 7:377, 2019.
  • [10] Mark E Casida, Christine Jamorski, Kim C Casida, and Dennis R Salahub. Molecular excitation energies to high-lying bound states from time-dependent density-functional response theory: Characterization and correction of the time-dependent local density approximation ionization threshold. The Journal of Chemical Physics, 108(11):4439–4449, 1998.
  • [11] Giovanni Onida, Lucia Reining, and Angel Rubio. Electronic excitations: density-functional versus many-body green’s-function approaches. Rev. Mod. Phys., 74(2):601, 2002.
  • [12] Jens Kehlet Nørskov, Thomas Bligaard, Jan Rossmeisl, and Claus Hviid Christensen. Towards the computational design of solid catalysts. Nat. Chem., 1(1):37–46, 2009.
  • [13] Anubhav Jain, Shyue Ping Ong, Geoffroy Hautier, Wei Chen, William Davidson Richards, Stephen Dacek, Shreyas Cholia, Dan Gunter, David Skinner, Gerbrand Ceder, et al. Commentary: The materials project: A materials genome approach to accelerating materials innovation. APL Mater., 1(1):011002, 2013.
  • [14] Stefano Curtarolo, Gus LW Hart, Marco Buongiorno Nardelli, Natalio Mingo, Stefano Sanvito, and Ohad Levy. The high-throughput highway to computational materials design. Nat. Mater., 12(3):191–201, 2013.
  • [15] Sten Haastrup, Mikkel Strange, Mohnish Pandey, Thorsten Deilmann, Per S Schmidt, Nicki F Hinsche, Morten N Gjerding, Daniele Torelli, Peter M Larsen, Anders C Riis-Jensen, et al. The computational 2d materials database: high-throughput modeling and discovery of atomically thin crystals. 2D Mater., 5(4):042002, 2018.
  • [16] Ivano E Castelli, Thomas Olsen, Soumendu Datta, David D Landis, Søren Dahl, Kristian S Thygesen, and Karsten W Jacobsen. Computational screening of perovskite metal oxides for optimal solar light capture. Energ. Environ. Sci., 5(2):5814–5819, 2012.
  • [17] Andreas Marek, Volker Blum, Rainer Johanni, Ville Havu, Bruno Lang, Thomas Auckenthaler, Alexander Heinecke, Hans-Joachim Bungartz, and Hermann Lederer. The elpa library: scalable parallel eigenvalue solutions for electronic structure theory and computational science. Journal of Physics: Condensed Matter, 26(21):213201, 2014.
  • [18] Peitao Liu, Merzuk Kaltak, Jiří Klimeš, and Georg Kresse. Cubic scaling GW: Towards fast quasiparticle calculations. Phys. Rev. B, 94(16):165109, 2016.
  • [19] Anubhav Jain, Shyue Ping Ong, Wei Chen, Bharat Medasani, Xiaohui Qu, Michael Kocher, Miriam Brafman, Guido Petretto, Gian-Marco Rignanese, Geoffroy Hautier, et al. Fireworks: a dynamic workflow system designed for high-throughput applications. Concurr. Comp-pract. E., 27(17):5037–5059, 2015.
  • [20] Giovanni Pizzi, Andrea Cepellotti, Riccardo Sabatini, Nicola Marzari, and Boris Kozinsky. Aiida: automated interactive infrastructure and database for computational science. Nato. Sc. S. Ss. Iii. C. S., 111:218–230, 2016.
  • [21] Jens Jørgen Mortensen, Morten Gjerding, and Kristian Sommer Thygesen. MyQueue: Task and workflow scheduling system. J. Open Source Softw., 5(45):1844, 2020.
  • [22] Morten Gjerding, Thorbjørn Skovhus, Asbjørn Rasmussen, Fabian Bertoldo, Ask Hjorth Larsen, Jens Jørgen Mortensen, and Kristian Sommer Thygesen. Atomic simulation recipes: A python framework and library for automated workflows. Nato. Sc. S. Ss. Iii. C. S., 199:110731, 2021.
  • [23] Jonathan Schmidt, Mário RG Marques, Silvana Botti, and Miguel AL Marques. Recent advances and applications of machine learning in solid-state materials science. npj Comput. Mater., 5(1):83, 2019.
  • [24] Albert P Bartók, Mike C Payne, Risi Kondor, and Gábor Csányi. Gaussian approximation potentials: The accuracy of quantum mechanics, without the electrons. Phys. Rev. Lett., 104(13):136403, 2010.
  • [25] Matthias Rupp, Alexandre Tkatchenko, Klaus-Robert Müller, and O Anatole Von Lilienfeld. Fast and accurate modeling of molecular atomization energies with machine learning. Phys. Rev. Lett., 108(5):058301, 2012.
  • [26] Andrew M Teale, Trygve Helgaker, Andreas Savin, Carlo Adamo, Bálint Aradi, Alexei V Arbuznikov, Paul W Ayers, Evert Jan Baerends, Vincenzo Barone, Patrizia Calaminici, et al. DFT exchange: sharing perspectives on the workhorse of quantum chemistry and materials science. Phys. Chem. Chem. Phys., 24(47):28700–28781, 2022.
  • [27] Xinguo Ren, Patrick Rinke, Christian Joas, and Matthias Scheffler. Random-phase approximation and its applications in computational chemistry and materials science. J. Mater. Sci., 47:7447–7471, 2012.
  • [28] Jianwei Sun, Adrienn Ruzsinszky, and John P Perdew. Strongly constrained and appropriately normed semilocal density functional. Phys. Rev. Lett., 115(3):036402, 2015.
  • [29] Thomas Olsen and Kristian S Thygesen. Random phase approximation applied to solids, molecules, and graphene-metal interfaces: From van der Waals to covalent bonding. Phys. Rev. B, 87(7):075111, 2013.
  • [30] Alexandre Tkatchenko and Matthias Scheffler. Accurate molecular van der Waals interactions from ground-state electron density and free-atom reference data. Phys. Rev. Lett., 102(7):073005, 2009.
  • [31] Max Dion, Henrik Rydberg, Elsebeth Schröder, David C Langreth, and Bengt I Lundqvist. Van der Waals density functional for general geometries. Phys. Rev. Lett., 92(24):246401, 2004.
  • [32] J. J. Mortensen, L. B. Hansen, and K. W. Jacobsen. Real-space grid implementation of the projector augmented wave method. Phys. Rev. B, 71:035109, Jan 2005.
  • [33] J Enkovaara, C Rostgaard, J J Mortensen, J Chen, M Dułak, L Ferrighi, J Gavnholt, C Glinsvad, V Haikola, H A Hansen, H H Kristoffersen, M Kuisma, A H Larsen, L Lehtovaara, M Ljungberg, O Lopez-Acevedo, P G Moses, J Ojanen, T Olsen, V Petzold, N A Romero, J Stausholm-Møller, M Strange, G A Tritsaris, M Vanin, M Walter, B Hammer, H Häkkinen, G K H Madsen, R M Nieminen, J K Nørskov, M Puska, T T Rantala, J Schiøtz, K S Thygesen, and K W Jacobsen. Electronic structure calculations with GPAW: a real-space implementation of the projector augmented-wave method. Journal of Physics: Condensed Matter, 22(25):253202, jun 2010.
  • [34] Michael Walter, Hannu Häkkinen, Lauri Lehtovaara, Martti Puska, Jussi Enkovaara, Carsten Rostgaard, and Jens Jørgen Mortensen. Time-dependent density-functional theory in the projector augmented-wave method. The Journal of Chemical Physics, 128(24):244101, June 2008.
  • [35] A. H. Larsen, M. Vanin, J. J. Mortensen, K. S. Thygesen, and K. W. Jacobsen. Localized atomic basis set in the projector augmented wave method. Phys. Rev. B, 80:195112, Nov 2009.
  • [36] Jun Yan, Jens J Mortensen, Karsten W Jacobsen, and Kristian S Thygesen. Linear density response function in the projector augmented wave method: Applications to solids, surfaces, and interfaces. Phys. Rev. B, 83(24):245122, 2011.
  • [37] Thomas Olsen and Kristian S Thygesen. Extending the random-phase approximation for electronic correlation energies: The renormalized adiabatic local density approximation. Phys. Rev. B, 86(8):081103, 2012.
  • [38] Falco Hüser, Thomas Olsen, and Kristian S Thygesen. Quasiparticle gw calculations for solids, molecules, and two-dimensional materials. Phys. Rev. B, 87(23):235132, 2013.
  • [39] Jun Yan, Karsten W Jacobsen, and Kristian S Thygesen. Optical properties of bulk semiconductors and graphene/boron nitride: The bethe-salpeter equation with derivative discontinuity-corrected density functional energies. Phys. Rev. B, 86(4):045208, 2012.
  • [40] Joachim Sødequist and Thomas Olsen. Type ii multiferroic order in two-dimensional transition metal halides from first principles spin-spiral calculations. 2D Mater., 10(3):035016, may 2023.
  • [41] Daniele Torelli and Thomas Olsen. Calculating critical temperatures for ferromagnetic order in two-dimensional materials. 2D Mater., 6:015028, 2018.
  • [42] Frederik L Durhuus, Thorbjørn Skovhus, and Thomas Olsen. Plane wave implementation of the magnetic force theorem for magnetic exchange constants: application to bulk fe, co and ni. Journal of Physics: Condensed Matter, 35(10):105802, jan 2023.
  • [43] Thorbjørn Skovhus and Thomas Olsen. Dynamic transverse magnetic susceptibility in the projector augmented-wave method: Application to Fe, Ni, and Co. Phys. Rev. B, 103:245110, 2021.
  • [44] Mads Kruse, Urko Petralanda, Morten N. Gjerding, Karsten W. Jacobsen, Kristian S. Thygesen, and Thomas Olsen. Two-dimensional ferroelectrics from high throughput computational screening. npj Comput. Mater., 9:45, 2023.
  • [45] Morten Niklas Gjerding, Alireza Taghizadeh, Asbjørn Rasmussen, Sajid Ali, Fabian Bertoldo, Thorsten Deilmann, Nikolaj Rørbæk Knøsgaard, Mads Kruse, Ask Hjorth Larsen, Simone Manti, Thomas Garm Pedersen, Urko Petralanda, Thorbjørn Skovhus, Mark Kamper Svendsen, Jens Jørgen Mortensen, Thomas Olsen, and Kristian Sommer Thygesen. Recent progress of the computational 2D materials database (C2DB). 2D Mater., 8:044002, 2021.
  • [46] Thomas Olsen, Erik Andersen, Takuya Okugawa, Daniele Torelli, Thorsten Deilmann, and Kristian S. Thygesen. Discovering two-dimensional topological insulators from high-throughput computations. Phys. Rev. Mater., 3:024005, 2019.
  • [47] Ask Hjorth Larsen, Jens Jørgen Mortensen, Jakob Blomqvist, Ivano E Castelli, Rune Christensen, Marcin Dułak, Jesper Friis, Michael N Groves, Bjørk Hammer, Cory Hargus, Eric D Hermes, Paul C Jennings, Peter Bjerre Jensen, James Kermode, John R Kitchin, Esben Leonhard Kolsbjerg, Joseph Kubal, Kristen Kaasbjerg, Steen Lysgaard, Jón Bergmann Maronsson, Tristan Maxson, Thomas Olsen, Lars Pastewka, Andrew Peterson, Carsten Rostgaard, Jakob Schiøtz, Ole Schütt, Mikkel Strange, Kristian S Thygesen, Tejs Vegge, Lasse Vilhelmsen, Michael Walter, Zhenhua Zeng, and Karsten W Jacobsen. The atomic simulation environment—a python library for working with atoms. Journal of Physics: Condensed Matter, 29(27):273002, jun 2017.
  • [48] Arash A Mostofi, Jonathan R Yates, Young-Su Lee, Ivo Souza, David Vanderbilt, and Nicola Marzari. wannier90: A tool for obtaining maximally-localised wannier functions. Comput. Phys. Commun., 178(9):685–699, 2008.
  • [49] Yorick L. A. Schmerwitz, Gianluca Levi, and Hannes Jónsson. Calculations of Excited Electronic States by Converging on Saddle Points Using Generalized Mode Following. J. Chem. Theory Comput., 19(12):3634–3651, 2023.
  • [50] Aleksei V. Ivanov, Gianluca Levi, Elvar Ö. Jónsson, and Hannes Jónsson. Method for calculating excited electronic states using density functionals and direct orbital optimization with real space grid or plane-wave basis set. J. Chem. Theory Comput., 17:5034–5049, 8 2021.
  • [51] Gianluca Levi, Aleksei V. Ivanov, and Hannes Jónsson. Variational density functional calculations of excited states via direct optimization. J. Chem. Theory Comput., 16:6968–6982, 11 2020.
  • [52] M. Kuisma, A. Sakko, T. P. Rossi, A. H. Larsen, J. Enkovaara, L. Lehtovaara, and T. T. Rantala. Localized surface plasmon resonance in silver nanoparticles: Atomistic first-principles time-dependent density-functional theory calculations. Phys. Rev. B, 91(11):115431, 2015.
  • [53] Tuomas P. Rossi, Susi Lehtola, Arto Sakko, Martti J. Puska, and Risto M. Nieminen. Nanoplasmonics simulations at the basis set limit through completeness-optimized, local numerical basis sets. The Journal of Chemical Physics, 142(9):094114, 2015.
  • [54] Tuomas P. Rossi, Mikael Kuisma, Martti J. Puska, Risto M. Nieminen, and Paul Erhart. Kohn–Sham Decomposition in Real-Time Time-Dependent Density-Functional Theory: An Efficient Tool for Analyzing Plasmonic Excitations. J. Chem. Theory Comput., 13(10):4779–4790, 2017.
  • [55] Esko Makkonen, Tuomas P Rossi, Ask Hjorth Larsen, Olga Lopez-Acevedo, Patrick Rinke, Mikael Kuisma, and Xi Chen. Real-time time-dependent density functional theory implementation of electronic circular dichroism applied to nanoscale metal–organic clusters. The Journal of Chemical Physics, 154(11):114102, 2021.
  • [56] Alireza Taghizadeh, Ulrik Leffers, Thomas G Pedersen, and Kristian S Thygesen. A library of ab initio raman spectra for automated identification of 2d materials. Nat. Commun., 11(1):3011, 2020.
  • [57] Alireza Taghizadeh, Kristian S Thygesen, and Thomas G Pedersen. Two-dimensional materials with giant optical nonlinearities near the theoretical upper limit. Acs Nano, 15(4):7155–7167, 2021.
  • [58] Mikkel Ohm Sauer, Alireza Taghizadeh, Urko Petralanda, Martin Ovesen, Kristian Sommer Thygesen, Thomas Olsen, Horia Cornean, and Thomas Garm Pedersen. Shift current photovoltaic efficiency of 2d materials. npj Comput. Mater., 9(1):35, 2023.
  • [59] GPAW’s git-repository: https://gitlab.com/gpaw/gpaw/.
  • [60] Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, and Florian Bruhin. pytest, 2004.
  • [61] GPAW tutorials and exercises: https://wiki.fysik.dtu.dk/gpaw/tutorialsexercises/tutorialsexercises.html.
  • [62] Matteo Frigo and Steven G. Johnson. The design and implementation of FFTW3. P. Ieee, 93(2):216–231, 2005. Special issue on “Program Generation, Optimization, and Platform Adaptation”.
  • [63] L. S. Blackford, J. Choi, A. Cleary, E. D’Azevedo, J. Demmel, I. Dhillon, J. Dongarra, S. Hammarling, G. Henry, A. Petitet, K. Stanley, D. Walker, and R. C. Whaley. ScaLAPACK Users’ Guide. Society for Industrial and Applied Mathematics, Philadelphia, PA, 1997.
  • [64] Miguel A.L. Marques, Micael J.T. Oliveira, and Tobias Burnus. Libxc: A library of exchange and correlation functionals for density functional theory. Comput. Phys. Commun., 183(10):2272–2281, 2012.
  • [65] Susi Lehtola, Conrad Steigemann, Micael J. T. Oliveira, and Miguel A. L. Marques. Recent developments in libxc — A comprehensive library of functionals for density functional theory. SoftwareX, 7:1–5, January 2018.
  • [66] Ask Hjorth Larsen, Mikael Kuisma, Joakim Löfgren, Yann Pouillon, Paul Erhart, and Per Hyldgaard. libvdwxc: a library for exchange–correlation functionals in the vdw-df family. Model. Simul. Mater. Sc., 25(6):065004, jun 2017.
  • [67] Charles R. Harris, K. Jarrod Millman, Stéfan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, Robert Kern, Matti Picus, Stephan Hoyer, Marten H. van Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fernández del Río, Mark Wiebe, Pearu Peterson, Pierre Gérard-Marchant, Kevin Sheppard, Tyler Reddy, Warren Weckesser, Hameer Abbasi, Christoph Gohlke, and Travis E. Oliphant. Array programming with NumPy. Nature, 585(7825):357–362, September 2020.
  • [68] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, İlhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, Antônio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nat. Methods, 17:261–272, 2020.
  • [69] P. E. Blöchl. Projector augmented-wave method. Phys. Rev. B, 50:17953–17979, Dec 1994.
  • [70] Toma Susi, Jacob Madsen, Ursula Ludacka, Jens Jørgen Mortensen, Timothy J. Pennycook, Zhongbo Lee, Jani Kotakoski, Ute Kaiser, and Jannik C. Meyer. Efficient first principles simulation of electron scattering factors for transmission electron microscopy. Ultramicroscopy, 197:16–22, February 2019.
  • [71] Jacob Madsen, Timothy J. Pennycook, and Toma Susi. ab initio description of bonding for transmission electron microscopy. Ultramicroscopy, 231:113253, December 2021.
  • [72] Jacob Madsen and Toma Susi. abTEM: transmission electron microscopy from first principles. Open Research Europe, 1(24):13015, 2021.
  • [73] G. Kresse and J. Furthmüller. Efficient iterative schemes for ab initio total-energy calculations using a plane-wave basis set. Phys. Rev. B, 54:11169–11186, Oct 1996.
  • [74] Nicola Marzari, David Vanderbilt, Alessandro De Vita, and M. C. Payne. Thermal contraction and disordering of the al(110) surface. Phys. Rev. Lett., 82:3296–3299, Apr 1999.
  • [75] Peter E. Blöchl, O. Jepsen, and O. K. Andersen. Improved tetrahedron method for brillouin-zone integrations. Phys. Rev. B, 49:16223–16233, Jun 1994.
  • [76] Susi Lehtola, Frank Blockhuys, and Christian Van Alsenoy. An overview of self-consistent field calculations within finite basis sets. Molecules, 25(5):1–23, 2020.
  • [77] Troy Van Voorhis and Martin Head-Gordon. A geometric approach to direct minimization. Mol. Phys., 100:1713–1721, 2002.
  • [78] M. C. Payne, M. P. Teter, D. C. Allan, T. A. Arias, and J. D. Joannopoulos. Iterative minimization techniques for ab initio total-energy calculations: Molecular dynamics and conjugate gradients. Rev. Mod. Phys., 64(4):1045–1097, 1992.
  • [79] Martin Head-Gordon and John A. Pople. Optimization of wave function and geometry in the finite basis Hartree-Fock method. J. Phys. Chem-us., 92(11):3063–3069, 1988.
  • [80] Aleksei V. Ivanov, Elvar Ö. Jónsson, Tejs Vegge, and Hannes Jónsson. Direct energy minimization based on exponential transformation in density functional calculations of finite and extended systems. Comput. Phys. Commun., 267:108047, 2021.
  • [81] PAW-XML specification. https://esl.cecam.org/data/paw-xml/.
  • [82] Xavier Gonze, Bernard Amadon, Gabriel Antonius, Frédéric Arnardi, Lucas Baguet, Jean-Michel Beuken, Jordan Bieder, François Bottin, Johann Bouchet, Eric Bousquet, Nils Brouwer, Fabien Bruneval, Guillaume Brunin, Théo Cavignac, Jean-Baptiste Charraud, Wei Chen, Michel Côté, Stefaan Cottenier, Jules Denier, Grégory Geneste, Philippe Ghosez, Matteo Giantomassi, Yannick Gillet, Olivier Gingras, Donald R. Hamann, Geoffroy Hautier, Xu He, Nicole Helbig, Natalie Holzwarth, Yongchao Jia, François Jollet, William Lafargue-Dit-Hauret, Kurt Lejaeghere, Miguel A.L. Marques, Alexandre Martin, Cyril Martins, Henrique P.C. Miranda, Francesco Naccarato, Kristin Persson, Guido Petretto, Valentin Planes, Yann Pouillon, Sergei Prokhorenko, Fabio Ricci, Gian-Marco Rignanese, Aldo H. Romero, Michael Marcus Schmitt, Marc Torrent, Michiel J. van Setten, Benoit Van Troeye, Matthieu J. Verstraete, Gilles Zérah, and Josef W. Zwanziger. The ABINIT project: Impact, environment and recent developments. Comput. Phys. Commun., 248:107042, 2020.
  • [83] François Jollet, Marc Torrent, and Natalie Holzwarth. Generation of projector augmented-wave atomic data: A 71 element validated table in the XML format. Comput. Phys. Commun., 185(4):1246–1254, 2014.
  • [84] C. Hartwigsen, S. Goedecker, and J. Hutter. Relativistic separable dual-space gaussian pseudopotentials from h to rn. Phys. Rev. B, 58:3641–3662, Aug 1998.
  • [85] Martin Schlipf and François Gygi. Optimization algorithm for the generation of oncv pseudopotentials. Comput. Phys. Commun., 196:36–44, 2015.
  • [86] CuPy. https://cupy.dev/.
  • [87] Header only porting. https://github.com/mlouhivu/hop/.
  • [88] Samuli Hakala, Ville Havu, Jussi Enkovaara, and Risto M. Nieminen. Parallel electronic structure calculations using multiple graphics processing units (gpus). Lect. Notes Comput. Sc., 7782:63–76, 2013.
  • [89] Samuli Hakala, Jussi Enkovaara, Ville Havu, Jun Yan, Lin Li, Chris O’Grady, and Risto M. Nieminen. Grid-based projector-augmented wave method. Method in Electronic Structure Calculations on Graphics Processing Units, 2015.
  • [90] John P. Perdew and Karla Schmidt. Jacob’s ladder of density functional approximations for the exchange-correlation energy. In AIP Conference Proceedings, volume 577, pages 1–20. AIP Publishing, July 2001.
  • [91] Jianmin Tao, John P. Perdew, Viktor N. Staroverov, and Gustavo E. Scuseria. Climbing the Density Functional Ladder: Nonempirical Meta-Generalized Gradient Approximation Designed for Molecules and Solids. Phys. Rev. Lett., 91(14):146401, September 2003.
  • [92] John P. Perdew and Yue Wang. Accurate and simple analytic representation of the electron-gas correlation energy. Phys. Rev. B, 45(23):13244–13249, June 1992.
  • [93] Guillermo Román-Pérez and José M. Soler. Efficient implementation of a van der waals density functional: Application to double-wall carbon nanotubes. Phys. Rev. Lett., 103:096102, Aug 2009.
  • [94] Oleg Gritsenko, Robert van Leeuwen, Erik van Lenthe, and Evert Jan Baerends. Self-consistent approximation to the Kohn-Sham exchange potential. Phys. Rev. A, 51(3):1944, 1995.
  • [95] M. Kuisma, J. Ojanen, J. Enkovaara, and T. T. Rantala. Kohn-Sham potential with discontinuity for band gap materials. Phys. Rev. B, 82(11):115106, 2010.
  • [96] Jun Yan, Karsten W. Jacobsen, and Kristian S. Thygesen. First-principles study of surface plasmons on Ag(111) and H/Ag(111). Phys. Rev. B, 84(23):235430, 2011.
  • [97] Jun Yan, Karsten W. Jacobsen, and Kristian S. Thygesen. Conventional and acoustic surface plasmons on noble metal surfaces: A time-dependent density functional theory study. Phys. Rev. B, 86(24):241404, 2012.
  • [98] J. Magnus Rahm, Christopher Tiburski, Tuomas P. Rossi, Ferry Anggoro Ardy Nugroho, Sara Nilsson, Christoph Langhammer, and Paul Erhart. A library of late transition metal alloy dielectric functions for nanophotonic applications. Adv. Funct. Mater., 30(35):2002122, 2020.
  • [99] Keshab Bashyal, Christopher K Pyles, Sajjad Afroosheh, Aneer Lamichhane, and Alexey T Zayak. Empirical optimization of DFT+U and HSE for the band structure of ZnO. Journal of Physics: Condensed Matter, 30(6):065501, jan 2018.
  • [100] M. K. Y. Chan and G. Ceder. Efficient band gap prediction for solids. Phys. Rev. Lett., 105:196403, Nov 2010.
  • [101] John P. Perdew. Density functional theory and the band gap problem. Int. J. Quantum Chem., 28(S19):497–523, 1985.
  • [102] Kevin J. May and Alexie M. Kolpak. Improved description of perovskite oxide crystal structure and electronic properties using self-consistent Hubbard u𝑢uitalic_u corrections from ACBN0. Phys. Rev. B, 101:165117, Apr 2020.
  • [103] S. L. Dudarev, G. A. Botton, S. Y. Savrasov, C. J. Humphreys, and A. P. Sutton. Electron-energy-loss spectra and the structural stability of nickel oxide: An LSDA+U study. Phys. Rev. B, 57:1505–1509, Jan 1998.
  • [104] A. I. Liechtenstein, V. I. Anisimov, and J. Zaanen. Density-functional theory and strong interactions: Orbital ordering in mott-hubbard insulators. Phys. Rev. B, 52:R5467–R5470, Aug 1995.
  • [105] F Aryasetiawan, T Miyake, and R Sakuma. The constrained RPA method for calculating the Hubbard U from first-principles. The LDA+ DMFT approach to strongly correlated materials, 2011.
  • [106] Matteo Cococcioni and Stefano de Gironcoli. Linear response approach to the calculation of the effective interaction parameters in the LDA+U method. Phys. Rev. B, 71(3), jan 2005.
  • [107] Guy C. Moore, Matthew K. Horton, Alexander M. Ganose, Martin Siron, Edward Linscott, David D. O’Regan, and Kristin A. Persson. High-throughput determination of Hubbard U and Hund J values for transition metal oxides via linear response formalism, 2022.
  • [108] Lei Wang, Thomas Maxisch, and Gerbrand Ceder. Oxidation energies of transition metal oxides within the GGA+UGGAU\mathrm{GGA}+\mathrm{U}roman_GGA + roman_U framework. Phys. Rev. B, 73:195107, May 2006.
  • [109] M F M Taib, D T Mustaffa, N H Hussin, M H Samat, A M M Ali, O H Hassan, and M Z A Yahya. First principles study on Zn doped MgO using Hubbard U correction. Materials Research Express, 6(9):094012, jul 2019.
  • [110] Maituo Yu, Shuyang Yang, Chunzhi Wu, and Noa Marom. Machine learning the Hubbard U parameter in DFT+U using Bayesian optimization. npj Comput. Mater., 6(1):180, 2020.
  • [111] Yoshihiro Tawada, Takao Tsuneda, Susumu Yanagisawa, Takeshi Yanai, and Kimihiko Hirao. A long-range-corrected time-dependent density functional theory. The Journal of Chemical Physics, 120(18):8425–8433, May 2004.
  • [112] Aron J. Cohen, Paula Mori-Sánchez, and Weitao Yang. Insights into Current Limitations of Density Functional Theory. Science, 321(5890):792–794, August 2008.
  • [113] Andreas Dreuw, Jennifer L. Weisman, and Martin Head-Gordon. Long-range charge-transfer excited states in time-dependent density functional theory require non-local exchange. J. Chem. Phys., 119(6):2943–2946, 2003.
  • [114] E. J. Baerends, O. V. Gritsenko, and R. van Meer. The Kohn–Sham gap, the fundamental gap and the optical gap: The physical meaning of occupied and virtual Kohn–Sham orbital energies. Phys. Chem. Chem. Phys., 15(39):16408–16425, September 2013.
  • [115] Stephan Kümmel. Charge-Transfer Excitations: A Challenge for Time-Dependent Density Functional Theory That Has Been Met. Adv. Energy Mater., 7(16):1700440, August 2017.
  • [116] Roi Baer, Ester Livshits, and Ulrike Salzner. Tuned Range-Separated Hybrids in Density Functional Theory. Annu. Rev. Phys. Chem., 61(1):85–109, 2010.
  • [117] Carlo Adamo and Vincenzo Barone. Toward chemical accuracy in the computation of NMR shieldings: The PBE0 model. Chem. Phys. Lett., 298(1–3):113–119, December 1998.
  • [118] Takeshi Yanai, David P Tew, and Nicholas C Handy. A new hybrid exchange–correlation functional using the Coulomb-attenuating method (CAM-B3LYP). Chem. Phys. Lett., 393(1–3):51–57, July 2004.
  • [119] Yoshinobu Akinaga and Seiichiro Ten-no. Range-separation by the Yukawa potential in long-range corrected density functional theory with Gaussian-type basis functions. Chem. Phys. Lett., 462(4–6):348–351, September 2008.
  • [120] Michael Seth and Tom Ziegler. Range-Separated Exchange Functionals with Slater-Type Functions. J. Chem. Theory Comput., 8(3):901–907, March 2012.
  • [121] Ester Livshits and Roi Baer. A well-tempered density functional theory of electrons in molecules. Phys. Chem. Chem. Phys., 9(23):2932–2941, June 2007.
  • [122] Rolf Würdemann. Berechnung optischer Spektren und Grundzustandseigenschaften neutraler und geladener Moleküle mittels Dichtefunktionaltheorie. PhD thesis, Universität Freiburg, Freiburg, Germany, July 2016.
  • [123] Rolf Würdemann and Michael Walter. Charge Transfer Excitations with Range Separated Functionals Using Improved Virtual Orbitals. J. Chem. Theory Comput., 14(7):3667–3676, July 2018.
  • [124] Perdew J. P. and A. Zunger. Self-interaction correction to density-functional approximations for many-electron systems. Phys. Rev. B, 23:5048, 1981.
  • [125] S. Klüpfel, P. J. Klüpfel, and H. Jónsson. Importance of complex orbitals in calculating the self-interaction corrected ground state of atoms. Phys. Rev. A, 84:050501(R), 2011.
  • [126] S. Lehtola and H. Jónsson. Variational, self-consistent implementation of the perdew-zunger self-interaction correction with complex optimal orbitals. J. Chem. Theory Comput., 10:5324, 2014.
  • [127] S. Lehtola, M. Head-Gordon, and H. Jónsson. Complex orbitals, multiple local minima, and symmetry breaking in perdew-zunger self-interaction corrected density functional theory calculations. J. Chem. Theory Comput., 12:3195, 2016.
  • [128] H. Jónsson. Simulation of surface processes. Proceedings of the National Academy of Sciences, 108:944, 2011.
  • [129] S. Klüpfel, P. Klüpfel, and H. Jónsson. The effect of the perdew-zunger self-interaction correction to density functionals on the energetics of small molecules. J. Chem. Phys., 137:124102, 2012.
  • [130] H. Gudmundsdóttir, Y. Zhang, P. M. Weber, and H. Jónsson. Self-interaction corrected density functional calculations of molecular rydberg states. J. Chem. Phys., 139:194102, 2013.
  • [131] A. V. Ivanov, T. Ghosh, E. Ö. Jónsson, and H. Jónsson. Mn dimer can be described accurately with density functional calculations when self-interaction correction is applied. J. Phys. Chem. Lett., 12:4240, 2021.
  • [132] H. Gudmundsdóttir, E. Ö. Jónsson, and H. Jónsson. Calculations of al dopant in alpha-quartz using a variational implementation of the perdew-zunger self-interaction correction. New J. Phys., 17:083006, 2015.
  • [133] Yorick L. A. Schmerwitz, Aleksei V. Ivanov, Elvar Ö. Jónsson, Hannes Jónsson, and Gianluca Levi. Variational density functional calculations of excited states: Conical intersection and avoided crossing in ethylene bond twisting. J. Phys. Chem. Lett., 13:3990–3999, 2022.
  • [134] J. J. Mortensen, K. Kaasbjerg, S. L. Frederiksen, J. K. Nørskov, J. P. Sethna, and K. W. Jacobsen. Bayesian Error Estimation in Density-Functional Theory. Phys. Rev. Lett., 95(21):216401, November 2005.
  • [135] Jess Wellendorff, Keld T. Lundgaard, Andreas Møgelhøj, Vivien Petzold, David D. Landis, Jens K. Nørskov, Thomas Bligaard, and Karsten W. Jacobsen. Density functionals for surface science: Exchange-correlation model development with Bayesian error estimation. Phys. Rev. B, 85:235149, 2012.
  • [136] Jess Wellendorff, Keld T. Lundgaard, Karsten W. Jacobsen, and Thomas Bligaard. mBEEF: An accurate semi-local Bayesian error estimation density functional. The Journal of Chemical Physics, 140(14):144107, April 2014.
  • [137] Keld T. Lundgaard, Jess Wellendorff, J. Voss, Karsten W. Jacobsen, and Thomas Bligaard. mBEEF-vdW: Robust fitting of error estimation density functionals. Phys. Rev. B, 93(23):235162, 2016.
  • [138] Andrew J. Medford, Jess Wellendorff, Aleksandra Vojvodic, Felix Studt, Frank Abild-Pedersen, Karsten W. Jacobsen, Thomas Bligaard, and Jens K. Nørskov. Assessing the reliability of calculated catalytic ammonia synthesis rates. Science, 345(6193):197–200, 2014.
  • [139] G Ciccotti, M Ferrario, and J P Ryckaert. Molecular dynamics of rigid systems in cartesian coordinates a general formulation. Mol. Phys., 47:1253–1264, 1982.
  • [140] Andrew A Peterson. Global optimization of adsorbate–surface structures while preserving molecular identity. Top. Catal., 57:40–53, 2014.
  • [141] E B Tadmor, G S Smith, N Bernstein, and E Kaxiras. Mixed finite element and atomistic formulation for complex crystals. Phys. Rev. B, 59:235, 1999.
  • [142] C G Broyden. The convergence of a class of double-rank minimization algorithms. J. I. Math. Appl., 6:76–90, 1970.
  • [143] R Fletcher. A new approach to variable metric algorithms. Comput. J., 13:317–322, 1970.
  • [144] D Goldfarb. A family of variable metric updates derived by variational means. Math. Comput., 24:23–26, 1970.
  • [145] D F Shanno. Conditioning of quasi-newton methods for function minimization. Math. Comput., 24:647–656, 1970.
  • [146] D Liu and J Nocedal. On the limited memory method for large scale optimization. Mathematical Programming B, 45:503–528, 1989.
  • [147] Erik Bitzek, Pekka Koskinen, Franz Gahler, Michael Moseler, and Peter Gumbsch. Structural relaxation made simple. Phys. Rev. Lett., 97:170201, 2006.
  • [148] D Packwood, J R Kermode, L Mones, N Bernstein, J Woolley, N Gould, C Ortner, and G Csanyi. A universal preconditioner for simulating condensed phase materials. J. Chem. Phys., 144:164109, 2016.
  • [149] Estefania Garijo del Rio, Jens J Mortensen, and Karsten W Jacobsen. Local bayesian optimizer for atomic structures. Phys. Rev. B, 100:104103, 2019.
  • [150] G Henkelman and H Jonsson. A dimer method for finding saddle points on high dimensional potential surfaces using only first derivatives. J. Chem. Phys., 111:7010, 1999.
  • [151] H Jonsson, G Mills, and K W Jacobsen. in ‘classical and quantum dynamics in condensed phase systems’, edited by b. j. berne, g. cicotti, and d. f. coker. World Scientific, 1998.
  • [152] G Henkelman and H Jonsson. Improved tangent estimate in the neb method for finding minimum energy paths and saddle points. J. Chem. Phys., 113:9978, 2000.
  • [153] G Henkelman, B P Uberuaga, and H Jonsson. A climbing-image neb method for finding saddle points and minimum energy paths.
  • [154] S Smidstrup, A Pedersen, K Stokbro, and H Jonsson. Improved initial guess for minimum energy path calculations. J. Chem. Phys., 140:214106, 2014.
  • [155] E L Kolsbjerg, M N Groves, and B Hammer. An automated nudged elastic band method. J. Chem. Phys., 145:094107, 2016.
  • [156] P Lindgren, G Kastlunger, and A A Peterson. Scaled and dynamic optimizations of nudged elastic bands. J. Chem. Theory Comput., 15:5787–5793, 2019.
  • [157] S Makri, C Ortner, and J R Kermode. A preconditioning scheme for minimum energy path finding methods. J. Chem. Phys., 150:094109, 2019.
  • [158] A A Peterson. Acceleration of saddle-point searches with machine learning. J. Chem. Phys., 145:074106, 2016.
  • [159] O Koistinen, F B Dagbjartsdottir, V Asgeirsson, A Vehtari, and H Jonsson. Nudged elastic band calculations accelerated with gaussian process regression. J. Chem. Phys., 147:152720, 2017.
  • [160] J A G Torres, P C Jennings, M H Hansen, J R Boes, and T Bligaard. Low–scaling algorithm for nudged elastic band calculations using a surrogate machine learning model. Phys. Rev. Lett., 122:156001, 2019.
  • [161] Manuel Šarić, Jan Rossmeisl, and Poul Georg Moses. Modeling the adsorption of sulfur containing molecules and their hydrodesulfurization intermediates on the Co-promoted MoS2 catalyst by DFT. J. Catal., 358:131–140, February 2018.
  • [162] Thomas M. Østergaard, Livia Giordano, Ivano E. Castelli, Filippo Maglia, Byron K. Antonopoulos, Yang Shao-Horn, and Jan Rossmeisl. Oxidation of ethylene carbonate on li metal oxide surfaces. The Journal of Physical Chemistry C, 122(19):10442–10449, April 2018.
  • [163] Logi Arnarson, Per S. Schmidt, Mohnish Pandey, Alexander Bagger, Kristian S. Thygesen, Ifan E. L. Stephens, and Jan Rossmeisl. Fundamental limitation of electrocatalytic methane conversion to methanol. Phys. Chem. Chem. Phys., 20(16):11152–11159, 2018.
  • [164] Hao Wan, Anders W. Jensen, María Escudero-Escribano, and Jan Rossmeisl. Insights in the oxygen reduction reaction: From metallic electrocatalysts to diporphyrins. ACS Catal., 10(11):5979–5989, April 2020.
  • [165] Gianluca Levi, Elisa Biasin, Asmus Ougaard Dohn, and Hannes Jónsson. On the interplay of solvent and conformational effects in simulated excited-state dynamics of a copper phenanthroline photosensitizer. Phys. Chem. Chem. Phys., 22:748–757, 2020.
  • [166] D A Wales and J P K Doye. Global optimization of clusters, crystals, and biomolecules. Science, 285:1368, 1999.
  • [167] S Goedecker. Minima hopping: An efficient search method for the global minimum of the potential energy surface of complex molecular systems. J. Chem. Phys., 120:9911, 2004.
  • [168] L B Vilhelmsen and B Hammer. A genetic algorithm for first principles global structure optimization of supported nano structures. The Journal of Chemical Physics, 141:044711, 2014.
  • [169] Mads-Peter V. Christiansen, Nikolaj Rønne, and Bjørk Hammer. Atomistic global optimization x: A python package for optimization of atomistic structures. The Journal of Chemical Physics, 157(5):054701, August 2022.
  • [170] Paul C. Jennings, Steen Lysgaard, Jens Strabo Hummelshøj, Tejs Vegge, and Thomas Bligaard. Genetic algorithms for computational materials discovery accelerated by machine learning. npj Comput. Mater., 5(1), April 2019.
  • [171] Malthe K. Bisbo and Bjørk Hammer. Efficient Global Structure Optimization with a Machine-Learned Surrogate Model. Phys. Rev. Lett., 124(8):086102, February 2020.
  • [172] Sami Kaappa, Casper Larsen, and Karsten Wedel Jacobsen. Atomic structure optimization with machine-learning enabled interpolation between chemical elements. Phys. Rev. Lett., 127(16), October 2021.
  • [173] Sami Kaappa, Estefanía Garijo del Río, and Karsten Wedel Jacobsen. Global optimization of atomic structures with gradient-enhanced gaussian process regression. Phys. Rev. B, 103(17), May 2021.
  • [174] Casper Larsen, Sami Kaappa, Andreas Lynge Vishart, Thomas Bligaard, and Karsten Wedel Jacobsen. Machine-learning enabled optimization of atomic structures using atoms with fractional existence, 2022.
  • [175] Ralf Wanzenböck, Marco Arrigoni, Sebastian Bichelmaier, Florian Buchner, Jesús Carrete, and Georg K. H. Madsen. Neural-network-backed evolutionary search for SrTiO_3_3\_3_ 3(110) surface reconstructions. Digital Discovery, 1(5):703–710, 2022.
  • [176] Andreas Møgelhøj, André K. Kelkkanen, K. Thor Wikfeldt, Jakob Schiøtz, Jens Jørgen Mortensen, Lars G. M. Pettersson, Bengt I. Lundqvist, Karsten W. Jacobsen, Anders Nilsson, and Jens K. Nørskov. Ab initio van der Waals interactions in simulations of water alter structure from mainly tetrahedral to high-density-like. The Journal of Physical Chemistry B, 115(48):14149–14160, August 2011.
  • [177] Martin Hangaard Hansen and Jan Rossmeisl. pH in grand canonical statistics of an electrochemical interface. The Journal of Physical Chemistry C, 120(51):29135–29143, December 2016.
  • [178] A. O. Dohn, E. Ö. Jónsson, G. Levi, J. J. Mortensen, O. Lopez-Acevedo, K. S. Thygesen, K. W. Jacobsen, J. Ulstrup, N. E. Henriksen, K. B. Møller, and H. Jónsson. Grid-based projector augmented wave (GPAW) implementation of quantum mechanics/molecular mechanics (QM/MM) electrostatic embedding and application to a solvated diplatinum complex. J. Chem. Theory Comput., 13(12):6010–6022, 2017.
  • [179] Asmus Ougaard Dohn, Elvar Örn Jónsson, Kasper Skov Kjær, Tim Brandt van Driel, Martin Meedom Nielsen, Karsten Wedel Jacobsen, Niels Engholm Henriksen, and Klaus Braagaard Møller. Direct dynamics studies of a binuclear metal complex in solution: The interplay between vibrational relaxation, coherence, and solvent effects. J. Phys. Chem. Lett., 5(14):2414–2418, June 2014.
  • [180] Tim B. van Driel, Kasper S. Kjær, Robert W. Hartsock, Asmus O. Dohn, Tobias Harlang, Matthieu Chollet, Morten Christensen, Wojciech Gawelda, Niels E. Henriksen, Jong Goo Kim, Kristoffer Haldrup, Kyung Hwan Kim, Hyotcherl Ihee, Jeongho Kim, Henrik Lemke, Zheng Sun, Villy Sundström, Wenkai Zhang, Diling Zhu, Klaus B. Møller, Martin M. Nielsen, and Kelly J. Gaffney. Atomistic characterization of the active-site solvation dynamics of a model photocatalyst. Nat. Commun., 7(1), 2016.
  • [181] Gianluca Levi, Mátyás Pápai, Niels E. Henriksen, Asmus O. Dohn, and Klaus B. Møller. Solution structure and ultrafast vibrational relaxation of the ptpop complex revealed by δ𝛿\deltaitalic_δscf-qm/mm direct dynamics simulations. J. Phys. Chem. C, 122:7100–7119, 4 2018.
  • [182] Kristoffer Haldrup, Gianluca Levi, Elisa Biasin, Peter Vester, Mads Goldschmidt Laursen, Frederik Beyer, Kasper Skov Kjær, Tim Brandt Van Driel, Tobias Harlang, Asmus O. Dohn, Robert J. Hartsock, Silke Nelson, James M. Glownia, Henrik T. Lemke, Morten Christensen, Kelly J. Gaffney, Niels E. Henriksen, Klaus B. Møller, and Martin M. Nielsen. Ultrafast X-Ray Scattering Measurements of Coherent Structural Dynamics on the Ground-State Potential Energy Surface of a Diplatinum Molecule. Phys. Rev. Lett., 122(6):63001, 2019.
  • [183] Asmus O. Dohn, Kasper S. Kjær, Tobias B. Harlang, Sophie E. Canton, Martin M. Nielsen, and Klaus B. Møller. Electron transfer and solvent-mediated electronic localization in molecular photocatalysis. Inorg. Chem., 55(20):10637–10644, October 2016.
  • [184] Elvar Örn Jónsson, Asmus Ougaard Dohn, and Hannes Jónsson. Polarizable embedding with a transferable H_2_2\_2_ 2O potential function I: Formulation and tests on dimer. J. Chem. Theory Comput., 15(12):6562–6577, 2019.
  • [185] Asmus Ougaard Dohn, Elvar Örn Jónsson, and Hannes Jónsson. Polarizable embedding with a transferable H_2_2\_2_ 2O potential function II: Application to H_2_2\_2_ 2O clusters and liquid water. J. Chem. Theory Comput., 15(12):6578–6587, 2019.
  • [186] Thomas Olsen. Designing in-plane heterostructures of quantum spin Hall insulators from first principles: 1T’-MoS_2_2\_2_ 2 with adsorbates. Phys. Rev. B, 94:235106, 2016.
  • [187] A.I. Liechtenstein, M.I. Katsnelson, V.P Antropov, and V.A. Gubanov. Local spin density functional approach to the theory of exchange interactions in ferromagnetic metals and alloys. J. Magn. Magn. Mater., 67:65–74, 1987.
  • [188] N. D. Mermin and H. Wagner. Absence of Ferromagnetism or Antiferromagnetism in One- or Two-Dimensional Isotropic Heisenberg Models. Phys. Rev. Lett., 17:1133–1136, 1966.
  • [189] J. L. Lado and J. Fernández-Rossier. On the origin of magnetic anisotropy in two dimensional CrI 3. 2D Mater., 4:035002, 2017.
  • [190] Daniele Torelli, Kristian Sommer Thygesen, and Thomas Olsen. High throughput computational screening for 2D ferromagnetic materials: the critical role of anisotropy and local correlations. 2D Mater., 6:045018, 2019.
  • [191] Daniele Torelli, Hadeel Moustafa, Karsten W. Jacobsen, and Thomas Olsen. High-throughput computational screening for two-dimensional magnetic materials based on experimental databases of three-dimensional compounds. npj Comput. Mater., 6:158, 2020.
  • [192] U von Barth and L. Hedin. A local exchange-correlation potential for the spin polarized case. i. J. Phys. C Solid State Phys., 5:1629–1642, 1972.
  • [193] Giovanni Scalmani and Michael J. Frisch. A New Approach to Noncollinear Spin Density Functional Theory beyond the Local Density Approximation. J. Chem. Theory Comput., 8:2193–2196, 2012.
  • [194] Tae Yun Kim and Cheol-Hwan Park. Magnetic Anisotropy and Magnetic Ordering of Transition-Metal Phosphorus Trisulfides. Nano Lett., 21:10114–10121, 2021.
  • [195] D. Ceresoli, U. Gerstmann, A. P. Seitsonen, and F. Mauri. First-principles theory of orbital magnetization. Phys. Rev. B, 81(6):060409, 2010.
  • [196] A. J. P. Meyer and G. Asch. Experimental g’ and g values of Fe, Co, Ni, and their alloys. J. Appl. Phys., 32(3):S330–S333, 1961.
  • [197] Simon Foner. High-field antiferromagnetic resonance in Cr_2_2\_{2}_ 2O_3_3\_{3}_ 3. Phys. Rev., 130:183–197, 1963.
  • [198] T. A. Kaplan. Classical Spin-Configuration Stability in the Presence of Competing Exchange Forces. Phys. Rev., 116(4):888–889, nov 1959.
  • [199] L. M. Sandratskii. Energy band structure calculations for crystals with spiral magnetic structure. Phys. Status Solidi B., 136(1):167–180, 1986.
  • [200] LM Sandratskii. Insight into the dzyaloshinskii-moriya interaction through first-principles study of chiral magnetic structures. Phys. Rev. B, 96(2):024450, 2017.
  • [201] Ryogo Kubo. Statistical-Mechanical Theory of Irreversible Processes. I. General Theory and Simple Applications to Magnetic and Conduction Problems. J. Phys. Soc. Jpn., 12(6):570–586, 6 1957.
  • [202] E. K U Gross and Walter Kohn. Local density-functional theory of frequency-dependent linear response. Phys. Rev. Lett., 55:2850–2852, 1985.
  • [203] Erich Runge and E. K. U. Gross. Density-Functional Theory for Time-Dependent Systems. Phys. Rev. Lett., 52:997–1000, 1984.
  • [204] S. Sharma, J. K. Dewhurst, A. Sanna, and E. K. U. Gross. Bootstrap approximation for the exchange-correlation kernel of time-dependent density-functional theory. Phys. Rev. Lett., 107:186401, Oct 2011.
  • [205] AH MacDonald, SH Vosko, and PT Coleridge. Extensions of the tetrahedron method for evaluating spectral properties of solids. Journal of Physics C: Solid State Physics, 12(15):2991, 1979.
  • [206] Carlo A. Rozzi, Daniele Varsano, Andrea Marini, Eberhard K. U. Gross, and Angel Rubio. Exact coulomb cutoff technique for supercell calculations. Phys. Rev. B, 73:205119, May 2006.
  • [207] Falco Hüser, Thomas Olsen, and Kristian S Thygesen. How dielectric screening in two-dimensional crystals affects the convergence of excited-state calculations: Monolayer MoS_2_2\_2_ 2. Phys. Rev. B, 88(24):245309, 2013.
  • [208] S. Latini, T. Olsen, and K. S. Thygesen. Excitons in van der waals heterostructures: The important role of dielectric screening. Phys. Rev. B, 92:245123, Dec 2015.
  • [209] Christopher E. Patrick and Kristian S. Thygesen. Hubbard-U corrected Hamiltonians for non-self-consistent random-phase approximation total-energy calculations: A study of ZnS, TiO_2_2\_{2}_ 2, and NiO. Phys. Rev. B, 93:035133, Jan 2016.
  • [210] Per S. Schmidt and Kristian S. Thygesen. Benchmark database of transition metal surface and adsorption energies from many-body perturbation theory. The Journal of Physical Chemistry C, 122(8):4381–4390, 2018.
  • [211] Thomas Olsen, Jun Yan, Jens J. Mortensen, and Kristian S. Thygesen. Dispersive and covalent interactions between graphene and metal surfaces from the random phase approximation. Phys. Rev. Lett., 107:156401, Oct 2011.
  • [212] Filipp Furche and Troy Van Voorhis. Fluctuation-dissipation theorem density-functional theory. The Journal of Chemical Physics, 122(16), 04 2005. 164106.
  • [213] Thomas Olsen and Kristian S. Thygesen. Beyond the random phase approximation: Improved description of short-range correlation by a renormalized adiabatic local density approximation. Phys. Rev. B, 88:115131, Sep 2013.
  • [214] Thomas Olsen and Kristian S. Thygesen. Accurate ground-state energies of solids and molecules from time-dependent density-functional theory. Phys. Rev. Lett., 112:203001, May 2014.
  • [215] Christopher E. Patrick and Kristian S. Thygesen. Adiabatic-connection fluctuation-dissipation DFT for the structural properties of solids—The renormalized ALDA and electron gas kernels. The Journal of Chemical Physics, 143(10), 04 2015. 102802.
  • [216] Thomas Olsen, Christopher E. Patrick, Jefferson E. Bates, Adrienn Ruzsinszky, and Kristian S. Thygesen. Beyond the RPA and GW methods with adiabatic xc-kernels for accurate ground state and quasiparticle energies. npj Comput. Mater., 5(1):106, Nov 2019.
  • [217] Paweł Buczek, Arthur Ernst, and Leonid M. Sandratskii. Different dimensionality trends in the Landau damping of magnons in iron, cobalt, and nickel: Time-dependent density functional study. Phys. Rev. B, 84:174418, 2011.
  • [218] Léon Van Hove. Time-Dependent Correlations between Spins and Neutron Scattering in Ferromagnetic Crystals. Phys. Rev., 95(6):1374–1384, 9 1954.
  • [219] Thorbjørn Skovhus, Thomas Olsen, and Henrik M Rønnow. Influence of static correlation on the magnon dynamics of an itinerant ferromagnet with competing exchange interactions: First-principles study of mnbi. Phys. Rev. Mater., 6:054402, 5 2022.
  • [220] Thorbjørn Skovhus and Thomas Olsen. Magnons in antiferromagnetic bcc cr and cr_2o_3cr_2o_3{\mathrm{cr}}\_{2}{\mathrm{o}}\_{3}roman_cr _ 2 roman_o _ 3 from time-dependent density functional theory. Phys. Rev. B, 106:085131, Aug 2022.
  • [221] HN Rojas, Rex William Godby, and RJ Needs. Space-time method for ab initio calculations of self-energies and dielectric response functions of solids. Phys. Rev. Lett., 74(10):1827, 1995.
  • [222] Christoph Friedrich, Stefan Blügel, and Arno Schindlmayr. Efficient implementation of the g w approximation within the all-electron flapw method. Phys. Rev. B, 81(12):125102, 2010.
  • [223] Ivan Duchemin and Xavier Blase. Robust analytic-continuation approach to many-body gw calculations. J. Chem. Theory Comput., 16(3):1742–1756, 2020.
  • [224] Dario A Leon, Claudia Cardoso, Tommaso Chiarotti, Daniele Varsano, Elisa Molinari, and Andrea Ferretti. Frequency dependence in g w made simple using a multipole approximation. Phys. Rev. B, 104(11):115157, 2021.
  • [225] Filip A Rasmussen, Per S Schmidt, Kirsten T Winther, and Kristian S Thygesen. Efficient many-body calculations for two-dimensional materials using exact limits for the screened potential: Band gaps of MoS_2_2\_2_ 2, H-BN, and phosphorene. Phys. Rev. B, 94(15):155406, 2016.
  • [226] Andrea Marini, Conor Hogan, Myrta Grüning, and Daniele Varsano. Yambo: an ab initio tool for excited state calculations. Comput. Phys. Commun., 180(8):1392–1403, 2009.
  • [227] Thomas Olsen, Simone Latini, Filip Rasmussen, and Kristian S. Thygesen. Simple Screened Hydrogen Model of Excitons in Two-Dimensional Materials. Phys. Rev. Lett., 116:056401, 2016.
  • [228] Thomas Olsen. Unified Treatment of Magnons and Excitons in Monolayer CrI_3_3\_3_ 3 from Many-Body Perturbation Theory. Phys. Rev. Lett., 127:166402, 2021.
  • [229] Zhen Li, Patrizio Graziosi, and Neophytos Neophytou. Deformation potential extraction and computationally efficient mobility calculations in silicon from first principles. Phys. Rev. B, 104(19):195201, 2021.
  • [230] Amy Y Liu and Andrew A Quong. Linear-response calculation of electron-phonon coupling parameters. Phys. Rev. B, 53(12):R7575, 1996.
  • [231] Feliciano Giustino. Electron-phonon interactions from first principles. Rev. Mod. Phys., 89:015003, Feb 2017.
  • [232] Michael Walter and Michael Moseler. Ab Initio Wavelength-Dependent Raman Spectra: Placzek Approximation and Beyond. J. Chem. Theory Comput., 16(1):576–586, January 2020.
  • [233] Ado Jorio, Mildred S Dresselhaus, Riichiro Saito, and Gene Dresselhaus. Raman spectroscopy in graphene related systems. John Wiley & Sons, 2011.
  • [234] Atsushi Togo, Laurent Chaput, Terumasa Tadano, and Isao Tanaka. Implementation strategies in phonopy and phono3py. J. Phys. Condens. Matter, 35(35):353001, 2023.
  • [235] Robert W. Boyd. Nonlinear Optics. Elsevier Science Publishing Co Inc., Amsterdam, 3rd edition, 2008.
  • [236] Alireza Taghizadeh, F. Hipolito, and T. G. Pedersen. Linear and nonlinear optical response of crystals using length and velocity gauges: Effect of basis truncation. Phys. Rev. B, 96:195413, 2017.
  • [237] Claudio Aversa and J. E. Sipe. Nonlinear optical susceptibilities of semiconductors: Results with a length-gauge analysis. Phys. Rev. B, 52:14636–14645, 1995.
  • [238] Arto Sakko, Tuomas P Rossi, and Risto M Nieminen. Dynamical coupling of plasmons and molecular excitations by hybrid quantum/classical calculations: time-domain approach. Journal of Physics: Condensed Matter, 26(31):315013, jul 2014.
  • [239] Tuomas P. Rossi, Kirsten T. Winther, Karsten W. Jacobsen, Risto M. Nieminen, Martti J. Puska, and Kristian S. Thygesen. Effect of edge plasmons on the optical properties of MoS_2_2\_{2}_ 2 monolayer flakes. Phys. Rev. B, 96:155407, Oct 2017.
  • [240] Priyank V. Kumar, Tuomas P. Rossi, Mikael Kuisma, Paul Erhart, and David J. Norris. Direct hot-carrier transfer in plasmonic catalysis. Faraday Discuss., 214:189–197, 2019.
  • [241] Priyank V. Kumar, Tuomas P. Rossi, Daniel Marti-Dafcik, Daniel Reichmuth, Mikael Kuisma, Paul Erhart, Martti J. Puska, and David J. Norris. Plasmon-Induced Direct Hot-Carrier Transfer at Metal–Acceptor Interfaces. Acs Nano, 13(3):3188–3195, 2019.
  • [242] Tuomas P. Rossi, Timur Shegai, Paul Erhart, and Tomasz J. Antosiewicz. Strong plasmon-molecule coupling at the nanoscale revealed by first-principles modeling. Nat. Commun., 10(1):3336, 2019.
  • [243] Tuomas P. Rossi, Paul Erhart, and Mikael Kuisma. Hot-Carrier Generation in Plasmonic Nanoparticles: The Importance of Atomic Structure. Acs Nano, 14(8):9963–9971, 2020.
  • [244] Jakub Fojt, Tuomas P. Rossi, Mikael Kuisma, and Paul Erhart. Hot-Carrier Transfer across a Nanoparticle–Molecule Junction: The Importance of Orbital Hybridization and Level Alignment. Nano Lett., 22(21):8786–8792, 2022.
  • [245] Daniel Sorvisto, Patrick Rinke, and Tuomas P. Rossi. Single-atom dopants in plasmonic nanocatalysts. The Journal of Physical Chemistry C, 127(18):8585–8590, 2023.
  • [246] K. Yabana and G. F. Bertsch. Time-dependent local-density approximation in real time. Phys. Rev. B, 54(7):4484–4487, 1996.
  • [247] Sami Malola, Lauri Lehtovaara, Jussi Enkovaara, and Hannu Häkkinen. Birth of the localized surface plasmon resonance in monolayer-protected gold nanoclusters. Acs Nano, 7(11):10263–10270, 2013.
  • [248] Tuomas Rossi, Paul Erhart, and Mikael Kuisma. Code for "hot-carrier generation in plasmonic nanoparticles: The importance of atomic structure". Zenodo.
  • [249] Jakub Fojt, Tuomas Rossi, Mikael Kuisma, and Paul Erhart. Code for "hot-carrier transfer across a nanoparticle-molecule junction: The importance of orbital hybridization and level alignment". Zenodo.
  • [250] Christian Schäfer and Göran Johansson. Shortcut to self-consistent light-matter interaction and realistic spectra from first principles. Phys. Rev. Lett., 128:156402, Apr 2022.
  • [251] Christian Schäfer. Polaritonic chemistry from first principles via embedding radiation reaction. J. Phys. Chem. Lett., 13(30):6905–6911, 2022. PMID: 35866694.
  • [252] Ari Ojanperä, Ville Havu, Lauri Lehtovaara, and Martti Puska. Nonadiabatic Ehrenfest molecular dynamics within the projector augmented-wave method. The Journal of Chemical Physics, 136(14):144103, April 2012. Publisher: American Institute of Physics.
  • [253] Ari Ojanperä, Arkady V. Krasheninnikov, and Martti Puska. Electronic stopping power from first-principles calculations with account for core electron excitations and projectile ionization. Phys. Rev. B, 89(3):035120, 2014.
  • [254] Olga A. Syzgantseva, Martti Puska, and Kari Laasonen. Charge Transfer at the Hybrid Interfaces in the Presence of Water: A Theoretical Study. The Journal of Physical Chemistry C, 119(51):28347–28352, December 2015.
  • [255] Christian Brand, Maxime Debiossac, Toma Susi, François Aguillon, Jani Kotakoski, Philippe Roncin, and Markus Arndt. Coherent diffraction of hydrogen through the 246 pm lattice of graphene. New J. Phys., 21(3):033004, March 2019.
  • [256] Evgeny A. Buntov and Anatoly F. Zatsepin. Carbon Bond Breaking under Ar+-Ion Irradiation in Dependence on sp Hybridization: Car–Parrinello, Ehrenfest, and Classical Dynamics Study. J. Phys. Chem. A, 124(44):9128–9132, November 2020.
  • [257] Yierpan Aierken, Ankit Agrawal, Meiling Sun, Marko Melander, Ethan J. Crumlin, Brett A. Helms, and David Prendergast. Revealing Charge-Transfer Dynamics at Electrified Sulfur Cathodes Using Constrained Density Functional Theory. J. Phys. Chem. Lett., 12(2):739–744, January 2021. Publisher: American Chemical Society.
  • [258] Emilio Artacho and David D. O’Regan. Quantum mechanics in an evolving Hilbert space. Phys. Rev. B, 95(11):115155, March 2017. Publisher: American Physical Society.
  • [259] Siesta: Recent developments and applications. The Journal of Chemical Physics, 152(20):204108, May 2020. Publisher: American Institute of Physics.
  • [260] Andreas Dreuw and Martin Head-Gordon. Failure of Time-Dependent Density Functional Theory for Long-Range Charge-Transfer Excited States: The Zincbacteriochlorin-Bacteriochlorin and Bacteriochlorophyll-Spheroidene Complexes. J. Am. Chem. Soc., 126(12):4007–4016, 2004.
  • [261] Issaka Seidu, Mykhaylo Krykunov, and Tom Ziegler. Applications of time-dependent and time-independent density functional theory to Rydberg transitions. J. Phys. Chem. A, 119(21):5107–5116, 2015.
  • [262] Benjamin G. Levine, Chaehyuk Ko, Jason Quenneville, and Todd J. Martínez. Conical intersections and double excitations in time-dependent density functional theory. Mol. Phys., 104:1039–1051, 3 2006.
  • [263] Sigeru Huzinaga and Catalina Arnau. Virtual Orbitals in Hartree-Fock Theory. Phys. Rev. A, 1(5):1285–1288, May 1970.
  • [264] Sigeru Huzinaga and Catalina Arnau. Virtual Orbitals in Hartree–Fock Theory. II. The Journal of Chemical Physics, 54(5):1948–1951, March 1971.
  • [265] Diptarka Hait and Martin Head-Gordon. Orbital optimized density functional theory for electronic excited states. J. Phys. Chem. Lett., 12:4517–4529, 5 2021.
  • [266] Giuseppe M.J. Barca, Andrew T.B. Gilbert, and Peter M.W. Gill. Simple models for difficult electronic excitations. J. Chem. Theory Comput., 14:1501–1509, 3 2018.
  • [267] Andrew T.B. Gilbert, Nicholas A. Besley, and Peter M.W. Gill. Self-consistent field calculations of excited states using the maximum overlap method (mom). J. Phys. Chem. A, 112:13164–13171, 12 2008.
  • [268] Gianluca Levi, Aleksei V. Ivanov, and Hannes Jónsson. Variational calculations of excited states via direct optimization of orbitals in DFT. Faraday Discuss., 224:448–466, 12 2020.
  • [269] Pierre François Loos, Massimiliano Comin, Xavier Blase, and Denis Jacquemin. Reference energies for intramolecular charge-transfer excitations. J. Chem. Theory Comput., 17:3666–3686, 6 2021.
  • [270] Tetsuo Katayama, Tae Kyu Choi, Dmitry Khakhulin, Asmus O Dohn, Christopher J. Milne, György Vankó, Zoltán Németh, Frederico A. Lima, Jakub Szlachetko, Tokushi Sato, Shunsuke Nozawa, Shin Ichi Adachi, Makina Yabashi, Thomas J. Penfold, Wojciech Gawelda, and Gianluca Levi. Atomic-scale observation of solvent reorganization influencing photoinduced structural dynamics in a copper complex photosensitizer. Chem. Sci., 14:2572–2584, 2023.
  • [271] He Ma, Marco Govoni, and Giulia Galli. Quantum simulations of materials on near term quantum computers. npj Comput. Mater., 6(1):85, December 2020.
  • [272] Mostafa Abedi, Gianluca Levi, Diana B Zederkof, Niels Engholm Henriksen, Mátyás Pápai, and Klaus B. Møller. Excited-State Solvation Structure of Transition Metal Complexes from Molecular Dynamics Simulations and Assessment of Partial Atomic Charge Methods. Phys. Chem. Chem. Phys., 21:4082–4095, 2019.
  • [273] Aleksei V. Ivanov, Yorick L. A. Schmerwitz, Gianluca Levi, and Hannes Jónsson. Electronic excitations of the charged nitrogen-vacancy center in diamond obtained using time-independent variational density functional calculations. SciPost Phys., 15:009, 2023.
  • [274] Theory of polarization of crystalline solids. Phys. Rev. B, 47:1651–1654, 1993.
  • [275] Raffaele Resta. Macroscopic polarization in crystalline dielectrics: the geometric phase approach. Rev. Mod. Phys., 66:899–915, 1994.
  • [276] Raffaele Resta and David Vanderbilt. Theory of Polarization: A Modern Approach. In Phys. Ferroelectr., volume 105, pages 31–68. 2007.
  • [277] Yasuhiro Yoneda, Koji Ohara, and Hajime Nagata. Local structure and phase transitions of KNbO 3. Jpn. J. Appl. Phys., 57:11UB07, 2018.
  • [278] Marco Gibertini and Nicola Marzari. Emergence of One-Dimensional Wires of Free Carriers in Transition-Metal-Dichalcogenide Nanostructures. Nano Lett., 15:6229–6238, 2015.
  • [279] Joachim Sødequist, Urko Petralanda, and Thomas Olsen. Abundance of second order topology in C 3 symmetric two-dimensional insulators. 2D Mater., 10:015009, 2023.
  • [280] Stefano Baroni, Stefano De Gironcoli, Andrea Dal Corso, and Paolo Giannozzi. Phonons and related crystal properties from density-functional perturbation theory. Rev. Mod. Phys., 73:515–562, 2001.
  • [281] Ruixiang Fei, Wei Kang, and Li Yang. Ferroelectricity and Phase Transitions in Monolayer Group-IV Monochalcogenides. Phys. Rev. Lett., 117:097601, 2016.
  • [282] Tonatiuh Rangel, Benjamin M Fregoso, Bernardo S Mendoza, Takahiro Morimoto, Joel E Moore, and Jeffrey B Neaton. Large Bulk Photovoltaic Effect and Spontaneous Polarization of Single-Layer Monochalcogenides. Phys. Rev. Lett., 119:067402, 2017.
  • [283] Hua Wang and Xiaofeng Qian. Two-dimensional multiferroics in monolayer group IV monochalcogenides. 2D Mater., 4:015042, 2017.
  • [284] Urko Petralanda and Thomas Olsen. Polarization switching induced by domain wall sliding in two-dimensional ferroelectric monochalcogenides. 2D Mater., 10:015001, 2023.
  • [285] Maryam Taherinejad, Kevin F. Garrity, and David Vanderbilt. Wannier center sheets in topological insulators. Phys. Rev. B, 89:115102, 2014.
  • [286] Nicola Marzari and David Vanderbilt. Maximally localized generalized wannier functions for composite energy bands. Phys. Rev. B, 56(20):12847, 1997.
  • [287] Xiaofeng Qian, Junwei Liu, Liang Fu, and Ju Li. Quantum spin Hall effect in two-dimensional transition metal dichalcogenides. Science, 346:1344–1347, 2014.
  • [288] Raffaele Resta and Sandro Sorella. Electron localization in the insulating state. Phys. Rev. Lett., 82(2):370, 1999.
  • [289] Gerd Berghold, Christopher J Mundy, Aldo H Romero, Jürg Hutter, and Michele Parrinello. General and efficient algorithms for obtaining maximally localized wannier functions. Phys. Rev. B, 61(15):10040, 2000.
  • [290] Kristian S Thygesen, Lars Bruno Hansen, and Karsten Wedel Jacobsen. Partly occupied wannier functions. Phys. Rev. Lett., 94(2):026405, 2005.
  • [291] Kristian Sommer Thygesen, Lars Bruno Hansen, and Karsten Wedel Jacobsen. Partly occupied wannier functions: Construction and applications. Phys. Rev. B, 72(12):125119, 2005.
  • [292] Pietro F Fontana, Ask H Larsen, Thomas Olsen, and Kristian S Thygesen. Spread-balanced wannier functions: Robust and automatable orbital localization. Phys. Rev. B, 104(12):125140, 2021.
  • [293] Cyrus E Dreyer, Audrius Alkauskas, John L Lyons, Anderson Janotti, and Chris G Van de Walle. First-principles calculations of point defects for quantum technologies. Annu. Rev. Mater. Res., 48:1–26, 2018.
  • [294] Ji Sang Park, Sunghyun Kim, Zijuan Xie, and Aron Walsh. Point defect engineering in thin-film solar cells. Nature Reviews Materials, 3(7):194–210, 2018.
  • [295] L Weston, D Wickramaratne, M Mackoit, A Alkauskas, and CG Van de Walle. Native point defects and impurities in hexagonal boron nitride. Phys. Rev. B, 97(21):214104, 2018.
  • [296] TQP Vuong, Guillaume Cassabois, Pierre Valvin, Abdelkarim Ouerghi, Yannick Chassagneux, Christophe Voisin, and Bernard Gil. Phonon-photon mapping in a color center in hexagonal boron nitride. Phys. Rev. Lett., 117(9):097402, 2016.
  • [297] Chris G Van de Walle and Jörg Neugebauer. First-principles calculations for defects and impurities: Applications to iii-nitrides. J. Appl. Phys., 95(8):3851–3879, 2004.
  • [298] Stephan Lany and Alex Zunger. Assessment of correction methods for the band-gap problem and for finite-size effects in supercell defect calculations: Case studies for zno and gaas. Phys. Rev. B, 78(23):235104, 2008.
  • [299] Christoph Freysoldt, Blazej Grabowski, Tilmann Hickel, Jörg Neugebauer, Georg Kresse, Anderson Janotti, and Chris G Van de Walle. First-principles calculations for point defects in solids. Rev. Mod. Phys., 86(1):253, 2014.
  • [300] Alex Zunger and Oleksandr I Malyi. Understanding doping of quantum materials. Chem. Rev., 121(5):3031–3060, 2021.
  • [301] Oleksandr O Kurakevych and Vladimir L Solozhenko. Rhombohedral boron subnitride, b13n2, by x-ray powder diffraction. Acta Crystallogr. C., 63(9):i80–i82, 2007.
  • [302] Guillaume Cassabois, Pierre Valvin, and Bernard Gil. Hexagonal boron nitride is an indirect bandgap semiconductor. Nat. Photonics, 10(4):262–266, 2016.
  • [303] Christoph Freysoldt, Jörg Neugebauer, and Chris G Van de Walle. Fully ab initio finite-size corrections for charged-defect supercell calculations. Phys. Rev. Lett., 102(1):016402, 2009.
  • [304] Sami Kaappa, Sami Malola, and Hannu Häkkinen. Point group symmetry analysis of the electronic structure of bare and protected metal nanocrystals. J. Phys. Chem. A, 122(43):8576–8584, 2018.
  • [305] Fabian Bertoldo, Sajid Ali, Simone Manti, and Kristian S. Thygesen. Quantum point defects in 2D materials - the QPOD database. npj Comput. Mater., 8(1):56, Apr 2022.
  • [306] J.F. Cornwell. Group Theory in Physics, volume 1 of Techniques of Physics. Academic Press, San Diego, 1997.
  • [307] Voicu Popescu and Alex Zunger. Extracting E versus k𝑘\vec{k}over→ start_ARG italic_k end_ARG effective band structure from supercell calculations on alloys and impurities. Phys. Rev. B, 85(8):085201, 2012.
  • [308] Quantum Electrostatic Heterostructure Model. https://qeh.readthedocs.io/en/latest/, 2019. [Online; accessed 15-May-2023].
  • [309] Kirsten Andersen, Simone Latini, and Kristian S Thygesen. Dielectric genome of van der Waals heterostructures. Nano Lett., 15(7):4616–4621, 2015.
  • [310] Calculating new building blocks. https://qeh.readthedocs.io/en/latest/tutorials.html, 2019. [Online; accessed 15-May-2023].
  • [311] Alexander Held and Michael Walter. Simplified continuum solvent model with a smooth cavity based on volumetric data. The Journal of Chemical Physics, 141(17):174108, 2014.
  • [312] A. Y. Lozovoi, A Alavi, Jorge Kohanoff, and R M Lynden-Bell. Ab initio simulation of charged slabs at constant chemical potential. The Journal of Chemical Physics, 115(4):1661–1669, jul 2001.
  • [313] Marko M Melander, Mikael J Kuisma, Thorbjørn Erik Køppen Christensen, and Karoliina Honkala. Grand-canonical approach to density functional theory of electrocatalytic systems: Thermodynamics of solid-liquid interfaces at constant ion and electrode potentials. The Journal of Chemical Physics, 150(4):041706, jan 2019.
  • [314] Ken Sakaushi, Tomoaki Kumeda, Sharon Hammes-Schiffer, Marko M Melander, and Osamu Sugino. Advances and challenges for experiment and theory for multi-electron multi-proton transfer at electrified solid–liquid interfaces. Phys. Chem. Chem. Phys., 22(35):19401–19442, 2020.
  • [315] Per Lindgren, Georg Kastlunger, and Andrew A. Peterson. Electrochemistry from the atomic scale, in the electronically grand-canonical ensemble. The Journal of Chemical Physics, 157(18):180902, nov 2022.
  • [316] M Otani and O Sugino. First-principles calculations of charged surfaces and interfaces: A plane-wave nonrepeated slab approach. Phys. Rev. B, 73(11):115407, mar 2006.
  • [317] Kiran Mathew, Ravishankar Sundararaman, Kendra Letchworth-Weaver, T A Arias, and Richard G Hennig. Implicit solvation model for density-functional study of nanocrystal surfaces and reaction pathways. The Journal of Chemical Physics, 140(8):84106, 2014.
  • [318] Kendra Letchworth-Weaver and T. A. Arias. Joint density functional theory of the electrode-electrolyte interface: Application to fixed electrode potentials, interfacial capacitances, and potentials of zero charge. Phys. Rev. B, 86(7):075140, aug 2012.
  • [319] Nicolas G. Hörmann, Oliviero Andreussi, and Nicola Marzari. Grand canonical simulations of electrochemical interfaces in implicit solvation models. The Journal of Chemical Physics, 150(4):041730, jan 2019.
  • [320] Stefan Ringe, Nicolas G Hörmann, Harald Oberhofer, and Karsten Reuter. Implicit Solvation Methods for Catalysis at Electrified Interfaces. Chem. Rev., 122(12):10777–10820, jun 2022.
  • [321] Georg Kastlunger, Per Lindgren, and Andrew A. Peterson. Controlled-potential simulation of elementary electrochemical reactions: Proton discharge on metal surfaces. The Journal of Physical Chemistry C, 122(24):12771–12781, jun 2018.
  • [322] Sergio Trasatti. The absolute electrode potential: an explanatory note (recommendations 1986). Journal of Electroanalytical Chemistry and Interfacial Electrochemistry, 209(2):417–428, sep 1986.
  • [323] Ravishankar Sundararaman and Kathleen Schwarz. Evaluating continuum solvation models for the electrode-electrolyte interface: Challenges and strategies for improvement. The Journal of Chemical Physics, 146(8), 02 2017.
  • [324] Marko M. Melander, Mikael J. Kuisma, Thorbjørn Erik Køppen Christensen, and Karoliina Honkala. Grand-canonical approach to density functional theory of electrocatalytic systems: Thermodynamics of solid-liquid interfaces at constant ion and electrode potentials. The Journal of Chemical Physics, 150(4), 11 2018.
  • [325] M. Weinert and J. W. Davenport. Fractional occupations and density-functional energies and forces. Phys. Rev. B, 45:13709–13712, Jun 1992.
  • [326] Per Lindgren, Georg Kastlunger, and Andrew A Peterson. A Challenge to the G\approx0 Interpretation of Hydrogen Evolution. ACS Catal., 10(1):121–128, jan 2020.
  • [327] Georg Kastlunger, Lei Wang, Nitish Govindarajan, Hendrik H Heenen, Stefan Ringe, Thomas Jaramillo, Christopher Hahn, and Karen Chan. Using pH Dependence to Understand Mechanisms in Electrochemical CO Reduction. ACS Catal., 12(8):4344–4357, apr 2022.
  • [328] Georg Kastlunger, Hendrik H. Heenen, and Nitish Govindarajan. Combining First-Principles Kinetics and Experimental Data to Establish Guidelines for Product Selectivity in Electrochemical CO 2 Reduction. ACS Catal., 13(7):5062–5072, apr 2023.
  • [329] Marko Melander, Tongwei Wu, and Karoliina Honkala. Constant inner potential DFT for modelling electrochemical systems under constant potential and bias. ChemRxiv, 2023. DOI=10.26434/chemrxiv-2021-r621x-v3.
  • [330] Qin Wu and Troy Van Voorhis. Direct optimization method to study constrained systems within density-functional theory. Phys. Rev. A, 72:024502, Aug 2005.
  • [331] Qin Wu and Troy Van Voorhis. Extracting electron transfer coupling elements from constrained density functional theory. The Journal of Chemical Physics, 125(16), 10 2006.
  • [332] Benjamin Kaduk, Tim Kowalczyk, and Troy Van Voorhis. Constrained density functional theory. Chem. Rev., 112(1):321–370, 2012.
  • [333] Marko Melander, Elvar Ö. Jónsson, Jens J. Mortensen, Tejs Vegge, and Juan Maria García Lastra. Implementation of Constrained DFT for Computing Charge Transfer Rates within the Projector Augmented Wave Method. J. Chem. Theory Comput., 12(11):5367–5378, 2016.
  • [334] Haesun Park, Nitin Kumar, Marko Melander, Tejs Vegge, Juan Maria Garcia Lastra, and Donald J. Siegel. Adiabatic and Nonadiabatic Charge Transport in Li–S Batteries. Chem. Mater., 30(3):915–928, 2018.
  • [335] Tomoaki Kumeda, Laura Laverdure, Karoliina Honkala, Marko M. Melander, and Ken Sakaushi. Cations determine the mechanism and selectivity of alkaline ORR on Pt(111), 2022.
  • [336] Marko M. Melander. Grand canonical rate theory for electrochemical and electrocatalytic systems i: General formulation and proton-coupled electron transfer reactions. J. Electrochem. Soc., 167(11):116518, jul 2020.
  • [337] Mel Levy, John P. Perdew, and Viraht Sahni. Exact differential equation for the density and ionization energy of a many-particle system. Phys. Rev. A, 30:2745–2748, Nov 1984.
  • [338] Jouko Lehtomäki, Ilja Makkonen, Miguel A. Caro, Ari Harju, and Olga Lopez-Acevedo. Orbital-free density functional theory implementation with the projector augmented-wave method. The Journal of Chemical Physics, 141(23), 12 2014. 234102.
  • [339] Jouko Lehtomäki and Olga Lopez-Acevedo. Large-Z limit in atoms and solids from first principles. The Journal of Chemical Physics, 151(24), 12 2019. 244101.
  • [340] Viktor Ivády, Tamás Simon, Jeronimo R Maze, IA Abrikosov, and Adam Gali. Pressure and temperature dependence of the zero-field splitting in the ground state of nv centers in diamond: A first-principles study. Phys. Rev. B, 90(23):235205, 2014.
  • [341] MJ Rayson and PR Briddon. First principles method for the calculation of zero-field splitting tensors in periodic systems. Phys. Rev. B, 77(3):035119, 2008.
  • [342] Timur Biktagirov, Wolf Gero Schmidt, and Uwe Gerstmann. Spin decontamination for magnetic dipolar coupling calculations: Application to high-spin molecules and solid-state spin qubits. Physical Review Research, 2(2):022024, 2020.
  • [343] Peter E Blöchl. First-principles calculations of defects in oxygen-deficient silica exposed to hydrogen. Phys. Rev. B, 62(10):6158, 2000.