Introduction

First-principles calculations are widely employed for modeling and designing materials, with applications ranging from energy1,2 to (opto)electronic devices3,4,5 to materials discovery6,7,8. Starting from the crystal structure and atomic positions as the main inputs, these methods can predict material properties, including mechanical, electrical, magnetic, and optical. While computing ground-state and linear-response properties with density functional theory (DFT) is a decades-long effort9,10,11,12, recent work has focused on modeling ultrafast dynamics in materials and simulating time-domain spectroscopies from first principles13,14,15,16,17,18,19,20,21,22,23. These methods focused on nonequilibrium dynamics are a more recent research frontier with both theoretical and computational challenges.

First-principles calculations in the time domain provide a microscopic description of nonequilibrium dynamics in materials. These methods propagate in time quantities characterizing the quantum dynamics, such as the time-dependent electron wave function, density24, density matrix25, or Green’s function21, and can also access the time-dependent atomic positions and lattice vibrations17,18. Different schemes are successful in different regimes. For example, coherent electron dynamics on the attosecond time scale can be modeled effectively using time-dependent DFT22,26,27,28,29, but that approach is not ideal for modeling phonon dynamics, which occurs on a picosecond time scale30.

The real-time Boltzmann transport equation (rt-BTE) has emerged as an effective tool for exploring the coupled electron and phonon dynamics from femtosecond to nanosecond timescales15,18,31. In the rt-BTE, the time-dependent electron populations are obtained by solving a set of integro-differential equations accounting for the e–ph scattering processes on dense momentum grids. Following an initial excitation, the rt-BTE is propagated in time to reach thermal equilibrium or steady state in an external field. This scheme employs a femtosecond time step to capture the e–ph scattering processes. However, evaluating the scattering integral at each time step makes the rt-BTE approach computationally demanding, even for materials with a handful of atoms in the unit cell.

Data-driven techniques are increasingly employed in materials modeling, both for accelerating computational workflows and to gain physical insight using learning algorithms32,33. In particular, dynamic mode decomposition (DMD), which was developed in the last decade to study fluid dynamics, is a valuable tool to linearize dynamical problems and reduce their dimensionality34,35. In DMD, explicit simulation of a short initial time window allows one to learn the dominant modes governing the dynamics and extrapolate the simulation to future times at low computational cost. Recent work has employed DMD to study electron dynamics described by model Hamiltonians with purely electronic interactions36,37. Yet, to date, DMD has not been applied to more computationally intensive first-principles studies.

In this work, we combine DMD with first-principles calculations of nonequilibrium electron dynamics, using the framework of the rt-BTE in the presence of e–ph collisions and external fields. We show that DMD provides an order-of-magnitude computational speed-up while retaining the full accuracy of the first-principles rt-BTE. In addition, DMD reveals key momentum-space temporal patterns and achieves a significant dimensionality reduction of the nonequilibrium physics. Our results include both high-field transport and transient excited-state dynamics and are accompanied by a careful characterization of convergence with respect to the size of the sampling window during which DMD learns the dominant modes. Taken together, this work provides the blueprint for combining data-driven methods with first-principles calculations to study nonequilibrium dynamics in real materials.

Results

First-principles rt-BTE

We describe the electron distribution using the time-dependent populations fnk(t), which quantify the occupation of each electronic state \(\left\vert n{{{\bf{k}}}}\right\rangle\), where k is the electron crystal momentum, and n is the band index (from now on, we omit the band index to simplify the notation). Starting from an initial distribution at time zero, fk(t = 0), in the rt-BTE, the populations evolve according to38

$$\frac{\partial {f}_{{{{\bf{k}}}}}(t)}{\partial t}=\frac{{{{\bf{F}}}}}{\hslash }\cdot {\nabla }_{{{{\bf{k}}}}}{f}_{{{{\bf{k}}}}}(t)+{{{\mathcal{I}}}}[{f}_{{{{\bf{k}}}}}(t)],$$
(1)

where \({{{\mathcal{I}}}}[{f}_{{{{\bf{k}}}}}(t)]\) is the collision integral accounting for e-ph scattering processes in momentum space39 and F includes any external fields applied to the system.

