Zandpack: A General Tool for Time-dependent Transport Simulation of Nanoelectronics Journal: Computer Physics Communications Aleksander Bach Lorentzen, Alexander Croy, Antti-Pekka Jauho, Mads Brandbyge Abstract The auxiliary mode approach to time-dependent open quantum system calculations is implemented and refined to yield a feasible computational approach to simulate nanostructures far from equilibrium. It is done by a careful diagonalization of the electrode level-width function, and provides an efficient approach which can simulate large, open systems at the level of time-dependent density functional theory. The approach, as given in this work, is implemented in the new open-source code Zandpack. The framework is applied to three systems perturbed by the same THz electromagnetic field pulse-form: 1) A Hubbard model for hydrogen on graphene is used to calculate spin-currents, mutual information, spin-transitions, and a pump-probe setup. 2) An armchair graphene nanoribbon (AGNR) probed by a metal tip showing electrons excited from the valence band of the AGNR into the tip via electron-electron interactions. 3) A gold break-junction is modeled with various gap distances, and displays behavior that is more different from the adiabatic case as the gap widens. In the examples 2 and 3, we develop and use a general linearization scheme for time-dependent open system calculations, which utilizes the DFTB+ or SIESTA codes. PROGRAM SUMMARY Program Title: Zandpack CPC Library link to program files: (to be added by Technical Editor) Developer’s repository link: https://github.com/AleksBL Licensing provisions: MPL-2.0 Programming language: Python Nature of problem: Simulating the evolution of electrons in a device region connected to electrodes that are experiencing a time-dependent and strong bias, while at the same time describing the evolving device electrons accurately at the mean-field level. The electronic structure of the electrodes must also be described accurately in terms of the energy-dependence of its level-width function. This on a practical level requires fitting a set of known functions to a sum of Lorentzians. This fit then fixes the parameters of a coupled system of ODEs, in which the electronic density and Hamiltonian appears. Lastly, this system of ODEs has to be solved numerically. Solution method: A user-friendly routine for fitting the electrode level-width functions is implemented. It can either take input from TBtrans or custom user input and convert it to a sum of Lorentzians. We employ the auxiliary mode expansion (AME) method following Popescu and Croy [New J. Phys. 18, 093944 (2016)] with a modified version of the diagonalization technique, combined with an effective account for the electrode level-width functions. The code can obtain the initial steady state, and propagate this initial steady state after application of a user-defined voltage bias-pulse applied to the electrodes using an explicit Runge-Kutta solver. Throughout this propagation, a user-defined density-dependence is needed, e.g. by interfacing to an external LCAO-DFT code. Such an interface is available for SIESTA and DFTB+, but can also be written by the user. Additional comments including restrictions and unusual features: The AME method does not have any restrictions on how fast oscillations can be, meaning it is valid for slow (e.g. THz fields) as well as fast (e.g. optical fields) perturbations. Simulations with normal-superconducting-normal type setups are also possible. In the current implementation, phonons cannot be included in the calculation, but the method does in theory allow for such [Y. Zhang, C. Y. Yam, G. Chen, J. Chem. Phys. 138 (16) (2013)]. PACS 0000 , 1111 MSC 0000 , 1111 † † highlights: A code implementing the auxiliary mode approach for time-dependent quantum transport in open systems is presented. The code is demonstrated using three examples of nano-scale devices applying different levels of complexity in the mean-field description of the electronic structure. 1 Introduction During the last decade scanning near-field optical microscopy (SNOM) and its THz equivalent have been developed and enhanced to utilize a scanning tunneling microscope (STM) by several experimental groups 12 , 94 , 47 , 86 , 53 . SNOM is firstly a measurement where the apex of an atomic force microscope (AFM) tip is brought into proximity of a surface to be probed, after which a THz/IR pulse is shone upon the tip, giving a significant enhancement of the electric field just below the tip. This allows probing the material just below the tip with a resolution on the nanometer scale 10 . This idea of using a strong THz field and a tip to probe the material in question has since been refined to give atomic resolution by using field-driven tunneling from the material to a STM-tip (THz-STM) 25 , 1 , 2 , 11 , 95 , 55 , 52 , 41 , 12 , 94 , 47 . Both SNOM and THz-STM open up the realm of non-equilibrium phenomena on the scale where quantum effects are significant. The THz pulse can furthermore be combined with higher frequency pulsed light to make a pump-probe setup, where a weaker near-optical or optical pulse perturbs and probes the system at a variable time during the THz pulse 12 , 1 , 49 , 95 . This type of experiment in particular combines the relatively short timescale of the optical pulse with the longer THz pulse, which makes for a theoretically challenging task as the simulation method used must handle both the optical transitions in the junction, together with the slowly varying field from the THz pulse. Simulations for the time-independent case have been standard in the nano-electronics community for many years now. Different techniques for efficient evaluation of the non-equilibrium steady state density matrix have been developed 58 , 77 , 8 , 22 , 44 . Non-equilibrium Green’s function (NEGF) theory for dealing with time-dependent electronic transport in non-equilibrium conditions is a well-established field, albeit computationally heavy. It can model time-dependent phenomena in open single particle systems, systems with many-body interactions and “normal-superconducting-normal”-type systems 39 , 29 , 100 , 42 , 99 , 67 , 63 , 92 , 36 , 13 , 89 , 4 , 87 , 38 , 82 , 81 , 5 , 71 , 32 , 34 , 88 , 90 . Software for simulation of nanoelectronics is already available in various packages, such as NESSi, Cheers, TKwant and HEOM-QUICK 70 , 43 , 93 , 62 , which implement the NEGF equations using a range of different approximations. These do have various difficulties associated with them: NESSi is a general many-body code which is computationally expensive. Tkwant is a wavefunction-based code which means the density matrix needs to be computed at each time instance and also introduces the embedding self-energies which will follow in Sec. 2 in a different way 43 . The driven Liouville-von Neumann (DLvN) approach is also a method applicable to the same problem, but it is phenomenological in nature 33 , 97 and not NEGF based. Common to NEGF codes is that the single particle density matrix is available from the lesser Green’s function ( G^{<} ). The electronic density can be obtained directly from the density matrix, meaning NEGF based methods are compatible with density functional theory (DFT). The body of available codes implementing DFT in various ways is large (see Ref. 91 ), and namely, the codes using localized basis functions are of particular use in quantum transport. For this paper, the DFTB+ 3 , 35 and SIESTA 22 , 74 codes have been used to describe the electronic structure. Zandpack itself is agnostic to the particular DFT code used, as long as a Python wrapper function can be made. A single-particle density-matrix-based NEGF method, which is computationally efficient, has however been developed in Ref. 63 . It can be combined with DFT and is applicable to larger systems. The strength of the method at hand is that it allows for an exact analytical treatment - within the level-width function fitting scheme and independent particle picture - of any bias-pulse of and electrode with an arbitrary electronic structure. This allows for ab-initio time-dependent transport calculations, as the electrode level-width functions, \mathbf{\Gamma}_{\alpha} , can be fitted to the needed precision. It is furthermore extensible to Kohn-Sham TDDFT because the electron density is readily available from the density matrix. Dynamical effects can therefore also be included through a retarded response function 48 . In this paper we describe a computationally efficient implementation of the method and clarify subtle, but important requirements for obtaining physically sensible results using the method. The described functionality is available in the new python-based software package Zandpack together with Jupyter notebooks demonstrating its use 51 . Zandpack contains the necessary tools to fit the electrode level-width functions to a sum of Lorentzians, together with tools for finding the steady state and carrying out the time-propagation. The provided software implementation can only deal with electronic correlations in the mean-field picture, but there are extensions of the methodology to perturbatively include electron-phonon interactions 9 , 98 . It does not deal with strong correlation effects, e.g. as is found in a Mott insulating phase. 2 Theory 2.1 The Transport Setup In transport theory, the basic setup is the electrode-device setup (usually a left-device-right setup), in which the electrodes are described by a self-energy, \mathbf{\Sigma} , defined inside the device region, as illustrated in Fig. 1 . Figure 1: Device region of a transport setup. Regions 0 and 1 denoted on the figure are where the device region (gray) couple to the surrounding environment. In the framework of NEGF, the self-energy \mathbf{\Sigma} introduces the effects of the infinite environment through an energy-dependent matrix-valued function \mathbf{\Sigma}(\epsilon) , in a numerically exact way 29 , 67 . The description of electrodes is completed by a chemical potential \mu_{\alpha} and \Delta_{\alpha}(t) , which is a time-dependent bias that describes a rigid, time-dependent shift of the electronic structure of electrode \alpha . Additionally, thermal energies, kT_{\alpha} , in the electrodes are needed in addition to the indicated quantities in Fig. 1 to obtain the description at finite temperature. 2.2 Non-equilibrium Green’s Functions The primary quantity of interest in electronic structure theory and time-dependent calculations is the electronic density matrix, which is a derived quantity from the lesser Green function of the system. The equation of motion of the density matrix for the full system is given by the usual Liouville-von Neumann equation of motion 100 , 65 , 29 \displaystyle i\hbar\frac{\mathrm{d}}{\mathrm{d}t}{\bm{\sigma}}_{F}(t)=[\mathbf{H}_{F}(t),{\bm{\sigma}}_{F}(t)]\,, (1) where \mathbf{H}_{F} is the Hamiltonian of the full system, and \bm{\sigma}_{F}(t)=-i\hbar\mathbf{G}_{F}^{<}(t,t) is the density matrix of the full system: \displaystyle\mathbf{H}_{F}=\left[{\begin{array}[]{ccc}\mathbf{H}_{L}&\mathbf{H}_{L,D}&0\\ \mathbf{H}_{D,L}&\mathbf{H}_{D}&\mathbf{H}_{D,R}\\ 0&\mathbf{H}_{R,D}&\mathbf{H}_{R}\end{array}}\right], and \displaystyle\bm{\sigma}_{F}=\left[{\begin{array}[]{ccc}\bm{\sigma}_{L}&\bm{\sigma}_{L,D}&\bm{\sigma}_{LR}\\ \bm{\sigma}_{D,L}&\bm{\sigma}_{D}&\bm{\sigma}_{D,R}\\ \bm{\sigma}_{R,L}&\bm{\sigma}_{R,D}&\bm{\sigma}_{R}\end{array}}\right]\,, in the case of the left-device-right setup and can be generalized to a N -electrode setup. The Liouville-von Neumann equation is intractable for a system with electrodes that have an effectively infinite extent. However, by considering only the elements inside a restricted region, the device region, it is possible to obtain the evolution of the density matrix of this sub-system as 100 , 13 , 63 , 67 \displaystyle i\hbar\frac{\mathrm{d}}{\mathrm{d}t}\bm{\sigma}_{D}(t)=[\mathbf{H}_{D}(t),\bm{\sigma}_{D}(t)]+i\sum_{\alpha}\left[\mathbf{\Pi}_{\alpha}(t)+\mathbf{\Pi}_{\alpha}^{\dagger}(t)\right]\,, (8) where the current matrices, \mathbf{\Pi}_{\alpha} , account for the effects of the n_{\alpha} uncoupled electrodes in the device region while keeping the problem tractable. The current matrices are given as, \displaystyle\mathbf{\Pi}_{\alpha}(t) \displaystyle=\int_{t_{0}}^{t}\mathrm{d}t^{\prime}\left[\mathbf{G}_{D}^{>}(t,t^{\prime})\mathbf{\Sigma}^{<}_{\alpha}(t^{\prime},t)-\mathbf{G}_{D}^{<}(t,t^{\prime})\mathbf{\Sigma}^{>}_{\alpha}(t^{\prime},t)\right], (9) and they yield the current flowing from the electrode \alpha as J_{\alpha}(t)=\frac{2\mathrm{e}}{\hbar}\mathrm{Re}\mathrm{Tr}\left[\mathbf{\Pi}_{\alpha}(t)\right] . From here on the " D "-subscript will be dropped. The electrode self-energy components \mathbf{\Sigma}_{\alpha}^{} in Eq. ( 9 ) are generalized scattering rates out of / into the device, and are given as 13 , 63 , 39 , 29 , \displaystyle\mathbf{\Sigma}^{<}_{\alpha}(t_{2},t)= \displaystyle\phantom{-}\frac{i}{2\pi\hbar}\mathrm{e}^{\frac{i}{\hbar}\int_{t_{2}}^{t}\mathrm{d}t_{1}\Delta_{\alpha}(t_{1})} (10) \displaystyle\times\int_{-\infty}^{\infty}\mathrm{d}\epsilon f_{\alpha}(\epsilon)\mathbf{\Gamma}_{\alpha}(\epsilon)\mathrm{e}^{-\frac{i}{\hbar}\epsilon(t_{2}-t)}, \displaystyle\mathbf{\Sigma}^{>}_{\alpha}(t_{2},t)= \displaystyle-\frac{i}{2\pi\hbar}\mathrm{e}^{\frac{i}{\hbar}\int_{t_{2}}^{t}\mathrm{d}t_{1}\Delta_{\alpha}(t_{1})} (11) \displaystyle\times\int_{-\infty}^{\infty}\mathrm{d}\epsilon(1-f_{\alpha}(\epsilon))\mathbf{\Gamma}_{\alpha}(\epsilon)\mathrm{e}^{-\frac{i}{\hbar}\epsilon(t_{2}-t)}, where f_{\alpha}(\epsilon)=1/(\exp((\epsilon-\mu_{\alpha})/kT_{\alpha})+1) is the Fermi-Dirac distribution of the electrode, \Delta_{\alpha} the time-dependent electrode bias, and \mathbf{\Gamma}_{\alpha} is the electrode level-width function. Note that here it is assumed that in the electrode regions (dashed in Fig. 1 ) the state energies and fillings rigidly follow the electrode bias shift \Delta_{\alpha}(t) . The retarded/advanced components of the self-energy can furthermore be obtained by the relation 29 , \displaystyle\mathbf{\Sigma}_{\alpha}^{r/a}(t_{2},t)=\pm\Theta(\pm t_{2}\mp t)\left[\mathbf{\Sigma}_{\alpha}^{>}(t_{2},t)-\mathbf{\Sigma}_{\alpha}^{<}(t_{2},t)\right], (12) where \Theta is the Heaviside step function. The retarded self energy, \mathbf{\Sigma}_{\alpha}^{r} , contains spectral information about electrode \alpha . 2.3 Pole Expansion The electrode level-width functions, which are obtained from the bare electrode Green’s function \mathbf{g}_{\alpha}^{r} , \displaystyle\mathbf{\Gamma}_{\alpha}=\mathbf{H}_{D\alpha}(\mathbf{g}_{\alpha}^{r}-\mathbf{g}_{\alpha}^{a})\mathbf{H}_{\alpha D}=i\left[\mathbf{\Sigma}^{r}_{\alpha}-\mathbf{\Sigma}^{a}_{\alpha}\right] (13) are assumed to be given by a weighted sum of Lorentzian functions 13 , 63 : \displaystyle\mathbf{\Gamma}_{\alpha}(\epsilon) \displaystyle=\sum_{l}^{N_{l}}L_{\alpha l}(\epsilon)\mathbf{W}_{\alpha l}\,, (14) where \mathbf{W}_{\alpha l} is a matrix of coefficients and \displaystyle L_{\nu}(\epsilon)=\frac{\gamma_{\nu}^{2}}{(\epsilon-\epsilon_{\nu})^{2}+\gamma_{\nu}^{2}}=\frac{i\gamma_{\nu}}{2}[\frac{1}{\epsilon-z_{\nu}^{-}}-\frac{1}{\epsilon-z_{\nu}^{+}}]\,, (15) is a Lorentzian function with z_{\nu}^{+}=(z_{\nu}^{-})^{*}=\epsilon_{\nu}+i\gamma_{\nu} . The coefficient matrix \mathbf{W}_{\alpha l} furthermore has the eigendecomposition \displaystyle\mathbf{W}_{\alpha l} \displaystyle=\sum_{c}\lambda_{\alpha lc}\,\vec{\xi}_{\alpha lc}\otimes\vec{\xi}^{\phantom{.}\dagger}_{\alpha lc}\,, (16) where the summation index c runs over the number of non-zero eigenvalues of \mathbf{W}_{\alpha l} . This form is just the regular \mathbf{M}=\mathbf{U}\mathbf{D}\mathbf{U}^{\dagger} eigendecomposition written as an explicit sum. The \mathbf{W}_{\alpha l} matrices in the above sum can be fitted with the python package Zandpack a to ab-initio level-width functions calculated using, e.g., the TBtrans code 58 . At this point we have to introduce the energy window around the initial, equilibrium Fermi energy. All essential states involved in the time-dependent dynamics, and the corresponding poles, should be located within this energy window on the real energy axis. Clearly, the size of the window must extend beyond the peak electrode potentials ( \Delta_{\alpha}(t)+\mu_{\alpha} ), but the concrete window size is a matter of case-by-case convergence (cf. App. C ). The fit of \mathbf{\Gamma}_{\alpha} ’s to the numerically exact broadening matrices \tilde{\mathbf{\Gamma}}_{\alpha}=i(\tilde{\mathbf{\Sigma}}_{\alpha}-\tilde{\mathbf{\Sigma}}_{\alpha}^{\dagger}) is the first part of the numerical procedure of going from the standard, time-independent transport setup, to the auxiliary mode time-propagation. Importantly, \tilde{\mathbf{\Gamma}}_{\alpha}(\epsilon) is positive semi-definite for all \epsilon\in\mathbb{R} and the fitted \mathbf{\Gamma}_{\alpha}(\epsilon) has to be so too 90 . For this purpose, the Zandpack code is used to determine the coefficients \mathbf{W}_{\alpha l} from Eq. ( 14 ). The fitting procedure is elaborated on in App. A . It should also be noted that the form in Eq. ( 14 ) also determines the retarded self-energy through the relation \displaystyle\mathbf{\Sigma}_{\alpha}^{r}(\epsilon)=\frac{1}{2}\mathcal{H}[\mathbf{\Gamma}_{\alpha}](\epsilon)-\frac{i}{2}\mathbf{\Gamma}_{\alpha}(\epsilon)\,, (17) where \mathcal{H} denotes the Hilbert transform 61 . The replacement of \mathbf{\Gamma}_{\alpha} by an approximation with support limited to the energy window, will show up in the real (Hilbert) part of \mathbf{\Sigma}_{\alpha}^{r} . This is illustrated in Fig. 2 for a simple example. Here we show how the Hilbert transform inside the energy window (white parts) can be impacted by the neglected real part of \Sigma^{r} outside the energy window (gray parts). Figure 2: The impact on the Hilbert transform (see Eq. ( 17 )) of a function \Gamma=i\left[\Sigma^{r}-\Sigma^{r\dagger}\right] that has been set to zero for |\epsilon|>2 . Here it is compared to its unrestricted counterpart -\mathrm{Im}\Sigma^{r} . Grey indicates the energy window where \Gamma is assumed to be zero, and \Sigma^{r} is the full self-energy. Furthermore, doing a sum-over-poles expansion for the scaled Fermi-function of the form 14 , 37 , 63 , \displaystyle F(s)=\frac{1}{1+\mathrm{e}^{s}}=\frac{1}{2}-\sum_{p}\frac{R_{p}}{s-z_{p}^{+}}+\frac{R_{p}}{s-z_{p}^{-}} (18) gives poles for the electrode Fermi function f_{\alpha}(\epsilon)=F(\frac{\epsilon-\mu_{\alpha}}{kT_{\alpha}}) at \epsilon=\mu_{\alpha}+kT_{\alpha}z^{\pm}_{p} . Having the fit, the energy-integrals in Eqs. ( 10 ) and ( 11 ) are done using the residue-theorem and Jordan’s lemma 63 . This requires a sum over the residues of the integrands in the self-energies. If the Fermi-function f is also expanded in poles (as in Refs. 37 , 14 ), then all poles of the integrand are known, namely, the union between the poles of the Lorentzian functions and the poles of the Fermi functions, f_{\alpha} . All poles are symmetrically distributed around the real axis. These poles are denoted by \chi^{\pm}_{\alpha x} where x is the combined index of the Fermi-poles and Lorentzian-poles, with the \pm sign indicating the sign of the imaginary part of the pole. Furthermore, the quantity \chi^{\pm}_{\alpha x}+\Delta_{\alpha}(t) will often appear, so we will introduce the following shorthand definition, \displaystyle\chi^{\pm}_{\alpha x}(t)=\chi^{\pm}_{\alpha x}+\Delta_{\alpha}(t)\,. (19) The vectors \vec{\xi}_{\alpha xc} will now appear with the x index, extending the eigendecomposition in Eq. ( 16 ) to also include the eigencompositions of \mathbf{\Gamma}_{\alpha}(z_{p}) in the Fermi poles. This is because the residual of the integrand must be computed in a Fermi-pole using Eq. ( 14 ). Additionally, \mathbf{\Gamma}_{\alpha}(z_{p}) is split in the following way: \displaystyle\mathbf{\Gamma}_{\alpha}(z_{p}) \displaystyle=\frac{\mathbf{\Gamma}_{\alpha}(z_{p})+\mathbf{\Gamma}^{\dagger}_{\alpha}(z_{p})}{2}+\frac{\mathbf{\Gamma}_{\alpha}(z_{p})-\mathbf{\Gamma}^{\dagger}_{\alpha}(z_{p})}{2} (20) \displaystyle=\widehat{\mathbf{\Gamma}}_{\alpha}(z_{p})+{\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 7.10185pt\hbox{\scalebox{1}[-1]{\lower 7.10185pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=6.86111pt\vrule height=0.0pt,width=6.91663pt}$}}}}\cr\hbox{$\displaystyle\mathbf{\Gamma}$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 7.10185pt\hbox{\scalebox{1}[-1]{\lower 7.10185pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=6.86111pt\vrule height=0.0pt,width=6.91663pt}$}}}}\cr\hbox{$\textstyle\mathbf{\Gamma}$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 6.41574pt\hbox{\scalebox{1}[-1]{\lower 6.41574pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=4.80278pt\vrule height=0.0pt,width=5.41388pt}$}}}}\cr\hbox{$\scriptstyle\mathbf{\Gamma}$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.95833pt\hbox{\scalebox{1}[-1]{\lower 5.95833pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=3.43056pt\vrule height=0.0pt,width=4.48601pt}$}}}}\cr\hbox{$\scriptscriptstyle\mathbf{\Gamma}$}\crcr}}}}}_{\alpha}(z_{p})\,. These two matrices, contrary to their sum, are individually diagonalizable by a unitary transformation, which is a necessary requirement to obtain the set of ordinary differential equations (ODE) given below. Importantly, we note that without a unitary decomposition, we may obtain spurious currents flowing under equilibrium conditions, which is clearly non-physical. Following Ref. 63 now gives the self-energies as a sum of outer products: \displaystyle\mathbf{\Sigma}_{\alpha}^{}(t_{2},t)=\frac{1}{\hbar}\sum_{c,x}\Lambda^{,\pm}_{\alpha xc}\vec{\xi}_{\alpha xc}\otimes\vec{\xi}^{\phantom{.}\dagger}_{\alpha xc}\mathrm{e}^{-\frac{i}{\hbar}\int_{t_{2}}^{t}\mathrm{d}t^{\prime}\chi_{\alpha x}^{\pm}(t^{\prime})}\,, (29) where the \pm depends on the time-ordering of the phase-factor, the index x runs over N_{L} indices corresponding to the Lorentzian poles of the \mathbf{\Gamma}_{\alpha}(\epsilon) expansion, and 2N_{F} indices are coming from the two matrices of each symmetric-antisymmetric decomposition of the N_{F} different \mathbf{\Gamma}_{\alpha}(z_{p}) . For each type of pole, the residues inside the self-energies evaluates to, \displaystyle\Lambda_{\alpha lc}^{<,\pm} \displaystyle=\phantom{-}\frac{i}{2}f_{\alpha}(z_{\alpha l}^{\pm})\lambda_{\alpha lc}\gamma_{\alpha l}\,, \displaystyle\Lambda_{\alpha\widehat{p}c}^{<,\pm} \displaystyle=\pm R_{\alpha p}kT_{\alpha}\widehat{\lambda}_{\alpha pc}\,, \displaystyle\Lambda_{\alpha{\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 5.81944pt\hbox{\scalebox{1}[-1]{\lower 5.81944pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=3.01389pt\vrule height=0.0pt,width=4.12234pt}$}}}}\cr\hbox{$\displaystyle p$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.81944pt\hbox{\scalebox{1}[-1]{\lower 5.81944pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=3.01389pt\vrule height=0.0pt,width=4.12234pt}$}}}}\cr\hbox{$\textstyle p$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.51805pt\hbox{\scalebox{1}[-1]{\lower 5.51805pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=2.10971pt\vrule height=0.0pt,width=2.46532pt}$}}}}\cr\hbox{$\scriptstyle p$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.31712pt\hbox{\scalebox{1}[-1]{\lower 5.31712pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=1.50694pt\vrule height=0.0pt,width=1.76094pt}$}}}}\cr\hbox{$\scriptscriptstyle p$}\crcr}}}}}c}^{<,\pm} \displaystyle=\pm R_{\alpha p}kT_{\alpha}{\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 7.12962pt\hbox{\scalebox{1}[-1]{\lower 7.12962pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=6.94444pt\vrule height=0.0pt,width=5.83336pt}$}}}}\cr\hbox{$\displaystyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 7.12962pt\hbox{\scalebox{1}[-1]{\lower 7.12962pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=6.94444pt\vrule height=0.0pt,width=5.83336pt}$}}}}\cr\hbox{$\textstyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 6.43518pt\hbox{\scalebox{1}[-1]{\lower 6.43518pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=4.8611pt\vrule height=0.0pt,width=4.74307pt}$}}}}\cr\hbox{$\scriptstyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.97221pt\hbox{\scalebox{1}[-1]{\lower 5.97221pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=3.47221pt\vrule height=0.0pt,width=4.20143pt}$}}}}\cr\hbox{$\scriptscriptstyle\lambda$}\crcr}}}}}_{\alpha pc}\,, (46a-f) \displaystyle\Lambda^{>,\pm}_{\alpha lc} \displaystyle=-\frac{i}{2}(1-f_{\alpha}(z_{\alpha l}^{\pm}))\lambda_{\alpha lc}\gamma_{\alpha l}\,, \displaystyle\Lambda_{\alpha\widehat{p}c}^{>,\pm} \displaystyle=\pm R_{\alpha p}kT_{\alpha}\widehat{\lambda}_{\alpha pc}\,, \displaystyle\Lambda_{\alpha{\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 5.81944pt\hbox{\scalebox{1}[-1]{\lower 5.81944pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=3.01389pt\vrule height=0.0pt,width=4.12234pt}$}}}}\cr\hbox{$\displaystyle p$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.81944pt\hbox{\scalebox{1}[-1]{\lower 5.81944pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=3.01389pt\vrule height=0.0pt,width=4.12234pt}$}}}}\cr\hbox{$\textstyle p$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.51805pt\hbox{\scalebox{1}[-1]{\lower 5.51805pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=2.10971pt\vrule height=0.0pt,width=2.46532pt}$}}}}\cr\hbox{$\scriptstyle p$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.31712pt\hbox{\scalebox{1}[-1]{\lower 5.31712pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=1.50694pt\vrule height=0.0pt,width=1.76094pt}$}}}}\cr\hbox{$\scriptscriptstyle p$}\crcr}}}}}c}^{>,\pm} \displaystyle=\pm R_{\alpha p}kT_{\alpha}{\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 7.12962pt\hbox{\scalebox{1}[-1]{\lower 7.12962pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=6.94444pt\vrule height=0.0pt,width=5.83336pt}$}}}}\cr\hbox{$\displaystyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 7.12962pt\hbox{\scalebox{1}[-1]{\lower 7.12962pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=6.94444pt\vrule height=0.0pt,width=5.83336pt}$}}}}\cr\hbox{$\textstyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 6.43518pt\hbox{\scalebox{1}[-1]{\lower 6.43518pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=4.8611pt\vrule height=0.0pt,width=4.74307pt}$}}}}\cr\hbox{$\scriptstyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.97221pt\hbox{\scalebox{1}[-1]{\lower 5.97221pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=3.47221pt\vrule height=0.0pt,width=4.20143pt}$}}}}\cr\hbox{$\scriptscriptstyle\lambda$}\crcr}}}}}_{\alpha pc}\,. Here \widehat{\lambda}_{\alpha pc}\phantom{n}({\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 7.12962pt\hbox{\scalebox{1}[-1]{\lower 7.12962pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=6.94444pt\vrule height=0.0pt,width=5.83336pt}$}}}}\cr\hbox{$\displaystyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 7.12962pt\hbox{\scalebox{1}[-1]{\lower 7.12962pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=6.94444pt\vrule height=0.0pt,width=5.83336pt}$}}}}\cr\hbox{$\textstyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 6.43518pt\hbox{\scalebox{1}[-1]{\lower 6.43518pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=4.8611pt\vrule height=0.0pt,width=4.74307pt}$}}}}\cr\hbox{$\scriptstyle\lambda$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.97221pt\hbox{\scalebox{1}[-1]{\lower 5.97221pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=3.47221pt\vrule height=0.0pt,width=4.20143pt}$}}}}\cr\hbox{$\scriptscriptstyle\lambda$}\crcr}}}}}_{\alpha pc}) are the accompanying eigenvalues of \widehat{\mathbf{\Gamma}}_{\alpha}(z_{p})\phantom{n}({\mathchoice{{\vtop{\halign{#\cr\hbox{\raise 7.10185pt\hbox{\scalebox{1}[-1]{\lower 7.10185pt\hbox{$\displaystyle\widehat{\vrule width=0.0pt,height=6.86111pt\vrule height=0.0pt,width=6.91663pt}$}}}}\cr\hbox{$\displaystyle\mathbf{\Gamma}$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 7.10185pt\hbox{\scalebox{1}[-1]{\lower 7.10185pt\hbox{$\textstyle\widehat{\vrule width=0.0pt,height=6.86111pt\vrule height=0.0pt,width=6.91663pt}$}}}}\cr\hbox{$\textstyle\mathbf{\Gamma}$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 6.41574pt\hbox{\scalebox{1}[-1]{\lower 6.41574pt\hbox{$\scriptstyle\widehat{\vrule width=0.0pt,height=4.80278pt\vrule height=0.0pt,width=5.41388pt}$}}}}\cr\hbox{$\scriptstyle\mathbf{\Gamma}$}\crcr}}}}{{\vtop{\halign{#\cr\hbox{\raise 5.95833pt\hbox{\scalebox{1}[-1]{\lower 5.95833pt\hbox{$\scriptscriptstyle\widehat{\vrule width=0.0pt,height=3.43056pt\vrule height=0.0pt,width=4.48601pt}$}}}}\cr\hbox{$\scriptscriptstyle\mathbf{\Gamma}$}\crcr}}}}}_{\alpha}(z_{p})) . Thus, the general index, x , now take values corresponding to the Lorentzian expansion, l , or a Fermi-pole requiring two indices, \widehat{p} and \textstyle\widehat{\vrule width=0.0pt,height=4.30554pt\vrule height=0.0pt,width=5.03125pt} \textstyle p , while index c runs over the corresponding eigendecomposition for each of these matrices. The \pm components of the \Lambda -quantities are defined relative to the electrode self-energy times as t>t_{2} ( t}(t,t^{\prime})\Lambda_{\alpha xc}^{<,+}-\textbf{G}^{<}(t,t^{\prime})\Lambda_{\alpha xc}^{>,+}] \displaystyle\times\mathrm{e}^{\frac{i}{\hbar}\int_{t^{\prime}}^{t}\mathrm{d}t^{\prime\prime}\chi_{\alpha xc}(t^{\prime\prime})}\vec{\xi}_{\alpha xc} (64) from Eq. ( 9 ) and inserting Eq. ( 29 ). The present method propagates the system described by the Hamiltonian, self-energies in terms of Lorentzian and Fermi functions, and the time-dependent bias in an exact way in the one-particle picture, with direct access to the density matrix. The method achieves this by introducing an auxiliary wave vector, \vec{\Psi}_{\alpha xc}(t) , whose equation of motion is given in Ref. 63 , page 5: \displaystyle i\hbar\frac{\mathrm{d}\phantom{l}}{\mathrm{d}t}\vec{\Psi}_{\alpha xc} \displaystyle=[\mathbf{H}(t)-\mathbf{1}\,\chi^{+}_{\alpha x}(t)]\vec{\Psi}_{\alpha xc}+\hbar\Lambda^{<+}_{\alpha xc}\vec{\xi}_{\alpha xc} (65) \displaystyle+\hbar(\Lambda^{>,+}_{\alpha xc}-\Lambda^{<,+}_{\alpha xc})\bm{\sigma}\vec{\xi}_{\alpha xc} \displaystyle+\frac{1}{\hbar}\sum_{\alpha^{\prime}x^{\prime}c^{\prime}}\Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}}\vec{\xi}_{\alpha^{\prime}x^{\prime}c^{\prime}}\,, \displaystyle i\hbar\frac{\mathrm{d}\phantom{l}}{\mathrm{d}t}\Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}} \displaystyle=(\chi^{-}_{\alpha^{\prime}x^{\prime}}(t)-\chi^{+}_{\alpha x}(t))\Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}} (66) \displaystyle\phantom{=}+i\hbar(\Lambda^{>,-}_{\alpha^{\prime}x^{\prime}{}c^{\prime}}-\Lambda^{<,-}_{\alpha^{\prime}x^{\prime}c^{\prime}})\vec{\xi}^{\phantom{.}\dagger}_{\alpha^{\prime}x^{\prime}c^{\prime}}\vec{\Psi}_{\alpha xc} \displaystyle\phantom{=}+i\hbar(\Lambda^{>,+}_{\alpha xc}\phantom{n.}-\phantom{n}\Lambda^{<,+}_{\alpha xc})\vec{\Psi}^{\dagger}_{\alpha^{\prime}x^{\prime}c^{\prime}}\vec{\xi}_{\alpha xc}\,. The quantity \Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}} appears when \frac{\mathrm{d}}{\mathrm{d}t}\vec{\Psi}_{\alpha xc} is calculated from Eq. ( 2.3 ). The efficiency of the present method comes from the absence of matrix-matrix products in Eqs. ( 65 ) and ( 66 ). More significantly, Eqs. ( 8 ), ( 65 ) and ( 66 ) constitute a regular, densely coupled ODE, for which there are standard methods of solving, given initial conditions. This also implies that a calculation can be restarted from the state obtained from previous time-steps. Importantly, it also scales linearly in the number of time-steps. A scaling analysis of the method is furthermore given in Fig. 2 of Ref. 63 . Details of the scaling can also be found in App. H . For the steady-state, an equation can furthermore be derived by letting \Delta_{\alpha}(t)=c_{\alpha} where c_{\alpha} is a constant initial bias, and setting the time-derivatives of \vec{\Psi}_{\alpha xc} and \Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}} in Eqs. ( 65 ) and ( 66 ) to zero. Doing this, the following equations are obtained: \displaystyle\Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}}^{0} \displaystyle=-\Biggl((\Lambda^{>,-}_{\alpha^{\prime}x^{\prime}c^{\prime}}-\Lambda^{<,-}_{\alpha^{\prime}x^{\prime}c^{\prime}})\vec{\xi}^{\phantom{.}\dagger}_{\alpha^{\prime}x^{\prime}c^{\prime}}\vec{\Psi}_{\alpha xc}^{0} \displaystyle\phantom{mn}+(\Lambda^{>,+}_{\alpha xc}\phantom{n.}-\phantom{n}\Lambda^{<,+}_{\alpha xc})\vec{\Psi^{0}}^{\dagger}_{\alpha^{\prime}x^{\prime}c^{\prime}}\vec{\xi}_{\alpha xc}\Biggl) (67) \displaystyle\phantom{mn}\times\left[\frac{i\hbar}{\chi_{\alpha^{\prime}x^{\prime}}^{-}(t_{0})-\chi_{\alpha x}^{+}(t_{0})}\right] and \displaystyle\vec{\Psi}^{0}_{\alpha xc} \displaystyle=-\left[\mathbf{H}^{0}-\mathbf{1}\chi_{\alpha xc}^{+}\right]^{-1} (68) \displaystyle\phantom{m}\times\Biggl(\hbar\Lambda_{\alpha xc}^{<+}\vec{\xi}_{\alpha xc}. \displaystyle\phantom{mm}+\hbar(\Lambda_{\alpha xc}^{>+}-\Lambda_{\alpha xc}^{<+})\bm{\sigma}^{0}\vec{\xi}_{\alpha xc} \displaystyle\phantom{mm}+\frac{1}{\hbar}\sum_{\alpha^{\prime}x^{\prime}c^{\prime}}\Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}}^{0}\vec{\xi}_{\alpha^{\prime}x^{\prime}c^{\prime}}\Biggl)\;. This system can be solved by substituting \Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}}^{0} into Eq. ( 68 ) and noting the equation is a linear inhomogeneous matrix problem. The system of equations just requires the steady-state density matrix to be known. Techniques for calculating the steady-state density matrix both in and out of equilibrium are well-developed 57 , 77 , 8 . It is obtained by using the Keldysh equation for the lesser Green’s function as 29 , \displaystyle\bm{\sigma}^{0}=\frac{i}{2\pi}\int_{-\infty}^{+\infty}\mathbf{G}^{r}(\epsilon)\mathbf{\Sigma}^{<}(\epsilon)\mathbf{G}^{a}(\epsilon)\mathrm{d}\epsilon\,. (69) This integral can be handled using contour integration, and the energy-resolved self-energy from Eq. ( 10 ) in steady state. Furthermore, it simplifies with the fluctuation-dissipation theorem under equilibrium conditions 29 . It should also be noted the static expression in Eq. ( 69 ) also accounts for bound states as G^{r/a}(\epsilon) contains all the the spectral information of the device. The same applies in the time-dependent case, where the bound states are likewise accounted for in equilibrium 76 . Out of equilibrium needs a fully time-dependent treatment to determine the density matrix 76 . Lastly, it is also possible to introduce a general additive term in Eq. ( 8 ). This could be a dissipative term scaling with the deviation of the density matrix from equilibrium such as 7 , \bm{\mathcal{D}}(t)=\eta(\bm{\sigma}(t)-\bm{\sigma}^{0})\;. (70) This term can e.g. be used to dampen rapid oscillations when calculating the initial state or introduce an ad hoc lifetime of electrons in the device. It can also be used to introduce a dampening term similar to what is used in the DLvN approach to quantum transport 64 . Altogether, the user must (1) start from a standard transport calculation using, for example, TBtrans 58 , (2) obtain a fitted level-width function in the form of Eq. ( 14 ), a Fermi function expansion of the form Eq. ( 18 ), (3) compute Eq. ( 69 ) self-consistently to then obtain the steady-state solution \vec{\Psi}^{0}_{\alpha xc} and \Omega^{0}_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}} , and then, finally, (4) propagate Eqs. ( 8 ), ( 65 ) and ( 66 ). The implementation is done in a stepwise manner, where the users can refine the fit as they see fit. 3 Orthogonalization Procedure In Section 2 , an orthogonal basis was assumed throughout. It is important to address the translation of a general DFT-based calculation, where the basis is not orthogonal, to the theory presented above. The main problem is to include the basis set overlap between the electrode basis \Phi_{\alpha} , and the device basis \Phi_{D} . To resolve this issue, the device basis is transformed according to Ref. 45 , \displaystyle\left[\begin{array}[]{c}{{\Phi_{L}}}\\ {{\tilde{\Phi}_{D}}}\\ {{\Phi_{R}}}\end{array}\right]=\left[\begin{array}[]{c c c}{{\mathbf{1}}}&{{0}}&{{0}}\\ {{\mathbf{U}_{DL}}}&{{\mathbf{U}_{DD}}}&{{\mathbf{U}_{DR}}}\\ {{0}}&{{0}}&{{\mathbf{1}}}\end{array}\right]\left[\begin{array}[]{c}{{\Phi_{L}}}\\ {{\Phi_{D}}}\\ {{\Phi_{R}}}\end{array}\right]\,, such that the resulting overlap matrix of the whole system in the transformed basis is on the form, \displaystyle\tilde{\mathbf{S}}=\mathbf{U}\mathbf{S}\mathbf{U}^{T}=\left[\begin{array}[]{c c c}{{\mathbf{S}_{L}}}&{{0}}&{{0}}\\ {{0}}&{{\tilde{\mathbf{S}}_{D}}}&{{0}}\\ {{0}}&{{0}}&{{\mathbf{S}_{R}}}\end{array}\right]. This ensures the electrode and device basis functions have zero overlap. The blocks \mathbf{U}_{DL},\mathbf{U}_{DD} and \mathbf{U}_{DR} are solved for in Ref. 45 and applying the transformation \mathbf{U} to the total system results in a modification of the Hamiltonian, overlap and self-energies, \displaystyle\tilde{\mathbf{H}}(t)=\mathbf{H}^{0}+\sum_{\alpha}\mathbf{\Sigma}^{0}_{\alpha}(t), (83) \displaystyle\tilde{\mathbf{S}}=\mathbf{S}-\sum_{\alpha}\mathbf{\Sigma}^{1}_{\alpha}, (84) \displaystyle\tilde{\mathbf{\Sigma}}^{r}_{\alpha}(z)=\mathbf{\Sigma}^{r}_{\alpha}(z)-\mathbf{\Sigma}^{0}_{\alpha}-\mathbf{\Sigma}^{1}_{\alpha}z. (85) The expressions for \mathbf{\Sigma}_{\alpha}^{0/1} can be found in App. G . The time-dependent Hamiltonian \tilde{\mathbf{H}}(t) contains the time-dependent correction introduced by the electrode-device overlap \mathbf{S}_{\alpha D} . Furthermore, as the transformed device basis, \Phi_{D} , is orthogonal to the electrode basis, the device basis can be simply orthogonalized with a Löwdin transformation: \displaystyle\mathbf{M}^{\prime}_{D}=\tilde{\mathbf{S}}^{-\frac{1}{2}}\mathbf{M}_{D}\tilde{\mathbf{S}}^{-\frac{1}{2}}. (86) This procedure makes the non-orthogonal electrode-device transport calculation compatible with the theory outlined in Section 2 . 4 Time-dependent Hamiltonian Involving some type of density matrix dependence in the Hamiltonian \mathbf{H}(t)=\mathbf{H}\left[\bm{\sigma}(t)\right] , as done in a mean-field description such as TDDFT, will incur a cost in terms of computation time when calculating the Hamiltonian from the density matrix. In some cases it can be advantageous to approximate the Hamiltonian’s dependence on the density matrix, \bm{\sigma} . Since Coulomb screening will keep the device region close to charge neutral, a Taylor expansion of the \bm{\sigma} dependence of the Hamiltonian around the equilibrium density can be a good approximation. In this work, the Hamiltonian will be linearized in terms of the density matrix by proxy, through the Mulliken charge matrix 35 \displaystyle\mathbf{Q}_{0}=\frac{1}{2}\left[\bm{\sigma}^{NO}\mathbf{S}+\mathbf{S}\,\bm{\sigma}^{NO}\right]. (87) Here,, Q_{0} is the Mulliken charge matrix, \mathbf{S} is the overlapmatrix,x, and \bm{\sigma}^{NO} is the density matrix in thnon-orthogonalnal basis. The diagonal of Q_{0} is the collection of the orbital-resolved Mulliken charge. In order to Taylor-expand \mathbf{H} around the ground state \bm{\sigma}^{NO} , a small charge \mathrm{d}q is added on the diagonal to give: \displaystyle[\mathbf{Q}_{0}^{i}]_{jk}=[Q_{0}]_{jk}+\delta_{jk}\delta_{ki}\mathrm{d}q, (88) which now is a displaced Mulliken charge matrix. To obtain the corresponding displaced density matrix from the Mulliken charge matrix Q_{0}^{i} , a Sylvester equation \displaystyle\mathbf{Q}_{0}^{i}=\frac{1}{2}\left[\bm{\sigma}^{NO}_{i}\mathbf{S}+\mathbf{S}\,\bm{\sigma}^{NO}_{i}\right] (89) is solved for \bm{\sigma}_{i}^{NO} , from which \mathbf{H}(\bm{\sigma}^{NO}_{i}) can be calculated using an external DFT-code. This in turn enables the calculation of the Taylor-expansion coefficients \displaystyle\frac{\mathrm{d}\mathbf{H}}{\mathrm{d}q_{i}}\approx\frac{\mathbf{H}(\bm{\sigma}_{i}^{NO})-\mathbf{H}^{0}}{\mathrm{d}q}. (90) The linearized Hamiltonian dependence on the Mulliken charge will then read \displaystyle\mathbf{H}(\bm{\sigma}(t))=\mathbf{H}^{0}+\sum_{i}\frac{\mathrm{d}\mathbf{H}}{\mathrm{d}q_{i}}[\mathbf{Q}(\bm{\sigma}(t))-\textbf{Q}_{0}]_{ii} (91) where the time-dependent Mulliken charge matrix will be calculated for each timestep. Other schemes, such as directly expanding the density matrix elements, are also possible. The main benefit is in any case, that the dynamic Hamiltonian from Eq. ( 91 ), can be evaluated fast compared to a full DFT calculation. Here, we treat the coupling to a classical photon field. However, it should be noted that in Ref. 80 the coupling to photonic cavity quantum modes is incorporated into Eq. ( 8 ) by extending the time-evolution to two sets of dynamical variables describing both electrons and modes, respectively. 5 Examples In this Section, three different systems are examined under influence of a THz-pulse. The first is a tight-binding model incorporating a spin-splitting Hubbard U term to model hydrogen adsorption on graphene. For this simple electronic structure model we also include an additional infrared pump field. The second system is a model of a THz-STM measurement of an arm-chair nanoribbon in which the electronic structure is described in greater detail using the DFTB+ code. The third system is a gold break-junction and where the significance of the gap on the current-response is examined using a linearized Mulliken-charge dependence of the Hamiltonian obtained with the SIESTA code. Throughout this Section, the adiabatic approximation for the exchange-correlation functional will be used 83 , i.e., no frequency-dependent effects are included, meaning the Hamiltonian depends only on the instantaneous density \bm{\sigma}(t) . This is done, however, only for practical reasons, and a retarded density matrix dependence of the Hamiltonian could be implemented without any theoretical barriers. 5.1 Tight-binding with Mean-field Hubbard Term: Hydrogenated Graphene Graphene can be hydrogenated with a hydrogen atom on top of a carbon atom, which induces a magnetic moment in the graphene layer 26 . This has also been treated in a simplified form in Ref. 78 . The basic property of this system is a switchable spin-polarization of the hydrogen atom when contacted with a STM-tip from above. Model Here an extended graphene sheet hydrogenated at a single carbon atom is modeled. The general setup is illustrated in Fig. 3 . Figure 3: Computational setup for the hydrogen atom on graphene. One orbital for each atom is added, giving a total of 85 orbitals. A mean-field Hubbard term U\bm{\sigma}_{HH}^{\overline{s}} is indicated where \overline{s} means the opposite spin 69 . A single-band electrode self-energy \mathbf{\Sigma}_{tip} and the graphene real-space self-energy \mathbf{\Sigma}_{\mathcal{R}} are also shown 56 . The full Hamiltonian consisting of the various parts is given as \displaystyle H_{F}=H_{gr}+H_{\rm tip}+H_{\rm dip}+H_{H}+\left[H_{gr,H}+H_{H,\mathrm{tip}}+\mathrm{H.c}\right], (92) where the different terms are \displaystyle H_{gr} \displaystyle=\sum_{,s}\gamma_{g}c^{\dagger}_{is}c_{js}+\sum_{is}V^{i}(t)c^{\dagger}_{is}c_{is}\,, \displaystyle H_{tip} \displaystyle=\sum_{,s}\gamma_{t}t^{\dagger}_{is}t_{js}+\sum_{i,s}V_{tip}(t)t_{is}^{\dagger}t_{is}\,, \displaystyle H_{H} \displaystyle=\sum_{s}(\epsilon_{H}+V_{tip}(t)+U\bm{\sigma}_{HH}^{\overline{s}}(t))d^{\dagger}_{Hs}d_{Hs}\,, (93) \displaystyle H_{H,tip} \displaystyle=\sum_{s}K_{tip}d^{\dagger}_{Hs}t_{0s}\,, \displaystyle H_{H,gr} \displaystyle=\sum_{s}K_{gr}d^{\dagger}_{Hs}c_{0s}\,, \displaystyle H_{dip} \displaystyle=\sum_{,s}\vec{r}_{ij}\cdot\vec{E}(t)c_{is}^{\dagger}c_{js}\,. Here, means nearest neighbors, s is a spin-index and c_{is} , t_{is} and d_{is} are the annihilation operators on each site. The parameters taken in the Hamiltonian are similar to the ones in Ref. 78 , namely \gamma_{g}=-2.7 eV, \gamma_{t}=-5.0 eV, \epsilon_{H}=-1.7 eV, U=6.5 eV, K_{tip}=0.25 eV, K_{gr}=3.25 eV , \mu_{gr}=\mu_{tip}=0 eV and kT_{gr}=kT_{tip}=0.025 eV. The time-dependent bias V_{tip}(t) is taken to be the experimentally measured THz-pulse seen in Fig. 4 . In this model, the hydrogen on-site energy follows the tip chemical potential ( \mu_{tip}(t)=\mathrm{e}V_{tip}(t) ), while the graphene chemical potential \mu_{gr}=0 is kept at zero. The dipole Hamiltonian H_{dip} includes a rapidly varying, spatially constant electric field in the dipole approximation. The real-space self-energy is in this case calculated using the sisl 60 , 56 and the STM-tip self-energy is calculated using TBtrans with the DFT and transport code siesta_python 58 , 68 . Any field-dependent coupling between the hydrogen and tip are neglected, meaning K_{tip} in eq. ( 5.1 ) is taken as constant. Figure 4: Temporal shape and frequency content of the experimental THz pulse V_{tip}(t) used in the calculations. Figure 5: A) Eigenvalues of the fitted level-width function \mathbf{\Gamma}_{gr} as a function of energy. B) Transmission function with exact self-energies and self-energies obtained from the fit, calculated without the Hubbard term. The eigenvalues of the fitted \mathbf{\Gamma}_{gr}(\epsilon) can be seen in Fig. 5 while the single-site \mathbf{\Gamma}_{tip} is easily verified to be positive semi-definite. Furthermore, note the significant pole in \mathbf{\Gamma}_{gr} at E=0 eV. Initial State The ODE to be propagated is now defined with the device part of the Hamiltonian from Eq. ( 5.1 ) and the pulse in Fig. 4 . The last ingredient to consider is initial steady-state density matrix for t\rightarrow-\infty which in turn determines the auxiliary mode vectors through Eq. ( 68 ). This means solving Eqs. ( 69 ) and ( 5.1 ) self-consistently for the steady-state solution \bm{\sigma}^{0}_{s}(t=-\infty) . This is done using the SCF tool of the Zandpack package. There are two possible solutions, namely a spin-unpolarized hydrogen orbital and a spin-polarized hydrogen orbital 78 . However, if the system is started in the unpolarized state, it will decay into the polarized state. Furthermore, the difference between starting the calculation with the state obtained using Zandpack’s SCF and psinought tools (SCF- \Psi^{0} initial state) and the naive approach \vec{\Psi}_{\alpha xc}(t_{0})=\vec{0} and \Omega_{\alpha xc\alpha^{\prime}x^{\prime}c^{\prime}}(t_{0})=0 can be seen in Fig. 6 , where both starting states have been propagated using Zandpack’s zand tool. The SCF- \Psi^{0} initial state is clearly seen being very close to the actual steady state, while the naive starting state has large oscillations before approaching the steady state. Figure 6: The current through the device using the SCF- \Psi^{0} initial state and compared to using the naive initial state, and same initial density matrix. The near-vertical black lines at -80 fs ,s}\frac{x_{ij}}{|\vec{r}_{ij}|}c_{is}^{\dagger}c_{js}\,, (95) where \displaystyle V_{dip}(t)=0.01\mathrm{eV}\cdot f(t)\,. (96) The pulse shape f of the infrared field is taken as \displaystyle f(t)=\mathrm{e}^{-\left[\frac{t-t_{0}}{s_{0}}\right]^{2}}\cos(2\pi f_{0}(t-t_{0}))\,, (97) where s_{0}=15 fs and f_{0}=\frac{v_{light}}{\lambdabar}\approx 0.29\mathrm{fs}^{-1} , with v_{light} the speed of light and \lambdabar the wavelength. t_{0} is the variable relative delay of the IR pump pulse to the THz probe pulse. The total charge transfer from the pulse Q_{\alpha}^{s}=\int_{-\infty}^{\infty}J_{\alpha}^{s}(t)\mathrm{d}t can then be plotted as a function of the IR pump delay t_{0} . This is seen in Fig. 7 F and shows a prominent peak in rectified charge at t_{0}=195 fs, nicely coinciding with the point of the transition from spin-polarized to unpolarized from Fig. 7 B. In an actual experiment the situation modeled here is repeated with MHz frequency, meaning the charge-transfer Q_{\alpha}^{s} in Fig. 7 F manifests as a change in measured current in the tip. The relative pump-probe delay t_{0} can furthermore be accurately controlled, contrary to the absolute time of the peak in V_{tip} 96 , 25 , 40 . 5.2 DFTB+ Interface: STM Tip on Armchair Graphene Nanoribbon In Ref. 2 , experimental measurements have been reported for AGNR nanoribbons which show a rectified current in a THz-STM setup. Here this system is simulated using the DFTB+ code 3 to give the Hamiltonian as the density evolves with time. The only complication in terms of theory is that the basis used by LCAO-based DFT-codes are not generally orthogonal, but the basis in which the EOM are formulated is orthogonal. It is, however, straightforward to translate between the orthogonal and non-orthogonal bases when using a Löwdin transformation to orthogonalize the states and the correction terms mentioned in Section 3 . The calculations runs along the same vein as in subsection 5.1 . The SCF- \Psi^{0} solution obtained with the SCF and psinought tools as before. DFTB+ calculates the Hamiltonian in terms of the Mulliken charges, q_{i} , on each orbital, i . The recipe for transformation from the orthogonal basis density matrix to the Mulliken charges, q_{i} , is done by calculating the non-orthogonal density, matrix 35 \displaystyle\sigma^{NO}=\mathbf{S}^{-1/2}\bm{\sigma}^{O}\mathbf{S}^{-1/2}, (98) where \mathbf{S} is the overlap matrix and then use Eq. ( 87 ). The process of obtaining the \mathbf{\Gamma}_{\alpha} ’s of the electrodes is then the same as in the TranSIESTA method, where the pristine electrode Hamiltonian is calculated, now using the DFTB+ code. The interface is implemented in the siesta_python code 50 . The device structure can be seen in Fig. 8 A and 8 B and the electrode electronic structure can be seen in Fig. 8 C and 8 D. The fit of \mathbf{\Gamma}_{\alpha} is done the same way as for the hydrogenated graphene sheet, where the fitting scheme here also uses N_{l}=81 Lorentzians for all three electrodes. The device region furthermore contains 4\cdot N_{Al}+1\cdot N_{C}=4\cdot 16+1\cdot 224=288 orbitals active in the calculation. Only the p_{z} part of the carbon atoms are used and the hydrogen s orbitals are discarded, while all four sp^{3} orbitals on the aluminium atoms are used. Figure 8: The AGNR with tip illustrated with associated electronic band structure. Sideview in A) and top view in B). Hydrogen in light grey, carbon in dark grey, aluminium in red, electrode atoms in shaded blue. C) Semi-conducting AGNR. D) Metallic Al Tip. Occupied states in dark blue, unoccupied states in light-blue. In C and D, the Fermi-level at equilibrium is taken at E_{F}=0.5 eV, indicated by the two dashed lines. The AGNR is semi-conducting which is evident from the band-structure, while the aluminium tip is metallic. The goal is to model what happens as a strong THz pulse is incident on this system, causing what in steady-state would be a potential energy shift in the tip. The system parameters being time-dependent does not, strictly speaking, allow for a description in energy, unless the system is evolving adiabatically. The bands in Fig. 8 C,D are however still useful to think of in relation to THz frequency perturbations of the system. The pulse seen in Fig. 4 is applied as the tip bias \displaystyle\Delta_{tip}(t)=V_{tip}(t)\,, (99) while keeping the AGNR electrodes fixed at \Delta_{L/R}=0 . Before doing so, all chemical potentials are set to \mu_{\alpha}=0.5 eV relative to the pristine \mu_{\alpha}=0 eV. A ramp V_{ramp}(z) that goes from 0 in the AGNR ( z=0 ) to \Delta_{tip}(t) in the tip electrode ( z=z_{max} ) is included, together with the density dependence of the Hamiltonian obtained from DFTB+. The current and rectified charge as the system evolves in time are seen in Fig. 9 A together with the device charge in Fig. 9 B. The current shows initially a normal scaling as the bias on the tip grows positive, but when the bias pulse instead becomes negative, rapid oscillations are seen in all three electrode currents. This behavior can be understood in the following way: When the tip electrode potential(bias) is positive(negative), tip electrons can tunnel from the tip into the unoccupied part of the spectrum seen in Fig. 8 of the AGNR resulting in a fairly smooth current curve in this part of the simulation. However, when trying to drive electrons from the semi-conducting ribbon to the tip, there are instead rapid oscillations, as seen in Fig. 9 A when V_{tip}<0 . The reason for these oscillations is that when trying to drive electrons from the occupied part of the AGNR into the tip, whose quasi-Fermi-level now is in the band-gap, the electrons can only do so by obtaining energy from a high-frequency oscillation as seen in Fig. 9 A. These oscillations subside again after the pulse is over. Furthermore, there is a large amount of charge-transfer relative to what was seen in Fig. 7 C. It is unknown if the current in the experiment of Ref. 2 is similar to the one in Fig. 9 A since it is only the value of the rectified current, Q_{tip} , after the pulse has passed, which is measured. The Q_{tip} does not show the rapid oscillations of the current, as it is the integral of it. In the STM measurement of Ref. 2 , metallic gold surface states introduced in the AGNR are furthermore observed, meaning the band-structure from Fig. 8 is not accurate for the electronic structure of the AGNR when it is modified by the substrate. They do, however, measure a rectified current corresponding to tens of electrons 2 , while for the pulse in Fig. 4 and the AGNR in Fig. 8 , around 0.7 electrons are rectified per pulse. One reason for this discrepancy might be the longer pulse duration in the experiment. Other factors are a stronger peak bias or contributions from the gold substrate. The importance of the feedback of the density to change the Hamiltonian is seen when comparing the dynamic calculation from Fig. 9 A to the one with a static Hamiltonian. The calculation with a static Hamiltonian can be seen in Fig. 9 D, which displays a much larger current with none of the prominent high-frequency oscillations in Fig. 9 A. Figure 9: A) Current (full lines) and rectified charge (dotted lines) in each electrode as a function of time. B) Device charge over time. C) Comparison of the tip current frequency content, calculated with and without the density dependence in the Hamiltonian. D, E) Same calculation as in A and B, but with no density dependence in the Hamiltonian. F) Comparison of the AGNR current frequency content, calculated with and without the density dependence in the Hamiltonian. The occupation number of the device region is also much larger in Fig. 9 E compared to Fig. 9 B because the electrons are not subjected to the electrostatic repulsion from the electronic density. The comparison of the frequency spectra of the currents can be seen in Figs. 9 C and 9 F and displays a much larger current response around f=350 THz corresponding to \sim 1.4 eV and is a result of an rapidly oscillating electron cloud that allows transition from valence band of the AGNR to the tip. Furthermore, the frequency spectrum of the device charge can be obtained by tracing Eq. ( 8 ) to obtain the continuity equation, \displaystyle\frac{\mathrm{d}N}{\mathrm{d}t}=\sum_{\alpha}J_{\alpha}(t), (100) which in its Fourier-transformed version states N(\omega)\propto\frac{1}{\omega}\sum_{\alpha}J_{\alpha}(\omega) . Figure 10: Normalized frequency spectrum of the device charge from the dynamical and static calculations from Fig. 9 . The Fourier transform of the device charge N(\omega) can furthermore be taken as a measure of how large a dipole the system contains at frequency \omega . In Fig. 10 we plot N(\omega) , which displays a small but significant dipole oscillation at f=350 THz with an amplitude of about \sim 1/100 compared to the maximum value of N(\omega) located at f\approx 4 THz. The radiated power, P , from an ideal, oscillating dipole is given as P=\frac{\mu_{0}\omega^{4}p^{2}}{12\pi v_{light}} where \mu_{0} is the permeability of free space, \omega the oscillation frequency of the dipole and p the dipole moment 27 . Comparing now two dipoles, one oscillating with frequency \omega_{0} and p_{0} , and a second oscillating with frequency \omega_{1}=80\omega_{0} and p_{1}=p_{0}/100 , the second would then radiate \frac{P_{1}}{P_{0}}\approx 4000 times more power than the first. It is however to be expected that dynamical screening effects 30 , 67 , 83 should be included to account for the electronic response to density oscillations in this high-frequency regime. Such physics can be incorporated in the generalized Kadanoff-Baym ansatz (GKBA) methods such as developed in Refs. 67 , 79 , but has not been incorporated in the method used in this work. It should also be stressed that it is an assumption that N(\omega) is proportional to the actual dipole moment. Figure 11: A) Gold tip geometries. B) Total currents through the geometries shown in A. Adiabatic results are also given for comparison. For each case, both the adiabatic and time-dependent current has been multiplied by the indicated factor. 5.3 Gold junction The accuracy-level of DFTB+, which was used in Subsection 5.2 , is the so-called DFTB1 level 35 , which is characterized by the fact that the \bm{\sigma} -dependence of \mathbf{H} is already linearized through the Mulliken charge given in Eq. ( 87 ). This simple and efficient approximation can also be useful for time-dependent calculations with a regular DFT code such as SIESTA instead of using the full dependence \mathbf{H}(\bm{\sigma}) . Here, the steady-state density matrix can be found, where after the Hamiltonian can be Taylor-expanded around the equilibrium Hamiltonian using a finite-difference approach, as described in Sec. 4 . We use the SIESTA code with the linearization to consider a gold atomic junction under the THz pulse. The geometries under consideration for this Section are shown in Fig. 11 A and indicated in black are ghost atoms which are used in the calculation. These introduce the same basis functions in the gap as are located on the gold atoms, but without the gold atom potential and electronic contribution. This in turn means that when the two gold tips are taken apart, the coupling does not artificially weaken due to basis function decay 24 , 23 . For the calculation at hand, in addition to the linearization of the dependence of Hamiltonian on the density matrix, the system has an external potential induced by the THz field. It is introduced in the symmetric junction as a linear ramp in the z -direction with V_{ext}(z)=0 at the centre of the junction and scaling with the z -component and bias V_{bias}(t)=\Delta_{1}(t)-\Delta_{0}(t) such that the ramp matches the bias applied in each end of the junction. This potential is assumed only to be added on the diagonal of the non-orthogonal Hamiltonian through the potential \displaystyle V_{ii}(t)=\frac{z_{i}-z_{centre}}{z_{max}-z_{min}}V_{bias}(t), (101) where z_{i} is the z -component of the atom on which the orbital is located and z_{centre} , and z_{min} , z_{max} the positions of the left and right electrodes, respectively. This potential is then readily brought into the orthogonal basis with the Löwdin transformation from Eq. ( 86 ). The currents, as calculated using the previously outlined approach, are shown in Fig. 11 B. The adiabatic results are obtained using the Landauer-Büttiker formula 59 for the current in a non-interacting transport setup, using the instantaneous Hamiltonian \mathbf{H}(t)=\mathbf{H}(\sigma(t)) obtained from the fully time-dependent calculation. Significant differences between the adiabatic and time-dependent current are seen in the +4 Å case where the coupling between the two tips is low. This example illustrates the importance of time-dependent method for sub-picosecond timescales. 6 Conclusions In summary, we have refined the method proposed in Ref. 63 to be applicable to device sizes of experimental relevance and to use arbitrary electrodes. Additionally, we present an approach to solve the well-established steady-state NEGF equations within the framework of the auxiliary-mode method, which leads to a steady-state auxiliary-mode expansion and can be reduced to solving a system of equations. Using a novel decomposition of the line-width function established in Eq. ( 20 ), we can propagate the system within the time-dependent NEGF framework without obtaining spurious currents under equilibrium conditions, while also maintaining the efficiency of the eigendecomposition proposed in Ref. 63 . The new generation of the auxiliary-mode NEGF method has been implemented in the Zandpack software package. It offers the possibility to include the complex density matrix dependence of the Hamiltonian through a general Python interface that can incorporate existing external DFT codes. Firstly, we demonstrate the use of Zandpack using a simple mean-field Hubbard model of hydrogenated graphene. We show calculations of pump-probe DC currents, which is usually measured in experiments, and of thermodynamical quantities such as entropy and mutual information. Secondly, we consider a scenario where the Hamiltonian is obtained by the DFTB+ package 3 , 35 and model a STM tip on an armchair graphene nanoribbon. The main bottleneck is typically the external code. We have also demonstrated the linearization scheme based on the SIESTA code 73 , 58 , and used the approximate density-matrix dependence of the Hamiltonian in the time-propagation. This linearization scheme is presented as a simpler solution that should still incorporate the main features of the density matrix dependence of the Hamiltonian from DFT. Overall, Zandpack provides a versatile tool for time-dependent nanoelectronics simulations with interfaces to widely used tools. It is another step towards studying realistic and experimentally relevant scenarios. 7 Funding Statement The Independent Research Fund Denmark, grant number ”0135-00372A” has funded this work together with TED2021-132388B-C44 funded by MCIN/AEI/10.13039/501100011033 and Unión Europea Next Generation EU/PRTR, and grant PID2022-140845OB-C66 funded by MCIN/AEI/10.13039/501100011033 and FEDER Una manera de hacer Europa. We also acknowledge support from the Novo Nordisk Foundation Data Science Research Infrastructure 2022 (NNF22OC0078009), and the DTU Computing Center 20 . 8