원시데이터 수집 시스템
선정목록으로

Phoebe: a high-performance framework for solving phonon and electron Boltzmann transport equations

간접 관련 수소연료전지 · (7) MEA(막전극접합체) (6) PEM(고분자전해질막)(15) 디스플레이 패널재료

기본 정보

저자
  1. Andrea Cepellotti — Harvard John A. Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138, United States of America
  2. Jennifer Coulter — Harvard John A. Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138, United States of America
  3. Anders Johansson — Harvard John A. Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138, United States of America
  4. Natalya S. Fedorova — Harvard John A. Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138, United States of America|||Materials Research and Technology Department, Luxembourg Institute of Science and Technology, 5 Avenue des Hauts-Fourneaux, L-4362 Esch/Alzette, Luxembourg
  5. Boris Kozinsky — Harvard John A. Paulson School of Engineering and Applied Sciences, Harvard University, Cambridge, MA 02138, United States of America|||Robert Bosch LLC, Research and Technology Center, Cambridge, MA, United States of America
DOI
10.1088/2515-7639/ac86f6
저널
Journal of Physics Materials
발행년도
2022
발행기관
IOP Publishing
피인용수
41
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1088/2515-7639/ac86f6
토픽
Thermal properties of materials
OpenAlex ID
W4291476124

평가 내용

관련도
간접 관련
사업분야
수소연료전지 · (7) MEA(막전극접합체)
부 분야
(6) PEM(고분자전해질막), (15) 디스플레이 패널재료
R&D 측면
분석·모델링
확신도
0.70
근거 용어
Boltzmann transport equations, electrical and thermal transport properties, electron-phonon scattering, computational modeling, thermoelectric performance
판단 근거
이 논문은 결정 구조 내에서 전자와 포논의 수송 방정식을 해결하는 고성능 계산 프레임워크(Phoebe)를 다룹니다. 이는 직접적인 제품 연구는 아니나, 수소연료전지(PEMFC)의 전해질막이나 전극 소재의 열/전기적 특성을 예측하는 시뮬레이션 방법론으로 응용될 수 있습니다.
R&D 활용 포인트
연료전지용 고분자 전해질막(PEM)이나 막전극접합체(MEA)의 열전도도 및 전기 전도도 특성을 분자 수준에서 예측하고 설계하는 계산 과학 도구로 활용 가능합니다.
평가 입력
본문 137,983자 중 30,032자 발췌

초록

Abstract Understanding the electrical and thermal transport properties of materials is critical to the design of electronics, sensors, and energy conversion devices. Computational modeling can accurately predict material properties but, in order to be reliable, requires accurate descriptions of electron and phonon states and their interactions. While first-principles methods are capable of describing the energy spectrum of each carrier, using them to compute transport properties is still a formidable task, both computationally demanding and memory intensive, requiring integration of fine microscopic scattering details for estimation of macroscopic transport properties. To address this challenge, we present Phoebe—a newly developed software package that includes the effects of electron–phonon, phonon–phonon, boundary, and isotope scattering in computations of electrical and thermal transport properties of materials with a variety of available methods and approximations. This open source C++ code combines MPI-OpenMP hybrid parallelization with GPU acceleration and distributed memory structures to manage computational cost, allowing Phoebe to effectively take advantage of contemporary computing infrastructures. We demonstrate that Phoebe accurately and efficiently predicts a wide range of transport properties, opening avenues for accelerated computational analysis of complex crystals.

본문 137,983자