The rt-BTE simulations use dense momentum grids to accurately describe scattering between electronic states via absorption and emission of phonons. The required grid sizes are typically >100 × 100 × 100 for both electron and phonon momenta. We time-step Eq. (1) using explicit solvers (Euler or fourth-order Runge–Kutta) or more advanced Strang splitting techniques31. The collision integral includes a summation over the phonon momentum grid and is evaluated at least once per time step using a parallel algorithm implemented in the Perturbo code38 (see the “Methods” section for details). Although here we focus on the dynamics of electrons interacting with phonons, the rt-BTE formalism has also been extended to study nonequilibrium phonon17 and exciton dynamics40.

DMD learning and prediction of the dynamics

We employ DMD in combination with rt-BTE simulations. The DMD approach linearizes the dynamics by relating the states of the system at times t and t + Δt via a time-independent matrix A41,42. Focusing on the e–ph dynamics, this amounts to advancing the electronic populations at time t using

$${f}_{{{{\bf{k}}}}}(t+\Delta t)={{{\bf{A}}}}{f}_{{{{\bf{k}}}}}(t),$$
(2)

where the populations fk form a vector with size N equal to the number of k-points in the electronic momentum grid (typically, N ≈ 105−106). To obtain the matrix A, we time-step the rt-BTE in a sampling window consisting of M time steps (using the Perturbo code38), and then we form two matrices X1 and X2. The populations fk(t) from t1 to tM−1 are stacked column-wise in the matrix X1, with column i corresponding to time ti and containing the populations fk(ti) for all k-points and bands. The populations from t2 to tM are similarly stacked column-wise in the second matrix X2.

According to equation (2), these matrices are related by X2 = AX1, but computing A naively from the pseudo-inverse of X1 has a prohibitive cost due to the large size N of the k-point grid. To circumvent this problem, in DMD, one first performs a truncated singular value decomposition (SVD)43,44 of the X1 matrix:

$${{{{\bf{X}}}}}_{1}={{{\bf{U}}}}{{{\mathbf{\Sigma }}}}{{{{\bf{V}}}}}^{{\dagger} },$$
(3)

where \({{{\mathbf{\Sigma }}}}\in {{\mathbb{R}}}^{N\times (M-1)}\) is a matrix with diagonal entries equal to the singular values σj arranged in decreasing order, while \({{{\bf{U}}}}\in {{\mathbb{C}}}^{N\times N}\) and \({{{\bf{V}}}}\in {{\mathbb{C}}}^{(M-1)\times (M-1)}\) are matrices collecting the mutually orthogonal singular vectors45. (Above, V indicates the Hermitian conjugate of V).

Because X1 contains time-dependent populations, this SVD procedure can single out the main patterns in the momentum-space dynamics. Here, we keep only the first r singular values (typically, r ≈ 10) to restrict the solution space to the leading r momentum-space modes and then project the matrix A onto this reduced r-dimensional space. This procedure provides the matrix \(\tilde{{{{\bf{A}}}}}\), with reduced size r × r, which can be diagonalized straightforwardly to obtain the dominant DMD modes. Using this procedure, the populations at future times t > tM are predicted—that is, obtained without explicit solution of the rt-BTE—using

$${f}_{{{{\bf{k}}}}}(t \,>\, {t}_{M})\,\approx\, \mathop{\sum }\limits_{l=1}^{r}\,{b}_{l}\,{\phi }_{{{{\bf{k}}}}}^{l}\,{{{{\rm{e}}}}}^{{{{\rm{i}}}}{\omega }_{l}^{{{{\rm{DMD}}}}}t},$$
(4)

where \({\phi }_{{{{\bf{k}}}}}^{l}\) are the momentum-space DMD modes obtained from the matrix \(\tilde{{{{\bf{A}}}}}\), and \({\omega }_{l}^{{{{\rm{DMD}}}}}\) and bl are their frequencies and amplitudes (see the “Methods” section for detailed derivations).

We summarize the main steps of this DMD procedure, which are illustrated in Fig. 1:

  1. 1.

    Simulate the rt-BTE dynamics for the first M steps and construct the matrices X1 and X2;

  2. 2.

    Perform SVD on X1 to find the matrix \(\tilde{{{{\bf{A}}}}}\) in the reduced r-dimensional space;

  3. 3.

    Diagonalize \(\tilde{{{{\bf{A}}}}}\) to find the DMD modes \({\phi }_{{{{\bf{k}}}}}^{l}\) and their frequencies \({\omega }_{l}^{{{{\rm{DMD}}}}}\), with l = 1…r;

  4. 4.

    Obtain the mode amplitudes bl from the initial condition fk(t1);

  5. 5.

    Predict the dynamics for t > tM using Eq. (4).

