κ \kappa ALDo 2.0: Scalable Thermal Transport from First Principles and Machine Learning Potentials Journal: Computer Physics Communications Giuseppe Barbalinardo ∗,a, Zekun Chen ∗,a, Dylan Folkner a, Bohan Li a,c, Nicholas Lundgren a, Nathaniel Troup a, Alfredo Fiorentino b,d, Davide Donadio a Abstract We introduce κ \kappa ALDo 2.0, an open-source Python package for computing vibrational, elastic, and thermal transport properties of crystalline and disordered solids from first principles and machine-learned interatomic potentials. Building on the anharmonic lattice dynamics (ALD) framework, κ \kappa ALDo 2.0 provides efficient CPU and GPU-accelerated implementations of the Boltzmann transport equation (BTE) for crystals and the quasi-harmonic Green-Kubo (QHGK) method. The QHGK formalism extends thermal transport predictions beyond translationally-invariant crystals to materials lacking long-range order, including glasses, alloys, and complex nanostructures. κ \kappa ALDo 2.0 introduces native integration with modern machine-learned potentials (MLPs), enabling thermal transport workflows that combine the accuracy of first-principles methods with the scalability of classical force fields. It also features comprehensive support for temperature-dependent effective potentials (TDEP) workflows, flexible storage backends for large-scale calculations, and advanced quantification of anharmonicity. The software seamlessly interfaces with electronic structure codes (Quantum ESPRESSO, VASP), molecular dynamics packages (LAMMPS), and state-of-the-art MLPs (ACE, NEP, MACE, MatterSim, Orb), enabling thermal transport studies from 0 K 0\text{\,}\mathrm{K} to finite temperatures. κ \kappa ALDo 2.0 implements multiple BTE solution strategies (relaxation time approximation, self-consistent iteration, full matrix inversion) and supports essential physical corrections, including isotopic scattering and non-analytical terms for polar materials. A modular Python architecture with lazy evaluation and multiple storage formats (formatted text, NumPy, HDF5) enables simulations of systems containing up to tens of thousands of atoms. This paper describes the theoretical framework, implementation details, software architecture, and validation examples demonstrating κ \kappa ALDo 2.0’s capabilities for studying complex materials, including halide perovskites with strong anharmonicity and polar oxides requiring long-range electrostatic corrections. † † *These authors contributed equally to this work Tags: Python, Materials Science, Computational Physics, Lattice Dynamics, Thermal Conductivity, Boltzmann Transport Equation, Machine Learning Potentials, Green-Kubo, Phonon Scattering, GPU Acceleration, TDEP, Anharmonic Effects Program Title: \kappa ALDo 2.0 CPC Library link to program files: (to be assigned) Developer’s repository: https://github.com/nanotheorygroup/kaldo Examples repository: https://github.com/nanotheorygroup/kaldo-examples Licensing provisions: BSD 3-Clause License Programming language: Python 3.10+ External libraries: NumPy 1 , SciPy 2 , TensorFlow 3 , ASE 4 , sparse, opt_einsum 5 , h5py 6 , seekpath 7 Nature of problem: Accurate prediction of lattice heat transport in solids requires the calculation of anharmonic interatomic force constants, phonon scattering processes, and solution of the Boltzmann transport equation (BTE) for crystals or alternative formalisms for disordered materials where BTE assumptions break down. A modern software to compute lattice thermal conductivity needs: (i) flexibility to handle both crystalline and disordered materials within a unified framework, (ii) support for finite-temperature renormalization effects critical in phase-changing materials, (iii) integration with modern machine-learned potentials, or (iv) scalability to systems with thousands of atoms. A unified platform is needed that seamlessly extends the calculation of lattice thermal conductivity from crystals, including strongly anharmonic crystals, to amorphous solids while combining first-principles accuracy with computational efficiency. Solution method: \kappa ALDo 2.0 implements anharmonic lattice dynamics with modular support for multiple force constant generation methods (finite differences, perturbation theory, fitting from MD trajectories) and thermal conductivity solvers: BTE (RTA, self-consistent, full matrix inversion) for crystalline materials, and quasi-harmonic Green-Kubo (QHGK) for strongly anharmonic and disordered systems. The QHGK implementation extends lattice dynamics predictions to materials lacking translational symmetry, bridging the gap between traditional BTE and molecular dynamics. The code uses sparse tensor representations and GPU acceleration via TensorFlow for the computationally intensive projection of third-order force constants onto phonon eigenstates. Multiple storage backends enable memory-efficient caching of intermediate results. Integration with ASE and various native interfaces (LAMMPS, Quantum-Espresso, etc.) provides access to diverse force calculators, including modern MLPs. Additional comments: \kappa ALDo 2.0 is particularly suited for: (i) materials with strong temperature-dependent anharmonicity (e.g., halide perovskites, materials near phase transitions), (ii) studies requiring systematic comparison of multiple thermal conductivity solution methods, (iii) large-scale materials screening workflows, and (iv) development and testing of new theoretical methods in phonon transport. The software includes extensive test coverage, Docker deployment, Google Colab tutorials, and auto-generated API documentation. No special hardware is required, though GPU access significantly accelerates calculations for systems with unit cells containing over 100 atoms. Introduction Thermal management has emerged as a critical challenge in modern technology, from microelectronics miniaturization to thermoelectric energy conversion and thermal barrier coatings. As device dimensions approach the nanoscale, classical continuum approaches to heat transport break down, necessitating atomistic descriptions of phonon-mediated thermal conductivity 8 , 9 . Understanding and predicting thermal transport at the atomistic level is essential for materials design in applications ranging from heat dissipation in high-power electronics to efficiency optimization in energy conversion devices 10 . The past decade has witnessed remarkable progress in computational materials science driven by three converging developments. First, large-scale materials databases 11 , 12 , 13 have enabled systematic screening of compounds across chemical space, identifying promising candidates for targeted properties. Second, advances in high-performance computing and algorithmic improvements have extended the reach of ab initio methods to increasingly complex systems 14 . Third, machine learning has revolutionized interatomic potential development, initially with specialized models that achieve near-DFT accuracy at computational scaling and overall cost comparable to empirical potentials 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , and, more recently, with foundation models that cover a large portion of the periodic table 23 , 24 , 25 , 26 . In semiconductors and insulators, thermal transport is governed by phonons, quantized lattice vibrations arising from collective atomic motion. Molecular dynamics (MD) provides a direct route to compute thermal conductivity, either through the equilibrium Green-Kubo formalism (EMD) 27 , 28 , 29 , 30 or via non-equilibrium approaches (NEMD) that impose a temperature gradient across the simulation cell 31 , 32 . A key strength of MD is that it captures the anharmonicity of the potential energy surface to all orders, making no perturbative truncation. Moreover, MD is straightforwardly applicable to complex systems such as nanostructured, defective, and disordered materials, where the lack of translational symmetry makes reciprocal-space methods impractical. Both EMD 33 , 34 , 35 , 36 and NEMD can be combined with empirical, machine-learned, or first-principles 37 force evaluations. However, MD-based methods face fundamental and practical limitations: (i) classical MD cannot capture quantum phonon populations, (ii) achieving size and time convergence may involve high computational cost, particularly for NEMD where finite-size extrapolation is required 32 , and (iii) decomposing the total conductivity into mode-specific contributions is challenging, thus limiting physical insight. Anharmonic lattice dynamics (ALD) offers a complementary approach that addresses these limitations 38 , 39 . By computing phonon frequencies, lifetimes, and transport properties from interatomic force constants (IFCs), ALD achieves favorable scaling: computational cost grows with the number of phonon modes ( 3N , where N is the number of atoms) rather than MD timesteps. The Boltzmann transport equation (BTE) framework 38 enables systematic treatment of phonon-phonon scattering, isotopic disorder, and boundary effects, while providing mode-resolved analysis unavailable from EMD. Recent theoretical advances have broadened the applicability of ALD. Unified theories, such as the Wigner approach and the quasi-harmonic Green-Kubo (QHGK) method 40 , 41 , have extended lattice dynamics to strongly anharmonic crystals and disordered materials, including glasses, alloys, and partially disordered nanostructures, for which interband energy transfer provides a substantial contribution to thermal transport 42 , 43 , 44 , 45 , 46 47 . Temperature-dependent effective potentials (TDEP) 48 , 49 , 50 enable treatment of strong anharmonicity, nuclear quantum effects, and temperature-induced renormalization of both harmonic and anharmonic vibrational properties 51 . Whereas most of the codes available to perform ALD calculations of thermal transport (ShengBTE 52 , Phono3py 53 , Phoebe 54 , ALAMODE 55 , THERMACOND 56 , and Thermal2 57 , 58 ) are designed to target crystalline systems by first principles, \kappa ALDo 2.0 is created to address complex materials and acts as a native Python bridge among modern MLPs, TDEP, and advanced transport formalisms (BTE and QHGK). It unifies BTE and QHGK methods with seamless integration to modern force calculators (DFT codes, LAMMPS, MLPs) and GPU acceleration. Version 2.0 features: (i) multiple BTE solvers (RTA, self-consistent, full inversion, eigendecomposition), (ii) comprehensive physical corrections (isotopes, non-analytical terms, finite-size effects), (iii) modular storage backends enabling up to 10,000 atom systems, and (iv) extensive documentation and containerized deployment. This paper is organized as follows. Section 2 presents the theoretical foundations and computational algorithms. Section 2.5 describes advanced physical modeling capabilities and software infrastructure. Section 3 demonstrates \kappa ALDo 2.0’s capabilities through applications to \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} halide perovskite and MgO oxide. Section 4 summarizes key features and future directions. Theory and Implementation \kappa ALDo 2.0 implements a hierarchical workflow for thermal transport calculations, progressing from atomic structure and interatomic force constants through phonon properties to thermal conductivity. This modular design mirrors the underlying physics while enabling flexible, efficient computation across diverse material systems. The three core components, ForceConstants , Phonons , and Conductivity classes, form the foundation of the software architecture (Fig. 2 ). Computational Workflow Thermal transport calculations in \kappa ALDo 2.0 proceed through three main stages: Stage 1: Force Constant Generation or Import. Second and third-order interatomic force constants (IFCs) are computed or imported. These tensors, encoding harmonic and anharmonic interatomic interactions, serve as the input for all subsequent analysis. Methods include: (i) finite-difference calculations with user-specified atomic displacements, (ii) direct import from density functional perturbation theory (DFPT) calculations, (iii) extraction from molecular dynamics trajectories via TDEP, or (iv) loading from external codes in various file formats (Fig. 1 ). Stage 2: Phonon Property Computation. The dynamical matrix constructed from second-order IFCs is diagonalized to obtain phonon frequencies, eigenvectors, and group velocities. Third-order IFCs are projected onto phonon eigenstates to compute scattering phase space and rates. This computationally intensive step uses sparse tensor operations and optional GPU acceleration. Additional properties, including mode-resolved heat capacity, populations (Bose-Einstein or classical), and optional isotopic scattering rates, are calculated. Stage 3: Thermal Conductivity Calculation. The BTE or QHGK formalism is employed using phonon properties from Stage 2. Multiple solution methods are available depending on accuracy requirements, memory constraints, and material characteristics. Results include mode-resolved thermal conductivity tensors, mean free paths, and optional diffusivities. Figure 1 : \kappa ALDo 2.0 input/output ecosystem. The software interfaces with diverse force constant sources, including ab initio codes (Quantum ESPRESSO, VASP), molecular dynamics packages (LAMMPS), TDEP, machine-learned potentials via ASE (NEP, MACE/MatterSim, Orb), and external phonon codes (ShengBTE, phono3py, HiPhive). The workflow progresses from force constant import/generation to phonon property calculation to thermal conductivity evaluation via BTE or QHGK methods. Figure 2 : \kappa ALDo 2.0 object-oriented class structure. ForceConstants manages second- and third-order IFCs with methods for importing from external codes ( from_folder() ) or direct calculation via ASE ( from_ase() ). Phonons computes vibrational properties including frequencies, velocities, scattering rates, heat capacities, and populations. Conductivity solves for thermal transport via BTE (RTA, self-consistent, inverse, eigendecomposition) or QHGK methods, with outputs including thermal conductivity tensors, mean free paths, and diffusivities. All classes inherit from Storable , implementing lazy evaluation and flexible storage backends. Interatomic Force Constants The first step of the ALD computation of thermal transport is the calculation of the harmonic and anharmonic force constants. In the standard lattice dynamics approach, these are the second-order, K^{(2)}=\{\phi^{\prime\prime}_{i\alpha i^{\prime}\alpha^{\prime}}\} , and higher-order derivatives of the potential energy surface with respect to atomic displacements. Anharmonic force constants are usually limited to third derivatives, K^{(3)}=\{\phi^{\prime\prime\prime}_{i\alpha i^{\prime}\alpha^{\prime}i^{\prime\prime}\alpha^{\prime\prime}}\} , corresponding to three-phonon processes, although four-phonon processes are critical to capture the correct \kappa of high-conductivity materials, such as diamond, graphene, and BAs 59 , 60 . In finite temperature approaches, e.g., TDEP, K^{(2)} and K^{(3)} , are numerical estimates of the derivatives of the Gibbs free energy 49 , 51 . Either way, K^{(2)} and K^{(3)} are second-order and third-order tensors. The mass-scaled second-order IFCs define the dynamical matrix elements: D_{i\alpha i^{\prime}\beta}=\frac{K^{(2)}_{i\alpha i^{\prime}\beta}}{\sqrt{m_{i}m_{i^{\prime}}}}, (1) where m_{i} is the mass of atom i . Phonon frequencies \omega_{\mu} and polarization vectors \eta_{i\alpha\mu} (mode index \mu ) satisfy the eigenvalue equation: \sum_{i^{\prime}\beta}D_{i\alpha i^{\prime}\beta}\eta_{i^{\prime}\beta\mu}=\omega_{\mu}^{2}\eta_{i\alpha\mu}. (2) For periodic crystals, translational symmetry enables reciprocal-space formulation. The dynamical matrix at wavevector \mathbf{q}_{k} is: D_{i\alpha ki^{\prime}\beta}=\sum_{\mathbf{R}_{l}}e^{-i\mathbf{q}_{k}\cdot\mathbf{R}_{l}}D_{i\alpha li^{\prime}\beta}, (3) where \mathbf{R}_{l} indexes unit cell replicas. The eigenvalue problem becomes: \sum_{i^{\prime}\beta}D_{i\alpha ki^{\prime}\beta}\eta_{i^{\prime}\beta ks}=\omega_{ks}^{2}\eta_{i\alpha ks}, (4) with band index s and wavevector index k . The composite index \mu=(k,s) labels individual phonon modes. The acoustic sum rule, ensuring zero frequency for the three acoustic modes at \Gamma ( \mathbf{q}=0 ), can be enforced via the is_acoustic_sum flag. Implementation and Interfaces The ForceConstants class provides a unified interface for importing and manipulating IFC files. The class method from_folder() supports multiple input formats listed in Table 1 . Additionally, the from_ase() method enables direct IFCs calculations from any ASE-compatible calculator, providing access to all modern machine-learned potentials (NEP, MACE, MatterSim, Orb, etc.) as well as classical force fields and DFT codes. This flexible design enables seamless integration with diverse computational workflows. Table 1 : Supported force constant file formats in \kappa ALDo 2.0, enabling integration with diverse computational workflows. Source Format String Second-Order Files Third-Order Files Numpy numpy second.npy third.npz or third.npy LAMMPS lammps Dyn.form THIRD VASP + ShengBTE vasp-sheng FORCE_CONSTANTS_2ND or FORCE_CONSTANTS FORCE_CONSTANTS_3RD QE + ShengBTE † † It supports loading force constants with mixed formats. Here, it means that the second-order force constant comes from Quantum Espresso and the third-order force comes from thirdorder.py in ShengBTE 52 . qe-sheng espresso.ifc2 FORCE_CONSTANTS_3RD VASP + d3q † † The second-order force constant comes from VASP and the third-order force constant comes from Thermal2 (D3Q) 57 , 58 . vasp-d3q FORCE_CONSTANTS_2ND or FORCE_CONSTANTS FORCE_CONSTANTS_3RD_D3Q QE + d3q qe-d3q espresso.ifc2 FORCE_CONSTANTS_3RD_D3Q HiPhive hiphive model2.fcs model3.fcs TDEP tdep infile.forceconstant infile.forceconstant_thirdorder A key capability introduced in version 2.0 is a native support for temperature-dependent effective potentials (TDEP) 48 , 50 , 51 . TDEP extracts renormalized force constants from molecular dynamics trajectories, capturing anharmonic effects and temperature-induced soft mode stabilization critical in materials undergoing structural phase transitions. The typical workflow involves: (i) running finite-temperature MD with an appropriate interatomic potential (DFT-based or MLP), (ii) processing the trajectory with TDEP tools to fit effective IFCs, and (iii) importing the resulting force constants into \kappa ALDo via the tdep format. Integration with machine-learned potentials (MLPs) proceeds through two primary pathways: Direct ASE 4 calculators wrapping MLP implementations or LAMMPS PHONON package 61 , enabling force evaluations during finite-difference IFC computation. Alternatively, MLPs can be employed within GPUMD 62 and ASE for large-scale MD simulations, with forces extracted during post-processing via TDEP. Supported MLPs include NEP 21 , MACE 26 , MatterSim 24 , Orb 25 , DeepMD 63 , and others accessible through ASE or LAMMPS interfaces. For a system with N_{b} atoms in the unit cell and N atoms in the supercell representation, a second-order IFC tensor has a maximum size of 3N_{b}\times 3N elements and is always stored as a dense matrix. Third-order force constants are stored as sparse tensors (SciPy COO format) to manage memory for large systems, where the dense representation would require 3N_{b}\times(3N)^{2} elements to be stored. To achieve a sparse representation while retaining good accuracy, users can specify a third_energy_threshold to discard negligible matrix elements, Distance-based truncation via distance_threshold further compresses the representation of the anharmonic IFC tensor by neglecting interactions beyond a specified cutoff radius. This approximation is valid for short-range interactions, and convergence needs to be verified for each system. Phonon Properties and Scattering The Phonons class computes vibrational properties and phonon scattering rates from force constants. Core functionality includes frequency and eigenvector calculation (Eq. 4 ), group velocity evaluation via the Hellmann-Feynman theorem, and three-phonon scattering matrix construction. Group Velocities Phonon group velocity, governing energy transport, is computed as: v_{\mu\alpha}=\frac{\partial\omega_{\mu}}{\partial q_{\alpha}}=\frac{1}{2\omega_{\mu}}\sum_{i\beta i^{\prime}\beta^{\prime}}\eta^{*}_{i\beta\mu}\frac{\partial D_{i\beta i^{\prime}\beta^{\prime}}(\mathbf{q})}{\partial q_{\alpha}}\eta_{i^{\prime}\beta^{\prime}\mu}, (5) implemented via finite-difference evaluation of \partial D/\partial q_{\alpha} or analytic derivatives when available from IFC spatial Fourier transforms. Phonon Populations and Heat Capacity The equilibrium phonon population follows Bose-Einstein statistics: n_{\mu}(T)=\frac{1}{e^{\hbar\omega_{\mu}/k_{B}T}-1}, (6) or in the classical limit ( k_{B}T\gg\hbar\omega_{\mu} ), n_{\mu}^{\text{cl}}=k_{B}T/(\hbar\omega_{\mu}) . The modal heat capacity is: c_{\mu}=k_{B}\left(\frac{\hbar\omega_{\mu}}{k_{B}T}\right)^{2}\frac{e^{\hbar\omega_{\mu}/k_{B}T}}{(e^{\hbar\omega_{\mu}/k_{B}T}-1)^{2}}=\hbar\omega_{\mu}\frac{\partial n_{\mu}}{\partial T}, (7) reducing to c_{\mu}^{\text{cl}}=k_{B} classically. The flag is_classic controls which statistics are employed. Three-Phonon Scattering Anharmonic three-phonon scattering arises from the first (cubic) anharmonic term of the Taylor expansion of the potential/free energy. Fermi’s golden rule yields scattering rates for processes \mu\rightarrow\mu^{\prime}+\mu^{\prime\prime} (phonon splitting, “+”) and \mu+\mu^{\prime}\rightarrow\mu^{\prime\prime} (phonon merging, “ - ”): \Gamma^{\pm}_{\mu\mu^{\prime}\mu^{\prime\prime}}=\frac{\hbar\pi}{8\omega_{\mu}\omega_{\mu^{\prime}}\omega_{\mu^{\prime\prime}}}|\Phi^{\pm}_{\mu\mu^{\prime}\mu^{\prime\prime}}|^{2}\Delta^{\pm}_{\mu\mu^{\prime}\mu^{\prime\prime}}(n_{\mu^{\prime}},n_{\mu^{\prime\prime}}), (8) where \Phi^{\pm}_{\mu\mu^{\prime}\mu^{\prime\prime}} is the projected third-order potential, and \Delta^{\pm} encodes energy and momentum conservation, and thermal population factors: \displaystyle\Delta^{+}_{\mu\mu^{\prime}\mu^{\prime\prime}} \displaystyle=(n_{\mu^{\prime}}-n_{\mu^{\prime\prime}})\delta(\omega_{\mu}-\omega_{\mu^{\prime}}+\omega_{\mu^{\prime\prime}})\delta_{\mathbf{q}_{\mu},\mathbf{q}_{\mu^{\prime}}-\mathbf{q}_{\mu^{\prime\prime}}+\mathbf{G}}, (9) \displaystyle\Delta^{-}_{\mu\mu^{\prime}\mu^{\prime\prime}} \displaystyle=(n_{\mu^{\prime}}+n_{\mu^{\prime\prime}}+1)\delta(\omega_{\mu}+\omega_{\mu^{\prime}}-\omega_{\mu^{\prime\prime}})\delta_{\mathbf{q}_{\mu}+\mathbf{q}_{\mu^{\prime}},\mathbf{q}_{\mu^{\prime\prime}}+\mathbf{G}}, (10) with reciprocal lattice vectors \mathbf{G} allowing umklapp processes that conserve the crystal momentum as in \mathbf{q}\pm\mathbf{q^{\prime}}-\mathbf{q^{\prime\prime}}=\mathbf{G} . The projected potential is: \Phi_{\mu\mu^{\prime}\mu^{\prime\prime}}=\sum_{i\alpha i^{\prime}\alpha^{\prime}i^{\prime\prime}\alpha^{\prime\prime}}\frac{\phi^{\prime\prime\prime}_{i\alpha i^{\prime}\alpha^{\prime}i^{\prime\prime}\alpha^{\prime\prime}}}{\sqrt{m_{i}m_{i^{\prime}}m_{i^{\prime\prime}}}}\eta_{i\alpha\mu}\eta_{i^{\prime}\alpha^{\prime}\mu^{\prime}}\eta_{i^{\prime\prime}\alpha^{\prime\prime}\mu^{\prime\prime}}, (11) requiring summation over all atoms and Cartesian directions, the most computationally demanding step in ALD calculations. Note that the projected potential is symmetric with respect to the process type: \Phi^{+}_{\mu\mu^{\prime}\mu^{\prime\prime}}=\Phi^{-}_{\mu\mu^{\prime}\mu^{\prime\prime}}\equiv\Phi_{\mu\mu^{\prime}\mu^{\prime\prime}} , as the same matrix element governs both emission and absorption. The \pm distinction in Eq. 8 arises solely from the different energy-momentum conservation rules and population factors encoded in \Delta^{\pm} , not from different interaction strengths. Specifically, |\Phi^{\pm}_{\mu\mu^{\prime}\mu^{\prime\prime}}|^{2} represents the scattering transition probability, which is intrinsic to the three-phonon interaction and independent of whether the process is absorption or emission. Energy conservation in the three-phonon scattering processes ( \omega_{\mu}\pm\omega_{\mu}^{\prime}-\omega_{\mu}^{\prime\prime}=0 ) is implemented by smearing the frequencies with finite-width distribution functions: \delta(\omega)\approx\frac{1}{\pi}\frac{{\sigma/2}}{\omega^{2}+{(\sigma/2)^{2}}}\quad\text{(Lorentzian)},\qquad\delta(\omega)\approx\frac{1}{{\sqrt{\pi}\sigma}}e^{-\omega^{2}/{\sigma^{2}}}\quad\text{(Gaussian)}, (12) with bandwidth \sigma set via third_bandwidth or calculated adaptively from phonon group velocity dispersions 52 . Both functions are normalized to unity over (-\infty,+\infty) ; scattering contributions are evaluated only for mode pairs satisfying |\Delta\omega|<2\sigma Three broadening schemes are available via the broadening_shape parameter: Lorentzian ( shape=’lorentz’ ), which has long tails and is exact for exponentially decaying correlations; Gaussian ( shape=’gauss’ ), the most common choice with smooth and faster-decaying tails; and triangular ( shape=’triangle’ ), which uses linear interpolation for fast computation at reduced accuracy, suitable for initial screening calculations. The phonon lifetime (inverse bandwidth) is: \tau_{\mu}=\frac{1}{2\Gamma_{\mu}}=\frac{1}{2\sum_{\mu^{\prime}\mu^{\prime\prime}}(\Gamma^{+}_{\mu\mu^{\prime}\mu^{\prime\prime}}+\Gamma^{-}_{\mu\mu^{\prime}\mu^{\prime\prime}})}. (13) Computational Implementation The bottleneck in ALD simulations is calculating phonon coupling terms and scattering matrix elements, which require projecting third-order force constants onto phonon eigenstates (Eq. 11 ). This projection scales as \mathcal{O}((N_{q}\cdot 3N_{b})^{3}) , where N_{q} is the number of q -points. \kappa ALDo 2.0 implements this algorithm as tensor multiplications: N_{q}\times(3N_{b})^{2} for BTE calculations (two N_{q}\times 3N_{b} tensor multiplications).Several optimization strategies are employed: 1. Sparse tensor operations: Third-order IFCs are stored in coordinate (COO) format and processed using TensorFlow sparse kernels, avoiding dense instantiation. 2. GPU acceleration: Matrix multiplications in the projection are offloaded to GPU via TensorFlow when available. 3. Selective calculation: Scattering rates are computed only for physical modes (frequency above min_frequency , below max_frequency ), excluding acoustic modes at \Gamma and user-defined frequency ranges. 4. Caching: Intermediate results ( _ps_and_gamma , _sparse_phase_and_potential ) are cached to disk in multiple formats (NumPy .npz , HDF5), avoiding recomputation in iterative workflows. The user can control the phonon projection framework through Phonons class parameters: storage (memory management strategy), broadening_shape (energy conservation kernel), is_balanced (symmetrizes population factors in three-phonon scattering rates to enforce detailed balance, improving convergence on coarse q -grids), and third_bandwidth (custom broadening width). Thermal Conductivity Given phonon frequencies, velocities, and scattering rates from the Phonons object, the Conductivity class solves for thermal transport using the BTE 64 , 38 or the QHGK formalism 41 . Boltzmann Transport Equation Under an applied temperature gradient \nabla_{\alpha}T , the phonon distribution deviates from equilibrium, with the deviation \delta n_{\mu} determined by the linearized BTE: \mathbf{v}_{\mu}\cdot\nabla T\frac{\partial n_{\mu}}{\partial T}=-\sum_{\mu^{\prime}}\tilde{\Gamma}_{\mu\mu^{\prime}}\delta n_{\mu^{\prime}}, (14) where the scattering matrix decomposes as \tilde{\Gamma}_{\mu\mu^{\prime}}=\delta_{\mu\mu^{\prime}}\Gamma^{0}_{\mu}+\Gamma^{1}_{\mu\mu^{\prime}} , with the diagonal terms calculated as: \Gamma^{0}_{\mu}=\sum_{\mu^{\prime}\mu^{\prime\prime}}(\Gamma^{+}_{\mu\mu^{\prime}\mu^{\prime\prime}}+\Gamma^{-}_{\mu\mu^{\prime}\mu^{\prime\prime}}) (15) and the off-diagonal terms: \Gamma^{1}_{\mu\mu^{\prime}}=-\sum_{\mu^{\prime\prime}}\left[\Gamma^{+}_{\mu\mu^{\prime}\mu^{\prime\prime}}+\Gamma^{-}_{\mu\mu^{\prime}\mu^{\prime\prime}}+\Gamma^{+}_{\mu^{\prime}\mu\mu^{\prime\prime}}+\Gamma^{-}_{\mu^{\prime}\mu\mu^{\prime\prime}}\right]. (16) that captures mode-coupling. Normal processes ( \mathbf{G}=0 ) redistribute energy without relaxing heat flux, while umklapp processes ( \mathbf{G}\neq 0 ) provide thermal resistance. The BTE can be rewritten as a linear algebra system in which the phonon mean free paths \lambda_{\mu^{\prime}} are calculated as: \mathbf{v}_{\mu}=\sum_{\mu^{\prime}}\left(\delta_{\mu\mu^{\prime}}\Gamma^{0}_{\mu}+\Gamma^{1}_{\mu\mu^{\prime}}\right)\lambda_{\mu^{\prime}}. (17) The thermal conductivity is then obtained as: \kappa_{\alpha\beta}=\frac{1}{N_{q}V}\sum_{\mu}c_{\mu}\mathrm{v}_{\mu\alpha}\lambda_{\mu\beta}. (18) The phonon mean free paths can be expressed in terms of phonon lifetimes as \lambda_{\mu\beta}=\mathrm{v}_{\mu\beta}\tau_{\mu\beta} . Three solution methods are implemented: (i) Relaxation Time Approximation (RTA). Neglecting off-diagonal coupling ( \Gamma^{1}=0 ), the mean free path simplifies to \lambda_{\mu\alpha}=\tau_{\mu}v_{\mu\alpha} with \tau_{\mu}=1/\Gamma^{0}_{\mu} , yielding: \kappa^{\text{RTA}}_{\alpha\beta}=\frac{1}{N_{q}V}\sum_{\mu}c_{\mu}\mathrm{v}_{\mu\alpha}\tau_{\mu}\mathrm{v}_{\mu\beta}=\frac{1}{N_{q}V}\sum_{\mu}c_{\mu}\mathrm{v}_{\mu\alpha}\frac{1}{\Gamma^{0}_{\mu}}\mathrm{v}_{\mu\beta}. (19) This approximation neglects momentum-conserving normal (N) processes. Whereas it is usually sufficiently accurate for systems with strong Umklapp scattering, it may underestimate the thermal conductivity by more than 50% in materials where N-processes are significant 65 . (ii) Self-Consistent Iterative Method (SC). The full BTE (Eq. 17 ) is solved iteratively 66 , 67 : \lambda^{(n+1)}_{\mu\alpha}=\frac{v_{\mu\alpha}}{\Gamma^{0}_{\mu}}-\frac{1}{\Gamma^{0}_{\mu}}\sum_{\mu^{\prime}}\Gamma^{1}_{\mu\mu^{\prime}}\lambda^{(n)}_{\mu^{\prime}\alpha}, (20) initialized with RTA solution \lambda^{(0)}_{\mu\alpha}=v_{\mu\alpha}/\Gamma^{0}_{\mu} . Convergence is guaranteed when \|\Gamma^{1}/\Gamma^{0}\|<1 68 . The user specifies the maximum number of iterations ( n_iterations ) and convergence tolerance ( tolerance ) on the relative change in the isotropically-averaged thermal conductivity: |\kappa^{(n+1)}-\kappa^{(n)}|/\kappa^{(n)}<\epsilon_{\text{tol}} between successive iterations, where \kappa=\text{Tr}(\kappa_{\alpha\beta})/3 . This method balances accuracy and memory, avoiding explicit storage of the full scattering matrix. (iii) Full Matrix Inversion. The exact solution of Eq. 17 can be obtained by inverting the scattering matrix. \kappa_{\alpha\beta}=\frac{1}{N_{q}V}\sum_{\mu\mu^{\prime}}c_{\mu}v_{\mu\alpha}(\tilde{\Gamma}^{-1})_{\mu\mu^{\prime}}v_{\mu^{\prime}\beta}. (21) This provides the most accurate BTE solution but requires storing the full (N_{q}\cdot 3N)\times(N_{q}\cdot 3N) scattering matrix, limiting applicability to moderate system sizes. Method selection is specified via method=’rta’/’sc’/’inverse’/’full’ when instantiating the Conductivity object. Memory scaling differs significantly: RTA and self-consistent methods require N_{q}\times(3N)^{2} storage, while full inversion and eigendecomposition require (N_{q}\cdot 3N)^{2} storage. For most bulk materials at moderate temperatures, the self-consistent method provides an optimal balance of accuracy and computational cost, while RTA is suitable for quick estimates and materials with strong anharmonicity. Finite-size effects, boundary scattering, and eigendecomposition approach. When characteristic sample dimensions L_{\alpha} become comparable to or smaller than phonon mean free paths, confinement and boundary scattering fundamentally alter thermal transport 69 , 70 . This regime is ubiquitous in nanoscale systems, including nanowires, thin films, superlattices, and nanostructured thermoelectrics, as well as in low-dimensional materials (graphene, nanotubes) at cryogenic temperatures, where thermal phonon mean free paths can exceed millimeters 71 . \kappa ALDo 2.0 provides two complementary approaches to address finite-size transport. The first adds a boundary scattering term to the diagonal of the full scattering matrix before inversion 72 , 73 : \tilde{\Gamma}^{\text{fs}}_{\mu\mu^{\prime}}=\tilde{\Gamma}_{\mu\mu^{\prime}}+\delta_{\mu\mu^{\prime}}\frac{2|v_{\mu\alpha}|}{L_{\alpha}}, (22) where v_{\mu\alpha} is the group velocity component and L_{\alpha} the sample dimension along direction \alpha . The mean free path is then obtained from full matrix inversion: \lambda^{\text{fs}}_{\mu\alpha}=\sum_{\mu^{\prime}}[(\tilde{\Gamma}^{\text{fs}})^{-1}]_{\mu\mu^{\prime}}v_{\mu^{\prime}\alpha}. (23) Unlike Matthiessen’s rule, which would simply add scattering rates for independent modes ( \tau^{-1}_{\text{eff}}=\tau^{-1}_{\text{anh}}+2|v|/L ), this formulation preserves the off-diagonal scattering matrix elements \Gamma^{1}_{\mu\mu^{\prime}} that describe momentum exchange between modes, correctly capturing the interplay between boundary scattering and collective phonon transport. This is selected via finite_length_method=’ms’ , with sample dimensions specified via length=(L_x, L_y, L_z) in Ångströms (using None or 0 for infinite dimensions). For strongly confined systems with L\ll\lambda_{\text{ph}} , the ballistic limit ( finite_length_method=’ballistic’ ) is also available. The second approach employs full eigendecomposition of the scattering matrix ( method=’full’ ) 68 . The method diagonalizes the scattering matrix \Gamma=U\Lambda U^{T} , where \Gamma is the (N_{q}\cdot 3N)\times(N_{q}\cdot 3N) phonon-phonon scattering matrix, U contains the eigenvectors (columns), and \Lambda is a diagonal matrix of eigenvalues representing the decay rates of the collective heat-carrying excitations (termed "relaxons" in the original formulation). These collective modes decay exponentially as e^{-\lambda_{i}t} with time constants \tau_{i}=1/\lambda_{i} , where \lambda_{i} are the eigenvalues. Rather than treating each phonon mode independently as in RTA, this approach identifies the true collective eigenmodes of the scattering operator that carry heat. This is essential in the hydrodynamic regime where momentum-conserving normal (N) processes dominate, causing breakdown of conventional RTA and self-consistent approximations. The eigendecomposition enables mode-by-mode analysis of transport contributions through the eigenvalue spectrum and can filter unphysical negative eigenvalues via is_using_gamma_tensor_evects , improving numerical stability. For a detailed description of the formalism and its physical interpretation, see Ref. 68 , 74 . Quasi-Harmonic Green-Kubo (QHGK) The QHGK approach 41 provides a unified lattice dynamic theory for both crystalline and disordered systems. This theory bridges and extends the BTE method for crystals and the Allen-Feldman theory for glasses 75 , 76 , and results in equations practically equivalent to the Wigner transport formalism 40 , 77 , naturally capturing diffuson and locon contributions 78 , 43 (vibrational modes that transport heat through diffusion or remain localized, respectively). The QHGK approach is particularly relevant for disordered, defective, and amorphous materials, where translational symmetry is broken, and the traditional BTE framework (which relies on well-defined wavevectors and Bloch states) becomes inapplicable, and for strongly anharmonic crystals for which the interband contribution to heat transport is substantial. For amorphous systems, QHGK is formulated as a real-space, \Gamma- point approach for large simulation cells ( N_{q}=1 , large N ), using (3N)^{2} storage to save the system state, making it computationally efficient for modeling disorder at the atomic scale. The thermal conductivity is: \kappa_{\alpha\beta}=\frac{1}{V}\sum_{\mu\mu^{\prime}}c_{\mu\mu^{\prime}}v_{\mu\mu^{\prime}}^{\alpha}\tau_{\mu\mu^{\prime}}v_{\mu\mu^{\prime}}^{\beta}, (24) where c_{\mu\mu^{\prime}} are generalized modal heat capacities defined as c_{\mu\mu^{\prime}}=\frac{k_{B}}{T}\frac{\omega_{\mu}\omega_{\mu^{\prime}}(n_{\mu}-n_{\mu^{\prime}})}{\omega_{\mu^{\prime}}-\omega_{\mu}} for \mu\neq\mu^{\prime} and c_{\mu\mu}=c_{\mu} (the diagonal heat capacity from Eq. 7 ) for degenerate modes. The generalized velocities are defined as v_{\mu\mu^{\prime}}^{\alpha}=\sum_{i\beta i^{\prime}\beta^{\prime}}\eta^{*}_{i\beta\mu}\frac{\partial D_{i\beta i^{\prime}\beta^{\prime}}}{\partial R_{i^{\prime}\alpha}}\eta_{i^{\prime}\beta^{\prime}\mu^{\prime}} , where \partial D/\partial R_{i^{\prime}\alpha} represents the derivative of the dynamical matrix with respect to atomic position, capturing how vibrational modes couple through atomic displacements. This operator captures non-diagonal contributions arising from the breakdown of wavevector definition in disordered systems, essential for representing diffuson transport. The generalized lifetimes \tau_{\mu\mu^{\prime}} are computed from thermal diffusivities with a broadening function. For Lorentzian broadening, \tau_{\mu\mu^{\prime}}=\frac{\gamma_{\mu\mu^{\prime}}}{2[(\omega_{\mu}-\omega_{\mu^{\prime}})^{2}+\gamma_{\mu\mu^{\prime}}^{2}]}, (25) where \gamma_{\mu\mu^{\prime}} is the bandwidth parameter controlling the energy resolution. However, the impact of QHGK is not limited to disordered systems. Indeed, in crystals, the QHGK approach highlights an additional transport contribution on top of the BTE one. In the RTA, it reads: \kappa_{\alpha\beta}=\kappa^{\mathrm{RTA}}+\frac{1}{V}\sum_{\mathbf{q}s\neq s^{\prime}}c_{\mathbf{q}ss^{\prime}}v_{\mathbf{q}ss^{\prime}}^{\alpha}\tau_{\mathbf{q}ss^{\prime}}v_{\mathbf{q}s^{\prime}s}^{\beta}, (26) where phonon is explicitly labeled with its own Bloch wavevector \mathbf{q} and band index s , \mu=(\mathbf{q}s) . The second sum in the expression indicated the so-called interband contribution 40 , between pairs of phonons with the same wavevector but different band indices. Although the BTE is generally dominant for most crystals, it has been shown that the additional term can significantly affect the thermal conductivity and its temperature dependence in certain crystals, e.g., GeTe and halide perovskites 79 , 44 . Finally, the QHGK formalism can be further extended beyond the RTA by employing the full scattering matrix in the intraband term 40 , 77 . In practice, \kappa^{\mathrm{RTA}} is replaced by the full BTE result, while the interband contribution is retained at the RTA level. As shown in Ref. 77 , the full scattering matrix is typically relevant only at very low temperatures, where the interband contribution becomes negligible, thereby justifying the simplified RTA treatment adopted for the latter. In addition to thermal conductivity, the QHGK method computes mode-resolved thermal diffusivities D_{\mu} accessible via Conductivity.diffusivity , providing insight into the spatial extent of vibrational energy transport and enabling identification of propagons, diffusons, and locons in disordered materials. Implementation details follow Ref. 41 , with broadening controlled by diffusivity_bandwidth and diffusivity_shape (Lorentzian, Gaussian, or triangular kernels). Modeling Extensions Beyond core thermal conductivity calculations, \kappa ALDo 2.0 provides specialized capabilities for challenging materials and computational efficiency enhancements for large-scale studies. Isotopic Scattering Natural isotopic disorder introduces mass variance that scatters phonons even in otherwise perfect harmonic crystals. Following Tamura’s perturbation theory 80 , the isotopic scattering rate for a phonon mode (\mathbf{q},s) reads \gamma^{\mathrm{iso}}_{\mathbf{q}s}=\frac{\pi}{2N_{q}}\,\omega_{\mathbf{q}s}^{2}\sum_{\mathbf{q}^{\prime}s^{\prime}}\delta\!\left(\omega_{\mathbf{q}s}-\omega_{\mathbf{q}^{\prime}s^{\prime}}\right)\sum_{i\alpha}g_{i}\left|\eta_{\mathbf{q}s}^{*,i\alpha}\eta_{\mathbf{q}^{\prime}s^{\prime}}^{i\alpha}\right|^{2}, (27) where \mathbf{q} and s denote the phonon wavevector and band index, respectively, \alpha labels the Cartesian direction, and g_{i}=\sum_{\mathrm{iso}}f_{i,\mathrm{iso}}(\Delta M_{i,\mathrm{iso}}/M_{i})^{2} is the relative mass-variance parameter of the i -th atom in the unit cell, defined in terms of the isotope fraction f_{i,\mathrm{iso}} and mass deviation \Delta M_{i,\mathrm{iso}} . In practice, isotopic scattering can be enabled by setting include_isotopes=True . If the input g_factor array is omitted, natural isotopic abundances from the ASE database are automatically used to compute it. Moreover, by tuning the g_factor , Tamura’s formalism provides a perturbative description of mass-disorder scattering in alloyed systems, such as silicon–germanium alloys 81 , 46 . Finally, the total scattering rate becomes \gamma_{\mu}=\gamma^{\text{anh}}_{\mu}+\gamma^{\text{iso}}_{\mu} . Non-Analytical Term Corrections In polar materials (ionic or covalent crystals with non-zero Born effective charges), long-range dipole-dipole interactions render the dynamical matrix non-analytic at \Gamma 82 . This causes directional dependence of the longitudinal optical (LO) and transverse optical (TO) mode splitting in the \mathbf{q}\rightarrow 0 limit. Neglecting this effect produces incorrect phonon dispersions near \Gamma and erroneous thermal conductivities. \kappa ALDo 2.0 implements the non-analytical correction (NAC) following Gonze and Lee: D^{\text{NAC}}_{i\alpha i^{\prime}\beta}(\mathbf{q})=\frac{1}{\sqrt{m_{i}m_{i^{\prime}}}}\frac{4\pi}{V_{\text{cell}}}\frac{(\sum_{\gamma}q_{\gamma}Z^{*}_{i,\gamma\alpha})(\sum_{\gamma^{\prime}}q_{\gamma^{\prime}}Z^{*}_{i^{\prime},\gamma^{\prime}\beta})}{\sum_{\alpha\beta}q_{\alpha}\epsilon^{\infty}_{\alpha\beta}q_{\beta}}, (28) where Z^{*}_{i,\gamma\alpha} is the Born effective charge tensor and \epsilon^{\infty}_{\alpha\beta} the high-frequency dielectric tensor. These quantities are obtained from DFPT calculations (Quantum ESPRESSO’s ph.x ) and imported via the is_nac=True flag during Phonons initialization. The NAC term is added to D(\mathbf{q}) before diagonalization for all \mathbf{q} near \Gamma . Figure 9 in Section 3 demonstrates the importance of NAC for polar oxides. Low-Dimensional Systems: Nanowires and Nanotubes \kappa ALDo 2.0 provides specialized support for quasi-one-dimensional systems such as nanowires and carbon nanotubes via the is_nw flag. In these geometries, translational symmetry is broken in two directions while periodic boundary conditions apply along the transport axis. Setting is_nw=True modifies the k-point sampling strategy to focus computational effort along the transport direction (e.g., kpts=[1, 1, 11] for z-axis transport), and adjusts the thermal conductivity normalization to account for the reduced cross-sectional area rather than three-dimensional volume. This capability is particularly valuable for studying thermal transport in carbon nanotubes, semiconductor nanowires, and other quasi-1D structures where boundary scattering and reduced dimensionality dominate . When combined with finite-size effects ( length parameter), \kappa ALDo 2.0 enables prediction of length-dependent thermal conductivity in nanotubes and nanowires, critical for thermoelectric and thermal interface material applications 83 . Elastic Properties The same second-order force constants used for phonon calculations also determine elastic properties. The elastic stiffness tensor C_{ijkl} relates stress and strain via generalized Hooke’s law. Following the derivation in Ref. 84 , the elastic tensor is computed from: C_{ijkl}=\frac{1}{V}\left[\sum_{nm}\phi^{(2)}_{nm,ik,jl}+\sum_{n\mu}\frac{(\partial D/\partial\epsilon_{ij})_{n\mu}(\partial D/\partial\epsilon_{kl})_{n\mu}}{\omega^{2}_{\mu}}\right], (29) where indices i,j,k,l denote Cartesian directions and strain components, and \epsilon is the strain tensor. The implementation in ForceConstants.elastic_prop() returns the full fourth-rank tensor in GPa. Derived quantities, like the bulk modulus B , shear modulus G , and Young’s modulus E , are extracted using Voigt-Reuss-Hill averaging. This capability is particularly valuable when combined with TDEP, enabling temperature-dependent elastic constant determination from the same MD trajectories used for thermal conductivity 51 . Harmonic Free Energy and Thermal Expansion via Quasi-Harmonic Approximation \kappa ALDo 2.0 implements calculation of the harmonic contribution to the Helmholtz free energy for a system of harmonic oscillators with frequencies \omega_{\mu}(\mathbf{q}) : F_{\text{vib}}(T)=\sum_{\mathbf{q}\mu}\left[\frac{\hbar\omega_{\mu}(\mathbf{q})}{2}+k_{B}T\ln\left(1-e^{-\hbar\omega_{\mu}(\mathbf{q})/(k_{B}T)}\right)\right], (30) which includes both the zero-point energy contribution and the thermal population term. This quantity is essential for thermodynamic calculations and enables thermal expansion predictions via the quasi-harmonic approximation (QHA) 85 , 86 , 87 . In the QHA framework, temperature-dependent equilibrium volumes and elastic properties are determined by minimizing the total Helmholtz free energy: F(V,T)=E_{0}(V)+F_{\text{vib}}(V,T)=E_{0}(V)+\sum_{\mu}\left[\frac{\hbar\omega_{\mu}(V)}{2}+k_{B}T\ln\left(1-e^{-\hbar\omega_{\mu}(V)/(k_{B}T)}\right)\right], (31) where E_{0}(V) is the static lattice energy and F_{\text{vib}}(V,T) is the vibrational free energy evaluated at different volumes. By calculating force constants and phonon frequencies across a grid of lattice parameters (controlled via the quasiharmonic module), the code determines equilibrium volumes, thermal expansion coefficients \alpha(T)=(1/V)(\partial V/\partial T)_{P} , and pressure-temperature phase diagrams. This functionality complements TDEP workflows by providing an alternative route to finite-temperature lattice properties when the computational cost of systematic volume sampling is acceptable. QHA is particularly useful for materials with moderate anharmonicity where explicit inclusion of temperature-dependent force renormalization (via TDEP) may not be necessary. Analysis Tools Anharmonicity Quantification Before devoting to expensive thermal transport calculations, it is useful to assess whether anharmonicity is significant. The \sigma_{A} score 88 represents anharmonic strength by comparing actual forces to their anharmonic contributions: \sigma_{A}=\sqrt{\frac{\langle(F^{\text{anharm}})^{2}\rangle}{\langle F^{2}\rangle}},\ F^{\text{anharm}}=F-F^{\text{harm}}, (32) where F are forces along an MD trajectory and F^{\text{harm}}=-\Phi^{(2)}\cdot u are forces predicted from second-order IFCs and displacements u . \sigma_{A} below 0.1 indicates a harmonic regime, 0.1<\sigma_{A}<0.5 for weak anharmonicity, and \sigma_{A} greater than 0.5 signifies strong anharmonicity, which indicates that accurate lattice thermal conductivity predictions might require beyond three-phonon BTE or molecular dynamics. The function sigma2_tdep_md() in the controllers.sigma2 module automates this calculation given TDEP force constants and an MD trajectory. Participation Ratio The participation ratio PR_{\mu} quantifies mode localization, particularly important in disordered systems: PR_{\mu}=\frac{1}{N}\left(\sum_{i=1}^{N}\sum_{\alpha}|\eta_{i\alpha\mu}|^{2}\right)^{2}\left(\sum_{i=1}^{N}\sum_{\alpha}|\eta_{i\alpha\mu}|^{4}\right)^{-1}. (33) Extended modes have PR\sim 1 , while localized modes have PR\ll 1 78 . Computed automatically via Phonons.participation_ratio , this property helps identify diffuson and locon contributions to thermal conductivity. Software Architecture and Performance Object-Oriented Design and Lazy Evaluation \kappa ALDo 2.0 employs a three-tier class hierarchy mirroring the computational workflow: ForceConstants manages IFCs and atomic geometry, Phonons computes vibrational properties and scattering rates, and Conductivity solves the BTE or QHGK. Each class inherits from the Storable base class, implementing lazy evaluation via the @lazy_property decorator pattern. Expensive properties (e.g., scattering rates, mean free paths) are computed only when accessed and cached automatically based on a label encoding relevant parameters (temperature, q -mesh, statistics). This dramatically reduces computation time for iterative workflows like convergence testing and parameter sweeps. Storage Backends Four storage formats accommodate different use cases, selected via storage=’formatted’/’numpy’/’hdf5’/’memory’ : formatted text files enable human inspection and interoperability; binary NumPy arrays provide fast I/O for production calculations; HDF5 organizes complex multi-parameter datasets; and memory-only mode suits transient calculations. Table 2 provides detailed performance characteristics. Table 2 : Comparison of storage backends for caching intermediate results in \kappa ALDo 2.0 calculations. Backend I/O Speed Storage Efficiency Recommended Use Case formatted Slow (text parsing) Low (ASCII) Human inspection; small systems; sharing with non-Python tools numpy Fast (binary) High (compressed) Production calculations; large systems; iterative workflows hdf5 Fast (binary) High (compressed) Complex datasets; multiple parameter sets; database integration memory Fastest (RAM only) N/A (no disk) Transient calculations; HPC job arrays; testing Visualization and Analysis Tools \kappa ALDo 2.0 includes comprehensive plotting utilities via the plotter module for rapid visualization and analysis of phonon properties. The plot_crystal() function automatically generates publication-quality figures for crystalline materials including: (i) phonon dispersion along high-symmetry paths, (ii) phonon density of states, (iii) group velocity versus q -vector, (iv) group velocity versus frequency, (v) heat capacity versus frequency, (vi) three-phonon scattering phase space, (vii) phonon lifetimes, (viii) scattering rates, (ix) mean free paths, (x) per-mode thermal conductivity contributions, (xi) cumulative \kappa versus frequency, and (xii) cumulative \kappa versus mean free path. For disordered and amorphous systems, plot_amorphous() provides all frequency-dependent plots plus mode thermal diffusivity and participation ratio analyses, essential for identifying propagons, diffusons, and locons. Individual plotting functions ( plot_dispersion() , plot_dos() , plot_vs_frequency() ) enable custom analysis workflows. All figures are automatically saved in high resolution with systematic folder organization based on simulation parameters (temperature, q -mesh, solution method), facilitating comparison across parameter sets. Performance Optimization Key performance features include: Sparse tensor operations: Third-order IFCs and scattering matrices are stored and manipulated in sparse formats (COO, CSR), reducing memory footprint by 100–1000 \times for typical systems. GPU acceleration: TensorFlow backend automatically utilizes available GPUs for tensor contractions in the IFC projection step (Eq. 11 ). Benchmarks on NVIDIA A100 show 5–10 \times speedup relative to CPU for N>50 atom unit cells. Further benchmark of runtime as a function of system sizes is shown in Figure 3 . Multi-temperature optimization: Version 2.0 decouples temperature-invariant computations from temperature-dependent population factors, enabling efficient thermal conductivity calculations across multiple temperatures. The computationally intensive projection of third-order force constants onto phonon modes (Eq. 11 ) is decoupled from temperature-dependent population factors. This allows the projection tensors to be computed once and cached, reducing the complexity of subsequent temperature sweeps from \mathcal{O}(N_{T}\cdot N^{3}) to \mathcal{O}(N^{3}+N_{T}\cdot N^{2}) , where N_{T} is the number of temperatures, providing order-of-magnitude speedups for typical material screening workflows. Vectorization: NumPy broadcasting and opt_einsum optimized contractions minimize Python-level loops in scattering calculations. Parallel q -point loops: Phonon property calculations at different q -points are embarrassingly parallel. While the current implementation is serial, users can easily parallelize via external job managers (SLURM array jobs, Python multiprocessing ). Figure 3 : Runtime profiling was performed for QHGK calculations of the lattice thermal conductivity of bulk Si across a range of system sizes, using a fixed 3\times 3\times 3 q-grid. Benchmarks were run on a single NVIDIA L40S GPU and on 16 CPU cores of an Intel Xeon Platinum 8562Y processor. Interatomic force constants for the profiling were obtained using the Tersoff potential. 89 Deployment and Documentation \kappa ALDo 2.0 emphasizes reproducibility and accessibility: Containerization: Docker images with all dependencies pre-installed enable one-line deployment across platforms. Cloud tutorials: Google Colab notebooks provide interactive tutorials runnable in web browsers without local installation. Continuous integration: Automated testing via CircleCI ensures code quality. Pull requests require passing 40+ unit tests covering core functionality and regression prevention. Auto-generated documentation: Sphinx processes docstrings into HTML/PDF manuals hosted at https://nanotheorygroup.github.io/kaldo , synchronized with each release. Example library: A standalone repository hosted at https://github.com/nanotheorygroup/kaldo-examples containing detailed examples to model lattice thermal conductivity of semiconducting materials (e.g. Si , Ge , SiC , GaAs , MgO , AlN , NaCl ) using various workflows including DFT with DFPT/D3Q, empirical potentials via LAMMPS, and machine-learned potentials (MatterSim 24 , ORB 25 , NEP 21 , ACE 51 , UPET 90 ). Example: Basic Workflow To illustrate typical usage, we present an example calculating the thermal conductivity of SiC using the MatterSim machine-learned potential with structure optimization: ⬇ 1 # Import kALDo classes and ASE 2 from kaldo . forceconstants import ForceConstants 3 from kaldo . phonons import Phonons 4 from kaldo . conductivity import Conductivity 5 import kaldo . controllers . plotter as plotter 6 from ase . build import bulk 7 from ase . optimize import BFGS 8 from ase . constraints import StrainFilter 9 from mattersim . forcefield import MatterSimCalculator 10 11 # Stage 1: Structure optimization 12 atoms = bulk ( ’SiC’ , ’zincblende’ , a =4.35) 13 calc = MatterSimCalculator ( device = ’cuda’ ) 14 atoms . calc = calc 15 16 # Optimize lattice parameters and atomic positions 17 sf = StrainFilter ( atoms ) 18 opt = BFGS ( sf ) 19 opt . run ( fmax =0.001) 20 21 # Stage 2: Compute force constants using finite differences 22 fc = ForceConstants ( 23 atoms = atoms , 24 supercell =[10, 10, 10], 25 third_supercell =[5, 5, 5], 26 folder = ’fd_SiC_MatterSim’ 27 ) 28 fc . second . calculate ( calc , delta_shift =0.03) 29 fc . third . calculate ( calc , delta_shift =0.03) 30 31 # Stage 3: Calculate phonon properties 32 phonons = Phonons ( 33 forceconstants = fc , 34 kpts =[15, 15, 15], 35 temperature =300, 36 is_classic = False , 37 folder = ’ALD_SiC_MatterSim’ 38 ) 39 40 # Plot phonon dispersion 41 plotter . plot_dispersion ( phonons , n_k_points =300) 42 43 # Stage 4: Calculate thermal conductivity 44 cond = Conductivity ( phonons = phonons , method = ’inverse’ ) 45 46 # Access results 47 kappa = cond . conductivity . sum ( axis =0) 48 print ( f "Thermal conductivity: {kappa.trace()/3:.1f} W/m/K" ) More complex workflows involving TDEP, isotopic scattering, or NAC corrections follow this same pattern with additional keyword arguments documented in the API reference. Command-Line Interface \kappa ALDo 2.0 includes a command-line interface ( kaldo/cli/ ) that accepts JSON-formatted configuration files, simplifying deployment on clusters and HPC systems. This declarative approach is particularly useful for batch job submission, parameter sweeps, and reproducible workflows where separating calculation parameters from execution logic is beneficial. A typical configuration file specifies the force constants, phonon calculation parameters, conductivity method, and optional visualization settings. While the Python API offers maximum flexibility for power users and complex research workflows, the JSON interface is optimized for high-throughput batch processing on HPC resources. ⬇ { "description" : "Example kALDo configuration using silicon crystal test data" , "forceconstants" : { "folder" : "kaldo/tests/si-crystal" , "format" : "eskm" , "supercell" : [3, 3, 3] }, "phonons" : { "temperature" : 300.0, "kpts" : [5, 5, 5], "is_classic" : false , "storage" : "memory" }, "conductivity" : { "method" : "rta" , "storage" : "memory" }, "plotter" : { "plot_dispersion" : { "n_k_points" : 300, "is_showing" : false , "with_velocity" : true , "folder" : "plots" } } } The configuration is executed via kaldo < example.in , making it ideal for automated workflows and ensuring complete reproducibility of calculations. Applications We demonstrate \kappa ALDo 2.0’s advanced capabilities through case studies of two prototypical materials: the halide perovskite \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} and the polar oxide MgO . These examples showcase the software’s key features, including TDEP-based temperature-dependent force constants for materials with strong anharmonicity ( \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} ), non-analytical corrections for polar materials ( MgO ), and seamless integration with machine-learned potentials (MatterSim) and electronic structure package (d3q). Together, these applications illustrate how \kappa ALDo 2.0 addresses challenging materials where conventional harmonic approaches fail, while providing the flexibility to combine multiple computational methods (DFPT, MLPs, TDEP) within a unified workflow. Cubic \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} using TDEP To study the cubic phase of \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} , we employ the temperature-dependent effective potential (TDEP) methodology. Experimentally, \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} transforms into the Pm\bar{3}m phase above approximately 411\text{\,}\mathrm{K} , where anharmonic lattice dynamics play a central role in stabilizing the structure. Within the harmonic approximation, the cubic phase is dynamically unstable due to soft phonon modes at the M and R points. By fitting temperature-dependent interatomic force constants from classical molecular dynamics trajectories, TDEP provides renormalized phonon dispersions that recover phase stability and enable a quantitative description of vibrational and thermal transport properties. In this phase, \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} exhibits the highest lattice thermal conductivity among its polymorphs, although phonon spectral functions show strongly overdamped, non-Lorentzian lineshapes that signal intense anharmonicity. To perform this calculation, we run an NPT equilibration step on a 6x6x6 cubic \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} supercell followed by an NVT simulation in GPUMD using a NEP potential developed by Erik Fransson et al 91 . We sample 200 frames evenly from the trajectory and fit the TDEP second- and third-order interatomic force constants to the chosen frames. Thermal conductivity is then calculated on a 12x12x12 q -grid. Non-analytical corrections are not applied in this example, as the LO–TO splitting is negligible in \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} and has no effect on \kappa 92 . Figure 4 : Phonon dispersion relation (left) and density of states (right) for cubic phase \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} at 360 and 500\text{\,}\mathrm{K} . In Fig. 4 , the phonon dispersion relations capture the phonon mode softening at the M and R points as the phase transition of the potential is approached from above ( \approx$340\text{\,}\mathrm{K}$ ). The total impact of coherent transport is determined by calculating the interband phonon contribution to the thermal conductivity using Eq. 26 , which gives the relation 77 : \kappa_{T}=\kappa_{inv}+(\kappa_{QHGK}-\kappa_{RTA}) (34) Interband transport contributions are present and account for \approx 25\% of total thermal conductivity in Fig 5 , but they are relatively weaker than in the lower-symmetry tetragonal and orthorhombic phases, in line with experimental evidence of anomalous heat conduction in this material. Figure 5 : Cumulative thermal conductivity with respect to phonon mode frequency (left) and phonon mean free path (right). Dashed lines are used to indicate coherent contribution from QHGK, dotted lines are used to indicate the BTE contribution, and solid lines indicate total thermal conductivity calculated by adding the coherent (diffuson) contribution, estimated as the difference between the full QHGK and RTA, to the exact BTE solution ( \kappa_{inv} ). Lastly, we plot various properties related to the second and third order interatomic force constants in Fig. 6 and Fig. 7 to gauge the impact of finite temperature renormalization on them. We notice little impact on increasing temperature on second order properties from 360\text{\,}\mathrm{K} to 500\text{\,}\mathrm{K} , however, third order properties change much more dramatically, with a scattering phase space increase of \approx 60\% and consistently larger lifetimes at 360\text{\,}\mathrm{K} compared to 500\text{\,}\mathrm{K} by about 1 order of magnitude. Figure 6 : Phonon heat capacity (left), group velocity magnitude (middle), and scattering phase space (right) for 360 and 500\text{\,}\mathrm{K} cubic \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} . Figure 7 : Phonon lifetimes (left), scattering rate (middle), and mean free path (right) for 360 and 500\text{\,}\mathrm{K} cubic \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} . Thermal Properties of MgO : QHA Thermal Expansion and NAC Corrections To test our new free energy calculator and quasiharmonic algorithm, we perform the quasiharmonic approximation on MgO from 0 to 900\text{\,}\mathrm{K} using the MatterSim potential developed using PBE level of theory on a 3 \times 3 \times 3 supercell and 12 \times 12 \times 12 q -grid using 21 evenly spaced lattice constants between 4.23027 and 4.35846 Å. The resulting free energy, lattice constant, and volumetric thermal expansion are shown below in Fig. 8 . Figure 8 : Quasiharmonic calculation performed on cubic phase MgO using MatterSim machine learned potential. Lattice dynamics calculations were carried out on rock-salt MgO at 300\text{\,}\mathrm{K} to assess the role of long-range Coulomb interactions on the thermal transport of a polar material. The second- and third-order force constants are obtained with DFPT 93 , 57 using the norm-conserving Vanderbilt pseudopotentials for Mg and O 94 . Figure 9 shows the phonon frequency dispersion with and without the inclusion of non-analytical corrections (NAC) 82 . Near \Gamma , the longitudinal-optical (LO) branch is hardened, opening a clear LO–TO split, while leaving the acoustic branches unchanged. This shift leads to a small suppression in the thermal conductivity, primarily through the diminished contribution of optical phonons as seen in the plot of the cumulative \kappa ( \kappa_{cum} ) against frequency in Figure 10 . The cumulative thermal conductivity \kappa_{cum} exhibits a steeper initial rise and converges to a higher value without NAC ( \sim 5 W/m/K higher), indicating that optical and mid-frequency acoustic modes are over-contributing when the LO-TO splitting is neglected. The reduction occurs primarily through reduced mode velocities, as the lifetimes are almost identical. The \kappa of both systems was measured across a broad temperature span in Figure 11 . Thermal conductivity falls proportionally with T^{-1} for both calculations at low temperature, consistent with Umklapp-dominated transport. The NAC curve stays systematically lower than the result without corrections across the entire range. The gap is largest at low temperature, where long-lived optical modes have the highest impact. The gap slowly narrows at high-T as strong phonon–phonon scattering washes out details of the spectrum. Figure 9 : The phonon dispersion of MgO along a high symmetry path with (red) and without (blue) the NAC correction. Figure 10 : Phonon velocities (left), lifetimes (middle), and cumulative thermal conductivity (right) for MgO with and without the NAC correction. Figure 11 : Thermal conductivity versus temperature calculated from full inversion of the scattering matrix for MgO with and without the NAC correction. Conclusions and Outlook We have presented \kappa ALDo v2.0, a comprehensive open-source platform for thermal transport calculations from anharmonic lattice dynamics. The software provides researchers with a unified framework combining (i) flexible force constant import from DFT, empirical potentials, and machine-learned potentials, (ii) efficient implementations of BTE (RTA, self-consistent, full inversion) and QHGK methods, (iii) essential physical corrections (isotopic scattering, non-analytical terms), (iv) GPU acceleration and sparse tensor operations for large systems, and (v) modular Python design with extensive documentation and deployment tools. Version 2.0 introduces significant advances over the original release 95 , including native TDEP support for temperature-dependent force constants, seamless MLP integration via ASE and LAMMPS, flexible storage backends enabling 10,000+ atom simulations, anharmonicity diagnostics ( \sigma_{A} score), and comprehensive testing/continuous integration. These enhancements position \kappa ALDo 2.0 as a premier tool for thermal transport research in complex materials. Applications to \text{CsPbBr}{\vphantom{\text{X}}}_{\vphantom{\text{2}}\smash[t]{\text{3}}}^{\vphantom{\smash[t]{\text{2}}}\hphantom{\text{3}}\text{}} and MgO demonstrate the software’s capabilities for challenging systems: perovskites requiring finite-temperature stabilization via TDEP and polar oxides needing non-analytical corrections. These examples illustrate workflows typical of contemporary materials science, combining multiple simulation packages and validation against experimental data. Future development directions include: (i) hybrid MPI+GPU parallelization for multi-node scaling, (ii) automation of convergence testing for q -meshes and broadening parameters, (iii) four-phonon scattering for materials where three-phonon processes are insufficient (e.g., Si, diamond) 59 , (iv) coupling to excited-state dynamics for electron-phonon and exciton-phonon interactions, and (v) integration with high-throughput frameworks (AiiDA, Atomate) for database generation. We invite the community to contribute code, report issues, and propose new features via the GitHub repository. A discussions page ( https://github.com/nanotheorygroup/kaldo/discussions ) is available for questions, feature requests, and sharing workflows. With its open-source license, comprehensive documentation, and modular architecture, \kappa ALDo 2.0 aims to serve both as a production tool for applied research and a platform for method development in phonon transport theory. Data Availability Input files, Jupyter notebooks, and results for all examples presented in this paper are available in the examples repository. A Docker image containing \kappa ALDo 2.0 and all dependencies can be obtained via docker pull gbarbalinardo/kaldo:latest . CPC Program Library Compliance This manuscript adheres to the requirements specified in the Computer Physics Communications Program Library guidelines. The submitted package includes: (i) source code with test suite, (ii) installation instructions, (iii) example input/output files, (iv) auto-generated documentation, and (v) containerized environment for reproducibility.