본문 펼치기
Phoebe: a High-Performance Framework for Solving Phonon and Electron Boltzmann Transport Equations Andrea Cepellotti, <sup>1</sup> Jennifer Coulter, <sup>1</sup> Anders Johansson, <sup>1</sup> Natalya S. Fedorova, <sup>1, 2</sup> and Boris Kozinsky <sup>1, 3,</sup> <sup>_∗_</sup> 1 _Harvard_ _John_ _A._ _Paulson_ _School_ _of_ _Engineering_ _and_ _Applied_ _Sciences,_ _Harvard_ _University,_ _Cambridge,_ _MA_ _02138,_ _USA_ 2 _Materials_ _Research_ _and_ _Technology_ _Department,_ _Luxembourg_ _Institute_ _of_ _Science_ _and_ _Technology,_ _5_ _Avenue_ _des_ _Hauts-Fourneaux,_ _L-4362_ _Esch/Alzette,_ _Luxembourg_ 3 _Robert_ _Bosch_ _LLC,_ _Research_ _and_ _Technology_ _Center,_ _Cambridge_ _MA_ (Dated: September 13, 2022) Understanding the electrical and thermal transport properties of materials is critical to the design of electronics, sensors and energy conversion devices. Computational modeling can accurately predict materials properties but, in order to be reliable, require accurate descriptions of electron and phonon states and their interactions. While first-principles methods are capable of describing the energy spectrum of each carrier, using them to compute transport properties is still a formidable task, both computationally demanding and memory intensive, requiring integration of fine microscopic scattering details for estimation of macroscopic transport properties. To address this challenge, we present Phoebe - a newly developed software package that includes the effects of electron-phonon, phonon-phonon, boundary, and isotope scattering in computations of electrical and thermal transport properties of materials with a variety of available methods and approximations. This open source `C++` code combines MPI-OpenMP hybrid parallelization with GPU acceleration and distributed memory structures to manage computational cost, allowing Phoebe to effectively take advantage of contemporary computing infrastructures. We demonstrate that Phoebe accurately and efficiently predicts a wide range of transport properties, opening avenues for accelerated computational analysis of complex crystals. I. INTRODUCTION As technology use and its energy footprint continue to grow, so does the importance of improving the properties of the materials which underlie such technology. Materials transport properties, and in particular the capacity of a crystal to conduct heat and electricity, are critical to the function of virtually any electronic device. These properties are determined by the spectrum and velocities of electrons and lattice vibrations in a crystal lattice, and the interactions of these carriers among themselves and with crystal defects. The task of engineering better materials can be greatly accelerated through computational studies, as exemplified by successful computational discovery of new thermoelectric compounds [1]. In particular, the prediction of materials transport properties has reached high accuracy and robustness in recent years, thanks to the combination of firstprinciples density functional theory (DFT) simulations and numerical Boltzmann Transport Equation (BTE) solvers, the former capable of accurately parameterizing the microscopic characteristics of crystal quasiparticles and the latter providing macroscopic transport properties from microscopic data. Both components are still the subject of study and are continuously evolving, as there are several challenges, both technical and conceptual, in both the calculation of the relevant microscopic scattering interactions, as well as in increasing the sophistication at which the BTE can be solved. There are several active efforts on software implementations of these simulation techniques, and the challenge is to achieve the best possible accuracy for the least computational cost. Various codes for solving the BTE are currently available, including EPW [2], BoltzWann [3], PERTURBO [4], and BoltzTrap [5] for electronic properties, as well as phonopy/phono3py [6, 7], ShengBTE [8], ALAMODE [9], kALDo [10] and GPU_PBTE [11] for the calculation of phonon transport. The physics of heat and electricity conduction are intrinsically linked one to the other, and, as we will discuss in further detail, the electron and phonon BTE also share several common features. Despite the similarities, no single currently developed software package is capable of describing both kinds of transport processes. Our vision behind the development of this new software was to take advantage of the parallels between physical descriptions of thermal and electrical conduction to provide a single framework to fully characterize materials transport properties. In addition, we aimed not only to provide a tool for the prediction of materials transport properties; instead, we developed a package containing the abstraction and generic data structures needed to calculate conduction. In doing so, we created a flexible computational framework designed to easily accommodate extensions and improvements, as ongoing work in this field continues to reveal new and exciting developments. Lastly, we capitalized on the rapid evolution of computational hardware, in particular with respect to the rise of GPU accelerators and the increasingly heterogeneous architecture of modern supercomputing facilities. As a result, we aspired to develop a new software which could run efficiently on any available computing environment. This work presents the new open-source software package Phoebe – a framework of PHOnon and Electron Boltzmann Equation solvers - for the prediction of electron and phonon transport properties from first principles. Phoebe implements the construction and solution of the Boltzmann transport equation for crystals using a scattering matrix formalism that takes into account the electron-phonon, phonon-phonon, boundary, and phonon-isotope scattering contributions to transport properties. Phoebe implements several unique features, including Wigner transport formalism, the electron-phonon averaged approximation, and hydrodynamic transport properties. Additionally, the simultaneous availability of both phonon and electron effects enables the calculation of properties such as the thermal conductivity of metals. This code is designed to take advantage of contemporary supercomputing facilities to tackle the intensive computational workload of ab-initio transport calculations using multiple levels of parallelization. The package is written in object-oriented `C++` and utilizes a hybrid MPI-OpenMP parallelization scheme, together with GPU acceleration, distributed memory data-structures, and parallel HDF5 input/output operations. We discuss the capability of Phoebe to scale on supercomputing hardware and to reduce the computational cost of the calculation with respect to other codes, streamlining the calculation of transport properties. With its flexible, object-oriented structure, Phoebe is designed for easy implementation of future features, such as additional quasiparticle interactions, and the possibility of interfacing with a wide range of ab-initio software for the calculation of interaction matrix elements. We showcase Phoebe’s capabilities with the calculations of the transport properties of GaN, a III-V semiconductor used for high-power electronics. After validating the results against experimental measurements, we argue that Phoebe is able to accurately and efficiently predict a wide range of material transport properties such as the electrical and thermal conductivity and thermoelectric performance in large and complex crystal structures. II. FUNCTIONALITIES Phoebe provides the tools necessary for a complete first-principles study of electrical, thermal, and thermoelectric transport properties of crystalline materials in a single package. The code takes the output of ab-initio calculations of carrier spectra and coupling matrix elements and processes them in order to predict transport properties. Phoebe provides the capability to compute a wide range of properties, such as: - Electron and phonon band-structure, density of states, and velocity operator; - Linewidths and lifetimes of electrons, limited by electron-phonon interaction and boundary scattering; - Linewidths and lifetimes of phonons, limited by three-phonon, isotope and boundary scattering; - Lattice thermal conductivity; - Electrical conductivity, mobility, electronic thermal conductivity and Seebeck coefficient; - Phonon and electron viscosity; with more properties planned for future releases. Moreover, we provide different approaches for modeling these properties at various levels of accuracy and/or computational cost. For example, the electron-phonon coupling can be evaluated either with the Wannier-interpolation technique, or the electron-phonon averaged approximation; transport properties can be evaluated using the BTE or the Wigner distribution function; and the BTE can be solved with various solvers, from relaxation time models to exact solutions. Phoebe is made available freely on GitHub [12] under the MIT open-source license, and is written using object-oriented `C++`, with the intention of allowing future extensions and implementation of new features with minimal effort. We rely on a number of open-source libraries, including Eigen [13] for small linear algebra problems and ScaLAPACK [14] for massively parallel linear algebra problems, as well as Spglib [15] for analyzing symmetries, PugiXML [16] for reading XML files, and HighFive [17] to handle I/O based using HDF5 [18]. Additionally, Phoebe is designed to efficiently scale on contemporary HPC infrastructure. Parallelization is achieved with a hybrid MPI and OpenMP architecture. The most computationally expensive parts of the code are further accelerated with Kokkos [19], which allows for the optional use of GPU accelerators. Finally, we take advantage of several GitHub functionalities, such as GitHub pages to create a static website for user accessing the code and GitHub Actions to perform a continuous integration. The documentation built with Doxygen [20] and Sphinx [21] is hosted online on Read The Docs [22]. III. MICROSCOPIC PROPERTIES In this section, we report a brief summary of the main approaches used and implemented in Phoebe, that are needed to obtain a description of microscopic electron and phonon properties, referring to other works for detailed explanations. A. Phonon Properties In crystals, the motion of atoms is typically an oscillation around their equilibrium positions, and is thus described with the atomic displacements _u_ ( _sα_ _R_ ), where _R_ is the Bravais lattice vector labeling a unit cell, _s_ is an index over the unit cell basis of atoms, and _α_ is the Cartesian direction of the atomic displacement. To lowest orders in perturbation theory, the lattice potential energy near the minimum is described with a Taylor expansion [23], where the first two important terms are the second derivative _V_ <sup>(2)</sup> of the crystal energy with respect to atomic displacements _<u>∂</u>_ <sup>2</sup> _<u>E</u>_ _V_ <sup>(2)</sup> ( _sα_ _R_, _s_ <sup>_′_</sup> _β_ _R_ <sup>_′_</sup> ) = _∂u_ ( _sα_ _R_ ) _∂u_ ( _s_ <sup>_′_</sup> _β_ _R_ <sup>_′_</sup> ) <sup>,</sup> (1) and the third derivative _V_ <sup>(3)</sup> _<u>∂</u>_ <sup>3</sup> _<u>E</u>_ _V_ <sup>(3)</sup> ( _sα_ _R_, _s_ <sup>_′_</sup> _β_ _R_ <sup>_′_</sup>, _s_ <sup>_′′_</sup> _γ_ _R_ <sup>_′′_</sup> ) = _∂u_ ( _sα_ _R_ ) _∂u_ ( _s_ <sup>_′_</sup> _β_ _R_ <sup>_′_</sup> ) _∂u_ ( _s_ <sup>_′′_</sup> _γ_ _R_ <sup>_′′_</sup> ) <sup>,</sup> (2) while higher order derivatives are here neglected. These quantities can be computed using existing ab-initio codes. In particular, Phoebe interfaces with phonopy/phono3py [6] and Quantum ESPRESSO (QE) [24] for the calculation of the second derivative and with phono3py [7] and ShengBTE [25] for the calculation of the third derivative of the energy. These two derivatives allow the characterization of phonon properties and of their scattering mechanisms by means of a Fourier transform. For example, the Fourier transform of the second derivative provides the dynamical matrix _D_ defined as [26] _V_ <sup>(2)</sup> ( _sα_ 0 _|s_ <sup>_′_</sup> _α_ <sup>_′_</sup> _R_ ) _e_ <sup>_i_</sup> <sup>_q_</sup> <sup>_·_</sup> <sup>_R_</sup>, (3) _D_ ( _sα|s_ <sup>_′_</sup> _α_ <sup>_′_</sup> )( _q_ ) = _R_ where _q_ is an arbitrary wavevector, and one Bravais lattice vector component of the second derivative _V_ <sup>(2)</sup> has been set to a reference unit cell 0 without loss of generality thanks to the translational periodicity of the crystal. The phonon harmonic properties are then found by diagonalizing the dynamical matrix _D_ ( _sα|s_ <sup>_′_</sup> _α_ <sup>_′_</sup> )( _q_ ) _zs′α′ν_ ( _q_ ) = (¯ _hων_ ( _q_ )) <sup>2</sup> _zsαν_ ( _q_ ), (4) where _ν_ is an eigenvalue index (i.e. the phonon branch), ¯ _hω_ _q_ _ν_ the phonon energy and _z_ _q_ <sup>_sα_</sup> _ν_ <sup>the</sup> <sup>phonon</sup> <sup>eigenvector.</sup> Polar corrections to the dynamical matrix are taken into account in Phoebe as explained in Ref. [26]. The Fourier transform of the third derivative _V_ <sup>(3)</sup> instead describes the coupling strength of a 3-phonon scattering event, and is computed as [27, 28] �3 _/_ 2 _RR_ <sup>_′_</sup> _αβγ_ <u>1</u> _V_ <sup>(3)</sup> ( _q_ _ν_, _q_ <sup>_′_</sup> _ν_ <sup>_′_</sup>, _q_ <sup>_′′_</sup> _ν_ <sup>_′′_</sup> ) = _N_ 0 <sup>3</sup> - <u>2</u> ¯ _h_ _ss_ <sup>_′_</sup> _s_ <sup>_′′_</sup> - _ω_ _q_ _<u>mνωsm</u>_ _q_ _′νs′′mω_ _q_ _<u>s′′′′ν′′</u>_ <sup>_z_</sup> _q_ <sup>_sα_</sup> _ν_ <sup>_∗_</sup> _q_ <sup>_sα_</sup> _ν_ <sup>_∗_</sup> <sup>_z_</sup> _q_ <sup>_s′′β_</sup> _ν_ <sup>_′∗_</sup> _q_ <sup>_s′′β_</sup> _ν_ <sup>_′∗ z_</sup> _q_ <sup>_s′′′′γ_</sup> _ν_ <sup>_∗′′_</sup> _q_ <sup>_s′′′′γ_</sup> _ν_ <sup>_∗′′_</sup> <sup>_e−i_</sup> <sup>(</sup> <sup>_q_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>+</sup> <sup>_q_</sup> <sup>_′·_</sup> <sup>_R_</sup> <sup>_′_</sup> <sup>)</sup> <sup>_V_</sup> <sup>(3)(</sup> <sup>_sα_</sup> <sup>_R_</sup> <sup>,</sup> <sup>_s′β_</sup> <sup>_R_</sup> <sup>_′_</sup> <sup>,</sup> <sup>_s′′γ_</sup> <sup>0</sup> <sup>),</sup> (5) where again one Bravais lattice vector component can be set to a reference unit cell 0 . The equations 3 and 5 allow us to compute phonon properties (such as phonon energies or scattering coupling strength) at arbitrary wavevectors, starting from the derivatives computed in real space that can be obtained from ab-initio codes. This interpolation procedure is a major computational bottleneck due to the large number of tensor indices and the fact that phonon properties need to be computed for all wavevectors used to sample the Brillouin zone (BZ). As a result, it is critical to efficiently implement this interpolation procedure, in particular for the 3-phonon coupling strength, as will be discussed in Section V E. B. Electron Properties In order to compute the electronic transport properties, it is necessary to characterize electrons and the electronphonon interaction. Phoebe relies on an external ab-initio code to compute the electronic energies _ϵ_ _k_ _b_ and wavefunctions _|ψ_ _k_ _b⟩_, where _k_, the electron wavevector, and _b_, the band index, are Bloch quantum numbers (spin is omitted for simplicity), which correspond to eigenvalues and eigenstates of the electronic Hamiltonian _H_ <sup>_B_</sup> ( _k_ ) _|ψ_ _k_ _b⟩_ = _ϵ_ _k_ _b |ψ_ _k_ _b⟩_ . (6) Once the electronic wavefunction is known, it is possible to compute other properties such as the interaction of electrons with the lattice. The electron-phonon coupling _g_ is defined as [29] - <u>1</u> 2 _mω_ _q_ _ν_ �1 _/_ 2 _⟨ψ_ _k_ + _q_, _b′| ∂_ _q_ _νV_ _|ψ_ _k_ _b⟩_ = �1 _/_ 2 _gb_ <sup>0</sup> <sup>_′_</sup> _bν_ <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_q_</sup> <sup>),</sup> (7) _gb′bν_ ( _k_, _q_ ) = - <u>1</u> 2 _mω_ _q_ _ν_ and provides the coupling strength of the interaction between two electrons and a phonon, and _∂_ _q_ _νV_ is the potential originating in response to the perturbation of the lattice with the ionic displacements of a phonon mode _q_ _ν_ . We define _g_ <sup>0</sup> here as a quantity smoother to interpolate than _g_, as will be discussed below. In this initial version, Phoebe interfaces with QE [24] in order to obtain values of the electronic energies and the electron-phonon coupling. In principle, ab-initio codes can directly compute electronic properties at any wavevector _k_ . The calculation of transport properties using momentum-space integrals typically requires very fine sampling of _k_ throughout the Brillouin zone, making a direct first-principles calculation of every state unfeasible in most cases. To circumvent this issue, transport calculations rely on an interpolation scheme, in which QE computes electronic properties on a coarse grid of wavevectors, _{_ _k_ _co}_, and Phoebe interpolates these properties to an arbitrary fine mesh of wavevectors _{_ _k_ _fi}_ . We implemented the Wannier interpolation technique, interfacing Phoebe with Wannier90 [30] for the construction of maximally localized Wannier functions (MLWF) [31, 32]. The Wannier function _|_ _R_ _m⟩_ computed by Wannier90 is defined as _|_ _R_ _m⟩_ = - _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_co·_</sup> <sup>_R_</sup> _U_ _k_ _co_, _mb |ψ_ _k_ _cob⟩_, (8) _b_ _k_ _co_ where _m_ is a Wannier function index, and _U_ is a rotation matrix. To briefly explain the MLWF procedure, we first recall that the wavefunction _|ψ_ _k_ _b⟩_ is not unique, as it has a gauge degree of freedom: the wavefunction can be multiplied by an arbitrary factor _e_ <sup>_iφ_</sup> <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_b_</sup> <sup>)</sup> . In practice, the phase _φ_ ( _k_, _b_ ) is a random result of the numerical diagonalization of a Hamiltonian matrix, and depends unpredictably on the linear algebra algorithm implementation. As a result of this phase arbitrariness, the Wannier function are not uniquely defined. The MLWF procedure aims at reducing this arbitrariness, by finding for a rotation matrix _U_ such that the spread of the Wannier function _|_ _R_ _m⟩_ is minimized. The interpolation of electronic energies proceeds as follows [32]: we first compute the Hamiltonian matrix in the basis of Wannier functions _⟨_ 0 _n|H|_ _R_ _m⟩_ as _⟨_ 0 _n|H|_ _R_ _m⟩_ = <sup><u>1</u></sup> _Nk_ _k_ _co_, _bb_ <sup>_′_</sup> _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_co·_</sup> <sup>_R_</sup> _U_ _k_ _co_, _nb_ [ _δbb_ <sup>_′_</sup> _ϵ_ _k_ _cob_ ] _U_ _k_ <sup>_†_</sup> _co_, _mb_ <sup>_′_</sup> <sup>,</sup> (9) _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_co·_</sup> <sup>_R_</sup> _U_ _k_ _co_, _nb_ [ _δbb_ <sup>_′_</sup> _ϵ_ _k_ _cob_ ] _U_ _k_ <sup>_†_</sup> where _Nk_ is the total number of wavevectors in the coarse grid _{_ _k_ _co}_ . From the Hamiltonian in the Wannier representation, we interpolate electronic energies at any arbitrary wavevector _k_ by computing a Fourier back-transform _H_ _k_ <sup>_W_</sup>, _nm_ <sup>=</sup> _R_ _e_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_R_</sup> _⟨_ 0 _n|H|_ _R_ _m⟩_, (10) followed by a diagonalization of the resulting matrix _k_ <sup>_B_</sup>, _bb_ <sup>_′_</sup> <sup>= [</sup> <sup>_U_</sup> _k_ <sup>_†_</sup> _k_ <sup>_W_</sup> <sup>_U_</sup> <sup>_k_</sup> <sup>]</sup> <sup>_bb′_</sup> <sup>=</sup> <sup>_δbb′ϵ_</sup> <sup>_k_</sup> <sup>_b_</sup> <sup>,</sup> (11) _H_ _k_ <sup>_B_</sup>, _k_ <sup>_†H_</sup> _k_ <sup>_W_</sup> which provides an interpolation of the electronic energies _ϵ_ _k_ _b_ and rotation matrix _U_ _k_ at any desired wavevector. The electron-phonon coupling can be interpolated in a conceptually similar way to the electronic energies. Following the approach of Ref. [33], we first note that the matrix _g_ <sup>0</sup> is smoother than _g_ (as defined in Eq. 7) in the reciprocal space, since it removes a dependence on the phonon dispersion relation, and _g_ <sup>0</sup> is thus more suitable for an interpolation algorithm. The matrix _g_ <sup>0</sup> ( _k_ _co_, _q_ _co_ ) (with band indices omitted for simplicity) is computed by QE on a coarse grid of wavevectors and is then transformed by Phoebe to the Wannier representation as <u>1</u> _g_ <sup>0</sup> ( _R_ _e_, _R_ _p_ ) = _NqNk_ _k_ _co_ _q_ _co_ _q_ <sup>_−_</sup> _co_ <sup>1</sup> <sup>,</sup> (12) _e_ <sup>_−i_</sup> <sup>_k_</sup> <sup>_co·_</sup> <sup>_R_</sup> <sup>_e−i_</sup> <sup>_q_</sup> <sup>_co·_</sup> <sup>_R_</sup> <sup>_p_</sup> _U_ _k_ <sup>_†_</sup> _k_ <sup>_†_</sup> _co_ + _q_ <sup>_g_</sup> <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_q_</sup> <sup>)</sup> <sup>_U_</sup> <sup>_k_</sup> <sup>_co_</sup> <sup>_z_</sup> _q_ <sup>_−_</sup> _co_ <sup>1</sup> where _Nq_ is the number of phonon wavevectors in the coarse sampling, _z_ is the phonon eigenvector introduced in Eq. 4, and _R_ _e_ ( _R_ _p_ ) is the set of Bravais lattice vectors associated to the electron (phonon) Fourier transform of the set _{_ _k_ _co}_ ( _{_ _q_ _co}_ ). Once this transformation is performed, the electron-phonon matrix is finally interpolated to arbitrary wavevectors _k_ and _q_ as _g_ <sup>0</sup> ( _k_, _q_ ) = <sup><u>1</u></sup> _Ne_ _R_ _e_ _R_ _p_ _e_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>_e_</sup> <sup>+</sup> <sup>_i_</sup> <sup>_q_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>_p_</sup> _U_ _k_ + _q_ _g_ <sup>0</sup> ( _R_ _e_, _R_ _p_ ) _U_ _k_ <sup>_†z_</sup> <sup>_q_</sup> <sup>,</sup> (13) _e_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>_e_</sup> <sup>+</sup> <sup>_i_</sup> <sup>_q_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>_p_</sup> _U_ _k_ + _q_ _g_ <sup>0</sup> ( _R_ _e_, _R_ _p_ ) _U_ _k_ <sup>_†_</sup> where the _U_ and _z_ matrices at the interpolating wavevectors can be found by constructing the dynamical matrix at the desired _q_ wavevector and by interpolating the electronic energy at wavevector _k_ . As a result of this interpolation procedure, one can accurately sample the the electron-phonon coupling over the BZ and compute transport properties. Similar to the interpolation of the three-phonon coupling, the interpolation of the electron-phonon coupling is a computationally expensive effort due to the large number of indices and the sheer number of interpolating wavevectors often needed to converge transport integrals. The implementation of the coupling interpolation for both electron-phonon and three-phonon coupling will be discussed together in detail in Section V E, as Eq. 5 and Eq. 13 are similar from a mathematical point of view. Finally, polar corrections to the electron-phonon coupling are implemented in Phoebe following the procedure outlined in Ref. [34]. The coupling is decomposed into short- and long-range contributions, _bb_ <sup>_S_</sup> <sup>_′_</sup> _ν_ <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_q_</sup> <sup>) +</sup> <sup>_g_</sup> _bb_ <sup>_L_</sup> _gbb′ν_ ( _k_, _q_ ) = _gbb_ <sup>_S_</sup> _bb_ <sup>_L_</sup> <sup>_′_</sup> _ν_ <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_q_</sup> <sup>),</sup> (14) where the long-range contribution is given by ( _q_ + _G_ ) _·_ _Z_ <sup>_∗_</sup> _<u>s</u>_ _s_ �1 _/_ 2 _G_ _̸_ = _q_ <sup>_∗_</sup> _<u>s</u>_ <sup>_·_</sup> <sup>_z_</sup> _<u>q</u>_ <sup>_s_</sup> _b_ <sup>_L′_</sup> _bν_ <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_q_</sup> <sup>) =</sup> <sup>_i_</sup> <sup><u>4</u></sup> <sup>_<u>π</u>_</sup> , (15) ��� _ei_ ( _q_ + _G_ ) _·_ _r_ ��� _ψ_ _k_ + _q_, _b_ _ψ_ _k_ + _q_, _b′_ - <u>¯</u> _<u>h</u>_ 2 _Nqmsω_ _q_ _ν_ _<u>s</u>_ <sup>_·_</sup> <sup>_z_</sup> _<u>q</u>_ <sup>_s_</sup> _<u>ν</u>_ ( _q_ + _G_ ) _·_ _ϵ_ <sup>_∞_</sup> _·_ ( _q_ + _G_ ) _gb_ <sup>_L′_</sup> _V_ _<u>e</u>_ <sup>2</sup> 4 _πϵ_ 0 and the short-range contribution is calculated on the coarse grid by subtracting the long-range term from the total electron-phonon coupling calculated by the ab-initio code. Here, _Z_ <sup>_∗_</sup> _s_ <sup>is</sup> <sup>the</sup> <sup>Born</sup> <sup>effective</sup> <sup>charge</sup> <sup>tensor</sup> <sup>of</sup> <sup>atom</sup> <sup>_s_</sup> <sup>,</sup> <sup>and</sup> _ϵ_ 0 and _ϵ_ <sup>_∞_</sup> are the low- and high-frequency permittivities. C. Velocity For charge carriers, we compute the matrix elements of the velocity operator _v_ as the derivative with respect to the wavevector of the non-interacting Hamiltonian [35] <u>1</u> _U_ _k_, _nb′_ _≈_ 2 _δα_ _mn_ _k_ <sup>_W_</sup> _−δα_, _mn_ _∂H_ _<u>k</u>_ <sup>_W_</sup> <u>,</u> _<u>mn</u>_ _∂kα_ - _H_ _k_ <sup>_W_</sup> _k_ <sup>_W_</sup> + _δα_, _mn_ <sup>_−_</sup> <sup>_H_</sup> _k_ <sup>_W_</sup> _U_ _k_ <sup>_†_</sup>, _mb_ _vα_ _k_, _bb′_ = _mn_ _U_ _k_ <sup>_†_</sup>, _mb_ _U_ _k_ <sup>_†_</sup> _U_ _k_, _nb′_, (16) where _H_ <sup>_W_</sup> is the Hamiltonian matrix in the Bloch representation computed at _k_ with the Wannier interpolation technique described above, and _δα_ is a small displacement vector along Cartesian direction _α_ . If the eigenvalue _ϵ_ _k_ _b_ is non-degenerate, the diagonal matrix element _vα_ _k_, _bb_ represents the electronic group velocity. However if _ϵ_ _k_ _b_ is a degenerate eigenvalue, we cannot readily identify the velocity matrix element _vα_ _k_, _bb_ with the group velocity: in this case, we select the degenerate subspace of the matrix _vα_ _k_ and diagonalize it. After this subspace diagonalization, the new diagonal matrix elements represent the group velocity of the degenerate state. The definition of the phonon velocity is similar to that of electrons, allowing us to use the same code for both velocity calculations. Simply, the matrix _H_ is replaced with the square root of the dynamical matrix - _D_ _q_ and the rotation matrix _U_ is replaced with the phonon eigenvector _z_ [27]. IV. TRANSPORT METHODS Moving on to the transport properties, we show in this section how the microscopic properties described above can be used to evaluate macroscopic transport coefficients. A. Phonon Boltzmann Transport Equation Given the microscopic quantities discussed in the previous sections, we discuss now how to obtain the lattice thermal conductivity. We describe lattice thermal transport in the framework of the phonon Boltzmann transport equation (BTE) [23, 36]. This semiclassical model describes the motion of a phonon (wavepacket) through the crystal. A phonon state ( _q_, _ν_ ) at thermal equilibrium is populated with _n_ ¯ _q_ _ν_ phonon quanta, where _n_ ¯ _q_ _ν_ = 1 _/_ ( _e_ <sup>_hω_</sup> <sup>¯</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>_/kB_</sup> <sup>_T_</sup> _−_ 1) is the Bose–Einstein distribution. The application of a thermal gradient _∇T_ to the crystal forces the system out-of-equilibrium, so that each phonon state is then populated with an out-of-equilibrium population _n_ _q_ _ν_ . The phonon BTE provides a way to find such out-of-equilibrium population and consists of a balance between two terms: _<u>∂n</u>_ <u>¯</u> _<u>q</u>_ _<u>ν</u>_ <u>1</u> _∂T_ <sup>_vα_</sup> <sup>_q_</sup> <sup>_ν∇αT_</sup> <sup>=</sup> <sup>_−_</sup> _V Nq_ _q_ <sup>_′_</sup> _ν_ <sup>_′_</sup> Ω _q_ _ν_, _q_ _′ν′δnα_ _q_ _′ν′_ . (17) The left-hand side is the diffusion operator, and describes the phonon drift in presence of a thermal gradient _∇T_, while the right-hand side describes how scattering changes the population number of a phonon state. Here, _V_ is the crystal unit cell volume, Ω _q_ _ν_, _q_ _′ν′_ is the scattering matrix and _δn_ _q_ _ν_ = _n_ _q_ _ν_ _−_ _n_ ¯ _q_ _ν_ is the deviation from equilibrium population. For computational convenience, we also work with a rescaled scattering matrix _A_ defined as _A_ _q_ _ν_, _q_ _′ν′_ = Ω _q_ _ν_, _q_ _′ν′_ ¯ _n_ _q_ _′ν′_ ( _n_ ¯ _q_ _′ν′_ + 1). The phonon scattering matrix is built taking into account the three-phonon interaction, phonon-isotope, phonon-boundary and phonon-electron scattering [27] as _q_ <sup>_′′_</sup> _ν_ <sup>_′′_</sup> _P_ _q_ <sup>isot</sup> _ν_, _q_ _q_ <sup>isot</sup> _ν_, _q_ <sup>_′′_</sup> _ν_ <sup>_′′_</sup> <sup>+</sup> <sup>_P_</sup> <sup>be</sup> _q_ _ν_ _P_ _<u>q</u>_ <sup>_ν′′′_</sup> _<u>ν</u>_ <sup>_′′′_</sup> <u>,</u> _<u>q</u>_ <sup>_′′_</sup> _<u>ν</u>_ <sup>_′′_</sup> 2 +   _δν_, _ν′δ_ _q_, _q_ _′_ (18) <sup>be</sup> _q_ _ν_ <sup>+</sup> <sup>_P_</sup> _q_ <sup>el</sup> _ν_ <sup>_−_</sup> <sup>ph</sup> _q_ _ν_ _A_ _q_ _ν_, _q_ _′ν′_ =   _q_ <sup>_′′_</sup> _q_ <sup>_′′′_</sup> _ν_ <sup>_′′_</sup> _ν_ <sup>_′′′_</sup> - _P_ _q_ <sup>_q_</sup> _ν_ <sup>_′′_</sup>, <sup>_ν_</sup> _q_ <sup>_′′′′′_</sup> _ν_ <sup>_′′′_</sup> <sup>+</sup> <sup>_q_</sup> _q_ _ν_ <sup>_′′_</sup>, <sup>_ν_</sup> _q_ <sup>_′′′_</sup> _ν_ <sup>_′_</sup> <sup>+</sup> <sup>_P_</sup> <sup>_q_</sup> _q_ <sup>_′ν_</sup> _ν_ _q_ <sup>_′_</sup> _ν_ <sup>_′_</sup>, _q_ <sup>_′′_</sup> _ν_ <sup>_′′_</sup> - _P_ _q_ <sup>_q_</sup> _ν_ <sup>_′ν_</sup>, _q_ <sup>_′_</sup> _q_ <sup>_q_</sup> _ν_ <sup>_′ν_</sup>, _q_ <sup>_′_</sup> <sup>_′′_</sup> _ν_ <sup>_′′_</sup> <sup>_−_</sup> <sup>_P_</sup> <sup>_q_</sup> _q_ _ν_ <sup>_′′_</sup>, <sup>_ν_</sup> _q_ <sup>_′′′_</sup> _−_ _q_ <sup>_′′_</sup> _ν_ <sup>_′′_</sup> - + _P_ _q_ <sup>isot</sup> _ν_, _q_ <sup>_′_</sup> _ν_ <sup>_′_</sup> <sup>,</sup> where we introduced the three-phonon scattering rates for coalescence events as _P_ _q_ <sup>_q_</sup> _ν_ <sup>_′′_</sup>, <sup>_ν_</sup> _q_ <sup>_′′′_</sup> _ν_ <sup>_′_</sup> <sup>=</sup> <u>2</u> _<u>π</u>_ _Nq_ ¯ _h_ <sup>2</sup> _G_ 2 _n_ ¯ _q_ _jn_ ¯ _q_ _′ν′_ (¯ _n_ _q_ _′′ν′′_ + 1) _δ_ _q_ + _q_ _′−_ _q_ _′′_, _G_ _δ_ (¯ _hω_ _q_ _ν_ + ¯ _hω_ _q_ _′ν′_ _−_ ¯ _hω_ _q_ _′′ν′′_ ), (19) ��� _V_ (3)( _q_ _j_, _q_ _′ν′_, _−_ _q_ _′′ν′′_ )��� while the scattering rate for phonon decay is _P_ _q_ <sup>_q_</sup> _ν_ <sup>_′ν′_</sup> <sup>,</sup> <sup>_q_</sup> <sup>_′′ν′′_</sup> = _N_ <u>2</u> _qπ_ ¯ _h_ <sup>2</sup> 2 - _n_ ¯ _q_ _ν_ (¯ _n_ _q_ _′ν′_ +1)(¯ _n_ _q_ _′′ν′′_ +1) _δ_ _q_ _−_ _q_ _′−_ _q_ _′′_, _G_ _δ_ (¯ _hω_ _q_ _ν_ _−_ ¯ _hω_ _q_ _′ν′ −_ ¯ _hω_ _q_ _′′ν′′_ ), (20) ��� _V_ (3)( _q_ _ν_, _−_ _q_ _′ν′_, _−_ _q_ _′′ν′′_ )��� _G_ where _G_ is a reciprocal lattice vector, _Nq_ is the number of phonon wavevectors for the BZ integration, and _V_ <sup>(3)</sup> ( _q_ _ν_, _q_ <sup>_′_</sup> _ν_ <sup>_′_</sup>, _q_ <sup>_′′_</sup> _ν_ <sup>_′′_</sup> ) is the three-phonon coupling strength defined in Eq. (5). The phonon-electron interaction contributes to the scattering matrix with a term on the diagonal part [37] _q_ <sup>el</sup> _ν_ <sup>_−_</sup> <sup>ph</sup> = _−_ <sup><u>2</u></sup> <sup>_<u>π</u>_</sup> _N_ _k_ _P_ _q_ <sup>el</sup> _ν_ <sup>_−_</sup> <sup>ph</sup> <sup><u>2</u></sup> <sup>_<u>π</u>_</sup> _N_ _k_ ¯ _h_ <sup>_n_</sup> <sup>¯</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>(¯</sup> <sup>_n_</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>+ 1)</sup> - _|gbb_ <sup>_′_</sup> _ν_ ( _k_, _q_ ) _|_ <sup>2</sup> ( _f_ _k_ _b −_ _f_ _k_ + _q_ _b′_ ) _δ_ ( _ε_ _k_ _b −_ _ε_ _k_ + _q_ _b′_ _−_ _ω_ _q_ _ν_ ), (21) _k_ _bb_ <sup>_′_</sup> with _f_ _k_ _b −_ _f_ _k_ + _q_ _b′_ _≈_ <sup>_<u>∂f</u>_</sup> _∂ε_ _k_ <sup>_<u>k</u>_</sup> _b_ <sup>_<u>b</u>_</sup> <sup>¯</sup> <sup>_hω_</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>for</sup> <sup>numerical</sup> <sup>stability.</sup> <sup>Additionally,</sup> <sup>the</sup> <sup>scattering</sup> <sup>rate</sup> <sup>for</sup> <sup>phonon-isotope</sup> <sup>scattering</sup> <sup>is</sup> [38] _α_ 2 �� _s_ _g_ <sup>_isot_</sup> ����� _<u>π</u>_ _P_ _q_ <sup>isot</sup> _ν_, _q_ <sup>_′_</sup> _ν_ <sup>_′_</sup> <sup>=</sup> _ω_ _q_ _νω_ _q_ _′ν′_ 2 _Nq_ - _n_ ¯ _q_ _νn_ ¯ _q_ _′ν′_ + <sup>_<u>n</u>_</sup> <sup><u>¯</u></sup> <sup>_<u>q</u>_</sup> <sup>_<u>ν</u>_</sup> <sup><u>+ ¯</u></sup> <sup>_<u>n</u>_</sup> <sup>_<u>q</u>_</sup> <sup>_′ν′_</sup> 2 _q_ <sup>_sα′_</sup> _ν_ <sup>_′_</sup> _z_ _q_ <sup>_sα_</sup> _ν_ <sup>_∗_</sup> _q_ <sup>_sα_</sup> _ν_ <sup>_∗_</sup> <sup>_· z_</sup> _q_ <sup>_sα′_</sup> _ν_ ����� _δ_ ( _ω_ _q_ _ν_ _−_ _ω_ _q_ _′ν′_ ), (22) where the coupling strength _gs_ <sup>_isot_</sup> depends on the variance of masses as <u>1</u> _gs_ <sup>_isot_</sup> = _⟨ms⟩_ <sup>2</sup> _i_ _fis_ ( _mis −⟨ms⟩_ ) <sup>2</sup>, (23) where _mis_ is the atomic mass of atom of species _s_ and isotope _i_, _fis_ is the abundance of the isotope (which by default is set to natural abundances [39]) and _⟨ms⟩_ is the average atomic mass. Finally, the boundary scattering rate is described with the term _q_ <sup>be</sup> _ν_ <sup>=</sup> <sup>_<u>v</u>_</sup> <sup>_<u>q</u>_</sup> <sup>_<u>ν</u>_</sup> _L_ _P_ _q_ <sup>be</sup> _ν_ <sup>_<u>v</u>_</sup> <sup>_<u>q</u>_</sup> <sup>_<u>ν</u>_</sup> (24) _L_ <sup>_n_</sup> <sup>¯</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>(¯</sup> <sup>_n_</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>+ 1),</sup> where _L_ is the user-specified macroscopic crystal size. Using the first-principles phonon properties discussed in Section III A it is possible to construct the phonon BTE and in particular the scattering matrix. In Section IV C, we will discuss how to solve the BTE to obtain the out-of-equilibrium population _n_ _q_ _ν_ . Assuming that _n_ _q_ _ν_ is found, the thermal conductivity tensor _καβ_ is computed as _β_ <u>1</u> _καβ_ = _NqV_ where _vα_ _q_ _ν_ is the phonon group velocity. _q_ _ν_ - _<u>δn</u>_ _<u>q</u>_ _<u>ν</u>_ ¯ _hω_ _q_ _vα_ _q_ _ν_ _∇T_ , (25) B. Electron Boltzmann Transport Equation The semiclassical description of electron transport shares several similarities with the phonon transport theory. In the phonon case, we solved for out-of-equilibrium phonon populations. Now, for the case of electron transport, we deal with the problem of finding the out-of-equilibrium occupation number of a charge carrier. At equilibrium, an electronic state ( _k_, _b_ ) is occupied according to the Fermi–Dirac distribution _f_ _k_ _b_ = 1 _/_ ( _e_ <sup>(</sup> <sup>_ϵ_</sup> <sup>_k_</sup> <sup>_b−µ_</sup> <sup>)</sup> <sup>_/kB_</sup> <sup>_T_</sup> + 1), where _µ_ is the chemical potential and _ϵ_ _k_ _b_ is the electronic energy. When we apply a thermal gradient to a material, we can expect to induce the diffusion of carriers just as in the phonon case, resulting in an out-of-equilibrium population _f_ _k_ _b_ . However, each carrier also possesses a charge _e_, and therefore can diffuse also when an external electric field _E_ is applied to the material. As we are only concerned with the linear response to the perturbation induced by the thermal gradient or the electric field, the electronic BTE consists of two separate problems for the two different perturbations _E_ and _∇T_ . The BTE describing the response to an electric field in direction _α_ is _<u>∂f</u>_ <sup>¯</sup> _<u>k</u>_ _<u>b</u>_ <u>1</u> _∂ϵ_ <sup>_vα_</sup> <sup>_k_</sup> <sup>_beEα_</sup> <sup>=</sup> <sup>_−_</sup> _NkV_ - Ω _k_ _b_, _k_ <sup>_′_</sup> _b′δfα_ _k_ <sup>_′_</sup> _b′_, (26) _k_ <sup>_′_</sup> _b_ <sup>_′_</sup> where _δf_ _k_ _b_ = _f_ _k_ _b_ _−f_ <sup>¯</sup> _k_ _b_ is the deviation from the equilibrium population, _vα_ _k_ _b_ is the electronic group velocity in direction _α_, and Ω is the electronic scattering matrix. The BTE describing the response to a thermal gradient perturbation closely resembles the phonon case and is _<u>∂f</u>_ <sup>¯</sup> _<u>k</u>_ _<u>b</u>_ <u>1</u> _∂T_ <sup>_vα_</sup> <sup>_k_</sup> <sup>_b∇αT_</sup> <sup>=</sup> <sup>_−_</sup> _NkV_ - Ω _k_ _b_, _k_ <sup>_′_</sup> _b′δfα_ _k_ <sup>_′_</sup> _b′_ . (27) _k_ <sup>_′_</sup> _b_ <sup>_′_</sup> When taking the electron-phonon scattering into account, the electron scattering matrix Ω can be computed as [40] <u>1</u> Ω _k_ _b_, _k_ <sup>_′_</sup> _b′_ = _τ_ _k_ _b_ _δ_ _k_ _b_, _k_ <sup>_′_</sup> _b′_ + (1 _−_ _δ_ _k_ _b_, _k_ <sup>_′_</sup> _b′_ ) <sup><u>2</u></sup> <sup>_<u>π</u>_</sup> _NkV_ _δ_ _k_ _b_, _k_ <sup>_′_</sup> _b′_ + (1 _−_ _δ_ _k_ _b_, _k_ <sup>_′_</sup> _b′_ ) <sup><u>2</u></sup> <sup>_<u>π</u>_</sup> _q_ _ν_ (1 _−_ _f_ <sup>¯</sup> _k_ <sup>_′_</sup> _b′_ + ¯ _n_ _q_ _ν_ ) _δ_ ( _ϵ_ _k_ _b −_ ¯ _hω_ _q_ _ν_ _−_ _ϵ_ _k_ <sup>_′_</sup> _b′_ ) (28) _|gbb_ <sup>_′_</sup> _ν_ ( _k_, _k_ <sup>_′_</sup> ) _|_ <sup>2�</sup> where the lifetime _τ_ _k_ _b_ is <u>1</u> _τ_ _k_ _b_ <u>2</u> _<u>π</u>_ = _NkV_ _k_ <sup>_′_</sup> _b_ <sup>_′_</sup> _q_ _ν_ + ( _f_ <sup>¯</sup> _k_ <sup>_′_</sup> _b′_ + ¯ _n_ _q_ _ν_ ) _δ_ ( _ϵ_ _k_ _b_ + ¯ _hω_ _q_ _ν_ _−_ _ϵ_ _k_ <sup>_′_</sup> _b′_ )� _δ_ ( _k_ _−_ _k_ <sup>_′_</sup> + _q_ ), (1 _−f_ _k_ <sup>_′_</sup> _b′_ +¯ _n_ _q_ _ν_ ) _δ_ ( _ϵ_ _k_ _b−_ ¯ _hω_ _q_ _ν_ _−ϵ_ _k_ <sup>_′_</sup> _b′_ )+( _f_ _k_ <sup>_′_</sup> _b′_ +¯ _n_ _q_ _ν_ ) _δ_ ( _ϵ_ _k_ _b_ +¯ _hω_ _q_ _ν_ _−ϵ_ _k_ <sup>_′_</sup> _b′_ )� _δ_ ( _k_ _−_ _k_ <sup>_′_</sup> + _q_ ) (29) _|gbb′ν_ ( _k_, _k_ <sup>_′_</sup> ) _|_ <sup>2�</sup> where _gbb′ν_ ( _k_, _k_ <sup>_′_</sup> ) is the coupling strength of the electron-phonon interaction. Electron scattering against surfaces or boundaries can be taken into account by adding to _A_ a term of the form <sup>_<u>vα</u>_</sup> _L_ <sup>_<u>k</u>_</sup> <sup>_<u>b</u>_</sup> <sup>_δ_</sup> <sup>_k_</sup> <sup>,</sup> <sup>_k_</sup> <sup>_′δb_</sup> <sup>,</sup> <sup>_b′_</sup> <sup>,</sup> <sup>where</sup> <sup>_L_</sup> <sup>is</sup> <sup>a</sup> <sup>characteristic</sup> length. We note that the scattering matrix Ω can be brought to a symmetric form with the scaling ˜Ω _k_ _b_, _k_ _′b′_ = Ω _k_ _b_, _k_ _′b′_ - _<u>f</u>_ ¯ _<u>k</u>_ _′b′_ <u>(1</u> _<u>−</u>_ _<u>f</u>_ ¯ _<u>k</u>_ _′b′_ <u>)</u> (30) _f_ <u>¯</u> _k_ _b_ (1 _−_ _f_ <u>¯</u> _k_ _b_ ) it can readily be checked that the matrix Ω <sup>˜</sup> is symmetric (i.e. Ω <sup>˜</sup> _k_ _b_, _k_ <sup>_′_</sup> _b′_ = Ω <sup>˜</sup> _k_ <sup>_′_</sup> _b′_, _k_ _b_ ), since the matrix elements are <u>1</u> ˜Ω _k_ _b_, _k_ _′b′_ = _τ_ _k_ _b_ _δ_ _k_ _b_ _k_ <sup>_′_</sup> _b′_ + (1 _−_ _δ_ _k_ _b_, _k_ <sup>_′_</sup> _b′_ ) <sup><u>2</u></sup> <sup>_<u>π</u>_</sup> _NkV_ _δ_ _k_ _b_ _k_ <sup>_′_</sup> _b′_ + (1 _−_ _δ_ _k_ _b_, _k_ <sup>_′_</sup> _b′_ ) <sup><u>2</u></sup> <sup>_<u>π</u>_</sup> _k_ <sup>_′_</sup> _b_ <sup>_′_</sup> _q_ _ν_ _|gbb′ν_ ( _k_, _k_ <sup>_′_</sup> ) _|_ <sup>2�</sup> _δ_ <sup>�</sup> _δ_ ( _ϵ_ _k_ _b −_ ¯ _hω_ _q_ _ν_ _−_ _ϵ_ _k_ <sup>_′_</sup> _b′_ ) + _δ_ ( _ϵ_ _k_ _b_ + ¯ _hω_ _q_ _ν_ _−_ _ϵ_ _k_ <sup>_′_</sup> _b′_ ) (31) (31) _× δ_ ( _k_ _−_ _k_ <sup>_′_</sup> + _q_ ) <u>1</u> ; . 2 sinh( 2 <sup>_<u>hω</u>_</sup> <sup><u>¯</u></sup> _kB_ <sup>_<u>q</u>_</sup> _T_ <sup>_<u>ν</u>_</sup> <sup>)</sup> This symmetric expression for the scattering matrix is more suitable for implementing linear algebra solvers to the BTE, and has been developed in analogy to the rescaling of the phonon scattering matrix described in Ref. [41]. The solution to the electronic BTE is discussed in Section IV C. Solving the BTE provides a way of calculating the linear response of the electronic out-of-equilibrium population in response to an electric field _δf_ <sup>_Eα_</sup> or a thermal gradient _δf_ <sup>_T α_</sup> in direction _α_, defined as _δfα_ _k_ _b_ = _δf_ <sup>_Eα_</sup> _E_ <sup>_α_</sup> and _δfα_ _k_ _b_ = _δf_ <sup>_T α_</sup> _∇αT_ respectively. These perturbations induce both a charge flux _J_ and an energy flux _Q_ defined as _<u>e</u>_ _J_ = _NkV_ _k_ _b_ _vα_ _k_ _bδf_ _k_ _b_, (32) <u>1</u> _Q_ = _NkV_ _k_ _b_ _vα_ _k_ _b_ ( _ϵ_ _k_ _b −_ _µ_ ) _δf_ _k_ _b_ . (33) These fluxes can be compared with the Onsager relations _J_ = _LEE_ _E_ + _LET ∇T_, (34) _Q_ = _LT E_ _E_ + _LT T ∇T_, (35) from which we can define and compute the electronic transport coefficients, such as the electrical conductivity _σ_ _σ_ = _LEE_, (36) the drift mobility _µ_ = _ed_ <sup>_<u>σ</u>_</sup> <sup>,</sup> <sup>where</sup> <sup>_d_</sup> <sup>is</sup> <sup>the</sup> <sup>carrier</sup> <sup>concentration,</sup> <sup>the</sup> <sup>Seebeck</sup> <sup>coefficient</sup> <sup>_S_</sup> _S_ = _−L_ <sup>_−_</sup> _EE_ <sup>1</sup> <sup>_LET_</sup> <sup>,</sup> (37) and electronic thermal conductivity tensor _κel_ _κel_ = _LT T_ _−_ _LT EL_ <sup>_−_</sup> _EE_ <sup>1</sup> <sup>_LET_</sup> <sup>.</sup> (38) With these definitions, we are finally ready to predict the thermal and electronic transport properties of crystals. C. BTE Solvers The similarity between electron and phonon BTEs allows us to readily implement solvers which can be applied generically to either the electron or phonon cases. We first look for a solution that is linear in the external perturbation of the system, i.e. an out-of-equilibrium population in the form _fλ_ _→_ _fλE_ or _fλ_ _→_ _fλ∇T_, with _λ_ as a combined index labeling the relevant band and momentum state (phonon or electron). Under this linear approximation, we write the BTE (Eqs. (17) (26) and (27)) in the more concise form of a linear algebra problem _λ_ <sup>_′_</sup> Ω _λλ′fλ′_ = _bλ_, (39) where _b_ is the diffusion term, Ω is the scattering matrix, all chosen appropriately according to the transport problem under consideration. Note that for the phonon transport problem, Phoebe uses at times a symmetrized scattering matrix Ω <sup>˜</sup> in place of Ω (see Ref. [41]) or the scattering matrix _A_ (see Ref. [27]). On the surface, the BTE appears as a trivial linear algebra problem; however, there are several complexities which arise when solving the BTE. First, the scattering matrix as in Eqs. (28) and (18) cannot be directly inverted to solve the problem [42] due to the presence of zero eigenvalues (arising from energy conservation and/or charge conservation). The second challenge is the sheer size of the problem: in order to obtain converged results, the summation over the Brillouin zone ( _λ_ includes a wavevector index) must be performed for an extremely fine mesh of wavevectors. It is often necessary to use more than 10 <sup>5</sup> wavevectors. Therefore, Phoebe contains a number of different solvers which operate at various levels of complexity and computational cost, each with distinct advantages and disadvantages, and lets the user decide which one is best suited for a particular material. Taking advantage of the similarity between charge and heat transport, the solvers have been implemented for both the electron and phonon BTE. _1._ _Constant_ _Relaxation_ _Time_ _Approximation_ The constant relaxation time approximation (CRTA) is a rudimentary, approximate solution to the BTE. In this case, the scattering matrix is replaced with a single scalar Ω _λλ′_ _≈_ <sup><u>1</u></sup> (40) _τ_ <sup>,</sup> where _τ_ is a user-specified constant relaxation time. Most of the complexity of the BTE is removed and the BTE is readily solved with the out-of-equilibrium population _fλ′_ _≈_ _τbλ_ . The CRTA may provide reasonable results for the Seebeck coefficient, as this often has a weak dependence on the scattering rate, and may be used for fast estimates of trends in other transport properties. However, the choice of _τ_ is largely arbitrary and in many crystals a more detailed description of scattering processes must be included to quantitatively predict transport properties or even capture qualitative transport anomalies [43, 44]. _2._ _Relaxation_ _Time_ _Approximation_ The relaxation time approximation (RTA) is another approximate solution to the BTE, in which only the diagonal elements of the scattering matrix are retained so that Ω _λλ′_ _≈_ Ω _λλ′δλλ′_ = _δλλ′_ <sup><u>1</u></sup> _τλ_ , (41) where _τλ_ is a carrier’s lifetime, and the off-diagonal matrix elements are neglected. With this approximation, the out-of-equilibrium population is readily found as _fλ′_ _≈_ _bλτλ_ . The RTA is a fast and memory-efficient BTE solver, and can be used when more accurate solvers become prohibitively expensive. For electronic transport, it often shows good agreement with more accurate solvers. On the other hand, there are reported cases for which the RTA approximation has failed, particularly for materials where the conservation of crystal momentum is of the utmost relevance, such as in hydrodynamic phonon transport regimes [45–47]. In these cases, one must use a solver which utilizes the complete scattering matrix, such as the solvers listed below. _3._ _Iterative_ _solver_ The iterative BTE solver [48–50] constructs the out-of-equilibrium populations with a geometric series. First, we decompose the scattering matrix into its diagonal terms Ω <sup>_out_</sup> and off-diagonal components Ω <sup>_in_</sup> . A solution is found by iteratively correcting the RTA solution, _f_ <sup>RTA</sup> = Ω <sup>_out_</sup> <u>1</u> <sup>_b_</sup> <sup>=</sup> <sup>_τb_</sup> <sup>,</sup> <sup>as</sup> - _j_ <u>1</u> Ω <sup>_out_</sup> <sup>_b_</sup> <sup>,</sup> (42) _f_ <sup>_i_</sup> = _i_ _j_ =0 - <u>1</u> _−_ Ω <sup>_out_</sup> <sup>Ω</sup> <sup>_in_</sup> where _j_ is an iteration index that can be stopped when transport coefficients are converged. Note also that because Ω <sup>_out_</sup> is a diagonal matrix, its inverse is trivially constructed. Additionally, we implemented crystal symmetries in this solver to further accelerate simulations (see Section IV H below). However, it’s worth pointing out that the iterative solver can only converge as a geometric series, i.e. only if the absolute value of the determinant _|_ det( Ω <sup>_out_</sup> <u>1</u> <sup>Ω</sup> <sup>_in_</sup> <sup>)</sup> <sup>_|_</sup> <sup>is</sup> <sup>smaller</sup> <sup>than</sup> <sup>1.</sup> <sup>If</sup> <sup>the</sup> <sup>convergence</sup> <sup>criterion</sup> <sup>is</sup> <sup>not</sup> <sup>satisfied,</sup> <sup>the</sup> algorithm may diverge. The iterative method can be used both by opting to store the scattering matrix in memory, which allows a fast solution once the scattering matrix is built but at the expense of a large usage of memory, or not storing Ω in memory, so that we lower memory requirements but require to compute the action of the scattering matrix Ω _· f_ several times. _4._ _Variational_ _solver_ The variational BTE solver [40, 51] operates by minimizing the following quadratic functional of the carrier population _f_ F[ _f_ ] = <sup><u>1</u></sup> 2 <sup>_f_</sup> <sup>_· A · f_</sup> <sup>_−_</sup> <sup>_b · f_</sup> <sup>.</sup> (43) Since the scattering matrix is semi-positive definite [40, 51, 52] (a property related to the ever increasing value of entropy [23]), the functional F has a single minimum which coincides with the solution of the BTE. We implemented a conjugate gradient algorithm [51] that minimizes the functional F and finds the exact solution to the BTE. In contrast to the iterative solver, the variational solver is guaranteed to converge to the solution provided that the scattering matrix is semi-positive definite. Like the iterative solver, the user can choose to store the matrix in memory to quickly build the solution, or not, so that the solution is found more slowly but with smaller memory requirements. _5._ _Relaxons_ _solver_ The last solver is based on a direct diagonalization of the BTE [41, 53]. The scattering matrix is diagonalized with a ScaLAPACK solver, and we compute the complete set of eigenvalues and eigenvectors _λ_ <sup>_′_</sup> _λ_ <sup>_α′_</sup> <sup>=</sup> <sup><u>1</u></sup> Ω _λλ′θλ_ <sup>_α_</sup> _τα_ _θλ_ <sup>_α_</sup> <sup>,</sup> (44) where _α_ is an eigenvalue index, _τα_ is the inverse eigenvalue and _θλ_ <sup>_α_</sup> <sup>the</sup> <sup>eigenvector.</sup> <sup>Thanks</sup> <sup>to</sup> <sup>the</sup> <sup>completeness</sup> <sup>of</sup> <sup>the</sup> basis set of eigenvectors, we expand the out-of-equilibrium population as _fλ_ = _α_ _fαθλ_ <sup>_α_</sup> <sup>,</sup> (45) where we introduced auxiliary coefficients _fα_ . Next, we write the BTE in the eigenvector (relaxons) basis as _λ_ _λ_ <sup>_α_</sup> <sup>=</sup> <sup><u>1</u></sup> _bλθλ_ <sup>_α_</sup> _τα_ _fα_, (46) and note that in this form we can analytically solve the BTE by substituting _fα_ = _τα_ - _λ_ <sup>_bλθ_</sup> _λ_ <sup>_α_</sup> <sup>in</sup> <sup>Eq.</sup> <sup>(45).</sup> This last solver has the benefit of always providing the exact solution, as it’s not based on any iterative scheme and therefore has none of the related numerical instabilities. Furthermore, this analytical solution to the BTE allows for further physical insights, such as the calculation of viscosity [54] (see Section IV E). On the other hand, this solver has the longest time-to-solution for calculations of transport properties. and note that in this form we can analytically solve the BTE by substituting _fα_ = _τα_ _λ_ <sup>_bλθ_</sup> _λ_ <sup>_α_</sup> D. Electron-Phonon Averaged approximation The Electron Phonon Averaged (EPA) approximation offers another approximate solution to the BTE using an average over the phonon energies and coarse-mesh electron-phonon matrix elements [55]. Although the Wannier function technique discussed in Section III B provides an accurate interpolation of the electronic properties, the number of fine-mesh momentum vectors needed to converge transport calculations can be very large. Furthermore, the construction of the MLWF is a challenging task, not yet fully automated (progress is being made in this direction [56]), and therefore is not always suitable for materials studies. Avoiding momentum space integration and Wannier interpolation altogether, EPA provides a way to estimate electron transport properties in a much faster and automatable way, suitable for rapid materials screening applications. Consider a set of electronic energies _ϵ_ ( _k_ _co_ ) (at fixed band index) computed by a first-principles code on a coarse grid of wavevectors in the BZ. To interpolate the energies, we implemented a plane-wave based interpolation method [57], which fits an electronic band with the periodic function _ϵ_ ˜( _k_ ) = _M_ _−_ 1 _m_ =0 _cme_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>_m_</sup>, (47) where _R_ _m_ is a set of _m_ = 0, 1, _. . ._, _M_ _−_ 1 Bravais lattice vectors chosen as all _R_ _m_ such that _|_ _R_ _m| < Rcut_, where _Rcut_ is a user-specified parameter, and _cm_ is an expansion coefficient. The expansion coefficients are found by optimizing a target error function against a set of training points. Further details can be found in Ref. [57]. This technique doesn’t involve Wannier functions and is thus simpler to implement and automate. In practice, compared to the Wannier interpolation, the sampling of wavevectors _{_ _k_ _co}_ typically needs to be denser in order to converge transport results. With this interpolation procedure, it is possible to evaluate the electronic density of states _ρ_ ( _ϵ_ ) = _V N_ <u>1</u> _k_ - _kb_ <sup>_δ_</sup> <sup>(</sup> <sup>_ϵ −_</sup> <sup>_ϵ_</sup> <sup>˜</sup> <sup>_b_</sup> <sup>(</sup> <sup>_k_</sup> <sup>)),</sup> With this interpolation procedure, it is possible to evaluate the electronic density of states _ρ_ ( _ϵ_ ) = _V N_ <u>1</u> _k_ - _kb_ <sup>_δ_</sup> <sup>(</sup> <sup>_ϵ −_</sup> <sup>_ϵ_</sup> <sup>˜</sup> <sup>_b_</sup> <sup>(</sup> <sup>_k_</sup> <sup>)),</sup> where _ϵ_ ˜ _b_ ( _k_ ) are the interpolated energies of each band _b_ . The next component of the EPA approach is a scheme for estimating the electron-phonon coupling. The idea underlying the EPA method is to replace momentum-space integrations of the BZ with integrations over the quasiparticle energies, simplifying some of the microscopic details of electronic transport to gain computational performance. The electron-phonon coupling is approximated as _bb_ <sup>2</sup> <sup>_′_</sup> _ν_ <sup>(</sup> <sup>_k_</sup> <sup>,</sup> <sup>_q_</sup> <sup>)</sup> <sup>_|_</sup> <sup>2</sup> <sup>_→_</sup> <sup>_g_</sup> _ν_ <sup>2</sup> _|g_ <sup>2</sup> _ν_ <sup>2(</sup> <sup>_ϵ_</sup> <sup>1,</sup> <sup>_ϵ_</sup> <sup>2),</sup> (48) which replaces a 6-dimensional wavevector dependence on _k_ and _q_ with a 2-dimensional dependence on electronic energies. Additionally, as _g_ often has a weak energy dependence, it is possible to sample _g_ <sup>2</sup> with just a few energy values. There are several ways to construct the function _g_ <sup>2</sup> [55], and we implemented the moving-least-squares (MLS) method [58], which constructs _g_ <sup>2</sup> by minimizing the integral , (49) d _q_ _|gbb′ν_ ( _k_, _q_ ) _|_ <sup>2</sup> _−_ _gν_ <sup>2</sup> _ν_ <sup>2(</sup> <sup>_ϵ_</sup> <sup>1,</sup> <sup>_ϵ_</sup> <sup>2)</sup> �2 exp - _−_ <sup><u>(</u></sup> <sup>_<u>ϵ</u>_</sup> <sup>_<u>k</u>_</sup> <sup>_<u>b −</u>_</sup> <sup>_<u>ϵ</u>_</sup> <sup><u>1)2 + (</u></sup> <sup>_<u>ϵ</u>_</sup> <sup>_<u>k</u>_</sup> <sup>_<u>b′</u>_</sup> <sup>_<u>−</u>_</sup> <sup>_<u>ϵ</u>_</sup> <sup><u>2)2</u></sup> _bb_ <sup>_′_</sup> d _k_ 2 _σ_ gauss <sup>2</sup> where _σ_ gauss is a user-specified smoothing scale parameter. The energy dependence on _ϵ_ 1 and _ϵ_ 2 is implemented numerically with a user-specified uniform sampling of an energy interval. Once the coupling is constructed, the energy-dependent electronic lifetime is calculated as _τ_ <sup>_−_</sup> <sup>1</sup> ( _ϵ_, _µ_, _T_ ) = <sup><u>2</u></sup> <sup>_<u>πV</u>_</sup> _gs_ ¯ _h_ _ν_ _gν_ <sup>2(</sup> <sup>_ϵ_</sup> <sup>,</sup> <sup>_ϵ_</sup> <sup>+</sup> <sup>_ω_</sup> <sup>¯</sup> <sup>_ν_</sup> <sup>))2 [</sup> <sup>_n_</sup> <sup>(¯</sup> <sup>_ων_</sup> <sup>,</sup> <sup>_T_</sup> <sup>) +</sup> <sup>_f_</sup> <sup>(</sup> <sup>_ϵ_</sup> <sup>+</sup> <sup>_ω_</sup> <sup>¯</sup> <sup>_ν_</sup> <sup>,</sup> <sup>_µ_</sup> <sup>,</sup> <sup>_T_</sup> <sup>)]</sup> <sup>_ρ_</sup> <sup>(</sup> <sup>_ϵ_</sup> <sup>+</sup> <sup>_ω_</sup> <sup>¯</sup> <sup>_ν_</sup> <sup>)</sup> (50) _{gν_ <sup>2</sup> + _gν_ <sup>2(</sup> <sup>_ϵ_</sup> <sup>,</sup> <sup>_ϵ −_</sup> <sup>_ω_</sup> <sup>¯</sup> <sup>_ν_</sup> <sup>))2 [</sup> <sup>_n_</sup> <sup>(¯</sup> <sup>_ων_</sup> <sup>,</sup> <sup>_T_</sup> <sup>) + 1</sup> <sup>_−_</sup> <sup>_f_</sup> <sup>(</sup> <sup>_ϵ −_</sup> <sup>_ω_</sup> <sup>¯</sup> <sup>_µ_</sup> <sup>,</sup> <sup>_µ_</sup> <sup>,</sup> <sup>_T_</sup> <sup>)]</sup> <sup>_ρ_</sup> <sup>(</sup> <sup>_ϵ −_</sup> <sup>_ω_</sup> <sup>¯</sup> <sup>_ν_</sup> <sup>)</sup> <sup>_}_</sup> <sup>,</sup> where _ω_ ¯ _ν_ = _N_ <u>1</u> _q_ where _ω_ ¯ _ν_ = _N_ <u>1</u> _q_ - _q_ <sup>_ω_</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>is</sup> <sup>the</sup> <sup>average</sup> <sup>phonon</sup> <sup>frequency</sup> <sup>of</sup> <sup>the</sup> <sup>phonon</sup> <sup>branch</sup> <sup>_ν_</sup> <sup>,</sup> <sup>_f_</sup> <sup>and</sup> <sup>_n_</sup> <sup>are</sup> <sup>energy-dependent</sup> <sup>Fermi–</sup> Dirac and Bose–Einstein distributions respectively, and _gs_ is the spin-multiplicity (equal to 2 for non spin-polarized calculations). Using this energy-dependent lifetime, the BTE is readily solved at the RTA level, and it is possible to evaluate the electronic transport coefficients using an energy-dependent approximation for Eqs. (36), (37), (38), as discussed in greater details in Ref. [55]. Typically, the computational bottleneck for this method in Phoebe is the construction of the electronic density of states, which simply has a cost linear in the number of wavevectors used to sample the BZ. E. Viscosity In some materials with large conductivities, transport doesn’t follow the conventional macroscopic diffusion equations such as Fourier’s law for heat or Ohm’s law for charge currents. Recent studies highlighted the necessity to complement conventional transport coefficients such as conductivity with hydrodynamic transport coefficients such as viscosity. Following Ref. [54], we implemented the phonon viscosity as defined from the response coefficient _η_, Π <sup>_ij_</sup> = _η_ <sup>_ijkl_</sup> <sup>_<u>∂u</u>_</sup> _∂r_ <sup>_kl_</sup> <sup>,</sup> (51) where _i_, _j_, _k_, _l_ are Cartesian indices, _u_ is the phonon drift velocity in direction _k_, _r_ is the position, and Π is the crystal momentum flux Π <sup>_ij_</sup> = _V N_ <u>1</u> _q_ - _q_ _ν_ <sup>¯</sup> <sup>_hqivjδn_</sup> _q_ <sup>_D_</sup> _ν_ <sup>,</sup> <sup>where</sup> <sup>_δnD_</sup> _q_ _ν_ <sup>is</sup> <sup>the</sup> <sup>out-of-equilibrium</sup> <sup>phonon</sup> <sup>population</sup> <sup>in</sup> <sup>response</sup> <sup>to</sup> <sup>a</sup> - _q_ _ν_ <sup>¯</sup> <sup>_hqivjδn_</sup> _q_ <sup>_D_</sup> _ν_ _q_ <sup>_D_</sup> _ν_ <sup>,</sup> <sup>where</sup> <sup>_δnD_</sup> _q_ momentum flux Π <sup>_ij_</sup> = _V N_ <u>1</u> _q_ - _q_ _ν_ <sup>¯</sup> <sup>_hqivjδn_</sup> _q_ <sup>_D_</sup> _ν_ <sup>,</sup> <sup>where</sup> <sup>_δnD_</sup> _q_ _ν_ <sup>is</sup> <sup>the</sup> <sup>out-of-equilibrium</sup> <sup>phonon</sup> <sup>population</sup> <sup>in</sup> <sup>response</sup> <sup>to</sup> <sup>a</sup> perturbation of the drift velocity _u_ . The out-of-equilibrium population can be found solving a modified version of the BTE, as reported in full details in Ref. [54]. Finally, the phonon viscosity _µ_ is found by symmetrizing _η_ as _µ_ <sup>_ijkl_</sup> = <sup>_<u>ηijkl</u>_</sup> <sup><u>+</u></sup> <sup>_<u>ηilkj</u>_</sup> . (52) 2 The phonon viscosity can be used to parametrize a generalization of the Fourier’s law for describing heat transport. We also implemented the analogous expression for electronic viscosity, which is readily obtained by replacing phonon properties such as group velocity, equilibrium distribution and lifetimes with their electronic counterparts. F. Transport with the Wigner distribution In systems where carriers’ energies overlap with each other, such as in strongly anharmonic systems [59] or narrow-gap semiconductors [60], it is important to include contributions to transport from the coupling of multiple bands, an effect which is not described by the BTE. To accurately describe these contributions, we implemented the Wigner transport corrections for phonon and electron transport properties. The starting point of this modeling is the Wigner distribution function of phonons _Nνν′_ ( _r_, _q_, _t_ ) or electrons _Fbb′_ ( _r_, _k_, _t_ ). The Wigner distribution cannot be interpreted anymore as a probability distribution, as is the case for electron and phonon population appearing in the BTE. Instead, _N_ and _F_ are quasiprobability distributions that describe the state of a quantum system. It is possible to construct an approximate equation of motion for the Wigner distribution function. As in the spirit of the BTE, this expression aims to describe the out-of-equilibrium state of a quantum system. In particular, the equation of motion for the phonon Wigner distribution function _N_ is _<u>∂N</u>_ <u>(</u> _<u>r</u>_ <u>,</u> _<u>q</u>_ <u>,</u> _<u>t</u>_ <u>)</u> _<u>r</u>_ <u>,</u> _<u>q</u>_ <u>,</u> _<u>t</u>_ <u>)</u> + _i_ [Ω( <sup>˜</sup> _q_ ), _N_ ( _r_, _q_, _t_ )] + <sup><u>1</u></sup> _∂t_ 2 <sup><u>1</u></sup> 2 <sup>_{_</sup> <sup>_V_</sup> <sup>(</sup> <sup>_q_</sup> <sup>),</sup> <sup>_·∇_</sup> <sup>_r_</sup> <sup>_N_</sup> <sup>(</sup> <sup>_r_</sup> <sup>,</sup> <sup>_q_</sup> <sup>,</sup> <sup>_t_</sup> <sup>)</sup> <sup>_}_</sup> <sup>=</sup> <sup>_<u>∂N</u>_</sup> <sup><u>(</u></sup> _∂t_ <sup>_<u>r</u>_</sup> <sup><u>,</u></sup> <sup>_<u>q</u>_</sup> <sup><u>,</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> �����coll , (53) ���coll <sup>is</sup> <sup>the</sup> <sup>phonon</sup> <sup>scattering</sup> <sup>operator,</sup> <sup>˜Ω(</sup> <sup>_q_</sup> <sup>)</sup> <sup>is</sup> <sup>a</sup> <sup>matrix</sup> <sup>of</sup> <sup>energies</sup> <sup>with</sup> <sup>elements</sup> <sup>˜Ω</sup> <sup>_νν′_</sup> <sup>(</sup> <sup>_q_</sup> <sup>) =</sup> <sup>_δνν′_</sup> <sup>¯</sup> <sup>_hω_</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>,</sup> where <sup>_<u>∂N</u>_</sup> <sup><u>(</u></sup> _∂t_ <sup>_<u>r</u>_</sup> <sup><u>,</u></sup> <sup>_<u>k</u>_</sup> <sup><u>,</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> where <sup>_<u>∂N</u>_</sup> <sup><u>(</u></sup> _∂t_ <sup>_<u>r</u>_</sup> <sup><u>,</u></sup> <sup>_<u>k</u>_</sup> <sup><u>,</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> [, ] is a commutator and _{_, _}_ an anticommutator. The electronic version of the Wigner transport equation is _<u>∂F</u>_ <u>(</u> _<u>r</u>_ <u>,</u> _<u>k</u>_ <u>,</u> _<u>t</u>_ <u>)</u> _<u>r</u>_ <u>,</u> _<u>k</u>_ <u>,</u> _<u>t</u>_ <u>)</u> + _i_ [E( _k_ ) + _d_ ( _k_ ) _·_ _E_, _F_ ( _r_, _k_, _t_ )] + <sup><u>1</u></sup> _∂t_ 2 <sup><u>1</u></sup> 2 <sup>_{_</sup> <sup>_V_</sup> <sup>(</sup> <sup>_k_</sup> <sup>),</sup> <sup>_·∇_</sup> <sup>_r_</sup> <sup>_F_</sup> <sup>(</sup> <sup>_r_</sup> <sup>,</sup> <sup>_k_</sup> <sup>,</sup> <sup>_t_</sup> <sup>)</sup> <sup>_} −_</sup> <sup>_e_</sup> <sup>_E_</sup> <sup>_· ∇_</sup> <sup>_k_</sup> <sup>_F_</sup> <sup>(</sup> <sup>_r_</sup> <sup>,</sup> <sup>_k_</sup> <sup>,</sup> <sup>_t_</sup> <sup>) =</sup> <sup>_<u>∂F</u>_</sup> <sup><u>(</u></sup> <sup>_<u>r</u>_</sup> _∂t_ <sup><u>,</u></sup> <sup>_<u>k</u>_</sup> <sup><u>,</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> �����coll , (54) ���coll <sup>is</sup> <sup>the</sup> <sup>electron</sup> <sup>scattering</sup> <sup>operator,</sup> <sup>E(</sup> <sup>_k_</sup> <sup>)</sup> <sup>is</sup> <sup>a</sup> <sup>matrix</sup> <sup>of</sup> <sup>energies</sup> <sup>with</sup> <sup>elements</sup> <sup>E</sup> <sup>_bb′_</sup> <sup>(</sup> <sup>_k_</sup> <sup>) =</sup> <sup>_δbb′ϵ_</sup> <sup>_k_</sup> <sup>_b_</sup> <sup>,</sup> <sup>and</sup> where <sup>_<u>∂F</u>_</sup> <sup><u>(</u></sup> _∂t_ <sup>_<u>r</u>_</sup> <sup><u>,</u></sup> <sup>_<u>k</u>_</sup> <sup><u>,</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> where <sup>_<u>∂F</u>_</sup> <sup><u>(</u></sup> _∂t_ <sup>_<u>r</u>_</sup> <sup><u>,</u></sup> <sup>_<u>k</u>_</sup> <sup><u>,</u></sup> <sup>_<u>t</u>_</sup> <sup><u>)</u></sup> _d_ _bb′_ ( _k_ ) is the electronic dipole [60]. The scattering operator for electrons is <sup>_<u>τ −</u>_</sup> _<u>k</u>_ _<u>b</u>_ <sup>1</sup> <sup>_′_</sup> _Fbb′_ ( _r_, _k_, _t_ ), (55) 2 _<u>∂F</u>_ <u>(</u> _<u>r</u>_ <u>,</u> _<u>k</u>_ <u>,</u> _<u>t</u>_ <u>)</u> _∂t_ �����coll Ω _k_ _b_, _k_ <sup>_′_</sup> _b′Fb_ <sup>_′_</sup> _b_ <sup>_′_</sup> ( _r_, _k_, _t_ ) _−_ (1 _−_ _δbb_ <sup>_′_</sup> ) <sup>_<u>τ −</u>_</sup> _<u>k</u>_ _<u>b</u>_ <sup>1</sup> <sup>_−_</sup> _<u>k</u>_ _<u>b</u>_ <sup>1</sup> <sup><u>+</u></sup> <sup>_<u>τ −</u>_</sup> _<u>k</u>_ _<u>b</u>_ <sup>1</sup> <sup>_′_</sup> = _−_ _k_ <sup>_′_</sup> _b_ <sup>_′_</sup> where we distinguished the scattering matrix acting on the diagonal components of the Wigner distribution matrix from the off-diagonal terms of the scattering operator. The scattering operator for the phonon Wigner distribution is obtained in full analogy by replacing in the previous equation electron lifetimes and scattering matrix with the phonon counterparts. The details of the derivation of these equations are given in Refs. [59, 60]. There are both similarities and notable differences between these equations and the electron or phonon BTE. First of all, the BTE is obtained from the Wigner transport equation as the limit in which the off-diagonal components of the Wigner distributions are neglected (i.e. _Nνν′_ _≈_ _Nνν′δνν′_ or _Fbb′_ _≈_ _Fbb′δbb′_ ). As a result, the Wigner formalism expands on the well-established predictive capability of the BTE. Critically, the equation of motion for the Wigner distribution adds a commutator, which allows coupling between different off-diagonal elements of the Wigner distribution function. We note that the diagonal (single-band) elements of these equations coincide with the electron and phonon BTE discussed previously, and that results for transport coefficients can be interpreted as corrections to the BTE predictions. Furthermore, these Wigner corrections to the BTE transport coefficients only depend on the carrier lifetimes. Because these quantities are already computed when constructing the scattering operator for the BTE, the computational cost of the Wigner corrections is negligible compared to the cost of constructing and solving the BTE. Just as described for the BTE, the Wigner transport equations for electrons and phonons can be solved considering linear perturbations of the Wigner distribution from equilibrium. Once the equations are solved, the transport coefficient are readily found. For example, the expectation value of charge flux is _<u>gs</u>_ _J_ ( _r_, _t_ ) = 2 _V Nk_ _k_ _b_ _bb_ <sup>,</sup> (56) - _{_ _V_ ( _k_ ), _F_ ( _r_, _k_, _t_ ) _}_ where _gs_ takes into account the spin degeneracy (here the equation is shown for a system without spin polarization). As shown in Ref. [60], the electrical conductivity can be written as _σ_ = _σ_ <sup>_BT E_</sup> + ∆ _σ_, where _σ_ <sup>_BT E_</sup> is the conductivity predicted by the BTE, and ∆ _σ_ is a correction introduced by the Wigner distribution function: <sup>_−_</sup> _k_ _b_ <sup>1</sup> <sup>_′_</sup> <sup>)2</sup> <sup>.</sup> (57) _<u>k</u>_ _<u>b</u>_ <sup><u>+</u></sup> <sup>_<u>τ −</u>_</sup> _<u>k</u>_ _<u>b</u>_ <sup>1</sup> <sup>_′_</sup> 4( _ϵb_ <sup>_′_</sup> ( _k_ ) _−_ _ϵb_ ( _k_ )) <sup>2</sup> + ( _τ_ _k_ <sup>_−_</sup> _b_ <sup>1</sup> <sup>+</sup> <sup>_τ −_</sup> _k_ _b_ <sup>1</sup> <sup>_′_</sup> _<u>τ</u>_ _<u>k</u>_ <sup>_−_</sup> _<u>b</u>_ <sup>1</sup> _<u>k</u>_ <sup>_−_</sup> _<u>b</u>_ <sup>1</sup> <sup><u>+</u></sup> <sup>_<u>τ −</u>_</sup> _<u>k</u>_ _<u>b</u>_ <sup>1</sup> <sup>_′_</sup> ∆ _σαβ_ = <sup><u>2</u></sup> <sup>_<u>gse</u>_</sup> <sup>2</sup> _V Nk_ _k_ _bb_ <sup>_′_</sup> _<u>f</u>_ ¯ _<u>b′</u>_ <u>(</u> _<u>k</u>_ <u>)</u> _<u>−</u>_ _<u>f</u>_ ¯ _<u>b</u>_ <u>(</u> _<u>k</u>_ <u>)</u> _β_ _k_ _b_ <sup>_′_</sup> _b_ _ϵb′_ ( _k_ ) _−_ _ϵb_ ( _k_ ) <sup>_vα_</sup> <sup>_k_</sup> <sup>,</sup> <sup>_bb′v∗_</sup> The correction to conductivity introduced by the Wigner distribution can be significant, for example when the difference between the energies of quasiparticles in valence and conduction bands are small, i.e. for narrow-gap semiconductors, or when the dipole coupling between valence and conduction states is strong. Corrections to the other Onsager coefficients can similarly be derived. A similar result holds for the phonon transport, where the energy current can be computed as <u>1</u> _Q_ ( _r_, _t_ ) = 2 _V Nq_ _q_ _ν_ _νν_ <sup>.</sup> (58) - _{_ _V_ ( _q_ ), _N_ ( _r_, _q_, _t_ ) _}_ Ω( _q_ ) _{_ _V_ ( _q_ ), _N_ ( _r_, _q_, _t_ ) _}_ Ω( _q_ ) Similarly, the lattice thermal conductivity is _k_ = _k_ <sup>_BT E_</sup> + ∆ _k_, with the first term being the lattice thermal conductivity predicted by the phonon BTE, and the Wigner distribution resulting in the correction <sup>_−_</sup> _q_ _ν_ <sup>1</sup> <sup>_′_</sup> <sup>)2</sup> <sup>.</sup> <u>¯</u> _<u>h</u>_ <sup>2</sup> ∆ _kαβ_ = _kBT_ <sup>2</sup> _V Nq_ _q_ _νν_ <sup>_′_</sup> _β_ <sup>_∗_</sup> _q_ _ν_ <sup>_′_</sup> _ν_ <sup>(</sup> <sup>_ω_</sup> <sup>_q_</sup> <sup>_νn_</sup> <sup>¯</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>(¯</sup> <sup>_n_</sup> <sup>_q_</sup> <sup>_ν_</sup> <sup>+1)+</sup> <sup>_ω_</sup> <sup>_q_</sup> <sup>_ν′_</sup> <sup>¯</sup> <sup>_n_</sup> <sup>_q_</sup> <sup>_ν′_</sup> <sup>(¯</sup> <sup>_n_</sup> <sup>_q_</sup> <sup>_ν′_</sup> <sup>+1))</sup> _<u>ω</u>_ _<u>q</u>_ _<u>ν</u>_ <u>+</u> _<u>ω</u>_ _<u>q</u>_ _<u>ν</u>_ <sup>_′_</sup> _<u>ω</u>_ _<u>q</u>_ _<u>ν</u>_ <sup>_′_</sup> _vα_ _q_, _νν′vβ_ <sup>_∗_</sup> 2 _q_ _ν_ <sup>+</sup> <sup>_τ −_</sup> _<u>q</u>_ _<u>ν</u>_ <sup>1</sup> <sup>_′_</sup> 4( _ω_ _q_ _ν′_ _−_ _ω_ _q_ _ν_ ) <sup>2</sup> + ( _τ_ _q_ <sup>_−_</sup> _ν_ <sup>1</sup> <sup>+</sup> <sup>_τ −_</sup> _q_ _ν_ <sup>1</sup> <sup>_′_</sup> _τ_ _q_ <sup>_−_</sup> _ν_ <sup>1</sup> _q_ <sup>_−_</sup> _ν_ <sup>1</sup> <sup>+</sup> <sup>_τ −_</sup> _<u>q</u>_ _<u>ν</u>_ <sup>1</sup> <sup>_′_</sup> (59) It has been shown [59] that this correction is especially relevant for crystals with localized vibrational modes, when the small phonon group velocities suppresses the BTE lattice thermal conductivity and small lifetimes and small energy differences between phonon modes enhance the correction described by the Wigner distribution. G. Dirac delta and Smearing Calculation of materials properties such as scattering rates often requires a numerical approximation of the Dirac–delta function, for example, the density of states, _ρ_ <u>1</u> _ρ_ ( _ϵ_ ) = 2 _π_ <sup>3</sup> _V_ _b_ _δ_ ( _ϵ −_ _ϵ_ _k_ _b_ )d _k_ . (60) We offer three different schemes for the numerical approximation of the Dirac–delta for the user to choose from: 1. _Gaussian_ _smearing_ : the Dirac–delta is replaced with a Gaussian function <u>1</u> _δ_ ( _ϵkb −_ _ϵk′b′_ ) _≈_ _~~√~~_ _<u>πσ</u>_ _exp_ - _−_ <sup><u>(</u></sup> <sup>_<u>ϵ</u>_</sup> <sup>_<u>k</u>_</sup> <sup>_<u>b −</u>_</sup> <sup>_<u>ϵk′b′</u>_</sup> <sup><u>)2</u></sup> -, (61) _σ_ <sup>2</sup> where _σ_ is a user-specified smearing parameter. This method is simple and fast, but requires the user to converge results with respect to _σ_ in conjunction with the number of wavevectors used for the BZ integration. 2. _Adaptive_ _Gaussian_ _smearing_ : the Gaussian smearing parameter _σ_ introduced above can be approximated [61, 62] as <u>�</u> _<u>A</u>_ _σ_ = _~~√~~_ 12 _<u>A</u>_ _σ_ = _~~√~~_ ~~�~~ <u>�</u> �� <sup>�</sup> _β_ <u>��</u> _α_ - _v_ _k_ <sup>_α_</sup> _k_ <sup>_α_</sup> _b_ <sup>_−_</sup> <sup>_v_</sup> _k_ <sup>_α_</sup> _k_ <sup>_α′_</sup> _b_ <sup>_′_</sup> - _<u>Cαβ</u>_ _Nβ_ , (62) where _C_ is the matrix describing the crystal lattice vectors, _Nβ_ is the size of the Monkhorst-Pack mesh in crystal direction _β_, and the parameter _A_ is a prefactor that can be fixed to 1 [62]. As this method self-adjusts _σ_ with respect to the chosen BZ sampling and the local derivative of the carrier’s energy, it tends to yield easier convergence of results compared the fixed-width Gaussian smearing scheme. 3. _Tetrahedron_ _method_ : discussed in Ref. [63], this method provides a truly parameter-free linear approximation of the integrand. For simplicity, the tetrahedron method is currently implemented only for the calculation of the DoS. The method is accurate and parameter-free, although considerably slower than the above two alternatives. H. Symmetries A crystal is characterized by a set of symmetry operations _S_ = _{R_, _t}_, with each operation _S_ consisting of a rotation _R_ and a fractional translation _t_ such that the application of a translation and a rotation to the atomic positions leaves the overall crystal unchanged. In reciprocal space, instead of working with a set of wavevectors _{_ _k_ _}_ that uniformly samples the BZ, symmetries allow the selection of a subset of irreducible wavevectors _{_ _k_ <sup>_∗_</sup> _}_, such that the complete set of wavevectors can be obtained by applying rotations to the irreducible wavevectors set _k_ = _R_ _k_ <sup>_∗_</sup> . As a result, integration over the BZ can be sped up by restricting the domain to the irreducible wedge of the BZ. We recall here that microscopic carrier properties also obey symmetry relations. For example, scalars such as the carriers energy or lifetimes are left invariant by symmetry operations between an irreducible point _k_ <sup>_∗_</sup> and its symmetry equivalent point _k_ = _R_ _k_ <sup>_∗_</sup> [53] _ϵ_ _k_ _b_ = _ϵ_ _k_ <sup>_∗_</sup> _b_, (63) and _τ_ _k_ _b_ = _τ_ _k_ <sup>_∗_</sup> _b_ . (64) Instead, the group velocity transforms like a vector as _vα_ _k_ _b_ = _β_ _Rαβvβ_ _k_ <sup>_∗_</sup> _b_, (65) and similarly, the out-of-equilibrium population [53] transform as _δfα_ _k_ _b_ = _β_ _Rαβδfβ_ _k_ <sup>_∗_</sup> _b_ . (66) As a result, the calculation of several properties can be sped up by restricting states to the irreducible wedge of the BZ, for example when computing the density of states, or solving the BTE at the RTA level. The relaxation time approximation and iterative solvers (see Sections IV C 2 and IV C 3) support the use of symmetries. The BTE for an irreducible point _k_ <sup>_∗_</sup> (omitting band indices for simplicity) is _β_ _k_ <sup>_′∗_</sup> _A_ ˜ _αβ_ ; _k_ _∗_ _k_ _′∗_ _f_ _k_ <sup>_β′∗_</sup> <sup>,</sup> (67) _β_ _k_ <sup>_′_</sup> _A_ _k_ <sup>_∗_</sup> _k_ <sup>_′_</sup> _R_ <sup>_αβ_</sup> _f_ _k_ <sup>_β′_</sup> <sup>=</sup> _b_ <sup>_α_</sup> _k_ <sup>_∗_</sup> <sup>=</sup> _k_ <sup>_′_</sup> _A_ _k_ <sup>_∗_</sup> _k_ <sup>_′_</sup> _f_ _k_ <sup>_α′_</sup> <sup>=</sup> where we used the symmetry properties of the out-of-equilibrium population, and _A_ <sup>˜</sup> is a tensor describing the scattering properties limited to the irreducible BZ wedge. As a result of symmetries, the BTE’s linear algebra problem can be solved with a much smaller number of momentum states, and thus with a better computational efficiency. V. SOFTWARE Phoebe is written in `C++` following the object-oriented paradigm. Since Phoebe computes a range of extremely different physical properties, each of these properties are organized in Apps. A main function simply initializes global properties (such as starting the MPI or Kokkos environments), reads the user input and launches the appropriate App through a class factory. Currently, Phoebe offers the following Apps: - `ElectronWannierBandsApp`, `ElectronFourierBandsApp`, `PhononBandsApp` : calculation of electron or phonon energies along a BZ path; - `ElectronWannierDosApp`, `ElectronFourierDosApp`, `PhononDosApp` : calculation of electron or phonon DOS; - `ElPhQeToPhoebeApp` : processing of the electron-phonon coupling from QE to a Phoebe format. An EPA processing computes the electron-phonon averaged coupling, while the Wannier processing transforms the coupling to its real-space Wannier representation; - `ElectronLifetimesApp` and `PhononLifetimesApp` : calculation of carriers’ lifetimes along a BZ path; - `ElectronWannierTransportApp` : calculation of electronic transport coefficients with Wannier interpolation method; - `TransportEpaApp` : calculation of electronic transport coefficients with the EPA approximation; - `PhononTransportApp` : evaluation of phonon transport properties. The physical properties computed by these Apps are either printed to standard output or written to JSON files for user’s convenience. We also provide a few `Python` scripts to generate some of the most common plots of physical properties. Each App uses a number of classes built to reduce code duplication and to provide convenient data structures. In fact, a central goal of the project is to guarantee a simple deployment of methods and algorithms for future releases. The most important among the several classes available are - `Crystal` : description of the crystal unit cell and crystal symmetries; - `Points` : handling of wavevectors in the BZ; - `HarmonicHamiltonian` : base class for the calculation of non-interacting carriers properties; subclassed into `PhononH0`, `ElectronH0Wannier` and `ElectronH0Fourier` for evaluating phonon properties, Wannier- and Fourierinterpolated electron properties respectively; - `BandStructure` : storage of carriers’ energies, velocities and eigenvectors; - `Context` : description of user input variables; - `MPIcontroller` : wrapper for calls to MPI functions; - `Matrix` : storage of MPI-distributed matrices and a wrapper to ScaLAPACK subroutines; - `StatisticsSweep` : calculation and description of values for temperature, chemical potentials and carrier concentrations; - `Interaction` : base class for the evaluation of the scattering coupling strength. Its subclasses describe the three-phonon interaction, electron-phonon coupling with Wannier interpolation and the EPA coupling; - `ScatteringMatrix` : base class for the calculation, storage and manipulation of the electron or phonon scattering matrix; - `VectorBTE` : data structure for storage and manipulation of the out-of-equilibrium population; - `Observable` : base class of a number of classes for evaluating transport coefficients. In the following we will discuss some of these classes in greater detail. A. Points class The `Points` class in Phoebe manages the wavevectors used to sample the BZ. We defined two constructors, one for instantiating a class for uniform sampling of the BZ and another for paths of wavevectors in the BZ. When uniformly sampling the BZ with a Monkhorst-Pack grid, the complete list of points (wavevectors) is not explicitly stored for memory management convenience. This implicit list contains points sorted by their coordinates (incrementing the coordinates z, y and x in this order). When describing BZ paths, instead, points are not sorted, and their coordinates are explicitly stored in a list. Points are internally manipulated in crystal coordinates (i.e. in scaled lattice vectors units), and we provide options to output points in Cartesian coordinates or to fold them in the first BZ. In the `Points` class we implemented the logic for reducing a set of wavevectors to the set of symmetry-irreducible wavevectors in the BZ. The class method `setIrreduciblePoints()`, takes the set of crystal symmetries (from the `Crystal` class) and finds the list of irreducible BZ points, i.e. finds the irreducible set of points _k_ <sup>_∗_</sup> such that all remaining points _k_ can be found applying a rotation _R_ to _k_ <sup>_∗_</sup> . It’s worth noting that symmetry operations are not unique, so that a symmetry operation may rotate a wavevector correctly as _k_ = _R_ _k_ <sup>_∗_</sup> but other quantities such as the group velocity may not be rotated correctly _v_ ( _k_ ) _̸_ = _R_ _v_ ( _k_ <sup>_∗_</sup> ). Since the carrier populations transform like group velocities, the method `setIrreduciblePoints()` can optionally find a set of symmetries that rotate both points and velocities. The `Points` class also has a `setActiveLayer()` method that allows discarding some points that don’t provide a sizeable contribution to a physical observable, a functionality that will be explained in Section V B in conjunction with the `ActiveBandStructure` class. After a call to this method, the functionalities in this class operate as if only the restricted set of points are present in the class. Finally, several other parts of the code require the lookup of a wavevector in the list of points and, due to the large number of points used to sample the BZ (often in the excess of 10 <sup>4</sup> ), this search operation can take a substantial part of the calculation if not implemented efficiently. If `Points` describes a uniform BZ sampling with a complete Monkhorst-Pack grid, the point search in the list can be done in _o_ (0) operations, taking advantage of the implicit ordering of points. If the list of points is sorted (e.g. after a call to `setActiveLayer()` ) the lookup operation can be done with a binary search algorithm, which scales logarithmically with the number of points. Only if points are not sorted (e.g. when they describe a BZ path), the point search is made with a slow element-by-element comparison. B. Band structure classes We developed a data structure dedicated to the storage of the band structure, that is, the energies ( _ϵ_ _k_ _b_ and ¯ _hω_ _q_ _ν_ ), eigenvectors ( _U_ _k_ _mb_ and _z_ _q_ <sup>_sα_</sup> _ν_ <sup>)</sup> <sup>and</sup> <sup>velocities</sup> <sup>(</sup> <sup>_vα_</sup> <sup>_k_</sup> <sup>_bb′_</sup> <sup>and</sup> <sup>_vα_</sup> <sup>_q_</sup> <sup>_νν′_</sup> <sup>)</sup> <sup>of</sup> <sup>carriers</sup> <sup>over</sup> <sup>the</sup> <sup>BZ.</sup> To handle this information, we defined two classes: `FullBandStructure` and `ActiveBandStructure` . Both classes take a `Points` instance as input, since `Points` defines the set of wavevectors over which the carriers’ properties are computed. While both classes store the band structure, there is an important difference. The `FullBandStructure` class stores energies, eigenvectors and velocities for all wavevectors defined in the `Points` instance. For example, given _Nk_ points and _Nb_ electronic bands, `FullBandStructure` stores the complete list of _Nk × Nb_ values of e.g. energies _ϵ_ _k_ _b_ (and similar for eigenvectors or velocities). Since wavevector meshes can be extremely large, carriers properties can optionally be stored in a MPI-distributed fashion, using the `Matrix` class described in Section V C. `ActiveBandStructure` contains similar functionalities of `FullBandStructure` in that it stores information of carriers properties (in fact they share the same virtual parent class). However, the constructor of this class discards some Bloch states ( _k_ _b_ ) that don’t contribute significantly to the calculation of transport properties. Because transport properties at finite temperature only depend on thermally excited electron and phonon states, there are many states which do not contribute and are readily discarded to save computational resources. For example, only long-wavelength acoustic phonon states contribute to transport at low temperatures _T_ as their excitation energy goes to 0 with _T_ . Similarly, only electrons with energy close to the chemical potential _µ_ contribute to charge currents and thus we can restrict calculations to electronic states such that _|ϵ_ _k_ _b −_ _µ|_ is smaller than a few _kBT_ . As a result, states that are not thermally excited can be discarded, and in Phoebe we term this band and momentum-space state filtering procedure as a "window". We implemented two kinds of windows. The first window type imposes an energy cutoff and discards all states with energy larger than a user-specified cutoff _ϵ_ cutoff : for phonons we retain states such that _|_ ¯ _hω_ _q_ _ν| < ϵ_ cutoff and for electrons _|ϵ_ _q_ _ν_ _−_ _µ| < ϵ_ cutoff . However, this kind of window is impractical, as the cutoff is temperature dependent and, in practice, a user would need to perform a convergence test on _ϵ_ cutoff . We implemented a second window type, noting that transport coefficients contain terms of the form _f_ <sup>¯</sup> _k_ _b_ (1 _−_ _f_ <sup>¯</sup> _k_ _b_ ) for electrons or _n_ ¯ _k_ _b_ (1 + _n_ ¯ _k_ _b_ ) for phonons (which arise from the energy or temperature derivative of equilibrium distributions). For both carriers, these terms decay exponentially to zero if the carrier’s energy is much larger than _kBT_, thus suppressing contributions of high-energy carriers to transport properties. We therefore define a "population window" by retaining only states such that, for electrons _f_ ¯ _k_ _b_ (1 _−_ _f_ ¯ _k_ _b_ ) _> δ_, (68) or for phonons _n_ ¯ _k_ _b_ (1 + ¯ _n_ _k_ _b_ ) _> δ_, (69) where _δ_ is a small number. Since the temperature dependence is inside the definition of Bose–Einstein and Fermi–Dirac distributions, we found that _δ_ can be hard-coded to a fixed value and that transport properties are not affected. In this way, we achieve a reduction in the number of Bloch states used in the various calculations, and avoid the introduction of an additional parameter to be converged, for greater user convenience. As a result of this filtering procedures, the number of electron bands _Nb_ or phonon branches _Nν_ is no longer a constant but depends on the wavevector index. As a result, quantities like the electronic energy _ϵ_ _k_ _b_ cannot be stored as a matrix of size _Nk × Nb_ . Instead, energies are stored as a flattened vector, and we provide class methods to access energies through combined band and wavevector state indices. A similar strategy is adopted for storing eigenvectors or velocities. C. Matrix As described in Sections IV A, IV B, the BTE is a linear algebra problem and due to the number of Bloch states involved, requires distributed matrices and parallel linear algebra operations. In order to perform these massively parallel dense linear algebra operations, we utilize the ScaLAPACK library [14]. In order to both avoid explicit calls to this library in the main body of code and to allow future flexibility should we desire to swap ScaLAPACK routines with those of a different library, we developed the `Matrix` class as a wrapper to this library. Because ScaLAPACK is mostly built in Fortran and C languages, it follows an imperative procedural programming paradigm, i.e. a set of routines that must be called in the right order, resulting in a departure from the objectoriented programming style adopted in the rest of Phoebe. The `Matrix` class has therefore been designed to map this procedural-style library into an object-oriented style. Therefore, the class constructor takes care of ScaLAPACK initializations, such as starting the BLACS environment and allocating the memory locations, while deallocations take place in the class destructor. Various class methods have been implemented to provide wrappers around the needed linear algebra operations, such as matrix-matrix multiplication and matrix diagonalization, with the benefit of hiding within the class method all the necessary auxiliary calls (such as temporary memory allocations or index mappings) in order to call use the ScaLAPACK library. As a result, the rest of Phoebe’s code can act on distributed memory with a simplified interface that doesn’t obfuscate the main body of the transport code. `C++` class templates further allow us to generalize the class to store different data-types (in particular, real and complex floating point values). We also allow the code to be compiled without the ScaLAPACK or MPI libraries. In this case, the `Matrix` class falls back to a "serial matrix" which relies on the `Eigen` library, losing all MPI-parallel characteristics (therefore becoming mostly suitable for debugging purposes). D. Scattering Matrix The `ScatteringMatrix` class, as the name suggest, implements operations related to BTE’s scattering operator. A key challenge in developing this class has been to try generalize this code to achieve different purposes. In order to implement the calculation of scattering rates, we defined `ScatteringMatrix` as a virtual base class that defines a virtual method `builder()` ; the method is implemented in the subclasses `PhononScatteringMatrix` and `ElectronScatteringMatrix` and evaluates Eqs. (28) or (18). In this way, auxiliary methods such as the calculation of a matrix-vector product or the scattering matrix diagonalization can be defined directly in the base class and are shared by the two different carriers. The scattering matrix has a few modes of operation. If the BTE is to be solved only at the RTA level, only the calculation of lifetimes is performed by the class instance. For exact BTE solutions, for which the full scattering matrix must be dealt with, we distinguish two cases: first, when the complete scattering matrix is stored in memory or alternatively, when only the product of the scattering matrix on a population vector is computed (without the need of saving the matrix in memory). In the former case, the calculation has a larger memory requirement, however, this allows to quickly solve the BTE. In the latter case, the memory footprint of the calculation is reduced, but as a drawback each iteration of a BTE solver will require more computational time. We thus let the user choose the desired memory impact, which will depend on both the material studied and on the available hardware. To summarize, the `builder()` method, depending on the input, is tasked with computing 1) the carriers’ lifetimes, 2) the scattering matrix or 3) its action on a vector. Note that due to the size of the scattering matrix _Aνν′_, it is stored as a class member using an MPI-distributed `Matrix` instance. Great care has been taken to optimize the efficiency of the scattering rate calculations implemented in `builder`, as these are some of the most computationally intensive functions in the code. Significant improvements to the calculation speed have been achieved by precomputing all independent particle properties whenever possible. Additionally, we used MPI parallelization to accelerate loops over _k_ and _k_ <sup>_′_</sup> wavevectors, while other loops over band indices are accelerated with OpenMP parallelization. The calculation of the interaction coupling strength and its GPU acceleration is described in the next section. E. Kokkos (Interaction) In Phoebe, great care has been taken to accelerate the calculation of interaction matrix elements and scattering rates. The calculation of the scattering coupling strength for either three phonon and electron-phonon scattering in reciprocal space, _fαβγ_ ( _k_, _k_ <sup>_′_</sup> ), starting from a real-space representation, _gabc_ ( _R_, _R_ <sup>_′_</sup> ), is obtained with a tensor operation in the form _e_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_R_</sup> <sup>+</sup> <sup>_i_</sup> <sup>_k_</sup> <sup>_′·_</sup> <sup>_R_</sup> <sup>_′_</sup> _Uαa_ ( _k_ <sup>_′_</sup> ) _gabc_ ( _R_, _R_ <sup>_′_</sup> ) _Uβb_ ( _k_ ) _Uγc_ ( _k_ <sup>_′_</sup> _−_ _k_ ), (70) _abc_ _fαβγ_ ( _k_, _k_ <sup>_′_</sup> ) = _RR_ <sup>_′_</sup> where _U_ are rectangular matrices indicating Wannier rotation matrices or phonon eigenvectors, _a_, _b_ and _c_ are indices labeling Wannier functions or atomic displacements, _α_, _β_ and _γ_ are Bloch band indices, _k_ is a wavevector, and _R_ is a Bravais lattice vector. In order to maximise performance, we first note that this expression typically appears inside a double loop on _k_ and _k_ <sup>_′_</sup> . Therefore, if _k_ is the outer loop, it is convenient to precompute the quantity _f_ ˜ _αbc_ ( _k_, _R_ <sup>_′_</sup> ) = _R_ _b_ _e_ <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_R_</sup> _gabc_ ( _R_, _R_ <sup>_′_</sup> ) _Uβb_ ( _k_ ), (71) at fixed value of _k_, and then complete the transformation inside the loop over _k_ <sup>_′_</sup> . It is necessary to adopt the most convenient tensor contractions in order to minimize the size of loops needed to perform the interpolation. Additionally, because GPUs are extremely effective at performing tensor operations, we implemented the calculation of the coupling with the Kokkos library [64]. This library provides a hardware-agnostic programming model for parallelizing operations, so that tensor operations are implemented once following Kokkos’ syntax and then, at compilation time, the code is optimized for the desired architecture. The code can thus run both on standard CPU-only architecture as well as on GPUs when available without code duplication. We therefore achieve strong parallel performance across a varied range of underlying architectures. In our preliminary tests, we observed that the interpolation at fixed values of _k_ and _k_ <sup>_′_</sup> is extremely fast on a GPU, causing communication latency between GPU and CPU to be the dominant bottleneck. To counteract this effect, we increase the workload on the GPU by performing the interpolation for a fixed value of _k_ and a set of values for _{_ _k_ <sup>_′_</sup> _}_ at once. The size of the set _{_ _k_ <sup>_′_</sup> _}_ is optimized at runtime so that most of the on-board GPU’s memory is used. Finally, as the size of the electron-phonon coupling matrix in the Wannier representation _gbb′ν_ ( _R_ _e_, _R_ _p_ ) may be too large to fit in a single GPU’s memory, we adopt an additional layer of MPI parallelization. The electron-phonon coupling can be distributed over the index _R_ _e_ across a “pool” of MPI processes, and we allow the user to specify the size of the pool at runtime through the command line. The electron-phonon matrix interpolation of polar materials takes an additional correction, specified in Eq. 15, due to long-range interaction. In order to optimize the evaluation of this long-range correction, we note that most terms, except the overlap matrix - _ψ_ _k_ + _q_, _b′_ <sup>��</sup> _e_ <sup>_i_</sup> <sup>(</sup> <sup>_q_</sup> <sup>+</sup> <sup>_G_</sup> <sup>)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>��</sup> _ψ_ _k_ + _q_, _b_ �, depend exclusively on the phonon wavevector _q_ . We therefore - _ψ_ _k_ + _q_, _b′_ <sup>��</sup> _e_ <sup>_i_</sup> <sup>(</sup> <sup>_q_</sup> <sup>+</sup> <sup>_G_</sup> <sup>)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>��</sup> _ψ_ _k_ + _q_, _b_ except the overlap matrix - _ψ_ _k_ + _q_, _b′_ <sup>��</sup> _e_ <sup>_i_</sup> <sup>(</sup> <sup>_q_</sup> <sup>+</sup> <sup>_G_</sup> <sup>)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>��</sup> _ψ_ _k_ + _q_, _b_ �, depend exclusively on the phonon wavevector _q_ . We therefore precompute these factors for all possible values of _q_ once, at the start of the coupling interpolation. Next, we note that the overlap term can be evaluated as - _ψ_ _k_ + _q_, _b′_ <sup>��</sup> _e_ <sup>_i_</sup> <sup>(</sup> <sup>_q_</sup> <sup>+</sup> <sup>_G_</sup> <sup>)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>��</sup> _ψ_ _k_ + _q_, _b_ - = - _U_ ( _k_ + _q_ ) _U_ <sup>_†_</sup> ( _k_ )� _b_ <sup>_′_</sup> _b_ <sup>,</sup> <sup>and,</sup> <sup>since</sup> <sup>the</sup> <sup>_U_</sup> <sup>matrices</sup> <sup>are</sup> readily available for the calculation of the short-range component of the electron-phonon matrix, it is readily possible to add this contribution without much overhead to the calculation. - _ψ_ _k_ + _q_, _b′_ <sup>��</sup> _e_ <sup>_i_</sup> <sup>(</sup> <sup>_q_</sup> <sup>+</sup> <sup>_G_</sup> <sup>)</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>��</sup> _ψ_ _k_ + _q_, _b_ - = - _U_ ( _k_ + _q_ ) _U_ <sup>_†_</sup> ( _k_ ) F. Quantum ESPRESSO interface for electron-phonon coupling Phoebe interfaces with QE `ph.x` and Wannier90 in order to obtain the relevant ab-initio input for the electron-phonon coupling calculations. However, this interface presented an important technical challenge. As mentioned in Section III B, gauge fixing is a critical component of the Wannier interpolation. In order for the Wannier interpolation to work, it is critical that the gauge of the wavefunctions used by these two separate codes stays the same throughout the calculations. Unfortunately, there is no built-in QE function to fix the gauge of a wavefunction and therefore the wavefunction may take a random phase every time it is computed. As a result, we developed a gauge-fixing procedure that ensures the wavefunction has a consistent gauge across `pw.x` (the QE code that finds the ground state wavefunctions), `ph.x` (the QE code that computes the electron-phonon coupling) and `wannier90` (which computes the maximally-localized Wannier functions). Therefore, in addition to the main Phoebe code, we provide a patched version of QE that must be used to compute electronic properties, which guarantees the gauge of the wavefunctions is appropriately taken into account. In order to explain this gauge fixing procedure, we first recall that QE is a plane-wave ab-initio code, so that the wavefunction is computed as _c_ _k_ _b_ ( _G_ ) _e_ <sup>_i_</sup> <sup>_G_</sup> <sup>_·_</sup> <sup>_r_</sup> <sup>+</sup> <sup>_i_</sup> <sup>_k_</sup> <sup>_·_</sup> <sup>_r_</sup>, (72) _ψ_ _k_ _b_ ( _r_ ) = _G_ where _G_ runs over a set of reciprocal lattice vectors (typically defined up to a user-defined cutoff value on _|_ _k_ + _G_ _|_ <sup>2</sup> ), _c_ are the plane wave coefficients, and _r_ is the position. The subroutine `c_bands()` of QE is responsible for building and diagonalizing the Hamiltonian matrix, and therefore also computes the eigenvalues _ϵ_ _k_ _b_ and the plane wave coefficients _c_ _k_ _b_ ( _G_ ). The phase arbitrariness manifests as a random phase on the complex plane-wave coefficients _c_ _k_ _b_ ( _G_ ). In our patch, we modified `c_bands()` so that if `c_bands()` is called by `pw.x` and QE has found the ground state wavefunction (i.e. a scf calculation), we save _c_ _k_ _b_ ( _G_ ) to file. These coefficients will serve as a reference wavefunction to fix the gauge of all subsequent calculations. If `c_bands()` is called by another code, for example, when generating auxiliary data for Wannier90 or `ph.x`, we read the reference plane-wave coefficients and use them to fix the gauge of the newly computed wavefunction. In this way, we can ensure that - at the phase level - the same wavefunction is used throughout these multiple calculations. An additional complexity in this patch is caused by the use of symmetries in the ab-initio code. The reference plane-wave coefficients built in a `pw.x` calculation are typically computed only for wavevectors _{_ _k_ <sup>˜</sup> _}_ in the irreducible BZ wedge. Therefore, we save to file only the coefficients _c_ _k_ ˜ _b_ ( _G_ ) computed at irreducible points. The wavefunction at a symmetry-equivalent wavevector _k_ can be reconstructed from the irreducible wavevector _k_ <sup>˜</sup> = _R_ _k_ as _ψR_ _k_ _b_ ( _r_ ) = _ψ_ _k_ _b_ ( _R_ <sup>_−_</sup> <sup>1</sup> ( _r_ _−_ _t_ )), (73) which in terms of plane-wave coefficients implies _cR_ _k_ _b_ ( _G_ ) = _e_ <sup>_−i_</sup> <sup>(</sup> <sup>_R_</sup> <sup>_k_</sup> <sup>+</sup> <sup>_G_</sup> <sup>)</sup> <sup>_·t_</sup> _c_ _k_ _b_ ( _R_ <sup>_−_</sup> <sup>1</sup> _G_ ), (74) where _S_ = _{R_, _t}_ is a crystal symmetry as introduced in Section IV H. An additional symmetry that is taken into account is the time reversal operation _ψ−_ _k_ _b_ ( _r_ ) = _ψ_ _k_ <sup>_∗_</sup> _b_ <sup>(</sup> <sup>_r_</sup> <sup>),</sup> (75) which in terms of plane-wave coefficients is _c−_ _k_ _b_ ( _G_ ) = _c_ <sup>_∗_</sup> _k_ _b_ <sup>(</sup> <sup>_−_</sup> <sup>_G_</sup> <sup>) .</sup> (76) Another constraint comes from the translational symmetry of the crystal, i.e. _ψ_ _k_ _b_ ( _r_ ) = _ψ_ _k_ + _G_ <sup>_′_</sup>, _b_ ( _r_ ), (77) or equivalently _c_ _k_ + _G_, _b_ ( _G_ ) = _c_ _k_ _b_ ( _G_ + _G_ <sup>_′_</sup> ) . (78) Capability for using symmetries in the presence of magnetism are currently being developed. Using these relations and knowing the wavefunction at _k_ <sup>˜</sup>, it is possible to reconstruct the wavefunction at any symmetry-equivalent wavevector _k_ . However, in QE, the wavefunction cannot be built from symmetries just by mapping _c_ _k_ ˜, _b_ ( _G_ ) into _c_ _k_, _b_ ( _G_ ). In fact, the set of _G_ vectors is chosen such that _|_ _G_ + _k_ _|_ <sup>2</sup> _< δ_, where _δ_ is a user-specified cutoff. As a result, we cannot map all _c_ _k_ ˜, _b_ ( _G_ ) into _c_ _k_, _b_ ( _G_ ) as some plane-wave coefficients might be missing at the rotated wavevector, causing errors in the normalization of the wavefunction. To address this, we first rotate the reference wavefunction _|ψ_ _k_ ˜ <sup>ref</sup> _b_ <sup>_⟩_</sup> <sup>into</sup> <sup>the</sup> <sup>desired</sup> wavevector _k_ finding _|ψ_ _k_ <sup>ref</sup> _b_ <sup>_⟩_</sup> <sup>=</sup> <sup>_|Sψ_</sup> _k_ ˜ <sup>ref</sup> _b_ <sup>_⟩_</sup> <sup>.</sup> <sup>Next,</sup> <sup>we</sup> <sup>compute</sup> <sup>the</sup> <sup>overlap</sup> <sup>matrix</sup> <sup>_O_</sup> <sup>as</sup> _k_ <sup>ref</sup> _b_ <sup>_⟩_</sup> <sup>=</sup> <sup>_|Sψ_</sup> _k_ ˜ <sup>ref</sup> _b_ _k_ ˜ <sup>ref</sup> _b_ <sup>_⟩_</sup> <sup>.</sup> <sup>Next,</sup> <sup>we</sup> <sup>compute</sup> <sup>the</sup> <sup>overlap</sup> <sup>matrix</sup> <sup>_O_</sup> <sup>as</sup> _k_ <sup>ref</sup>, _b_ <sup>_|ψ_</sup> _k_ <sup>arb</sup>, _b_ <sup>_′−_</sup> <sup>gauge</sup> _O_ _k_ _bb′_ = _⟨ψ_ _k_ <sup>ref</sup>, _b_ _k_ <sup>arb</sup>, _b_ <sup>_′−_</sup> <sup>gauge</sup> _⟩bb′_, (79) where _|ψ_ _k_ <sup>arb</sup>, _b_ <sup>_−_</sup> <sup>gauge</sup> _⟩_ is the wavefunction with an arbitrary gauge that has been computed by QE at wavevector _k_ . With a complete basis set _O_ would be a unitary matrix, however, due to the finite set of _G_ -vectors, the unitary property is violated by a small amount ∆ defined as ∆= 1 _−_ _OO_ <sup>_†_</sup> . (80) We can re-enforce the unitary property of _O_ by first noting that _O_ is expected to be semi-positive definite (due to the lack of completeness of the finite set of _G_ vectors). We then write 1 = _OO_ <sup>_†_</sup> + ∆ (81) = _OO_ <sup>_†_</sup> + ( _OO_ <sup>_†_</sup> + ∆)∆( _OO_ <sup>_†_</sup> + ∆) (82) _≈_ _OO_ <sup>_†_</sup> + _OO_ <sup>_†_</sup> ∆ _OO_ <sup>_†_</sup> (83) = _OLL_ <sup>_†_</sup> _O_ <sup>_†_</sup> (84) where _L_ is the Cholesky decomposition of the matrix _LL_ <sup>_†_</sup> = 1 + _O_ <sup>_†_</sup> ∆ _O_ and introduced an approximation that has an error of order ∆ <sup>3</sup> (expected to be small for well-converged calculations). By construction, the matrix _OL_ is a unitary matrix which can now be used to rotate the wavefunction computed at a symmetry-equivalent point to the desired gauge, while preserving the orthonormality of the wavefunctions. We therefore fix the gauge of the wavefunction at _k_ by applying the rotation _ψ_ _k_ <sup>fixed</sup> <sup>_−_</sup> <sup>gauge</sup> _k_ <sup>arb</sup> <sup>_−_</sup> <sup>gauge</sup> . (85) _k_ <sup>fixed</sup> <sup>_−_</sup> <sup>gauge</sup> = _OLψ_ _k_ <sup>arb</sup> <sup>_−_</sup> <sup>gauge</sup> This procedure makes the wavefunctions obey the symmetries of the crystals and greatly simplifies the electron-phonon coupling calculation. As explained in Ref. [33], if the wavefunction obeys crystal symmetries, the electron-phonon coupling satisfies the symmetry relation _gbb′ν_ ( _S_ _k_, _q_ ) = _gbb′ν_ ( _k_, _S_ <sup>_−_</sup> <sup>1</sup> _q_ ), (86) where _S_ is a symmetry operation of a crystal and _gbb′ν_ ( _k_, _q_ ) = _gbb′ν_ ( _k_ + _G_, _q_ + _G_ ), (87) due to the periodicity of the crystal. As a result, we can compute the electron-phonon coupling on a set of irreducible wavevectors, then construct the remaining matrix elements by means of the symmetry relations, reducing the burden of the ab-initio calculation. We stress that this QE patch avoids the need for re-implementing calculations of the electron-phonon matrix elements _⟨ψ_ _k_ + _q_, _b′|∂_ _q_ _νV |ψ_ _k_ _b⟩_, which are already computed in the code `ph.x` . As a result, Phoebe can readily take advantage of all features supported by `ph.x`, such as ultra-soft or PAW pseudopotentials [65], U corrections [24] and others, without the need for re-implementing them. The only modification necessary in the code `ph.x` has been the introduction of a subroutine that unfolds the symmetry of the coupling _g_ and writes it to file output. The Wannier90 code does not need to be modified, as it simply reads the wavefunctions pre-computed by QE. As a last detail, we stress that the gauge problem must also be taken care when dealing with the phonon eigenvector _z_, and the eigenvector _z_ present in Eq. 12 must be exactly the same phonon eigenvector (phase factor included) used by `ph.x` to compute the electron-phonon coupling. Additionally, _z_ must obey the symmetries of the crystal, as discussed in Ref. [33]. Fixed-gauge wavefunction ? and el. energies ? Patched pw.x G. Workflow Overview Rotation matrix ? Wannier90 qe2Phoebe Electronic Transport App properties App Electron transport workflow Electron Transport App Patched Fourier/Wannier interpolation of ?(?, ?) ; integration of el. BTE ph.x Phonon energies ph.x ℏ? and el-ph coupling ?(?, ?) Fourier/Wannier transform to real space ?(??, ??) Phonon energies ℏ? and ph-ph coupling ? <sup>3</sup> ?, ? <sup>′</sup>, ? <sup>′′</sup> Phonon transport workflow Ground state DFT Phono(3)py DFT Calculation of forces ? Phonon Transport App App Interpolation of phonon coupling ? <sup>3</sup> ?,? <sup>′</sup>, ? <sup>′′</sup> ; Phonon properties Interpolation of phonon integration of ph. BTE Figure 1. Schematic depiction of the user workflows to compute electronic transport properties with Phoebe (top panel) or phonon transport properties (bottom panel). Generally, the user must first perform ab-initio simulations (blue boxes), using our patched version of Quantum ESPRESSO for studying electron-phonon interactions or any DFT code that can provide anharmonic phonon interactions. Next, shown in purple boxes, the user must launch the Phoebe executable. The electronic transport properties calculation must be preceded by a one-time post-processing of the electron-phonon coupling taken in output from Quantum ESPRESSO, while the phonon transport calculation can be directly started from the output of ab-initio calculations. Finally, results are provided in output either in the standard output file, or as a parsable JSON format. Having introduced all the major features and computational structures of Phoebe, we demonstrate how the code can be used to calculate transport properties of materials. In Fig. 1 we schematically show a user’s workflow for computing electronic and thermal transport properties with Phoebe. The electronic transport workflow, as shown in the top panel, starts with the user going through the ab-initio calculation. The first step requires the calculation of the ground state wavefunction and electronic energies. Due to the wavefunction gauge requirements explained in Section V F, the ground state calculation must be performed using our patched version of QE. Next, the user proceeds to compute the phonon properties with the patched version of `ph.x` . The output of this calculation, specifically files containing the force constants and the electron-phonon coupling, are later passed to Phoebe. At the same time, the user must also compute the Wannier functions with Wannier90, which outputs the real-space representation of the electronic Hamiltonian and the _U_ rotation matrices that must be used to rotate the wavefunction to the Wannier gauge. After these ab-initio calculations have concluded, the user must run the `qe2PhoebeApp`, which uses the data from the ab-initio calculations to compute the electron-phonon coupling in the Wannier representation _g_ ( _R_ _e_, _R_ _p_ ) starting from _g_ ( _k_, _q_ ) computed by `ph.x`, as described in Eq. 12. This operation needs to be run only once per material, and generates an output (HDF5) file with the electron-phonon coupling in real space, ready to be used for the interpolation. Finally, the user has all the input data necessary to compute the electron transport properties by launching the `electronWannierTransportApp` . Results are output as JSON files, easily parsed and analyzed by the user. The workflow for computing the phonon transport properties is shown in the lower panel of Fig. 1. First, the user must select an ab-initio code (from any that work with phono3py or ShengBTE) to calculate the equilibrium ground state of the crystal. After a reference equilibrium crystal structure is found, the user runs an external library, e.g. phonopy and phono3py or ShengBTE, in conjunction with the ab-initio code to generate all atomic displacements needed to compute the second and third derivatives of the total energy (see Sec. III A). Once both _V_ <sup>(2)</sup> and _V_ <sup>(3)</sup> are computed, the `PhononTransportApp` is ready to be launched. This app will interpolate the phonon-phonon coupling, compute phonon lifetimes, and then solve the BTE to evaluate the phonon transport properties such as the thermal conductivity. As in the electronic transport case, the results are written in easily parsable JSON files that can be conveniently analyzed. VI. RESULTS Next, we showcase the calculation of transport properties by applying these two computational workflows to GaN, a semiconductor often used for high-power applications. A. GaN Gallium nitride (GaN) is a well-studied semiconductor that crystallizes in a wurtzite structure. We calculate the electronic structure of this material via QE using optimized norm-conserving Vanderbilt pseudopotentials [66, 67] and the local-density approximation exchange-correlation functional [68]. For the phonon workflow, we construct the force constants in a 4 _×_ 4 _×_ 3 supercell, and the third derivative using a 3 _×_ 3 _×_ 2 supercell. The supercell DFT calculation is performed using a 2 _×_ 2 _×_ 2 mesh for the _k_ -point integration and a wavefunction cutoff of 110 Ry. Next, the phonon BTE is built using the adaptive smearing method for approximating the Dirac-delta and converged with a 15 _×_ 15 _×_ 15 mesh of _q_ -points. For the electron transport workflow, ab-initio properties are computed using a 110 Ry plane-wave energy cutoff, a 12 _×_ 12 _×_ 7 coarse mesh for both _k_ - and _q_ -points and the same pseudopotential choice. The maximally-localized Wannier function basis for this material was established by starting with an initial guess of 14 random Wannier centers. The electronic BTE is build using an adaptive smearing scheme (Sec. IV G), and states are discarded with the population window described in V B. The BTE is integrated using a variable mesh of k-points, starting from the densest mesh of 170 _×_ 170 _×_ 106 at the lowest temperature of 100K and gradually decreased down to 90 _×_ 90 _×_ 56 at the highest temperature of 450K, as the convergence properties depend on temperature. In Fig. 2 we plot some of the transport properties of GaN as a function of temperature. In the top left panel of Fig. 2, we plot the lattice thermal conductivity as a function of temperature, and compare results of the BTE at various levels of approximation with the experimental values [69]. We find a good agreement between our simulations and experiments, validating the results of this work. The RTA solution tends to underestimate the thermal conductivity predicted by exact BTE, as expected due to the variational principle underlying the formalism [23, 27]. To solve the phonon BTE exactly, we use the variational and the relaxons solvers, mainly to note how the two solvers are able to provide, as expected, approximately the same solution to the BTE. The electron drift mobility at a n-carrier concentration of about 2 _·_ 10 <sup>17</sup> cm <sup>_−_</sup> <sup>3</sup> is plotted versus temperature in the bottom left panel of Fig. 2 and compared against some of the available experiments [70–72]. Here we distinguish two regimes. At higher temperatures, where a sufficient number of phonons is thermally excited, we expect electron-phonon scattering to be the dominant factor limiting charge transport in GaN. Indeed, for temperatures above approximately 150K, we obtain a good agreement with experimental values, and correctly reproduce the decreasing trend of mobility with respect to temperature. At lower temperatures we observe a departure in computed mobility from experimental values, which tend to decrease as temperature goes to zero, while our results are showing the opposite trend. This is likely due to the fact that at lower temperature fewer phonons are thermally excited, and electrons have a higher probability of scattering against defects or impurities in the crystal, which have not been taken into account for this simulation. We also note that the RTA already provides a good approximation to the mobility (and also for the Seebeck coefficient and the resistivity), and the variational and relaxon solvers provide essentially the same estimates. Overall, we observe a good agreement with experiments for simulations in the phonon-limited regime of charge transport. Additionally, in the top right panel of Fig. 2, we include a calculation of the Lorenz ratio, defined as _L/L_ 0 = _σT Lke_ 0 <sup>,</sup> where _ke_ is the electronic contribution to the thermal conductivity, and _L_ 0 is the standard Lorenz constant for an ideal metal [GIVE VALUE]. In GaN we confirm that _L/L_ 0 shows sensible behavior and is close to unity, i.e. the limit in which the Wiedemann-Franz law is obeyed. A deviation from _L/L_ 0 = 1 is to be expected, since the Wiedemann-Franz law is typically more closely followed by metals. Figure 2. The calculated lattice thermal conductivity (top left), electron mobility (bottom left), Lorenz number (top right), and Seebeck coefficient (bottom right) (with _µ_, _L_, and _S_ calculated for carrier density n=2x10 <sup>17</sup> _cm_ <sup>_−_</sup> <sup>3</sup> ) of GaN along the a-direction crystal axis determined using the RTA, variational and relaxons solutions to the BTE as implemented in Phoebe. Experimental data for _κphonon_ [69], _µelectron_ [70–72], and S [73] are shown for comparison. In Fig. 2, bottom right panel, we plot the Seebeck coefficient as a function of temperature. Here, we obtain a good agreement between our results and the experimental values for large temperatures [73], i.e. larger than 150K. Since the Seebeck coefficient is strongly related to the density of states of the material [74], the results seem to indicate that the DFT simulation provided a good approximation to the electronic band structure. Also in this case, we observe a departure between our results and experiments at the lowest temperatures. Electronic scattering by defects is not expected to change the Seebeck coefficient significantly [75]. Instead, this deviation could be attributed to phonon drag, which for example has been investigated in GaAs [75], and often manifests with a sudden change in the Seebeck coefficient at low temperatures. In the top panels of Fig. 3 we plot the phonon (left panels) and electronic (right panels) band structure. On top of the band structure, we superimpose the carrier linewidths computed at a temperature of 300K. These pictures are produced with `Python` scripts that have been included in the Phoebe release for user’s convenience. The top panel provides an easy way to identify some particular bands or areas of the Brillouin zone which tend to scatter the most, as the linewidths are a measure of the total scattering rate. In the upper-left panel of 3, we can observe how optical phonons tend to scatter more, especially at the Γ or _A_ high-symmetry points. In the upper-right panel of Fig. 3 instead we can observe how the holes close to the chemical potential have larger linewidths than electrons close to the band gap, but otherwise we don’t observe any pocket of large scattering rates. The bottom panels describe the energy-dependence of the lifetimes, which sometimes is useful to derive simplified models of transport. For phonons, in the lower-left panel of Fig. 3, we can clearly see that lifetimes are largest for the three acoustic phonon modes whose energies tend to zero at the Γ point. The calculated phonon lifetimes tend to decrease as the energy increases. However, one can notice how the energy dependence cannot be described with a simple empirical power-law expression: Figure 3. Plots of phonon (left panels) and electron (right panels) linewidths and lifetimes of GaN. In the top panels, linewidths are plotted as the thickness of lines against the band structure of the carrier on a high-symmetry path of the Brillouin zone. In the bottom panels, we plot lifetimes as a function of carrier energy. The reference zero energy corresponds to the chemical potential. an accurate microscopic description, as done here, is often necessary to describe phonon lifetimes. In the lower-right panel 3, we instead show the energy dependence of electron lifetimes due to electron-phonon scattering. We observe a spike in the electron lifetimes for carriers closest to the band edge due to the vanishing density of states; often these carriers are responsible for determining the transport properties of a material. Away from the gap, the relaxation times simply show a weaker energy dependence. B. Performance and Scaling Phoebe uses MPI, OpenMP and Kokkos for scaling and acceleration at different levels. MPI enables large-scale simulations on multiple nodes, while OpenMP allows shared-memory parallelization within one node. As explained in Section V E, the interpolation of the particle interaction is implemented with Kokkos, so that if no GPU is available, Kokkos’s OpenMP backend will add to the intra-node parallelization, otherwise its CUDA, HIP, SYCL and OpenMPTarget backends compile the code for GPUs from different vendors. In this section, we show some examples of the computational performance of Phoebe. As a benchmark, we take the GaN calculation of electronic transport properties discussed in the previous section, and integrate the BTE at a temperature of 300 K on a grid of 90 _×_ 90 _×_ 56 wavevectors. For this test, we reduced the coarse ab-initio grid of wavevectors to 7 _×_ 7 _×_ 4. The simulation is run on the TACC Longhorn supercomputer, where each node has 4 NVIDIA V100 GPUs and 2 IBM Power 9 AC922 20-core CPUs. In Fig. 4 we plot the scaling of the `ElectronWannierTransportApp` with respect to the two levels of parallelization (MPI and OpenMP), while also demonstrating how the GPU accelerates the calculation (with 1 GPU per MPI process). The solid lines show the total wall time of the calculation as a function of the number of MPI processes (left panel) 1000 100 Total number of OpenMP threads 160 320 640 1280 2560 Without GPUs With GPUs Ideal Total time Scattering matrix 4 8 16 32 64 Number of MPI processes and GPUs 10000 1000 Total number of OpenMP threads 4 8 16 32 Without GPUs ~~With~~ ~~GPUs~~ Ideal Total time Scattering matrix 1 2 4 8 Number of OpenMP threads per MPI process Figure 4. Strong scaling with MPI and OpenMP. The solid lines show the total execution time of Phoebe for the calculation of electronic transport properties of GaN, while the dashed lines show the time used to calculate the scattering matrix. On the left panel, the number of MPI processes is varied while the number of OpenMP threads is kept constant, and vice-versa on the right panel. In blue lines, we show results when the GPU is used (one V100 GPU per MPI process), which is contrasted with results in red lines performed on the same computational nodes but without GPUs. GPUs speedup simulations by approximately a factor of three. or OpenMP threads per MPI thread (right panel), while dashed lines show the wall time for the calculation of the scattering matrix (typically the most computationally intensive algorithm present in the code). Dotted lines represent the ideal scaling of a calculation - a straight line in this logarithmic scale - and the color code labels simulations performed with (blue) or without (red) GPU acceleration. In the left panel of Fig. 4, we test the MPI scaling by increasing the number of nodes used, with 4 MPI ranks, 4 GPUs and 160 OpenMP threads per node. When running without GPUs, the overall scaling of the simulation is very close to ideal. In this case, the calculation of the scattering matrix dominates the total cost of the simulation and since it’s efficiently distributed across MPI processes over the wavevectors, we achieve a good scaling performance. The GPUs, shown in blue lines, greatly accelerate the calculation of the scattering matrix, which is now a much smaller contribution to the overall computation time. Remarkably, we achieve a GPU acceleration of a factor 2 or 3 to the overall simulation wall time. Dashed lines in Fig. 4 show in detail the time taken by the construction of the scattering matrix. This part, dominant for larger systems and grids, is very close to ideal scaling. The right panel of Fig. 4 showcases the scaling performance of Phoebe with respect to the number of OpenMP threads per MPI process. Here, we used a single node with 4 GPUs and 4 MPI ranks, while the number of OpenMP threads per MPI rank is gradually increased from 1 to 8. Because not all steps of the calculation can be parallelized with OpenMP (in particular, the input files reading at the start of the calculation), the total simulation time deviates from ideal scaling as more threads are used. Nevertheless, we achieve good OpenMP scaling performance when GPUs are not used, especially for the construction of the scattering matrix. When GPUs are used, we observe a significant deviation from the linear scaling, which can be traced to the lack of OpenMP scaling of the scattering matrix construction. This is not surprising: since the majority of the scattering matrix calculation is offloaded to the GPU, it becomes largely independent of the number of OpenMP threads being used on the CPU, which are only responsible for minor precomputations and data transfer. Figure 5 shows the performance breakdown of the most significant steps in a single electronic transport calculation. This simulation is computed using a 80 _×_ 80 _×_ 50 _k_ -mesh, and has been run on one node of Harvard University’s Cannon supercomputer with 4 MPI processes and 8 OpenMP threads, where each node has 4 V100 GPUs and 2 Intel Xeon Gold 6142 16-core CPUs. The simulation is profiled using the KokkosP Profiling tools. A vast majority of the initial simulation time is spent reading input files, in particular the large HDF5 files containing the electron-phonon coupling in real space precomputed from Eq. (12). While file-reading cannot be accelerated with OpenMP or GPUs, we use parallel HDF5 to maximize the I/O speed. In the next step of the calculation, Phoebe precomputes electron and phonon properties as described in sections III A and III B, i.e. energies, eigenvectors, and velocities at all points _k_, _q_ and _k_ + _q_ . This operation is trivially parallelized with both MPI processes and either OpenMP threads or Figure 5. Performance breakdown during a simulation of GaN electronic transport properties, with and without GPUs. The simulation is run on a single node with 4 MPI ranks, 8 OpenMP threads and 4 GPUs. The first step is to read the HDF5 file, which only depends on file system speed. Phoebe then computes the energies, eigenvectors and velocities for the phonon and electron Hamiltonians at different wavevectors, and finally the scattering matrix. Overall, we find the GPU greatly accelerates the total computation time. a GPU, thus driving the overall scaling towards linearity. The GPU is particularly efficient for diagonalizing the phonon and electron Hamiltonians at different wavevectors by using the `cusolverDnZheevjBatched` function from the cuSOLVER library, which diagonalizes a batch of small matrices. At this stage, we also precompute all factors in the long-range polar correction (Eq. 15), except for the wavefunction overlap which is added during the calculation of the scattering rates. In this way, part of the calculation of the polar correction has a linear scaling with _q_, rather than being embedded in a loop over _k_ during the construction of the scattering matrix. In the last part of the simulation, Phoebe computes the scattering matrix, which is the largest contribution to the total wall time. When the GPU is being used, we can see how the calculation of the scattering matrix is significantly accelerated, to the point where the GPU calculation is about ten times faster than the calculation on CPU, and the GPU simulation is dominated by the cost of I/O. The use of non-blocking MPI reductions ( `MPI_Ireduce` ) minimizes the time spent on the CPU and further enhances the scaling. The calculation of transport properties after the scattering matrix has been built is done at a negligible cost compared to the operations shown in Fig. 5. Overall, we demonstrate that Phoebe successfully leverages multi-level parallelism and GPU acceleration even for a moderately expensive calculation. With just a single GPU node, the calculation is fast enough that it becomes dominated by unavoidable overhead tasks like file reading and data transfer. VII. CONCLUSION In this article we present Phoebe, a high-performance software for characterising electron and phonon transport properties from first-principles. It provides various tools to predict transport properties at various levels of theory and accuracy, such as the Boltzmann transport equation or models based on the Wigner distribution. Phoebe interfaces with Phono3py and ShengBTE to obtain the first-principles coupling strength of the phonon-phonon interaction, and with QE for the electron-phonon interaction. The accurate integration of the Boltzmann transport equation and related transport properties is achieved with Fourier/Wannier based interpolation techniques or with energy-averaging approximations. Lastly, the code is optimized for speed and scaling, using a mix of parallelization levels based on MPI, OpenMP and GPU (through Kokkos). The code has been made publicly available on Github (https://mir-group.github.io/phoebe/) under an open-source basis (MIT license). The ongoing goal for this project is to provide the community with a scalable software to efficiently perform simulation of materials transport properties, while providing an extensible platform for implementing new methods as they are being developed. _Acknowledgments_ We acknowledge funding support from the Star-Friedman Fund for Promising Scientific Research, the Harvard Quantum Initiative, the Harvard Climate Change Solutions Fund, the STC Center for Integrated Quantum Materials, NSF Grant No. DMR-1231319. Computational resources were provided by the Harvard FAS Research Computing and TACC, allocation DMR20013. J.C. acknowledges support from the Department of Energy Computational Science Graduate Fellowship (DOE CSGF) under Award Number DE-FG02-97ER25308. A.J. acknowledges support from the Aker Scholarship. N.S.F. acknowledges support from Swiss National Science Foundation (project number P2EZP2_178532). _∗_ [bkoz@g.harvard.edu](mailto:bkoz@g.harvard.edu) [1] B. Kozinsky and D. J. Singh, Annual Review of [Materials](http://dx.doi.org/10.1146/annurev-matsci-100520-015716) Research 51, 565 (2021), [https://doi.org/10.1146/annurev-matsci-](http://arxiv.org/abs/https://doi.org/10.1146/annurev-matsci-100520-015716) [100520-015716.](http://arxiv.org/abs/https://doi.org/10.1146/annurev-matsci-100520-015716) [2] S. Poncé, E. Margine, C. Verdi, and F. Giustino, Computer Physics [Communications](http://dx.doi.org/ https://doi.org/10.1016/j.cpc.2016.07.028) 209, 116 (2016). [3] G. Pizzi, D. Volja, B. Kozinsky, M. Fornari, and N. Marzari, Computer Physics [Communications](http://dx.doi.org/ https://doi.org/10.1016/j.cpc.2013.09.015) 185, 422 (2014). [4] J. J. Zhou, J. Park, I. T. Lu, I. Maliyov, X. Tong, and M. Bernardi, Computer Physics [Communications](http://dx.doi.org/ https://doi.org/10.1016/j.cpc.2021.107970) 264, 107970 [(2021).](http://dx.doi.org/ https://doi.org/10.1016/j.cpc.2021.107970) [5] G. K. H. Madsen, J. Carrete, and M. J. Verstraete, Comput. Phys. [Commun.](http://dx.doi.org/10.1016/j.cpc.2018.05.010) 231, 140 (2018). [6] A. Togo and I. Tanaka, Scr. Mater. 108, 1 (2015). [7] A. Togo, L. Chaput, and I. Tanaka, Phys. Rev. B [91](http://dx.doi.org/10.1103/PhysRevB.91.094306), 094306 (2015). [8] W. Li, J. Carrete, N. A. Katcho, and N. Mingo, Computer Physics [Communications](http://dx.doi.org/https://doi.org/10.1016/j.cpc.2014.02.015) 185, 1747 (2014). [9] T. Tadano, Y. Gohda, and S. Tsuneyuki, J. Phys. Cond. [Matter.](http://dx.doi.org/10.1088/0953-8984/26/22/225402) 26, 225402 (2014). [10] G. Barbalinardo, Z. Chen, N. W. Lundgren, and D. Donadio, Journal of Applied [Physics](http://dx.doi.org/10.1063/5.0020443) 128, 135104 (2020), [https://doi.org/10.1063/5.0020443.](http://arxiv.org/abs/https://doi.org/10.1063/5.0020443) [11] B. Zhang, Z. Fan, C. Y. Zhao, and X. Gu, Journal of Physics: [Condensed](http://dx.doi.org/ 10.1088/1361-648x/ac268d) Matter 33, 495901 (2021). [12] A. Cepellotti, J. Coulter, A. Johansson, N. Fedorova, and B. Kozinsky, “Phoebe,” `[https://mir-group.github.io/phoebe/](https://mir-group.github.io/phoebe/)` (2021). [13] G. Guennebaud, B. Jacob, _et_ _al._, “Eigen v3,” http://eigen.tuxfamily.org (2010). [14] “Scalapack,” `[https://github.com/Reference-ScaLAPACK/scalapack](https://github.com/Reference-ScaLAPACK/scalapack)` (2020). [15] A. Togo and I. Tanaka, “ `Spglib` : a software library for crystal symmetry search,” (2018), [arXiv:1808.01590](http://arxiv.org/abs/1808.01590) [cond-mat.mtrl [sci].](http://arxiv.org/abs/1808.01590) [16] A. Kapoulkine, “Pugixml,” `[https://github.com/zeux/pugixml](https://github.com/zeux/pugixml)` (2020). [17] A. Devresse, “Highfive,” `[https://github.com/BlueBrain/HighFive](https://github.com/BlueBrain/HighFive)` (2021). [18] The HDF Group, “Hierarchical data format version 5,” `[http://www.hdfgroup.org/HDF5](http://www.hdfgroup.org/HDF5)` (2000-2010). [19] E. H. Carter, C. R. Trott, and D. Sunderland, Journal of Parallel and [Distributed](http://dx.doi.org/10.1016/j.jpdc.2014.07.003) Computing (2014), [10.1016/j.jpdc.2014.07.003.](http://dx.doi.org/10.1016/j.jpdc.2014.07.003) [20] van Heesch, Dimitri, “Doxygen, Generate documentation from source code,” `[https://www.doxygen.nl/](https://www.doxygen.nl/)` (1997-2021). [21] Brandl, G and the Sphinx Team, “Python Documentation Generator,” `[https://www.sphinx-doc.org](https://www.sphinx-doc.org)` (2007-2021). [22] Read The Docs, Inc & contributors, “Read The Docs,” `[https://readthedocs.org/](https://readthedocs.org/)` (2010-2021). [23] J. Ziman, _Electrons_ _and_ _Phonons:_ _The_ _Theory_ _of_ _Transport_ _Phenomena_ _in_ _Solids_, Oxford Classic Texts in the Physical Sciences (Oxford University Press, USA, 2001). [24] P. Giannozzi, O. Andreussi, T. Brumme, O. Bunau, M. B. Nardelli, M. Calandra, R. Car, C. Cavazzoni, D. Ceresoli, M. Cococcioni, N. Colonna, I. Carnimeo, A. D. Corso, S. de Gironcoli, P. Delugas, R. A. D. Jr, A. Ferretti, A. Floris, G. Fratesi, G. Fugallo, R. Gebauer, U. Gerstmann, F. Giustino, T. Gorni, J. Jia, M. Kawamura, H.-Y. Ko, A. Kokalj, E. Küçükbenli, M. Lazzeri, M. Marsili, N. Marzari, F. Mauri, N. L. Nguyen, H.-V. Nguyen, A. O. de-la Roza, L. Paulatto, S. Poncé, D. Rocca, R. Sabatini, B. Santra, M. Schlipf, A. P. Seitsonen, A. Smogunov, I. Timrov, T. Thonhauser, P. Umari, N. Vast, X. Wu, and S. Baroni, Journal of Physics: [Condensed](http://stacks.iop.org/0953-8984/29/i=46/a=465901) Matter 29, 465901 (2017). [25] W. Li, J. Carrete, N. A. Katcho, and N. Mingo, Comp. Phys. [Commun.](http://dx.doi.org/10.1016/j.cpc.2014.02.015) 185, 1747 (2014). [26] S. Baroni, S. de Gironcoli, A. Dal Corso, and P. Giannozzi, Rev. Mod. [Phys.](http://dx.doi.org/10.1103/RevModPhys.73.515) 73, 515 (2001). [27] G. Fugallo, M. Lazzeri, L. Paulatto, and F. Mauri, Phys. Rev. B [88](http://dx.doi.org/10.1103/PhysRevB.88.045430), 045430 (2013). [28] L. Paulatto, F. Mauri, and M. Lazzeri, Phys. Rev. B [87](http://dx.doi.org/10.1103/PhysRevB.87.214303), 214303 (2013). [29] F. Giustino, Rev. Mod. Phys. [89](http://dx.doi.org/10.1103/RevModPhys.89.015003), 015003 (2017). [30] G. Pizzi, V. Vitale, R. Arita, S. Blügel, F. Freimuth, G. Géranton, M. Gibertini, D. Gresch, C. Johnson, T. Koretsune, J. Ibañez-Azpiroz, H. Lee, J.-M. Lihm, D. Marchand, A. Marrazzo, Y. Mokrousov, J. I. Mustafa, Y. Nohara, Y. Nomura, L. Paulatto, S. Poncé, T. Ponweiser, J. Qiao, F. Thöle, S. S. Tsirkin, M. Wierzbowska, N. Marzari, D. Vanderbilt, I. Souza, A. A. Mostofi, and J. R. Yates, Journal of Physics: [Condensed](http://dx.doi.org/ 10.1088/1361-648x/ab51ff) Matter 32, 165902 (2020). [31] N. Marzari, A. A. Mostofi, J. R. Yates, I. Souza, and D. Vanderbilt, Rev. Mod. [Phys.](http://dx.doi.org/ 10.1103/RevModPhys.84.1419) 84, 1419 (2012). [32] I. Souza, N. Marzari, and D. Vanderbilt, Phys. Rev. B [65](http://dx.doi.org/10.1103/PhysRevB.65.035109), 035109 (2001). [33] F. Giustino, M. L. Cohen, and S. G. Louie, Phys. Rev. B [76](http://dx.doi.org/10.1103/PhysRevB.76.165108), 165108 (2007). [34] C. Verdi and F. Giustino, Phys. Rev. Lett. [115](http://dx.doi.org/10.1103/PhysRevLett.115.176401), 176401 (2015). [35] E. Blount (Academic Press, 1962) pp. 305–373. [36] R. Peierls, Annalen der [Physik](http://dx.doi.org/https://doi.org/10.1002/andp.19293950803) 395, 1055 (1929), [https://onlinelibrary.wiley.com/doi/pdf/10.1002/andp.19293950803.](http://arxiv.org/abs/https://onlinelibrary.wiley.com/doi/pdf/10.1002/andp.19293950803) [37] B. Liao, B. Qiu, J. Zhou, S. Huberman, K. Esfarjani, and G. Chen, Physical review letters 114, 115901 (2015). [38] J. Garg, N. Bonini, B. Kozinsky, and N. Marzari, Phys. Rev. Lett. [106](http://dx.doi.org/10.1103/PhysRevLett.106.045901), 045901 (2011). [39] J. Meija, T. B. Coplen, M. Berglund, W. A. Brand, P. D. Bièvre, M. Gröning, N. E. Holden, J. Irrgeher, R. D. Loss, T. Walczyk, and T. Prohaska, Pure and Applied [Chemistry](http://dx.doi.org/ doi:10.1515/pac-2015-0503) 88, 293 (2016). [40] M. Fiorentini and N. Bonini, Phys. Rev. B [94](http://dx.doi.org/10.1103/PhysRevB.94.085204), 085204 (2016). [41] A. Cepellotti and N. Marzari, Phys. Rev. X 6, 041013 (2016). [42] R. A. Guyer and J. A. Krumhansl, Phys. Rev. [148](http://dx.doi.org/10.1103/PhysRev.148.766), 766 (1966). [43] N. S. Fedorova, A. Cepellotti, and B. Kozinsky, “Anomalous thermoelectric transport phenomena from interband electron phonon scattering,” (2021), arXiv:2103.06558 [[cond-mat.mtrl-sci].](http://arxiv.org/abs/2103.06558) [44] B. Kozinsky and D. J. Singh, Annual Review of Materials Research 51, 565 (2021). [45] A. Cepellotti, G. Fugallo, L. Paulatto, M. Lazzeri, F. Mauri, and N. Marzari, Nat. Commun. 6, 6400 (2015). [46] G. Fugallo, A. Cepellotti, L. Paulatto, M. Lazzeri, N. Marzari, and F. Mauri, Nano Lett. [14](http://dx.doi.org/ 10.1021/nl502059f), 6109 (2014). [47] L. Lindsay, D. A. Broido, and N. Mingo, Phys. Rev. B [82](http://dx.doi.org/10.1103/PhysRevB.82.115427), 115427 (2010). [48] M. Omini and A. Sparavigna, Nuovo Cimento D 19, 1537 (1997). [49] M. Omini and A. Sparavigna, Phys. Rev. B [53](http://dx.doi.org/10.1103/PhysRevB.53.9064), 9064 (1996). [50] D. A. Broido, A. Ward, and N. Mingo, Phys. Rev. B [72](http://dx.doi.org/10.1103/PhysRevB.72.014308), 014308 (2005). [51] G. Fugallo, M. Lazzeri, L. Paulatto, and F. Mauri, Phys. Rev. B [88](http://dx.doi.org/10.1103/PhysRevB.88.045430), 045430 (2013). [52] R. J. Hardy, Phys. Rev. B [2](http://dx.doi.org/10.1103/PhysRevB.2.1193), 1193 (1970). [53] L. Chaput, Phys. Rev. Lett. [110](http://dx.doi.org/10.1103/PhysRevLett.110.265506), 265506 (2013). [54] M. Simoncelli, N. Marzari, and A. Cepellotti, Phys. Rev. X [10](http://dx.doi.org/10.1103/PhysRevX.10.011019), 011019 (2020). [55] G. Samsonidze and B. Kozinsky, Advanced Energy [Materials](http://dx.doi.org/https://doi.org/10.1002/aenm.201800246) 8, 1800246 (2018), [https://onlinelibrary.wiley.com/doi/pdf/10.1002/aenm.201800246.](http://arxiv.org/abs/https://onlinelibrary.wiley.com/doi/pdf/10.1002/aenm.201800246) [56] V. Vitale, G. Pizzi, A. Marrazzo, J. R. Yates, N. Marzari, and A. A. Mostofi, npj Computational Materials 6 (2020), [10.1038/s41524-020-0312-y.](http://dx.doi.org/ 10.1038/s41524-020-0312-y) [57] W. E. Pickett, H. Krakauer, and P. B. Allen, Phys. Rev. B [38](http://dx.doi.org/10.1103/PhysRevB.38.2721), 2721 (1988). [58] S. Bang, J. Kim, D. Wee, G. Samsonidze, and B. Kozinsky, Materials Today [Physics](http://dx.doi.org/ https://doi.org/10.1016/j.mtphys.2018.07.001) 6, 22 (2018). [59] M. Simoncelli, N. Marzari, and F. Mauri, Nature Physics 15, 809 (2019). [60] A. Cepellotti and B. Kozinsky, Materials Today [Physics](http://dx.doi.org/https://doi.org/10.1016/j.mtphys.2021.100412) 19, 100412 (2021). [61] J. R. Yates, X. Wang, D. Vanderbilt, and I. Souza, Phys. Rev. B [75](http://dx.doi.org/10.1103/PhysRevB.75.195121), 195121 (2007). [62] W. Li, N. Mingo, L. Lindsay, D. A. Broido, D. A. Stewart, and N. A. Katcho, Phys. Rev. B [85](http://dx.doi.org/ 10.1103/PhysRevB.85.195436), 195436 (2012). [63] P. E. Blöchl, O. Jepsen, and O. K. Andersen, Phys. Rev. B [49](http://dx.doi.org/10.1103/PhysRevB.49.16223), 16223 (1994). [64] H. Carter Edwards, C. R. Trott, and D. Sunderland, Journal of Parallel and [Distributed](http://dx.doi.org/10.1016/j.jpdc.2014.07.003) Computing 74 (2014), [10.1016/j.jpdc.2014.07.003.](http://dx.doi.org/10.1016/j.jpdc.2014.07.003) [65] P. Giannozzi, S. Baroni, N. Bonini, M. Calandra, R. Car, C. Cavazzoni, D. Ceresoli, G. L. Chiarotti, M. Cococcioni, I. Dabo, A. D. Corso, S. de Gironcoli, S. Fabris, G. Fratesi, R. Gebauer, U. Gerstmann, C. Gougoussis, A. Kokalj, M. Lazzeri, L. Martin-Samos, N. Marzari, F. Mauri, R. Mazzarello, S. Paolini, A. Pasquarello, L. Paulatto, C. Sbraccia, S. Scandolo, G. Sclauzero, A. P. Seitsonen, A. Smogunov, P. Umari, and R. M. Wentzcovitch, Journal of Physics: Condensed Matter 21, [395502](http://dx.doi.org/10.1088/0953-8984/21/39/395502) (2009). [66] D. Hamann, Physical Review B 88, 085117 (2013). [67] M. J. van Setten, M. Giantomassi, E. Bousquet, M. J. Verstraete, D. R. Hamann, X. Gonze, and G.-M. Rignanese, Computer Physics [Communications](https://doi.org/10.1016/j.cpc.2018.01.012) 226, 39 (2018). [68] J. P. Perdew and Y. Wang, Physical review B 45, 13244 (1992). [69] A. V. Inyushkin, A. Taldenkov, D. A. Chernodubov, V. V. Voronenkov, and Y. G. Shreter, Jetp Letters 112, 106 (2020). [70] W. Götz, N. Johnson, C. Chen, H. Liu, C. Kuo, and W. Imler, Applied Physics Letters 68, 3144 (1996). [71] I. Akasaki, H. Amano, Y. Koide, K. Hiramatsu, and N. Sawaki, Journal of crystal growth 98, 209 (1989). [72] M. Ilegems and H. Montgomery, Journal of Physics and Chemistry of Solids 34, 885 (1973). [73] G. Homm, P. Klar, J. Teubert, and W. Heimbrodt, Applied Physics Letters 93, 042107 (2008). [74] A. F. May, D. J. Singh, and G. J. Snyder, Phys. Rev. B [79](http://dx.doi.org/10.1103/PhysRevB.79.153101), 153101 (2009). [75] N. H. Protik and D. A. Broido, Phys. Rev. B [101](http://dx.doi.org/10.1103/PhysRevB.101.075202), 075202 (2020).

섹션 본문 189문단 · 82,779자

(제목 없음)

1Understanding the electrical and thermal transport properties of materials is critical to the design of all kinds of devices. Computational modeling nowadays allows for accurate in-silico predictions of materials properties, providing insights and guidelines for materials design. In order to accurately simulate materials transport properties, it is necessary to achieve an accurate description of electron and phonon properties, including the effect of interactions between carriers. While first-principles methods are capable of describing the microscopic properties of each carrier, using them to compute transport properties is still a formidable task, computationally demanding and memory intensive, as it requires carefully assembling all pieces of microscopic information to provide a picture of a macroscopic transport property. To address this challenge, we present a newly developed software package, Phoebe (a collection of PHOnon and Electron Boltzmann Equation solvers), which evaluates the effect of electron-phonon, phonon-phonon, boundary, and isotope scattering to predict the electron and phonon transport properties of materials. This open source C++ code combines MPI-OpenMP hybrid parallelization with GPU acceleration and distributed memory structures to manage computational cost, allowing Phoebe to effectively take advantage of contemporary computing infrastructures. Using this new framework, Phoebe can accurately and efficiently predict a wide range of transport properties such as the electrical, thermal conductivity, and thermoelectric performance, opening the way for the computational analysis of large and complex crystals. arXiv:2111.14999v1 [cond-mat.mtrl-sci] 29 Nov 2021

I. INTRODUCTION

2As technology use and its energy footprint continue to grow, so does the importance of improving the properties of the materials which underlie such technology. Materials transport properties, and in particular the capacity of a crystal to conduct heat and electricity, are an important set of materials characteristics, critical to the function of virtually any electronic device. These properties are determined by the traveling of electrons through a crystal lattice, the propagation of lattice vibrations, and the interactions between these excitations.

3The task of engineering better materials can be greatly accelerated through computational studies. In particular, the prediction of materials transport properties has reached great levels of accuracy in recent years, thanks to the combination of first-principles simulations and numerical Boltzmann Transport Equation (BTE) solvers, the former capable of accurately parametrizing the characteristics of crystal excitations and the latter providing macroscopic transport properties from microscopic data. Both components are still the subject of study and are continuously evolving, as there are several challenges, both technical and conceptual, behind both the calculation of the relevant microscopic interactions, as well as in increasing the sophistication at which the BTE can be solved. There are several projects actively implementing these simulation techniques in software packages, the challenge being to achieve the best possible accuracy at the smallest computational cost. Various existing BTE codes are currently available, including EPW [1], BoltzWann [2], PERTURBO [3], and BoltzTrap [4] for electronic properties, as well as phonopy/phono3py [5,6], ShengBTE [7], and ALAMODE [8] for the calculation of phonon transport. All of these have been used with various successes for the study of materials transport properties. The physics of heat and electricity conduction are intrinsically linked one to the other, and, as we will discuss in further detail, the electron and phonon BTE also share several common features. Despite the similarities, no currently developed software package is capable of describing both kinds of transport processes.

4Our vision behind the development of this new software was to take advantage of the affinity between thermal and electrical conduction to provide a single framework to fully characterize materials transport properties. In addition, we aimed not only to provide a tool for the prediction of materials transport properties; instead, we developed a package containing the abstraction and generic data structures needed to calculate conduction. In doing so, we created a flexible computational framework designed to easily accommodate extensions and improvements, as ongoing work in this field continues to reveal new and exciting developments. Lastly, we took note of the rapid evolution of computational hardware, in particular with respect to the rise of GPU accelerators and the increasingly heterogeneous architecture offerings of modern supercomputing facilities. As a result, we aspired to develop a new software which could run efficiently regardless of the available computing environment.

5Therefore, in this work we present the new open-source software package Phoebe -a suite of PHOnon and Electron Boltzmann Equation solvers -for the prediction of electron and phonon transport properties. Phoebe implements the construction and solution of the Boltzmann transport equation for crystals using a scattering matrix formalism that takes into account for electron-phonon, phonon-phonon, boundary, and phonon-isotope scattering contributions to transport properties. Phoebe interfaces with ab-initio codes to construct the BTE in a parameter-free approach, allowing for unbiased prediction of materials' transport properties. Additionally, Phoebe has been developed to tackle the intensive computational workload of ab-initio transport calculations in order to take advantage of contemporary supercomputing facilities. The package is written in object-oriented C++ and utilizes a hybrid MPI-OpenMP parallelization scheme, together with GPU acceleration, distributed memory data-structures, and parallel HDF5 input/output operations. We discuss the capability of Phoebe to scale over supercomputing hardware and to reduce the computational cost of the calculation with respect to other codes, streamlining the calculation of transport properties. Additionally, because of its flexible, object-oriented structure, Phoebe is designed for easy implementation of additional features, and the possibility of interfacing with additional ab-initio software. Going forward, we aim to expand the capabilities described here to include interfaces with additional ab-initio packages for the calculation of interaction matrix elements, more interacting quasiparticle properties, and further transport coefficients.

6We showcase Phoebe's capabilities with the calculations of the transport properties of GaN, a III-V semiconductor used for high-power electronics. After validating the results against experimental measurements, we argue that Phoebe is able to accurately and efficiently predict a wide range of material transport properties such as the electrical and thermal conductivity and thermoelectric performance in large and complex crystal structures.

II. FUNCTIONALITIES

7Phoebe is a software designed to characterize the transport properties of materials from first principles. In this article, we discuss the first release of Phoebe, which aims to provide the tools necessary for a complete study of electrical, thermal, and thermoelectric material properties in a single package. Phoebe interfaces with the output of ab-initio software and postprocesses it in order to predict transport properties. With Phoebe, it is possible to compute a wide range of properties, such as:

8• Wannier/Fourier interpolation of electron and phonon properties;

9• Electron and phonon BTE solvers, from relaxation time models to exact solutions;

10• Linewidths and lifetimes of electrons, limited by electron-phonon interaction and boundary scattering;

11• Linewidths and lifetimes of phonons, limited by three-phonon, isotope and boundary scattering;

12• Lattice thermal conductivity;

13• Electrical conductivity, mobility, thermal conductivity and Seebeck coefficient;

14• Phonon and electron viscosity;

15• Electron-phonon averaged approximation;

16• Wigner distribution description of electron and phonon transport;

17• Electron and phonon band-structure, density of states, and velocity operator; with more functionalities planned for future releases.

18Phoebe is made available freely on GitHub [9] under a permissive MIT open-source license, and has been written using object-oriented C++, with the intention of allowing future extensions and implementation of new features with minimal effort. We rely on a number of open-source libraries, including Eigen [10] for small linear algebra problems and ScaLAPACK [11] for massively parallel linear algebra problems, as well as Spglib [12] for analyzing symmetries, PugiXML [13] for reading XML files, and HighFive [14] to handle I/O based using HDF5 [15].

19Additionally, Phoebe has been written to take advantage of contemporary HPC infrastructure. Parallelization is achieved with hybrid MPI and OpenMP parallelization, while the most computationally expensive parts of the code are accelerated with Kokkos [16], allowing the use of GPU accelerators, if available. Finally, we take advantage of several GitHub functionalities, such as GitHub pages to create a static website for user accessing the code and GitHub Actions to perform a continuous integration. The documentation built with Doxygen [17] and Sphinx [18] is hosted online on Read The Docs [19].

III. METHODOLOGY

20In this section, we report a brief summary of the main algorithms implemented in Phoebe, and refer to external works for the details of the derivation and the physics behind the methodology.

A. Phonon Properties

21In several crystals, the motion of atoms is simply an oscillation around their equilibrium positions, and is thus described with the atomic displacements u(sαR), where R is the Bravais lattice vector labeling a unit cell, s is an index over the unit cell basis of atoms, and α is the Cartesian direction of the atomic displacement. To lowest orders in perturbation theory, the lattice potential energy is described with a Taylor expansion [20], where the first two important terms are the second derivative V (2) of the crystal energy with respect to atomic displacements

22and the third derivative V (3)

23while higher order derivatives are here neglected. These quantities can be computed using external ab-initio codes. In particular, Phoebe interfaces with phonopy/phono3py [5] and Quantum-ESPRESSO [21] for the calculation of the second derivative and with phono3py [6] and ShengBTE [22] for the calculation of the third derivative. These two tensors of derivatives allow the characterization of phonon properties and of their scattering mechanisms by means of a Fourier transform. For example, the Fourier transform of the second derivative tensor provides the dynamical matrix D defined as [23]

24where q is an arbitrary wavevector, and one Bravais lattice vector component of the second derivative V (2) has been set to a reference unit cell 0 without loss of generality thanks to the translational periodicity of the crystal. The phonon harmonic properties are then found by diagonalizing the dynamical matrix

25where ν is an eigenvalue index (i.e. the phonon branch),hω qν the phonon energy and z sα qν the phonon eigenvector. Polar corrections to the dynamical matrix are taken into account in Phoebe as explained in Ref. [23].

26The Fourier transform of the third derivative V (3) instead describes the coupling strength of a 3-phonon scattering event, and is computed as [24,25]

27where again one Bravais lattice vector component can be set to a reference unit cell 0 thanks to the translational periodicity.

28The equations 3 and 5 allow us to compute the phonon properties at arbitrary wavevectors, starting from the derivatives computed in real space that can be obtained from ab-initio codes. This interpolation procedure is a major computational bottleneck due to the large number of tensor indices and the fact that it needs to be computed for all wavevectors used to sample the Brillouin zone (BZ). As a result, it is critical to implement this interpolation procedure, in particular for the 3-phonon coupling strength, in the most efficient way possible, which will be discussed in Section IV E.

B. Electron Properties

29In order to compute electronic transport properties, it is necessary to characterize electrons and the electron-phonon interaction. Phoebe relies on an external ab-initio code to compute the electronic energies kb and wavefunctions |ψ kb , where k, the electron wavevector, and b, the band index, are Bloch quantum numbers (spin is omitted for simplicity), which represent eigenvalues/eigenstates of the electronic Hamiltonian

30Once the electronic wavefunction is known, it is possible to compute other properties such as the interaction of electrons with the lattice. The electron-phonon coupling g is defined as [26] g b bν (k, q) = 1 2mω qν

31and provides the coupling strength of the interaction between two electrons and a phonon, and g 0 is introduced for later convenience (as it's a quantity smoother to interpolate than g), and ∂ qν V is the potential originating in response to the perturbation of the lattice with the ionic displacements of a phonon mode qν.

32For the first release of Phoebe we interface with Quantum-ESPRESSO [21] in order to obtain values of the electronic energies and the electron-phonon coupling. In principle, ab-initio codes can directly compute electronic properties at any wavevector k. However, the calculation of transport properties requires extremely accurate sampling of k throughout the Brillouin zone, making a direct first-principles calculation unfeasible in most cases. To circumvent this issue, transport calculations typically adopt an interpolation scheme, in which Quantum-ESPRESSO computes electronic properties on a coarse grid of wavevectors, {k co }, and Phoebe interpolates these properties to an arbitrary fine mesh of wavevectors {k f i }.

33We implemented the Wannier interpolation technique, interfacing Phoebe with Wannier90 [27], which provides the construction of the maximally-localized Wannier-function (MLWF) [28,29]. To briefly explain the MLWF procedure, we first note that the wavefunction |ψ kb is not unique, as it has a gauge degree of freedom: the wavefunction can be multiplied by an arbitrary factor e iφ(k,b) . Since the phase φ(k, b), for our practical purposes, is the result of the numerical diagonalization of a Hamiltonian matrix, it can be assumed to be random, and as a result the wavefunction does not vary smoothly with k. The MLWF procedure consists in finding a gauge that makes the wavefunction smooth -phase factors included -across the BZ. The Wannier function |mR computed by Wannier90 is defined as

34where m is a Wannier function index, and the rotation matrix U is found by Wannier90 as the matrix that smoothens the wavefunction in reciprocal space. The interpolation of electronic energies proceeds as follows from Ref. [29]: we can first compute the Hamiltonian matrix in the basis of Wannier functions 0n|H|Rm as

35where N k is the total number of wavevectors in the coarse grid {k co }. From the Hamiltonian in the Wannier representation, we interpolate electronic energies at any arbitrary wavevector k by computing a Fourier back-transform

36followed by a diagonalization of the resulting matrix

37which provides an interpolation of the electronic energies kb and rotation matrix U k at any desired wavevector. The electron-phonon coupling can be interpolated in a conceptually similar way to the electronic energies. Following the approach of Ref. [30], we first note that the tensor g 0 is smoother than g (as defined in Eq. 7) and thus more suitable for an interpolation algorithm. The tensor g 0 (k co , q co ) (with band indices omitted for simplicity) is computed by Quantum-ESPRESSO on a coarse grid of wavevectors and is then transformed by Phoebe to the Wannier representation as

38where N q is the number of phonon wavevectors in the coarse sampling, z is the phonon eigenvector introduced in Eq. 4, and R e (R p ) is the set of Bravais lattice vectors associated to the electron (phonon) Fourier transform of the set {k co } ({q co }). Once this transformation is performed, the electron-phonon coupling tensor is finally interpolated to arbitrary wavevectors k and q as

39where the U and z matrices at the interpolating wavevectors can be found by constructing the dynamical matrix at the desired q wavevector and by interpolating the electronic energy at wavevector k. As a result of this interpolation procedure, one can accurately sample the the electron-phonon coupling over the BZ and compute transport properties.

40As for the interpolation of the three-phonon coupling, the interpolation of the electron-phonon coupling is a computationally expensive effort due to the large number of indices and the sheer number of interpolating wavevectors. The implementation of the coupling interpolation for both electron-phonon and three-phonon coupling will be discussed together in detail in Section IV E, as Eq. 5 and Eq. 13 are similar from a mathematical point of view.

41Finally, polar corrections to the electron-phonon coupling are implemented in Phoebe following the procedure outlined in Ref. [31]. The coupling is decomposed into short-and long-range contributions,

42where the long-range contribution is given by

43and the short-range contribution is calculated on the coarse grid by subtracting the long-range term from the total electron-phonon coupling calculated by the ab-initio code. Here, Z * s is the Born effective charge tensor of atom s, and 0 and ∞ are the low-and high-frequency permittivities. Note that all factors except the overlap only depend on the single point q. We therefore precompute all of these factors before the scattering matrix calculation, leaving only multiplication by the overlap for the expensive double loop over k and q.

C. Velocity

44Transport properties require knowledge of the velocity operator, which characterizes the diffusion velocity of a single heat or charge carrier. For charge carriers, we compute the matrix elements of the velocity operator v as the derivative with respect to the wavevector of the non-interacting Hamiltonian [32] v αk,bb =

45where H W is the Hamiltonian matrix in the Bloch representation computed at k with the Wannier interpolation technique described above, and δ α is a small displacement vector along Cartesian direction α. If the eigenvalue kb is non-degenerate, the diagonal matrix element v αk,bb represents the electronic group velocity. However if kb is a degenerate eigenvalue, we cannot readily identify the velocity matrix element v αk,bb with the group velocity: in this case, we select the degenerate subspace of the matrix v αk and diagonalize it. After this subspace diagonalization, the new diagonal matrix elements represent the group velocity of the degenerate state. The definition of the phonon velocity is extremely similar (to the point that we use the same code for both). Simply, the matrix H is replaced with the square root of the dynamical matrix D q and the rotation matrix U is replaced with the phonon eigenvector z [24].

D. Phonon Boltzmann Transport Equation

46Given the microscopic quantities discussed in the previous sections, we can discuss now how to obtain the lattice thermal conductivity. In Phoebe, we describe lattice thermal transport with the phonon Boltzmann transport equation (BTE). This semiclassical model describes the motion of a phonon (wavepacket) through the crystal. A phonon state (q, ν) at thermal equilibrium is populated withn qν phonon quanta, wheren qν = 1/(eh ωqν /k B T − 1) is the Bose-Einstein distribution. The application of a thermal gradient ∇T to the crystal forces the system out-of-equilibrium, so that each phonon state is then populated with an out-of-equilibrium population n qν . The phonon BTE provides a way to find such out-of-equilibrium population and consists of a balance between two terms:

47The left-hand side is the diffusion operator, and describes the phonon drift in presence of a thermal gradient ∇T , while the right-hand side describes how scattering changes the population number of a phonon state. Here, V is the crystal unit cell volume, Ω qq νν is the scattering matrix and δn qν = n qν −n qν is the deviation from equilibrium population. For computational convenience, we also work with a rescaled scattering matrix A defined as A qq νν = 1 √n qν (nqν +1)n q ν (n q ν +1) Ω qq νν . In Phoebe, the phonon scattering matrix is built taking into account the three-phonon interaction, phonon-isotope and phonon-boundary scattering [24] as

48where we introduced the three-phonon scattering rates for coalescence events as

49while the scattering rate for phonon decay is

50where G is a reciprocal lattice vector, N q is a normalization number of phonon wavevectors, and V (3) (qν, q ν , q ν ) is the three-phonon coupling strength. Additionally, the scattering rate for phonon-isotope scattering is [33] P isot qν,q ν = π 2N q ω qν ω q ν n qνnq ν +n qν +n q ν 2

51where the coupling strength g isot s depends on the variance of masses as

52where m is is the atomic mass of atom of species s and isotope i, f is is the abundance of the isotope (which by default is set to natural abundances [34]) and m s is the average atomic mass. Finally, the boundary scattering rate is described with the term

53where L is the user-specified macroscopic crystal size. Using the first-principles phonon properties discussed in Section III A it is possible to construct the phonon BTE and in particular the scattering matrix. We will later discuss how to solve both the electron and phonon BTEs to obtain the out-of-equilibrium population n qν . Assuming that n qν is found, the thermal conductivity tensor k αβ is computed as

54where v αqν is the phonon group velocity.

E. Electron Boltzmann Transport Equation

55The semiclassical description of electron transport shares several similarities with the phonon transport theory. In the phonon case, we solved for out-of-equilibrium phonon populations. Now, for the case of electron transport, we deal with the problem of finding the out-of-equilibrium occupation number of a charge carrier. At equilibrium, an electronic state (k, b) is occupied according to the Fermi-Dirac distribution f kb = 1/(e kb /k B T −µ − 1), where µ is the chemical potential and kb is the electronic energy. When we apply a thermal gradient to a material, we can expect to induce the diffusion of carriers just as in the phonon case, resulting in an out-of-equilibrium population f kb . However, each carrier also possesses a charge e, and therefore can diffuse also when an external electric field E is applied to the material. As we are only concerned with the linear response to the perturbation induced by the thermal gradient or the electric field, the electronic BTE consists of two separate problems for the two different perturbations E and ∇T . The BTE describing the response to an electric field in direction α is

56where δf kb = f kb −f kb is the deviation from the equilibrium population, v αkb is the electronic group velocity in direction α, and A is the electronic scattering matrix. The BTE describing the response to a thermal gradient perturbation closely resembles the phonon case and is

57When taking the electron-phonon scattering into account, the scattering matrix A can be computed as [35] A

58where g bb ν (k, k ) is the coupling strength of the electron-phonon interaction. Electron scattering against surfaces or boundaries can be taken into account by adding to A a term of the form v αkb L δ k,k δ bb , where L is a characteristic length.

59The solution to the electronic BTE is discussed in the next section. Solving the BTE provides a way of calculating the linear response of the electronic out-of-equilibrium population in response to an electric field δf Eα or a thermal gradient δf T α in direction α, defined as δf αkb = δf Eα E α and δf αkb = δf T α ∇ α T respectively. These perturbations induce both a charge flux J and an energy flux Q defined as

60These fluxes can be compared with the Onsager relations

61from which we can define and compute the electronic transport coefficients, such as the electrical conductivity σ

62and electronic thermal conductivity k

63With these definitions, we are finally ready to predict the thermal and electronic transport properties of crystals.

F. BTE Solvers

64The similarity between electron and phonon BTEs allows us to readily implement solvers which can be applied generically to either the electron or phonon cases. We first look for a solution that is linear in the external perturbation of the system, i.e. an out-of-equilibrium population in the form f λ → f λ E or f λ → f λ ∇T , with λ an index running on the relevant Bloch-state indices (phonon or electron indices). Under this linear approximation, we write the BTE (Eqs. 17 25 and 26) in the more concise form of a linear algebra problem

65where b is the diffusion term, A is the scattering matrix, all chosen appropriately according to the transport problem under consideration (Eqs. 17, 25 or 26). On the surface, the BTE appears as a trivial linear algebra problem; however, there are several complexities which arise when solving the BTE. First, the scattering matrix is not invertible [36] due to the presence of zero-valued eigenvalues (arising from the property of energy conservation and/or charge conservation). It is thus not possible to directly invert the scattering matrix to solve the problem. The second challenge lies in the sheer size of the problem: in order to obtain converged results, the summation over the Brillouin zone (λ includes a wavevector index) must be performed for an extremely fine mesh of wavevectors. It is not uncommon to use more than 10 5 wavevectors. Therefore, Phoebe contains a number of different solvers which operate at various levels of complexity and computational cost, each with distinct advantages and disadvantages, and let the user decide which one is the best suited for a particular material.

Constant Relaxation Time Approximation

66The constant relaxation time approximation (CRTA) is a rudimentary, approximate solution to the BTE. In this case, the scattering matrix is replaced with a single scalar

67where τ is a user-specified constant relaxation time. Most of the complexity of the BTE is removed and the BTE is readily solved with the out-of-equilibrium population f λ ≈ τ b λ . The CRTA may provide reasonable results for the Seebeck coefficient, as this often has a weak dependence on the scattering properties, and may be used for fast estimates of other transport properties. However, the choice of τ is largely arbitrary and in many crystals a more detailed description of scattering processes must be included to accurately predict transport properties.

Relaxation Time Approximation

68The relaxation time approximation (RTA) is another approximate solution to the BTE, in which only the diagonal elements of the scattering matrix are retained so that

69where τ λ is a carrier's lifetime, and the off-diagonal matrix elements are neglected. Specifically, the electronic lifetime is defined as A kbk b = 1 τ kb , while for phonons the lifetime is Ω qνqν = 1 τqν . With this approximation, the out-of-equilibrium population is readily found as f λ ≈ b λ τ λ . The RTA is a fast and memory-efficient BTE solver, and can be used when more accurate solvers become prohibitively expensive. For electronic transport, it often shows good agreement with more accurate solvers. On the other hand, there are reported cases for which this approximation has failed, particularly for materials where the conservation of crystal momentum is of the utmost relevance [37][38][39]. In such case, one must consider solvers that utilize the complete scattering matrix.

Iterative solver

70The iterative BTE solver [40][41][42] constructs the out-of-equilibrium populations with a geometric series. First, we decompose the scattering matrix into its diagonal terms A out and off-diagonal components A in . A solution is found by iteratively correcting the RTA solution, b A out = bτ , as

71where j is an iteration index that can be stopped when transport coefficients are converged. Note also that because A out is a diagonal matrix, its inverse is trivially constructed. Additionally, we implemented symmetries in this solver to further accelerate simulations (see Section III K below). However, it's worth pointing out that the iterative solver can only converge as a geometric series, i.e. only if the absolute value of the determinant | det( 1 A out A in )| is smaller than 1. If the convergence criterion is not satisfied, the algorithm may diverge after a few iterations. The iterative method can be used both by opting to store the scattering matrix in memory, which allows a fast solution once the scattering matrix is built but at the expense of a large usage of memory, or not storing A in memory, so that we lower memory requirements but require to compute the action of the scattering matrix A · f several times.

Variational solver

72The variational BTE solver [35,43] takes advantage of the following quadratic functional of the population f

73Since the scattering matrix is semi-positive definite [35,43,44] (a property related to the ever increasing value of entropy [20]), the functional F has a single minimum which coincides with the solution of the BTE. In Phoebe, we implemented a conjugate gradient algorithm [43] that minimizes the functional F and finds the exact solution to the BTE. In contrast to the iterative solver, the variational solver is guaranteed to converge to the solution provided that the scattering matrix is semi-positive definite. Like the iterative solver, the user can choose to store the matrix in memory to quickly build the solution, or not, so that the solution is found more slowly but with smaller memory requirements.

Relaxons

74The last solver is based on a direct diagonalization of the BTE [45,46]. The scattering matrix is diagonalized with a ScaLAPACK solver and we compute the complete set of eigenvalues and eigenvectors

75where α is an eigenvalue index, τ α is the inverse eigenvalue and θ α λ the eigenvector. Thanks to the completeness of the basis set of eigenvectors, we expand the out-of-equilibrium population as

76where we introduced auxiliary coefficients f α . Next, we write the BTE in the eigenvector (relaxons) basis as

77and note that in this form we can analytically solve the BTE by substituting f α = τ α λ b λ θ α λ in Eq. 41. This last solver has the benefit of always providing the exact solution, as it's not based on any iterative scheme and therefore has none of the related numerical instabilities. Furthermore, this analytical solution to the BTE allows for further physical insights, such as the calculation of viscosity [47] (see Section III H). On the other hand, this solver has the longest time-to-solution and may not suitable for rapid calculations of transport properties.

G. Electron-Phonon Averaged approximation

78The Electron Phonon Average (EPA) approximation is another approximation for the calculation of electronic transport properties. Although the Wannier function technique discussed in Section III B provides an accurate interpolation of the electronic properties, the construction of the MLWF is a challenging task, not yet fully automated (progress is being made in this direction [48]), and therefore is not always suitable for materials studies. EPA provides a way to estimate transport properties without Wannier functions, making it a much faster and automatable method suitable for materials screening applications.

79Consider a set of electronic energies (k co ) (at fixed band index) computed by a first-principles code on a coarse grid of wavevectors in the BZ. To interpolate the energies, we implemented a plane-wave based interpolation method [49], which fits an electronic band with the periodic functioñ

80where R m is a set of m = 0, 1, . . . , M − 1 Bravais lattice vectors chosen as all R m such that |R m | < R cut , where R cut is a user-specified parameter, and c m is an expansion coefficient. The expansion coefficient are found by optimizing a target error function against a set of training points. Further details can be found in Ref. [49]. This technique doesn't involve Wannier functions and is thus simpler to initialize. The drawback, compared to the Wannier interpolation, is that it requires a denser sampling of wavevectors {k co } in order to obtain a good interpolation quality and converged transport results. The next component of the EPA approach is a scheme for estimating the electron-phonon coupling. The idea underlying the EPA method is to replace integrations of the BZ with integrations over the quasiparticle energies, simplifying some of the microscopic details of electronic transport to gain computational performance. The electronphonon coupling is approximated as

81which replaces a 6-dimensional wavevector dependence on k and q with a 2-dimensional dependence on electronic energies. Additionally, as g has a weak energy dependence, it is possible to sample g 2 with just a few values of energies. There are several ways to construct the function g 2 [50] and in Phoebe we implemented the moving-least-squares (MLS) method [51], which constructs g 2 by minimizing the integral

82where σ gauss is a user-specified smoothing scale parameter. The energy dependence on 1 and 2 is implemented numerically with a user-specified uniform sampling of an energy interval. Once the coupling is constructed, the energy-dependent electronic lifetime is calculated as

83Nq q ω qν is the average phonon frequency of the phonon branch ν, f and n are energy-dependent Fermi-Dirac and Bose-Einstein distributions respectively, ρ is the electronic density of states, and g s is the spin-multiplicity (equal to 2 for non spin-polarized crystals).

84Using this lifetime, the BTE is readily solved at the relaxation time approximation level, and it is possible to evaluate the electronic transport coefficients using an energy-dependent approximation for Eqs. 32, 33, 34, as discussed in greater details in Ref. [50]. Typically, the computational bottleneck for this method in Phoebe is the construction of the electronic DoS, which simply has a cost linear in the number of wavevectors used to sample the BZ.

H. Viscosity

85In some materials with large conductivities, transport doesn't follow the conventional macroscopic diffusion equations such as Fourier's law for heat or Ohm's law for charge currents. Recent studies highlighted the necessity to complement conventional transport coefficients such as conductivity with hydrodynamic transport coefficients such as viscosity. In Phoebe, we implemented the phonon viscosity as described in Ref. [47], which is defined from the response coefficient η

86where i, j, k, l are Cartesian indices, u is the phonon drift velocity in direction k, r is the position, and Π is the crystal momentum flux Π ij = 1

87Nq qνh q i δn D,j qν , where δn D,j qν is the out-of-equilibrium phonon population in response to a perturbation of the drift velocity u j . The out-of-equilibrium population can be found solving a modified version of the BTE, as reported in full details in Ref. [47]. Finally, the phonon viscosity µ is found by symmetrizing η as

88The phonon viscosity can be used to parametrize a generalization of the Fourier's law for describing heat transport. In Phoebe, we also implemented the analogous expression for electronic viscosity, which is readily obtained by replacing phonon properties such as group velocity, equilibrium distribution and lifetimes with their electronic counterparts.

I. Transport with the Wigner distribution

89There have been some recent developments in the description of transport using the Wigner distribution. In crystals where several carriers' energies overlap with each other, it is possible to observe important contributions to transport that are not described by the BTE, for both electron and phonon transport. This is relevant for example in disordered systems [52] or narrow-gap semiconductors [53]. In Phoebe, we implemented the transport equation for the phonon Wigner distribution N , which is

90where where ∂N (r,k,t)

91∂t coll is the phonon scattering operator, Ω(q) is a matrix of energies with elements Ω νν (q) = δ νν qν ,

92[, ] is a commutator and {, } an anticommutator. The electronic version of the Wigner transport equation is

93where ∂F (r,k,t)

94∂t coll is the electron scattering operator, (k) is a matrix of energies with elements bb (k) = δ bb kb , and d bb (k) is the electronic dipole [53]. Further details behind these methods are described in Refs. [52,53]. Here we just mention that the diagonal elements of these equations coincide with the electron and phonon BTE discussed previously, and that results for transport coefficients can be interpreted as corrections to the BTE predictions. Furthermore, these Wigner corrections to the BTE transport coefficients only depend on the carriers lifetimes. Because these quantities are already computed when constructing the scattering operator for the BTE, the computational cost of the Wigner corrections is negligible compared to the cost of constructing and solving the BTE.

J. Dirac delta

95The calculation of materials properties such as scattering rates often requires a numerical approximation of the Dirac-delta function, for example, the density of states (DOS)

96In Phoebe, we offer three different schemes for the numerical approximation of the Dirac-delta for the user to choose from:

971. Gaussian broadening: the Dirac-delta is replaced with a Gaussian function

98where σ is a user-specified broadening parameter. This method is simple and fast, but requires the user to converge results with respect to σ in conjunction with the number of wavevectors used for the BZ integration.

992. Adaptive Gaussian broadening: the Gaussian broadening parameter σ introduced above can be approximated [54,55] as

100where C is the matrix describing the crystal lattice vectors, N β is the size of the Monkhorst-Pack mesh in crystal direction β, and the parameter A is a prefactor that can be fixed to 1 [55]. As this method self-adjusts σ with respect to the chosen BZ sampling and the local derivative of the carrier's energy, it tends to provide easier-to-converge results than the fixed-broadening Gaussian scheme.

1013. Tetrahedron method : discussed in Ref. [56], this method provides a parameter-free linear approximation of the integrand. For simplicity, the tetrahedron method is currently implemented only for the calculation of the DoS. The method is accurate and parameter-free, although considerably slower than the alternatives.

K. Symmetries

102A crystal is characterized by a set of symmetries S, each symmetry consisting of a rotation R and a fractional translation S = {R, t} such that the application of a translation and a rotation to the atomic positions leaves the crystal overall unchanged. In reciprocal space, symmetries ensure that a point in the BZ can be mapped to another symmetry-equivalent point. Rather than working with a set of wavevectors {k} that uniformly samples the BZ, we can select a subset of irreducible wavevectors {k * }, such that the complete set of wavevectors can be obtained by applying rotations on the irreducible wavevectors set k = Rk * . As a result, integrations over the BZ can be sped up by restricting the integration to the irreducible wedge of the BZ.

103We recall here that microscopic carrier properties also obey symmetry relations. For example, scalars such as the carriers energy or lifetimes are left invariant by symmetry operations between an irreducible point k * and its symmetry equivalent point k = Rk * [46]

104and

105Instead, the group velocity transforms like a vector as

106and similarly, the out-of-equilibrium population [46] transform as

107As a result, the calculation of several properties can be restricted to the irreducible wedge of the BZ, for example when computing the DoS, or solving the BTE at the RTA level.

108The relaxation time solvers of the BTE support symmetries, while the only exact solver that supports symmetries in Phoebe is the iterative one (see Section III F 3). In fact, the BTE for an irreducible point k * (omitting band indices for simplicity) is

109where we used the symmetry properties of the out-of-equilibrium population, andà is a tensor describing the scattering properties limited to the irreducible BZ wedge. As a result of symmetries, the BTE's linear algebra problem can be solved with a much smaller number of Bloch states, and thus with a better computational efficiency.

IV. SOFTWARE

110Phoebe is written in C++ following an object-oriented paradigm. Since Phoebe computes a range of extremely different physical properties, each of these properties are organized in Apps. A main function simply initializes global properties (such as starting the MPI or Kokkos environments), reads the user input and launches the appropriate App through a class factory. Currently, Phoebe offers the following Apps:

111• ElectronWannierBandsApp, ElectronFourierBandsApp, PhononBandsApp: calculation of electron or phonon energies along a BZ path;

112• ElectronWannierDosApp, ElectronFourierDosApp, PhononDosApp: calculation of electron or phonon DOS;

113• ElPhQeToPhoebeApp: processing of the electron-phonon coupling from Quantum-ESPRESSO to a Phoebe format. An EPA processing computes the electron-phonon averaged coupling, while the Wannier processing transforms the coupling to its real-space Wannier representation;

114• ElectronLifetimesApp and PhononLifetimesApp: calculation of carriers' lifetimes along a BZ path;

115• ElectronWannierTransportApp: calculation of electronic transport coefficients with Wannier interpolation method;

116• TransportEpaApp: calculation of electronic transport coefficients with the EPA approximation;

117• PhononTransportApp: evaluation of phonon transport properties.

118The physical properties computed by these Apps are either printed to standard output or written to JSON files for user's convenience. We also provide a few Python scripts to generate some of the most common plots of physical properties. Each App uses a number of classes built to reduce code duplication and to provide convenient data structures. In fact, a central goal of the project is to guarantee a simple deployment of methods and algorithms for future releases. The most important among the several classes available are • Crystal: description of the crystal unit cell and crystal symmetries;

119• Points: handling of wavevectors in the BZ;

120• HarmonicHamiltonian: base class for the calculation of non-interacting carriers properties; subclassed into PhononH0, ElectronH0Wannier and ElectronH0Fourier for evaluating phonon properties, Wannier-and Fourierinterpolated electron properties respectively;

121• BandStructure: storage of carriers' energies, velocities and eigenvectors;

122• Context: description of user input variables;

123• MPIcontroller: wrapper for calls to MPI functions;

124• Matrix: storage of MPI-distributed matrices and a wrapper to ScaLAPACK subroutines;

125• StatisticsSweep: calculation and description of values for temperature, chemical potentials and carrier concentrations;

126• Interaction: base class for the evaluation of the scattering coupling strength. Its subclasses describe the three-phonon interaction, electron-phonon coupling with Wannier interpolation and the EPA coupling;

127• ScatteringMatrix: base class for the calculation, storage and manipulation of the electron or phonon scattering matrix;

128• VectorBTE: data structure for storage and manipulation of the out-of-equilibrium population;

129• Observable: base class of a number of classes for evaluating transport coefficients.

130In the following we will discuss some of these classes in greater detail.

A. Points class

131The Points class in Phoebe manages the wavevectors used to sample the BZ. We defined two constructors, one for instantiating a class for uniform sampling of the BZ and another for paths of wavevectors in the BZ. When uniformly sampling the BZ with a Monkhorst-Pack grid, the complete list of points (wavevectors) is not explicitly stored for memory management convenience. This implicit list contains points sorted by their coordinates (incrementing the coordinates z, y and x in this order). When describing BZ paths instead points are not sorted and their coordinates are explicitly stored in a list. Points are internally manipulated in crystal coordinates (i.e. in scaled lattice vectors units), and we provide options to output points in Cartesian coordinates or to fold them in the first BZ.

132In the Points class we implemented the logic for reducing a set of wavevectors to the set of symmetry-irreducible wavevectors in the BZ. The class method setIrreduciblePoints(), takes the set of crystal symmetries (from the Crystal class) and finds the list of irreducible BZ points, i.e. finds the irreducible set of points k * such that all remaining points k can be found applying a rotation R to k * .

133It's worth noting that symmetry operations are not unique, so that a symmetry operation may rotate a wavevector correctly as k = Rk * but other quantities such as the group velocity may not be rotated correctly v(k) = Rv(k * ). Since the carrier populations transform like group velocities, the method setIrreduciblePoints() can optionally find a set of symmetries that rotate both points and velocities.

134The Points class also has a setActiveLayer() method that allows discarding some points that don't provide a sizeable contribution to a physical observable, a functionality that will be explained in Section IV B in conjunction with the ActiveBandStructure class. After a call to this method, the functionalities in this class operate as if only the restricted set of points are present in the class.

135Finally, several other parts of the code require the lookup of a wavevector in the list of points and, due to the large number of points used to sample the BZ (often in the excess of 10 4 ), this search operation can take a substantial part of the calculation if not implemented effectively. If Points describes a uniform BZ sampling with a complete Monkhorst-Pack grid, the point search in the list can be done in o(0) operations, taking advantage of the implicit ordering of points. If the list of points is sorted (e.g. after a call to setActiveLayer()) the lookup operation can be done with a binary search algorithm, which scales logarithmically with the number of points. Only if points are not sorted (e.g. when they describe a BZ path), the point search is made with a slow element-by-element comparison.

B. Band structure classes

136We developed a data-structure dedicated to the storage of the band structure, that is, the energies ( kb andhω qν ), eigenvectors (U kmb and z sα qν ) and velocities (v αkbb and v αqνν ) of carriers over the BZ, which are needed to integrate several materials properties.

137To handle this information, we defined two classes: FullBandStructure and ActiveBandStructure. Both classes take a Points instance as input, since Points defines the set of wavevectors k over which the carriers' properties are computed. While both classes store the band structure, there is an important difference. The FullBandStructure class stores energies, eigenvectors and velocities for all wavevectors defined in the Points instance. For example, given N k points and N b electronic bands, FullBandStructure stores the complete list of N k × N b values of e.g. energies kb (and similar for eigenvectors or velocities). Since wavevector meshes can be extremely large, carriers properties can optionally be stored in a MPI-distributed fashion, using the Matrix class described in Section IV C.

138ActiveBandStructure contains similar functionalities of FullBandStructure in that it stores information of carriers properties (in fact they share the same virtual parent class). However, the constructor of this class discards some Bloch states (kb) that don't contribute significantly to the calculation of transport properties. Because transport properties at finite temperature only depend on electron (phonon) states that are thermally excited, there are many states which do not contribute and are readily discarded to save computational resources. For example, only long-wavelength acoustic phonon states contribute to transport at low temperatures T as their excitation energy goes to 0 with T . Similarly, only electrons with energy close to the chemical potential µ contribute to charge currents and thus we can restrict calculations to electronic states such that | kb − µ| is smaller than a few k B T . As a result, states that are not thermally excited can be discarded, and in Phoebe we term this Bloch state filtering procedure as a "window".

139In Phoebe, we implemented two kinds of windows. The first window type imposes an energy cutoff and discards all Bloch states with energy larger than a user-specified cutoff cutoff : for phonons we retain states such that |hω qν | < cutoff and for electrons | qν − µ| < cutoff . However, this kind of window is impractical, as the cutoff is temperature dependent and, in practice, a user would need to perform a convergence test on cutoff .

140We implemented a second window type, noting that transport coefficients contain terms of the formf kb (1 −f kb ) for electrons orn kb (1 +n kb ) for phonons (which arise from the energy or temperature derivative of equilibrium distributions). For both carriers, these terms decay exponentially to zero if the carrier's energy is much larger than k B T , thus suppressing contributions of high-energy carriers to transport properties. We therefore define a "population window" by retaining only states such that, for electrons

141or for phononsn

142where δ is a small number. Since the temperature dependence is inside the definition of Bose-Einstein and Fermi-Dirac distributions, we found that δ can be hard-coded to a fixed value and that transport properties are not affected. In this way, we achieve a reduction in the number of Bloch states used in the various calculations, and avoid the introduction of an additional parameter to be converged, for greater user convenience. As a result of this filtering procedures, the number of electron bands N b or phonon branches N ν is no longer a constant but depends on the wavevector index. As a result, quantities like the electronic energy kb cannot be stored as a matrix of size N k × N b . Instead, energies are stored as a flattened vector, and we provide class methods to access energies through Bloch state indices. A similar strategy is adopted for storing phonon properties, as well as eigenvectors or velocities.

C. Matrix

143As described in Sections III D, III E, the BTE is a linear algebra problem and due to the number of Bloch states involved, requires distributed matrices and parallel linear algebra operations. In order to perform these massively parallel dense linear algebra operations, we utilize the ScaLAPACK library [11]. In order to both avoid explicit calls to this library in the main body of code and to allow future flexibility should we desire to swap ScaLAPACK routines with those of a different library, we developed the Matrix class as a wrapper to this library.

144Because ScaLAPACK is mostly built in Fortran and C languages, it follows an imperative procedural programming paradigm, i.e. a set of routines that must be called in the right order, resulting in a departure from the objectoriented programming style adopted in the rest of Phoebe. The Matrix class has therefore been designed to map this procedural-style library into an object-oriented style. Therefore, the class constructor takes care of ScaLAPACK initializations, such as starting the BLACS environment and allocating the memory locations, while deallocations take place in the class destructor. Various class methods have been implemented to provide wrappers around the needed linear algebra operations, such as matrix-matrix multiplication and matrix diagonalization, with the benefit of hiding within the class method all the necessary auxiliary calls (such as temporary memory allocations or index mappings) in order to call use the ScaLAPACK library. As a result, the rest of Phoebe's code can act on distributed memory with a simplified interface that doesn't obfuscate the main body of the transport code.

145C++ class templates further allow us to generalize the class to store different data-types (in particular, real and complex floating point values). We also allow the code to be compiled without the ScaLAPACK or MPI libraries. In this case, the Matrix class falls back to a "serial matrix" which relies on the Eigen library, losing all MPI-parallel characteristics (therefore becoming mostly suitable for debugging purposes).

D. Scattering Matrix

146The ScatteringMatrix class, as the name suggest, implements operations related to BTE's scattering operator.

147A key challenge in developing this class has been to try generalize this code to achieve different purposes. In order to implement the calculation of scattering rates, we defined ScatteringMatrix as a virtual base class that defines a virtual method builder(); the method is implemented in the subclasses PhononScatteringMatrix and ElectronScatteringMatrix and evaluates Eqs. 27 or 18. In this way, auxiliary methods such as the calculation of a matrix-vector product or the scattering matrix diagonalization can be defined directly in the base class and are shared by the two different carriers.

148The scattering matrix has a few modes of operation. If the BTE is to be solved only at the RTA level, only the calculation of lifetimes is performed by the class instance. For exact BTE solutions, for which the full scattering matrix must be dealt with, we distinguish two cases: first, when the complete scattering matrix is stored in memory or alternatively, when only the product of the scattering matrix on a population vector is computed (without the need of saving the matrix in memory). In the former case, the calculation has a larger memory requirement, however, this allows to quickly solve the BTE. In the latter case, the memory footprint of the calculation is reduced, but as a drawback each iteration of a BTE solver will require more computational time. We thus let the user choose the desired memory impact, which will depend on both the material studied and on the available hardware. To summarize, the builder() method, depending on the input, is tasked with computing 1) the carriers' lifetimes, 2) the scattering matrix or 3) its action on a vector. Note that due to the size of the scattering matrix A νν , it is stored as a class member using an MPI-distributed Matrix instance.

149Great care has been taken to optimize the efficiency of the scattering rate calculations implemented in builder, as these are some of the most computationally intensive functions in the code. Significant improvements to the calculation speed have been achieved by precomputing all independent particle properties whenever possible. Additionally, we used MPI parallelization to accelerate loops over k and k wavevectors, while other loops over band indices are accelerated with OpenMP parallelization. The calculation of the interaction coupling strength and its GPU acceleration is described in the next section.

E. Kokkos (Interaction)

150In Phoebe, great care has been taken to accelerate the calculation of interaction matrix elements and scattering rates. The calculation of the scattering coupling strength for either three phonon and electron-phonon scattering in reciprocal space, f αβγ (k, k ), starting from a real-space representation, g abc (R, R ), is obtained with a tensor operation in the form

151where U are rectangular matrices indicating Wannier rotation matrices or phonon eigenvectors, a, b and c are indices labeling Wannier functions or atomic displacements, α, β and γ are Bloch band indices, k is a wavevector, and R is a Bravais lattice vector. In order to maximise performance, we first note that this expression typically appears inside a double loop on k and k . Therefore, if k is the outer loop, it is convenient to precompute the quantitỹ

152at fixed value of k, and then complete the transformation inside the loop over k . It is necessary to adopt the most convenient tensor contractions in order to minimize the size of loops needed to perform the interpolation. Additionally, because GPUs are extremely effective at performing tensor operations, we implemented the calculation of the coupling with the Kokkos library [57]. This library provides a hardware-agnostic programming model for parallelizing operations, so that tensor operations are implemented once following Kokkos' syntax and then, at compilation time, the code is optimized for the desired architecture. The code can thus run both on standard CPU-only architecture as well as on GPUs when available without code duplication. We therefore achieve strong parallel performance across a varied range of underlying architectures.

153In our preliminary tests, we observed that the interpolation at fixed values of k and k is extremely fast on a GPU, causing communication latency between GPU and CPU to be the dominant bottleneck. To counteract this effect, we increase the workload on the GPU by performing the interpolation for a fixed value of k and a set of values for {k } at once. The size of the set {k } is optimized at runtime so that most of the on-board GPU's memory is used. Finally, as the size of the electron-phonon coupling tensor in the Wannier representation g bb ν (R e , R p ) may be too large to fit in a single GPU's memory, we adopt an additional layer of MPI parallelization. The electron-phonon coupling can be distributed over the index R e across a "pool" of MPI processes, and we allow the user to specify the size of the pool at runtime through the command line.

F. Quantum-ESPRESSO interface for electron-phonon coupling

154Phoebe has been interfaced with Quantum ESPRESSO ph.x and Wannier90 in order to obtain the relevant ab-initio input for the electron-phonon coupling calculations. However, this interface presented an important technical challenge.

155As mentioned in Section III B, gauge fixing is a critical component of the Wannier interpolation. In order for the Wannier interpolation to work, it is critical that the gauge of the wavefunctions used by these two separate codes stays the same throughout the calculations. Unfortunately, there is no built-in QE function to fix the gauge of a wavefunction and therefore the wavefunction may take a random phase every time it is computed. As a result, we developed a gauge-fixing procedure that ensures the wavefunction has a consistent gauge across pw.x (the QE code that finds the ground state wavefunctions), ph.x (the QE code that computes the electron-phonon coupling) and wannier90 (which computes the maximally-localized Wannier functions).

156Therefore, in addition to the main Phoebe code, we provide a patched version of QE that must be used to compute electronic properties, which guarantees the gauge of the wavefunctions is appropriately taken into account. In order to explain this gauge fixing procedure, we first recall that QE is a plane-wave ab-initio code, so that the wavefunction is computed as

157where G runs over a set of reciprocal lattice vectors (typically defined up to a user-defined cutoff value on |k + G| 2 ), c are the plane wave coefficients, and r is the position. The subroutine c_bands() of QE is responsible for building and diagonalizing the Hamiltonian matrix, and therefore also computes the eigenvalues kb and the plane wave coefficients c kb (G). The phase arbitrariness manifests as a random phase on the complex plane-wave coefficients c kb (G). In our patch, we modified c_bands() so that if c_bands() is called by pw.x and QE has found the ground state wavefunction (i.e. a scf calculation), we save c kb (G) to file. These coefficients will serve as a reference wavefunction to fix the gauge of all subsequent calculations. If c_bands() is called by another code, for example, when generating auxiliary data for Wannier90 or ph.x, we read the reference plane-wave coefficients and use them to fix the gauge of the newly computed wavefunction. In this way, we can ensure that -at the phase level -the same wavefunction is used throughout these multiple calculations. An additional complexity in this patch is caused by the use of symmetries in the ab-initio code. The reference plane-wave coefficients built in a pw-scf calculation are typically computed only for wavevectors {k * } in the irreducible BZ wedge. Therefore, we save to file only the coefficients c k * b (G) computed at irreducible points. The wavefunction at a symmetry-equivalent wavevector k can be reconstructed from the irreducible wavevector as

158which in terms of plane-wave coefficients implies

159where S = {R, t} is a crystal symmetry as introduced in Section III K. An additional symmetry that is taken into account is the time reversal operation

160which in terms of plane-wave coefficients is

161A last constrain comes from the translational symmetry of the crystal, i.e.

162or equivalently

163Symmetries in the presence of magnetism are currently being developed. Using these relations and knowing the wavefunction at k * , it is possible to reconstruct the wavefunction at any symmetry-equivalent wavevector k. However, in QE, the wavefunction cannot be built from symmetries just by mapping c k * ,b (G) into c k,b (G). In fact, the set of G vectors is chosen such that |G + k| 2 < δ, where δ is a user-specified cutoff. As a result, we cannot map all c k * ,b (G) into c k,b (G) as some plane-wave coefficients might be missing at the rotated wavevector, causing errors in the normalization of the wavefunction. To address this, we first rotate the reference wavefunction |ψ ref

164where |ψ arb−gauge

165is the wavefunction with an arbitrary gauge that has been computed by QE at wavevector k. With a complete basis set O would be a unitary matrix, however, due to the finite set of G-vectors, the unitary property is violated by a small amount ∆ defined as

166We can re-enforce the unitary property of O by first noting that O is expected to be semi-positive definite (due to the lack of completeness of the finite set of G vectors). We then write

167where L is the Cholesky decomposition of the matrix LL † = 1 + O † ∆O and introduced an approximation that has an error of order ∆ 3 (expected to be small for well-converged calculations). By construction, the matrix OL is a unitary matrix which can now be used to rotate the wavefunction computed at a symmetry-equivalent point to the desired gauge, while preserving the orthonormality condition. We therefore fix the gauge of the wavefunction at k by applying the rotation

168This procedure makes the wavefunctions obey the symmetries of the crystals. This allows for a great simplification of the electron-phonon coupling calculation. As explained in Ref. [30], if the wavefunction obeys crystal symmetries, the electron-phonon coupling satisfies the symmetry relation

169where S is a symmetry operation of a crystal and

170due to the periodicity of the crystal. As a result, we can compute the electron-phonon coupling on a set of irreducible wavevectors, then construct the remaining matrix elements by means of the symmetry relations, reducing the burden of the ab-initio calculation.

171We stress that this patch avoids the need for re-implementing calculations of the electron-phonon matrix elements ψ k+q,b |∂ qν V |ψ kb , which are already computed in the code ph.x. As a result, Phoebe can readily take advantage of all features supported by ph.x, such as ultra-soft or PAW pseudopotentials [58], U corrections [21] and others, without the need for re-implementing them. The only modification necessary in the code ph.x has been the introduction of a subroutine that unfolds the symmetry of the coupling g and writes it to file output. The Wannier90 code has not been explicitly modified, as it simply reads the wavefunctions pre-computed by QE. As a last detail, we stress that the gauge problem must also be taken care when dealing with the phonon eigenvector z, and the eigenvector z present in Eq. 12 must be exactly the same phonon eigenvector (phase factor included) used by ph.x to compute the electron-phonon coupling. Additionally, also z must obey the symmetries of the crystal, as discussed in Ref. [30]. . Generally, the user must first perform ab-initio simulations (blue boxes), using our patched version of Quantum-ESPRESSO for studying electron-phonon interactions or any DFT code that can provide anharmonic phonon interactions. Next, shown in purple boxes, the user must launch the Phoebe executable. The electronic transport properties calculation must be preceded by a one-time post-processing of the electron-phonon coupling taken in output from Quantum-ESPRESSO, while the phonon transport calculation can be directly started from the output of ab-initio calculations. Finally, results are provided in output either in the standard output file, or as a parsable JSON format. Now, having introduced all the major features and computational structures of Phoebe, we demonstrate how the code can be used to calculate the transport properties of materials. In Fig. 1 we schematically show a user's workflow for computing electronic and thermal transport properties with Phoebe. The electronic transport workflow, as shown in the top panel, starts with the user going through the ab-initio calculation. The first step requires the calculation of the ground state wavefunction and electronic energies. Due to the wavefunction gauge requirements explained in Section IV F, the ground state calculation must be performed using our patched version of QE. Next, the user proceeds to compute the phonon properties with the patched version of ph.x. The output of this calculation, specifically files containing the force constants and the electron-phonon coupling, are later passed to Phoebe. At the same time, the user must also compute the Wannier functions with Wannier90, which outputs the real-space representation of the electronic Hamiltonian and the U rotation matrices that must be used to rotate the wavefunction to the Wannier gauge. After these ab-initio calculations have concluded, the user must run the qe2PhoebeApp, which uses the data from the ab-initio calculations to compute the electron-phonon coupling in the Wannier representation g(R e , R p ) starting from g(k, q) computed by ph.x, as described in Eq. 12. This operation needs to be run only once per material, and generates an output (HDF5) file with the electron-phonon coupling in real space, ready to be used for the interpolation. Finally, the user has all the input data necessary to compute the electron transport properties by launching the electronWannierTransportApp. Results are output as JSON files, easily parsed and analyzed by the user.

172The workflow for computing the phonon transport properties is shown in the lower panel of Fig. 1. First, the user must select an ab-initio code (from any that work with phono3py or ShengBTE) to calculate the equilibrium ground state of the crystal. After a reference equilibrium crystal structure is found, the user runs an external library, e.g. phonopy and phono3py or ShengBTE, in conjunction with the ab-initio code to generate all atomic displacements needed to compute the second and third derivatives of the total energy (see Sec. III A). Once both V (2) and V (3) are computed, the PhononTransportApp is ready to be launched. This app will interpolate the phonon-phonon coupling, compute phonon lifetimes, and then solve the BTE to evaluate the phonon transport properties such as the thermal conductivity. As in the electronic transport case, the results are written in easily parsable JSON files that can be conveniently analyzed. Next, we showcase the calculation of transport properties by applying these two computational workflows to GaN, a semiconductor often used for high-power applications.

A. GaN

173Gallium nitride (GaN) is a well-studied semiconductor that crystallizes in a wurtzite structure. We calculate the electronic structure of this material via Quantum-ESPRESSO using optimized norm-conserving Vanderbilt (ONCV) pseudopotentials [59,60] and the local-density approximation (LDA) exchange-correlation functional [61]. For the phonon workflow, we construct the force constants in a 4×4×3 supercell, and the third derivative using a 3×3×2 supercell. The supercell DFT calculation is performed using a 2×2×2 mesh for the k-point integration and a wavefunction cutoff of 110 Ry. Next, the phonon BTE is built using the adaptive smearing method for approximating the Dirac-delta and converged with a 15×15×15 mesh of q-points. For the electron transport workflow, ab-initio properties are computed using a 110 Ry plane-wave energy cutoff, a 12×12×7 coarse mesh for both k-and q-points and the same pseudopotential choice. The maximally-localized Wannier function basis for this material was established using 14 random Wannier centers. The electronic BTE is build using an adaptive smearing scheme, and states are discarded with the population window. The BTE is integrated using a variable mesh of k-points, starting from the densest mesh of 170×170×106 at the lowest temperature of 100K and gradually decreased down to 90×90×56 at the highest temperature of 450K, as the convergence properties depend on temperature.

174In Fig. 2 we plot some of the transport properties of GaN as a function of temperature. In 2a, we plot the lattice thermal conductivity as a function of temperature, and compare results of the BTE at various levels of approximation agains the experimental values [62]. We find a good agreement between our simulations and experiments, validating the results of this work. The RTA solution tends to underestimate the thermal conductivity predicted by exact BTE, as expected due to the variational principle underlying the formalism [20,24]. To solve the phonon BTE exactly, we use the variational and the relaxons solvers, mainly to note how the two solvers are able to provide, as expected, approximately the same solution to the BTE.

175The electron drift mobility at a n-carrier concentration of about 2 · 10 17 cm −3 is plotted versus temperature in Fig. 2b and compared against some of the available experiments [63][64][65]. Here we distinguish two regimes. At higher temperatures, where a sufficient number of phonons is thermally excited, we expect electron-phonon scattering to be the dominant factor limiting charge transport in GaN. Indeed, for temperatures above approximately 150K, we obtain a good agreement with experimental values, and correctly reproduce the decreasing trend of mobility with respect to temperature. At lower temperatures we do observe a departure of experimental values, which tend to decrease as temperature goes to zero, while our results are showing the opposite trend. This is likely due to the fact that, as temperature is decreased, fewer phonons are thermally excited and electron have a higher probability of scattering against defects or impurities in the crystal, which for simplicity have not been taken into account for this simulation. We also note that here the RTA already provides a good approximation to the mobility (and also for the Seebeck coefficient and the resistivity), with the variational and relaxon solvers providing essentially the same estimates. Overall, we do observe a good agreement with experiments for simulations in the phonon-limited regime of charge transport.

176In Fig. 2c, we plot the Seebeck coefficient as a function of temperature. Here, we do obtain a good qualitative agreement between our results and the experimental values for large temperatures [66], i.e. larger than 150K. Since the Seebeck coefficient is strongly related to the density of states of the material [67], the results seem to indicate that the DFT simulation provided a good approximation to the electronic band structure. Also in this case, we observe a departure between our results and experiments at the lowest temperatures. As in the case of the drift mobility, a possible explanation can be attributed to the presence of different scattering mechanisms. Another alternative explanation could be attributed to the presence of phonon drag, which for example has been proposed to exist in GaAs [68], and typically manifests as a large sudden change in the values of the Seebeck coefficient at low temperatures. Therefore, our results suggest that a detailed investigation of phonon-drag in GaN could be relevant to understand the transport properties of this material at this carrier concentration.

177In the top panels of Fig. 3 we plot the phonon (left panels) and electronic (right panels) band structure. On top of the band structure, we superimpose the carrier linewidths computed at a temperature of 300K. These pictures are produced with Python scripts that have been included in the Phoebe release for user's convenience. The top panel provides an easy way to identify some particular bands or areas of the Brillouin zone which tend to scatter the most, as the linewidths are a measure of the total scattering rate. For this particular material, we can observe how optical phonons tend to scatter more, especially at the Γ or A high-symmetry points. In panel Fig. 3b instead we can observe how the holes close to the chemical potential have larger linewidths than electrons close to the band gap, but otherwise we don't observe any pocket of large scattering rates. The bottom panels describe the energy-dependence of the lifetimes, which sometimes is useful to derive simplified models of transport. For phonons, in Fig. 3c, we can clearly see that phonon lifetimes tend to be the largest for the three acoustic phonon modes whose energies tend to zero at the Γ point. Generically, lifetimes tend to decrease as the energy increases, in agreement with standard expectations. However, we observe significant deviations from a simple power-law behavior of the energy dependence, especially for optical phonon modes. This complicated energy-dependence of the phonon lifetimes is indicative that simple constant-relaxation time models are inadequate for studying the phonon transport in GaN, and a more accurate microscopic description, as done here, is necessary. In panel 3d we instead show the energy dependence of carrier lifetimes for p-doped GaN. While we observe a small spike for carriers closest to the band edge due to the vanishing density of states, the relaxation times simply show a weak energy dependence.

B. Performance and Scaling

178Phoebe uses MPI, OpenMP and Kokkos for scaling and acceleration at different levels. MPI enables large-scale simulations on multiple nodes, while OpenMP allows shared-memory parallelization within one node. As explained in Section IV E, the interpolation of the particle interaction is implemented with Kokkos, so that if no GPU is available, Kokkos's OpenMP backend will add to the intra-node parallelization, otherwise its CUDA, HIP, SYCL and OpenMPTarget backends compile the code for GPUs from different vendors.

179In this section, we show some examples of the computational performance of Phoebe. As a benchmark, we take the GaN calculation of electronic transport properties discussed in the previous section, and integrate the BTE at a temperature of 300 K on a grid of 90 × 90 × 56 wavevectors. For this test, we reduced the coarse ab-initio grid of wavevectors to 7 × 7 × 4. The simulation is run on the TACC Longhorn supercomputer, where each node has 4 NVIDIA V100 GPUs and 2 IBM Power 9 AC922 20-core CPUs.

180In Fig. 4 we plot the scaling of the ElectronWannierTransportApp with respect to the two levels of parallelization (MPI and OpenMP), while also demonstrating how the GPU accelerates the calculation (with 1 GPU per MPI process). The Figure 5. System load as a function of time during a simulation of GaN electronic transport properties. The top panel shows a CPU-only simulation performed with 1 MPI process and 8 OpenMP, where a vast majority of Phoebe's work is well parallelized with OpenMP, except for the input file reading at the beginning of the simulation. In the bottom panel, the same simulation, but GPU-accelerated, shows a much shorter total wall time, and a lower system load during the calculation of the scattering properties, attributable to the latency spent transferring data between GPU and CPU.

181the ideal scaling of a calculation -a straight line in this logarithmic scale -and the color code labels simulations performed with (blue) or without (red) GPU acceleration.

182In the left panel of Fig. 4, we test the MPI scaling by increasing the number of nodes used, with 4 MPI ranks, 4 GPUs and 160 OpenMP threads per node. When running without GPUs, the overall scaling of the simulation is very close to ideal. In this case, the calculation of the scattering matrix dominates the total cost of the simulation and since it's efficiently distributed across MPI processes over the wavevectors, we achieve a good scaling performance. The GPUs, shown in blue lines, greatly accelerate the calculation of the scattering matrix, which is now a much smaller contribution to the overall computation time. Remarkably, we achieve a GPU acceleration of a factor 2 or 3 to the overall simulation wall time. Dashed lines in Fig. 4 show in detail the time taken by the construction of the scattering matrix. This part, dominant for larger systems and grids, is very close to ideal scaling.

183The right panel of Fig. 4 showcases the scaling performance of Phoebe with respect to the number of OpenMP threads per MPI process. Here, we used a single node with 4 GPUs and 4 MPI ranks, while the number of OpenMP threads per MPI rank is gradually increased from 1 to 8. Because not all steps of the calculation (see Fig. 5) can be parallelized with OpenMP (in particular, the input files reading at the start of the calculation), the total simulation time deviates from ideal scaling as more threads are used. Nevertheless, we achieve good OpenMP scaling performance when GPUs are not used, especially for the construction of the scattering matrix. When GPUs are used, we observe a significant deviation from the linear scaling, which can be traced to the lack of OpenMP scaling of the scattering matrix construction. This is not surprising: since the majority of the scattering matrix calculation is offloaded to the GPU, it becomes largely independent of the number of OpenMP threads being used on the CPU, which are only responsible for minor precomputations and data transfer. Figure 5 shows the timeline of the system load during a single electronic transport calculation. This simulation is computed using a 80 × 80 × 50 k-mesh, and has been run on one node of Harvard University's Cannon supercomputer with 4 MPI processes and 8 OpenMP threads, where each node has 4 V100 GPUs and 2 Intel Xeon Gold 6142 16-core CPUs. The simulation is profiled with the NVIDIA Nsight Systems software. In the top panel, the simulation has been run without GPU acceleration, and we report the system load from the main thread and the first OpenMP thread (the remaining threads behave identically to this thread); in the bottom panel, the GPU is being used and we thus reported the system load for the GPU as well.

184At the start of the calculation, where Phoebe is reading input files, the vast majority of time is spent reading the large HDF5 files containing the electron-phonon coupling in real space precomputed from Eq. (12), an operation that cannot be OpenMP accelerated and thus only MPI processes are active. After this step, OpenMP threads are used and remain active for the vast majority of the remaining execution time.

185In the next step of the calculation, Phoebe precomputes electron and phonon properties as described in sections III A and III B, i.e. energies, eigenvectors, and velocities at all points k, q and k + q. This operation is trivially parallelized with both MPI processes and OpenMP threads (notice the load almost at 100%), thus driving the overall scaling towards linearity. At this stage, we also precompute all factors in the long-range polar correction (Eq. 15), except for the wavefunction overlap which is added during the calculation of the scattering rates. In this way, part of the calculation of the polar correction has a linear scaling with q, rather than being embedded in a loop over k during the construction of the scattering matrix.

186In the last part of the simulation, Phoebe computes the scattering matrix, which is the largest contribution to the total wall time. When the GPU is not used, the OpenMP threads are accelerating only the interpolation of the electron-phonon coupling strength. However, the OpenMP system load is at around 75%, indicating how the coupling interpolation represents most of the simulation cost. When the GPU is being used, as shown in the lower panel, we can see how the calculation of the scattering matrix is significantly accelerated. The relatively low GPU utilization for this production-scale simulation indicates that the tensor products involved in the calculation runs so quickly on the GPU that preparing the data transfer between CPU and GPU becomes the bottleneck of the acceleration. Finally, the calculation of the transport coefficients, here made at the RTA level, is too fast to be visible in the picture.

187Overall, we find that Phoebe takes good advantage of multi-level parallelism and GPU acceleration even for a moderately expensive calculation. With just a few GPU nodes, the calculation is fast enough that it becomes dominated by unavoidable overhead tasks like file reading and data transfer. We mention in passing that future releases of Phoebe have still room for improving the performance, in particular by increasing the fraction of work performed by the GPU when available.

VI. CONCLUSIONS

188In this article we present Phoebe, a HPC software for characterising electron and phonon transport properties from first-principles. We provide various tools to predict transport properties at various levels of theory and accuracy, such as the Boltzmann transport equation or models based on the Wigner distribution. Phoebe has been interfaced with Phono3py and ShengBTE to obtain the first-principles coupling strength of the phonon-phonon interaction, and the electron-phonon interaction has been interfaced with Quantum-ESPRESSO. The accurate integration of the Boltzmann transport equation and related transport properties is achieved with Fourier/Wannier based interpolation techniques or with energy-averaging approximations. Lastly, the code has been optimized for speed and scaling, using a mix of parallelization levels based on MPI, OpenMP and GPU (through Kokkos). The code has been made publicly available on Github (https://mir-group.github.io/phoebe/) under an open-source basis (MIT license).

189The overall goal for this project has been to provide the community with an efficient software to perform simulation of materials transport properties, while providing an extensible framework for implementing new methodologies as they are being developed. We believe the current software framework allows us to achieve these goals, and we intend continue our work on the project, both improving performance and adding new features to future releases.

참고문헌 66건

  1. Heat transport in dielectric solids with diamond structure Il Nuovo Cimento D · Springer Nature · 1997
  2. First principles phonon calculations in materials science Scripta Materialia · Elsevier BV · 2015 10.1016/j.scriptamat.2015.07.021
  3. Phonons and related crystal properties from density-functional perturbation theory Reviews of Modern Physics · American Physical Society · 2001 10.1103/revmodphys.73.515
  4. Distributions of phonon lifetimes in Brillouin zones Physical Review B · American Physical Society · 2015 10.1103/physrevb.91.094306
  5. Beyond the isotropic-model approximation in the theory of thermal conductivity Physical review. B, Condensed matter · American Physical Society · 1996 10.1103/physrevb.53.9064
  6. Zur kinetischen Theorie der Wärmeleitung in Kristallen Annalen der Physik · Wiley · 1929 10.1002/andp.19293950803
  7. BoltzWann: A code for the evaluation of thermoelectric and electronic transport properties with a maximally-localized Wannier functions basis Computer Physics Communications · Elsevier BV · 2013 10.1016/j.cpc.2013.09.015
  8. Lattice thermal conductivity of silicon from empirical interatomic potentials Physical Review B · American Physical Society · 2005 10.1103/physrevb.72.014308
  9. Improved tetrahedron method for Brillouin-zone integrations Physical review. B, Condensed matter · American Physical Society · 1994 10.1103/physrevb.49.16223
  10. Significant Reduction of Lattice Thermal Conductivity by the Electron-Phonon Interaction in Silicon with High Carrier Concentrations: A First-Principles Study Physical Review Letters · American Physical Society · 2015 10.1103/physrevlett.114.115901
  11. Effects of ain buffer layer on crystallographic structure and on electrical and optical properties of GaN and Ga1−AlN (0 &lt; x ≦ 0.4) films grown on sapphire substrate by MOVPE Journal of Crystal Growth · Elsevier BV · 1989 10.1016/0022-0248(89)90200-5
  12. ShengBTE: A solver of the Boltzmann transport equation for phonons Computer Physics Communications · Elsevier BV · 2014 10.1016/j.cpc.2014.02.015
  13. Phonon hydrodynamics in two-dimensional materials Nature Communications · Nature Portfolio · 2015 10.1038/ncomms7400
  14. <i>Ab initio</i>variational approach for evaluating lattice thermal conductivity Physical Review B · American Physical Society · 2013 10.1103/physrevb.88.045430
  15. Optimized norm-conserving Vanderbilt pseudopotentials Physical Review B · American Physical Society · 2013 10.1103/physrevb.88.085117
  16. Anharmonic properties from a generalized third-order<i>ab initio</i>approach: Theory and applications to graphite and graphene Physical Review B · American Physical Society · 2013 10.1103/physrevb.87.214303
  17. Flexural phonons and thermal transport in graphene Physical Review B · American Physical Society · 2010 10.1103/physrevb.82.115427
  18. Maximally localized Wannier functions: Theory and applications Reviews of Modern Physics · American Physical Society · 2012 10.1103/revmodphys.84.1419
  19. Electrical properties of n-type vapor-grown gallium nitride Journal of Physics and Chemistry of Solids · Elsevier BV · 1973 10.1016/s0022-3697(73)80090-3
  20. Activation energies of Si donors in GaN Applied Physics Letters · American Institute of Physics · 1996 10.1063/1.115805
  21. Accurate and simple analytic representation of the electron-gas correlation energy Physical review. B, Condensed matter · American Physical Society · 1992 10.1103/physrevb.45.13244
  22. Role of Disorder and Anharmonicity in the Thermal Conductivity of Silicon-Germanium Alloys: A First-Principles Study Physical Review Letters · American Physical Society · 2011 10.1103/physrevlett.106.045901
  23. Seebeck coefficients of n-type (Ga,In)(N,As), (B,Ga,In)As, and GaAs Applied Physics Letters · American Institute of Physics · 2008 10.1063/1.2959079
  24. Smooth Fourier interpolation of periodic functions Physical review. B, Condensed matter · American Physical Society · 1988 10.1103/physrevb.38.2721
  25. Anharmonic force constants extracted from first-principles molecular dynamics: applications to heat transfer simulations Journal of Physics Condensed Matter · IOP Publishing · 2014 10.1088/0953-8984/26/22/225402
  26. Solution of the Linearized Phonon Boltzmann Equation Physical Review · American Institute of Physics · 1966 10.1103/physrev.148.766
  27. Phonon Boltzmann Equation and Second Sound in Solids Physical review. B, Solid state · American Physical Society · 1970 10.1103/physrevb.2.1193
  28. Kokkos: Enabling manycore performance portability through polymorphic memory access patterns Journal of Parallel and Distributed Computing · Elsevier BV · 2014 10.1016/j.jpdc.2014.07.003
  29. Electron-phonon interaction using Wannier functions Physical Review B · American Physical Society · 2007 10.1103/physrevb.76.165108
  30. Direct Solution to the Linearized Phonon Boltzmann Equation Physical Review Letters · American Physical Society · 2013 10.1103/physrevlett.110.265506
  31. Spectral and Fermi surface properties from Wannier interpolation Physical Review B · American Physical Society · 2007 10.1103/physrevb.75.195121
  32. QUANTUM ESPRESSO: a modular and open-source software project for quantum simulations of materials Journal of Physics Condensed Matter · IOP Publishing · 2009 10.1088/0953-8984/21/39/395502
  33. Maximally localized Wannier functions for entangled energy bands Physical review. B, Condensed matter · American Physical Society · 2001 10.1103/physrevb.65.035109
  34. Thermal Conductivity of Graphene and Graphite: Collective Excitations and Mean Free Paths Nano Letters · American Chemical Society · 2014 10.1021/nl502059f
  35. Influence of band structure on the large thermoelectric performance of lanthanum telluride Physical Review B · American Physical Society · 2009 10.1103/physrevb.79.153101
  36. Thermal conductivity of diamond nanowires from first principles Physical Review B · American Physical Society · 2012 10.1103/physrevb.85.195436
  37. Fröhlich Electron-Phonon Vertex from First Principles Physical Review Letters · American Physical Society · 2015 10.1103/physrevlett.115.176401
  38. Formalisms of Band Theory Solid state physics · Elsevier BV · 1962 10.1016/s0081-1947(08)60459-2
  39. Thermal Transport in Crystals as a Kinetic Theory of Relaxons Physical Review X · American Physical Society · 2016 10.1103/physrevx.6.041013
  40. Electron-phonon interactions from first principles Reviews of Modern Physics · American Physical Society · 2017 10.1103/revmodphys.89.015003
  41. EPW: Electron–phonon coupling, transport and superconducting properties using maximally localized Wannier functions Computer Physics Communications · Elsevier BV · 2016 10.1016/j.cpc.2016.07.028
  42. Thermoelectric coefficients of<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>n</mml:mi></mml:math>-doped silicon from first principles via the solution of the Boltzmann transport equation Physical review. B./Physical review. B · American Physical Society · 2016 10.1103/physrevb.94.085204
  43. Advanced capabilities for materials modelling with Quantum ESPRESSO Journal of Physics Condensed Matter · IOP Publishing · 2017 10.1088/1361-648x/aa8f79
  44. The PseudoDojo: Training and grading a 85 element optimized norm-conserving pseudopotential table Computer Physics Communications · Elsevier BV · 2018 10.1016/j.cpc.2018.01.012
  45. BoltzTraP2, a program for interpolating band structures and calculating semi-classical transport coefficients Computer Physics Communications · Elsevier BV · 2018 10.1016/j.cpc.2018.05.010
  46. Accelerated Screening of Thermoelectric Materials by First‐Principles Computations of Electron–Phonon Scattering Advanced Energy Materials · Wiley · 2018 10.1002/aenm.201800246
  47. Estimation of electron-phonon coupling via moving least squares averaging: a method for fast-screening potential thermoelectric materials Materials Today Physics · Elsevier BV · 2018 10.1016/j.mtphys.2018.07.001
  48. Unified theory of thermal transport in crystals and glasses Nature Physics · Nature Portfolio · 2019 10.1038/s41567-019-0520-x
  49. Isotopic compositions of the elements 2013 (IUPAC Technical Report) Pure and Applied Chemistry · International Union of Pure and Applied Chemistry · 2016 10.1515/pac-2015-0503
  50. Generalization of Fourier’s Law into Viscous Heat Equations Physical Review X · American Physical Society · 2020 10.1103/physrevx.10.011019
  51. Wannier90 as a community code: new features and applications Journal of Physics Condensed Matter · IOP Publishing · 2019 10.1088/1361-648x/ab51ff
  52. Perturbo: A software package for ab initio electron–phonon interactions, charge transport and ultrafast dynamics Computer Physics Communications · Elsevier BV · 2021 10.1016/j.cpc.2021.107970
  53. Coupled transport of phonons and carriers in semiconductors: A case study of <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML"><mml:mi>n</mml:mi></mml:math> -doped GaAs Physical review. B./Physical review. B · American Physical Society · 2020 10.1103/physrevb.101.075202
  54. Automated high-throughput Wannierisation npj Computational Materials · Nature Portfolio · 2020 10.1038/s41524-020-0312-y
  55. High Thermal Conductivity of Bulk GaN Single Crystal: An Accurate Experimental Determination JETP Letters · Pleiades Publishing · 2020 10.1134/s0021364020140039
  56. Efficient anharmonic lattice dynamics calculations of thermal transport in crystalline and disordered solids Journal of Applied Physics · American Institute of Physics · 2020 10.1063/5.0020443
  57. Automated high-throughput Wannierisation npj Computational Materials · Nature Portfolio · 2020 10.1038/s41524-020-0312-y
  58. Generalization of Fourier’s Law into Viscous Heat Equations Physical Review X · American Physical Society · 2020 10.1103/physrevx.10.011019
  59. Unified theory of thermal transport in crystals and glasses Nature Physics · Nature Portfolio · 2019 10.1038/s41567-019-0520-x
  60. Efficient anharmonic lattice dynamics calculations of thermal transport in crystalline and disordered solids Journal of Applied Physics · American Institute of Physics · 2020 10.1063/5.0020443
  61. Interband tunneling effects on materials transport properties using the first principles Wigner distribution Materials Today Physics · Elsevier BV · 2021 10.1016/j.mtphys.2021.100412
  62. Interband tunneling effects on materials transport properties using the first principles Wigner distribution Materials Today Physics · Elsevier BV · 2021 10.1016/j.mtphys.2021.100412
  63. Thermoelectrics by Computational Design: Progress and Opportunities Annual Review of Materials Research · Annual Reviews · 2021 10.1146/annurev-matsci-100520-015716
  64. GPU_PBTE: an efficient solver for three and four phonon scattering rates on graphics processing units Journal of Physics Condensed Matter · IOP Publishing · 2021 10.1088/1361-648x/ac268d
  65. Anomalous Thermoelectric Transport Phenomena from First‐Principles Computations of Interband Electron–Phonon Scattering Advanced Functional Materials · Wiley · 2022 10.1002/adfm.202111354
  66. Spglib: a software library for crystal symmetry search Science and Technology of Advanced Materials Methods · Taylor & Francis · 2024 10.1080/27660400.2024.2384822