Fig. 1: Workflow of DMD plus rt-BTE calculations.
figure 1

The first M steps of the dynamics, which make up the sampling window for DMD learning, are simulated by solving the rt-BTE. The resulting populations fk(t) are stacked in the X1 and X2 matrices with a relative shift of one time step. The dynamics at later times t > tM is predicted with DMD using the r leading modes obtained by SVD of the matrix X1 and diagonalization of the matrix \(\tilde{{{{\bf{A}}}}}={\tilde{{{{\bf{U}}}}}}^{{\dagger} }{{{\bf{A}}}}\tilde{{{{\bf{U}}}}}\).

A key parameter is the duration of the sampling window (tM) required for accurate DMD extrapolation of the dynamics beyond tM. As the computational cost of DMD is negligible, the size of the sampling window, during which the rt-BTE is solved by explicit time-stepping, determines the computational cost of the entire workflow.

High-field electron dynamics

We employ our DMD-based approach to simulate time-domain electron dynamics in an applied electric field in the presence of e-ph collisions. We recently demonstrated similar calculations using the rt-BTE without the aid of data-driven techniques31. Here, we use this case study to explore the accuracy and efficiency of our rt-BTE plus DMD approach, as well as find optimal values for the sampling window and analyze the momentum-space DMD modes. Our calculations focus on electrons in GaAs, where the conduction band has three sets of low-energy valleys, at Γ and near L and X in order of increasing energy46 (see the inset in Fig. 2a). Upon applying an electric field, the electrons are accelerated to higher band energies while they also transfer part of that excess energy to the lattice via e–ph collisions. These competing mechanisms lead to a steady-state electronic distribution which is typically reached on a picosecond to nanosecond time scale.

Fig. 2: DMD simulations of electrons in GaAs in an applied electric field.
figure 2

a Time-dependent electron populations fk(t) for four electron momenta. The gray region indicates the shortest sampling window (0.4 ps), and the red vertical line is the longest sampling window we tested (2 ps). Solid black lines show the rt-BTE results and orange dashed lines, the DMD predictions obtained using the longest sampling window. The inset is a schematic of the low-energy band structure of GaAs showing the Γ- and higher energy L- and X-valleys. b Singular values of the X1 matrix, with the ten largest singular values used in our DMD calculations separated by a vertical line. c DMD frequencies plotted in the complex plane and shown as circles with radii proportional to the DMD mode amplitudes bl. In panels ac, the colors indicate the duration of the DMD sampling window according to the legend given in (c). d DMD momentum-space modes \({\phi }_{{{{\bf{k}}}}}^{l}\), multiplied by the corresponding amplitudes bl, given as a function of energy. The initial state fk(t1) is shown with a dashed line. e Convergence of the steady-state drift velocity with respect to the duration of the DMD sampling window. The rt-BTE value is shown for reference as a dashed line.

Our simulations begin with electrons in thermal equilibrium with the lattice at 300 K. We apply a constant electric field E and time-step the electron populations until they reach the steady-state distribution, \({f}_{{{{\bf{k}}}}}^{{{{\bf{E}}}}}\), from which we compute the mean drift velocity, v(E), a quantity routinely measured in experiments47,48,49. Repeating this procedure for multiple field values allows us to construct the full drift velocity versus electric field curve in a material, starting from linear response at low field to velocity saturation at high field31.

Figure 2a shows the time-dependent populations in four regions of the Brillouin zone following the application of a high field (5 kV cm−1). Electrons initially occupying the Γ-valley scatter to the higher-energy L- and X-valleys. As a result, the electron populations in the Γ-valley decrease, with a corresponding increase in L- and X-valley populations. In regions of momentum space between the Γ- and L-valleys, the populations peak at intermediate times and then relax to lower values.

This dynamics is nontrivial because the populations evolve differently in different momentum-space regions, making accurate predictions challenging. Our DMD approach can learn the dominant modes governing these intricate dynamics and extrapolate the time-dependent populations well beyond the sampling window. Remarkably, we find that a short sampling window −400 fs to 2 ps out of a total simulation time of 12.5 ps —is sufficient to extrapolate the dynamics all the way to steady state, with rt-BTE and DMD trajectories in nearly exact agreement outside the sampling window (Fig. 2a). This accuracy extends to the entire set of ~105 k-points considered in our simulations, providing carrier number conservation within 1% error.

The ability to learn key temporal momentum-space patterns is a consequence of the relatively rapid decay of the singular values of the X1 matrix used for learning the dynamics in the sampling window (Fig. 2b). This decay becomes slower as the sampling window increases, but it remains significant even for the longest sampling window of 2 ps used here (note the log scale in the plot). In turn, the singular value decay enables a striking dimensionality reduction, with DMD employing only r ≈ 10 modes to solve the dynamics as opposed to 105 populations fk and billions of e–ph scattering terms in the rt-BTE.

The choice of an ideal sampling window can rely on the appearance of specific DMD modes at a steady state. Figure 2c shows the DMD mode frequencies ωDMD in the complex plane, where the imaginary part of ωDMD corresponds to the decay rate of a given mode, and the real part gives its oscillation frequency. The populations fk(t) are real-valued and are written as a summation of complex exponentials in Eq. (4). Therefore, physically meaningful results are possible only when \({{{\rm{Re}}}}({\omega }^{{{{\rm{DMD}}}}})=0\) (modes 1, 2) or when ωDMD appear as conjugate pairs (modes 3−10). Describing the steady state is particularly important in our simulations. In DMD, all modes with a non-zero imaginary frequency vanish in the long time limit, with only one mode surviving at steady state (mode 1 in Fig. 2c). As the sampling window increases, the imaginary frequency of this mode goes to zero, providing the correct steady-state behavior. This analysis allows us to find the minimal sampling window required for accurate steady-state results by monitoring the zero-frequency mode.

The DMD eigenvector of the zero-frequency mode (mode 1 in Fig. 2d) determines the steady-state electron distribution \({b}_{l}{\phi }_{{{{\bf{k}}}}}^{1}={f}_{{{{\bf{k}}}}}(t\to \infty )\), while the other modes control the transient dynamics. For example, mode 2 governs electron scattering from the Γ- to the L- and X-valleys, and higher modes appearing as conjugate pairs exhibit oscillating trends in energy (modes 3−10 in Fig. 2d). Converging the zero-frequency mode allows us to compute the steady-state drift velocity more efficiently. Figure 2e shows that a sampling window of 1.7 ps (170 snapshots) provides a drift velocity nearly identical to the full rt-BTE calculation, which requires much longer simulation times of up to 12.5 ps (1250 snapshots). On this basis, we conclude that DMD needs only ~10% of the dynamics data for accurate steady-state predictions.

Velocity-field curves

We also employ DMD to accelerate calculations of entire velocity-field curves. This requires the drift velocity for a set of electric field values, and thus we adopt a modified workflow. Following our recent work31, we gradually increase the electric field (black curve in Fig. 3a) and use the steady-state populations for a given field, \({f}_{{{{\bf{k}}}}}^{{{{\bf{E}}}}}\), as the initial condition for the next field value, E + ΔE, where the field increment ΔE is typically 100−200 V cm−1. As the applied field increases, the DMD frequencies and momentum-space modes change substantially. Therefore, for each new field value, we repeat DMD learning in the initial stage of the simulation (see the DMD sampling regions shown as red rectangles in Fig. 3a). We then predict the steady-state populations using mode 1 from DMD, \({f}_{{{{\bf{k}}}}}^{{{{\bf{E}}}}}={b}_{1}{\phi }_{{{{\bf{k}}}}}^{1}\) and the drift velocity for that field value, and use \({f}_{{{{\bf{k}}}}}^{{{{\bf{E}}}}}\) as the initial condition for the next field value.

Fig. 3: Velocity-field curves from DMD.
figure 3

a Transient drift velocity in GaAs computed as a function of time (black curve). The external electric field is increased step-wise in the simulation (see the field values given above the plot). The DMD sampling window for each electric field is shown with a red rectangle, and the drift velocities outside this window are predicted with DMD. The steady-state drift velocities from DMD correspond to the plateaus for each field value and agree with the reference drift velocities obtained by explicitly time-stepping the rt-BTE until the steady state, which are shown with white dots. b Velocity-field curves in GaAs and graphene obtained from the rt-BTE (black and blue solid lines) and by combining the rt-BTE and DMD (red and orange dashed lines).

The velocity-field curves obtained with this approach are shown in Fig. 3b for GaAs and graphene and compared with rt-BTE results obtained without DMD. Using DMD lowers significantly the computational cost to obtain the full velocity-field curves by a factor of 10.5 for GaAs and ~ 16.5 for graphene, while fully preserving the accuracy. Because the drift velocity is computed as a weighted sum of \({f}_{{{{\bf{k}}}}}^{{{{\bf{E}}}}}\)31, the nearly exact agreement between the DMD and full rt-BTE results demonstrates the accuracy of the DMD populations in momentum space. The DMD efficiency is a consequence of its ability to capture the dominant modes in the population dynamics using only a small number of snapshots, with a similar accuracy regardless of the electric field value. Our strategy of gradually increasing the electric field leads to easier-to-extrapolate dynamics compared to the abrupt application of a strong field.

Excited electron relaxation

Next, we consider different nonequilibrium dynamics where the material is initially prepared in an excited electronic state. This setting can be used, for example, to model the effect of an optical excitation with a laser pulse13. Different from the high-field dynamics, in this case, the long-time limit is known, and we are primarily interested in the transient dynamics. Following the initial excitation, in the presence of e–ph interactions and without any external fields, the electrons relax to a thermal equilibrium Fermi–Dirac distribution50, \({f}_{{{{\bf{k}}}}}^{{{{\rm{FD}}}}}\), typically on a sub-picosecond time scale. This ultrafast dynamics can be modeled by time-stepping the rt-BTE until reaching the equilibrium Fermi-Dirac distribution. Using this approach, our previous work has shown that electrons relax to the band edge significantly slower than holes in GaN semiconductors, with implications for optoelectronic devices15.

Following that work, we model an excited state in GaN by placing the electrons ~1 eV above the conduction band edge and then obtain the time-dependent electron populations by solving the rt-BTE (see Fig. 4a, b). We employ DMD to predict this transient dynamics and find large errors when using a short time window of up to ~50 fs (solid red line in Fig. 4c). The correct steady state and transient dynamics are obtained by increasing the sampling window to 200 fs (dashed orange line in Fig. 4c). Our analysis of the DMD frequencies shows that the zero-frequency mode describing thermal equilibrium in the long-time limit appears when the sampling window reaches 100 fs (see the arrow in Fig. 4d) and fully converges for a ~200 fs sampling window. The need for such a long sampling window relative to the total duration of the dynamics (400 fs) makes DMD ineffective.

Fig. 4: Transient dynamics in GaN using DMD.
figure 4

a Energy dependence of the momentum-averaged electron populations, and b difference between the time-dependent and equilibrium populations in GaN. In both panels, the simulation time is color-coded using sepia for the initial excited state and purple for the equilibrium state. The energy zero is set to the conduction band minimum. c DMD error on the electron populations, computed as the root-mean-square difference between the reference values from rt-BTE and those obtained from DMD. Results are shown for different sampling windows, given in the legend, and for the two schemes where DMD is applied to fk(t) or alternatively to \(\delta {f}_{{{{\bf{k}}}}}(t)={f}_{{{{\bf{k}}}}}(t)-{f}_{{{{\bf{k}}}}}^{{{{\rm{FD}}}}}\). d, e DMD frequencies on the complex plane, respectively for fk(t) and \({f}_{{{{\bf{k}}}}}(t)-{f}_{{{{\bf{k}}}}}^{{{{\rm{FD}}}}}\), with the duration of the sampling window, color-coded.

To address this issue and more efficiently study transient dynamics with DMD, we formulate a different learning procedure that incorporates knowledge of the equilibrium state. We focus on the difference between the transient and equilibrium populations, \(\delta {f}_{{{{\bf{k}}}}}(t)={f}_{{{{\bf{k}}}}}(t)-{f}_{{{{\bf{k}}}}}^{{{{\rm{FD}}}}}\), as opposed to just fk(t) as we did in the high-field example. After predicting δfk(t) with DMD, we obtain the time-dependent populations fk(t) by adding back the \({f}_{{{{\bf{k}}}}}^{{{{\rm{FD}}}}}\) term. As δfk vanishes in the long-time limit (Fig. 4b), the zero-frequency DMD mode is missing when computing δfk (Fig. 4e); all other DMD frequencies associated with δfk are similar to those for fk(t) (Fig. 4d, e). We find that the DMD method based on δfk is far more effective and requires a significantly shorter sampling window for accurate DMD predictions−using a 50 fs sampling window, we achieve results similar to DMD for fk(t) with a four times longer (200 fs) window (Fig. 4c).

With this improved DMD approach, using a sampling window of only ~12% of the total simulation time allows us to accurately predict the average electron relaxation rate in GaN, with a DMD computed value of 5.23 eV fs−1 in close agreement (within 0.8%) with the rt-BTE result. This result demonstrates that our DMD approach can predict excited electron relaxation with a high accuracy.

Discussion

The DMD approach introduced here is very efficient: the rt-BTE is solved explicitly on a high-performance computer only for a small number of initial time steps, after which the entire dynamics can be computed straightforwardly with DMD, using only a laptop. The most demanding step is carrying out truncated SVD on the X1 matrix, but for comparison, this step requires lower computational resources than even just a single rt-BTE time step.

This remarkable speed-up is achieved by reducing the dimensionality of the rt-BTE dynamics and is linked to the shape of the X1 matrix. The rt-BTE employs a large number of k-points (about 105−106), which equals the number of rows of the matrix X1, and a significantly smaller number of snapshots in the DMD sampling window, typically ~100 time steps, which sets the number of columns in X1. Following truncated SVD, the size of the problem is reduced to (at most) the number of snapshots and is typically of order 50−100, and thus smaller by orders of magnitude compared to the original rt-BTE. (Note that one could use the entire set of singular values, but here we prefer using only ~10 singular values to prevent numerical instabilities45).

This efficiency allows us to evaluate the accuracy of DMD on the fly, halting explicit time-stepping of the rt-BTE when the DMD steady state or transient dynamics are fully converged. In addition, our approach addresses the key challenge of storing the rt-BTE populations. This is a critical improvement because in conventional rt-BTE simulations one needs to store the populations fk(t) on dense momentum grids for thousands of time steps, resulting in terabytes of data. In contrast, after carrying out SVD in the sampling window, DMD stores only a handful of complex frequencies and momentum-space modes, using which the dynamics can be reconstructed for the entire simulation.

In summary, we have introduced a data-driven approach based on DMD to accelerate first-principles calculations of nonequilibrium electron dynamics in materials. Our method speeds up the solution of the time-dependent Boltzmann equation with electron collisions computed from first principles. We have shown that DMD can capture dominant modes governing the microscopic dynamics, enabling accurate predictions of the steady-state properties such as the drift velocity as well as transient processes such as electron relaxation and equilibration. In both steady-state and transient nonequilibrium calculations, DMD requires explicit time-stepping of the rt-BTE in a time window of only ~10% of the full simulation, after which the dynamics is extrapolated from the DMD modes with negligible computational cost. This DMD workflow preserves the accuracy while requiring far more modest computational resources than full rt-BTE simulations.

These advances are broadly relevant to studying nonequilibrium quantum dynamics of elementary excitations. For example, in future work, our data-driven approach will be extended to study the coupled dynamics of electrons and phonons, which involves fast (electron) and slow (phonon) timescales. The current DMD approach is not designed to address such multiscale nonequilibrium dynamics, and extensions using multiresolution DMD will be explored.

Methods

Computing DMD modes and frequencies

Let us describe in more detail the calculation of DMD modes and frequencies. We start from the snapshots fk(t) evaluated explicitly with the rt-BTE in the sampling window t1 < t < tM, and then apply the SVD procedure to the matrix X1 (see Eq. (3)). As shown in Fig. 2b, we find that the singular values σj decay rapidly. Keeping only the largest r ≈ 10 singular values, we write the SVD of X1 as

$${{{{\bf{X}}}}}_{1}\,\approx\, \tilde{{{{\bf{U}}}}}\tilde{{{{\mathbf{\Sigma }}}}}{\tilde{{{{\bf{V}}}}}}^{{\dagger} },$$
(5)

where we defined the economy-sized matrices in the r-dimensional subspace45 as \(\tilde{{{{\mathbf{\Sigma }}}}}={{{\mathbf{\Sigma }}}}(1:r,1:r)\), \(\tilde{{{{\bf{U}}}}}={{{\bf{U}}}}(1:N,1:r)\), \(\tilde{{{{\bf{V}}}}}={{{\bf{V}}}}(1:M-1,1:r)\). This way, the approximate pseudo-inverse of the matrix X1, denoted as \({{{{{\bf{X}}}}}_{1}}^{+}\), can be obtained with little effort as \(\tilde{{{{\bf{V}}}}}{\tilde{{{{\mathbf{\Sigma }}}}}}^{-1}{\tilde{{{{\bf{U}}}}}}^{{\dagger} }\). Then the matrix A relating the snapshot matrices via X2 = AX1 can be written as

$${{{\bf{A}}}}={{{{\bf{X}}}}}_{2}{{{{{\bf{X}}}}}_{1}}^{+}={{{{\bf{X}}}}}_{2}\tilde{{{{\bf{V}}}}}{\tilde{{{{\mathbf{\Sigma }}}}}}^{-1}{\tilde{{{{\bf{U}}}}}}^{{\dagger} }.$$
(6)

Note that the matrix A depends on the sampling window. Due to its large N × N size (here, N ≈ 105 is the number of k-points), diagonalizing A is computationally expensive. In DMD, a key step is rewriting this matrix in the reduced r-dimensional space:

$$\tilde{{{{\bf{A}}}}}={\tilde{{{{\bf{U}}}}}}^{{\dagger} }{{{\bf{A}}}}\tilde{{{{\bf{U}}}}}={\tilde{{{{\bf{U}}}}}}^{{\dagger} }{{{{\bf{X}}}}}_{2}\tilde{{{{\bf{V}}}}}{\tilde{{{{\mathbf{\Sigma }}}}}}^{-1},$$
(7)

allowing for straightforward eigenvalue decomposition:

$$\tilde{{{{\bf{A}}}}}{{{\bf{W}}}}={{{\bf{W}}}}{{{\mathbf{\Lambda }}}},$$
(8)

where the matrix W contains the eigenvectors of \(\tilde{{{{\bf{A}}}}}\) and the eigenvalues Λ = diag{λl} are common to both matrices \(\tilde{{{{\bf{A}}}}}\) and A51. The DMD modes, stacked column-wise in the matrix \({{{\mathbf{\Phi }}}}=\left({{{{\boldsymbol{\phi }}}}}^{1}\ {{{{\boldsymbol{\phi }}}}}^{2}\cdots {{{{\boldsymbol{\phi }}}}}^{r}\right)\in {{\mathbb{C}}}^{N\times r}\), can be obtained using51

$${{{\mathbf{\Phi }}}}={{{{\bf{X}}}}}_{2}\tilde{{{{\bf{V}}}}}{\tilde{{{{\mathbf{\Sigma }}}}}}^{-1}{{{\bf{W}}}}.$$
(9)

The DMD frequency of mode l is obtained from the corresponding eigenvalue λl using Eq. (8),

$${\omega }_{l}^{{{{\rm{DMD}}}}}=-{{{\rm{i}}}}\frac{\ln {\lambda }_{l}}{\Delta t},$$
(10)

where Δt is the simulation time step. To circumvent the potential addition of a \(2\pi m\,{{{\rm{i}}}},m\in {\mathbb{Z}}\) term due to \(\ln {\lambda }_{l}\) computation, we evaluate the logarithm in the following way: \(\ln {\lambda }_{l}=\ln | {\lambda }_{l}| +{{{\rm{i}}}}\arg ({\lambda }_{l})\), with \(\arg ({\lambda }_{l})\) in (−π, π].

The mode amplitudes \({{{\bf{b}}}}=\left({b}_{1}\ {b}_{2}\cdots {b}_{r}\right)\in {{\mathbb{C}}}^{r}\) are obtained from the initial condition. Setting t = 0 in Eq. (4), we get

$${f}_{{{{\bf{k}}}}}(0)={{{\mathbf{\Phi }}}}{{{\bf{b}}}},$$
(11)

and thus the mode amplitude vector b is obtained from the pseudo-inverse of the DMD mode matrix Φ:

$${{{\bf{b}}}}={{{{\mathbf{\Phi }}}}}^{+}{f}_{{{{\bf{k}}}}}(0).$$
(12)

The pseudo-inverse of the matrix Φ is computed using truncated SVD and has a negligible computational cost compared to SVD of the X1 matrix due to (N, r) dimensions of the matrix Φ.

This approach provides the DMD modes \({\phi }_{{{{\bf{k}}}}}^{l}\), frequencies \({\omega }_{l}^{{{{\rm{DMD}}}}}\), and mode amplitudes bl, and thus all the quantities needed for DMD prediction of the dynamics outside the sampling window (t > tM) using Eq. (4).

Electron–phonon scattering from first principles

Our first-principles calculations of e–ph scattering employ an established workflow, which is summarized here and described in more detail in ref. 38. The electronic wave functions and band energies are obtained from plane-wave DFT calculations with the Quantum Espresso code52 using the local density approximation53 and norm-conserving pseudopotentials54. The electronic quasiparticle band structure is refined using GW calculations carried out with the, Yambo code55. This step improves the agreement with the experiment of the electron effective masses and relative valley energies, which are essential for precise calculations of high-field dynamics31 and excited electron relaxation15.

The phonon dispersion and e-ph perturbation potentials are obtained from density-functional perturbation theory (DFPT), where lattice vibrations and their coupling with electrons are treated as perturbations to the ground-state electron density52. The e–ph interactions are described by the matrix elements

$${g}_{mn\nu }({{{\bf{k}}}},{{{\bf{q}}}})={\left(\frac{\hslash }{2{\omega }_{\nu {{{\bf{q}}}}}}\right)}^{1/2}\left\langle {\psi }_{m{{{\bf{k}}}}+{{{\bf{q}}}}}\left\vert {\Delta }_{\nu {{{\bf{q}}}}}{V}^{{{{\rm{KS}}}}}\right\vert {\psi }_{n{{{\bf{k}}}}}\right\rangle ,$$
(13)

which are the probability amplitudes to scatter from an initial electronic state \(\left\vert {\psi }_{n{{{\bf{k}}}}}\right\rangle\), with band n and momentum k, to a final state \(\vert {\psi }_{m{{{\bf{k}}}}+{{{\bf{q}}}}}\rangle\) by absorbing or emitting a phonon with mode ν, momentum q, and frequency ωνq. The term ΔνqVKS is the e–ph perturbation potential induced by the phonon mode and is defined in ref. 38.

To study nonequilibrium dynamics with the rt-BTE, the electrons, phonons, and e–ph scattering are described on dense k- and q-point momentum grids. Obtaining the e–ph matrix elements on such grids directly from DFPT is computationally prohibitive. Therefore, we first compute gmnν(k, q) on coarse k- and q-point grids15,56 and then interpolate these quantities to significantly finer grids using Wannier–Fourier interpolation with Wannier functions generated from Wannier9057. Finally, the e–ph scattering integral employed in Eq. (1) is defined as

$$\begin{array}{lll}{{{\mathcal{I}}}}\left[{f}_{n{{{\bf{k}}}}}\right]\,=\,-\frac{2\pi }{\hslash }\frac{1}{{{{{\mathcal{N}}}}}_{{{{\bf{q}}}}}}\mathop{\sum}\limits_{m{{{\bf{q}}}}\nu }{\left\vert {g}_{mn\nu }({{{\bf{k}}}},{{{\bf{q}}}})\right\vert }^{2}\\ \\\qquad\qquad\;\;\times \left(\delta ({\varepsilon }_{n{{{\bf{k}}}}}-\hslash {\omega }_{\nu {{{\bf{q}}}}}-{\varepsilon }_{m{{{\bf{k}}}}+{{{\bf{q}}}}})\times {F}_{{{{\rm{em}}}}}\left[{f}_{n{{{\bf{k}}}}}\right]\right.\\ \\\qquad\qquad\;\;+\left.\delta ({\varepsilon }_{n{{{\bf{k}}}}}+\hslash {\omega }_{\nu {{{\bf{q}}}}}-{\varepsilon }_{m{{{\bf{k}}}}+{{{\bf{q}}}}})\times {F}_{{{{\rm{abs}}}}}\left[{f}_{n{{{\bf{k}}}}}\right]\right),\end{array}$$
(14)

where \({{{{\mathcal{N}}}}}_{{{{\bf{q}}}}}\) is the number of q-points, εnk and εmk+q are the band energies of the initial and final electronic states, and the Dirac delta functions expressing energy conservation are implemented as Gaussians with a small (~5 meV) broadening. Above, Fabs and Fem are phonon absorption and emission terms, whose explicit expressions are given in ref. 38. The Wannier interpolation, scattering integral computation, and the rt-BTE ultrafast dynamics are implemented in our Perturbo open-source package38.