Introduction

The time evolution of a closed quantum system can offer important insights about its nature and properties. However, the dynamics are inevitable affected by interactions with external environments1,2, which can involve the exchange of energy or particles, and the suppression of quantum coherence. Due to the effective continuum of degrees of freedom present in these external baths3,4, modeling the dynamics of an open quantum system can be challenging. This is especially the case when perturbative approaches5 are no longer valid due to non-Markovian effects emerging in the presence of strong interaction with the bath6,7. In this regime, standard Markovian master equations are no longer applicable, and non-perturbative techniques are required8,9,10,11,12.

In particular, here we consider the hierarchical equations of motion (HEOM) approach, which offers a non-perturbative13 characterization of all the environmental effects on the system. This is achieved by using a hierarchy of auxiliary density operators (ADOs) to model system-bath correlations and entanglement14,15. This makes the HEOM suitable for studying complex systems strongly coupled to either bosonic (with applications in quantum biology16,17, quantum optics18, quantum thermodynamics19, and quantum information20), or fermionic environments (for the analysis of quantum transport21,22,23 and condensed matter physics24). Additionally, quantum systems interacting simultaneously with both bosonic and fermionic environments can be found in the study of electron transport through both natural and artificial molecules25,26. Naturally, such an increase in the complexity of the environment leads to an increase in computational resources which, in the case of the HEOM method, corresponds to an increase in the size of the HEOM Liouvillian superoperator (HEOMLS) matrix. To deal with this issue, it is beneficial to explore the numerical efficiency of programming languages designed to optimize different computational resources.

In this work, we use Julia27,28: a dynamic general-purpose, high-level programming language capable of high-performance in scientific applications. It was created in 2012 with the goal to build a language with the speed of C29, the dynamism of Ruby30, the practicality of Python31, and able to solve statistics and linear algebra tasks like R32 and Matlab33, respectively. Julia is fast because it uses a just-in-time compiler34 to convert source code into machine code before running it. Recently, many researchers are turning to Julia to build high-performance simulations and models for open quantum system dynamics35, quantum optics36, quantum algorithms37 and quantum information theories38. Moreover, the variable name in Julia supports UTF-8 encoding (e.g., Greek symbols and mathematical symbols) which allows to write equations in code more elegantly.

HierarchicalEOM.jl is developed following the Julia design philosophy: one can have machine performance without sacrificing human convenience27. While integrating many of the features presented in other open-source HEOM packages, HierarchicalEOM.jl also includes other functionalities, such as the estimation of importance values for all ADOs, the calculation of spectra for both bosonic and fermionic systems, the construction of HEOMLS matrices for even- or odd-parity auxiliary density operators, and a user-friendly interface (which interrogates the ADOs multi-indexes) for gaining access to bath properties. By wrapping some functions from other Julia packages39,40,41, we could further optimize the computations of the dynamics and stationary states for all ADOs. The entire ecosystem of HierarchicalEOM.jl package is summarized in Fig. 1.

Fig. 1: The ecosystem of the HierarchicalEOM.jl package.
figure 1

a Users should specify the system Hamiltonian Hs(t), coupling operators (Vs or ds), and the bath correlation function C(t). For the exponent {ηk, γk}, users can either specify the physical parameters characterizing the spectral density of the bath by built-in functions, or directly providing a list of exponents. b Construction of the bath-object which includes the system coupling operator and a list of exponents characterizing the bath correlation function. c Construction of the HEOM Liouvillian superoperator (HEOMLS) matrix \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) which defines the hierarchical equations of motion from the system Hamiltonian and the bath-objects. d Computation of the dynamics and stationary states for all auxiliary density operators using \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\). e The hierarchy dictionary translates the index of each ADO into the corresponding multi-index ensembles together with the exponents of the bath, and vice-versa. f The hierarchy dictionary allows a high-level interpretation of the ADOs to compute some physical properties. g Logo of HierarchicalEOM.jl package.

Results

Preliminaries for hierarchical equations of motion

Throughout this work, we consider an open quantum system (s) interacting with fermionic (f) and bosonic (b) environments described by the following total (T) Hamiltonian ( is set to unity throughout this work):

$${H}_{{{{{\rm{T}}}}}}={H}_{{{{{\rm{s}}}}}}(t)+{H}_{{{{{\rm{f}}}}}}+{H}_{{{{{\rm{b}}}}}}+{H}_{{{{{\rm{sf}}}}}}+{H}_{{{{{\rm{sb}}}}}},$$
(1)

where Hs(t) is the (possibly time-dependent) system Hamiltonian containing boson and fermion particles. Here, we allow the fermionic environment to be composed by multiple baths of non-interacting fermionic degrees of freedom described by the Hamiltonian

$${H}_{{{{{{{{\rm{f}}}}}}}}}=\mathop{\sum}\limits_{\alpha }\mathop{\sum}\limits_{k}{\epsilon }_{\alpha ,k}{c}_{\alpha ,k}^{{{{\dagger}}} }{c}_{\alpha ,k},$$
(2)

where cα,k\(({c}_{\alpha ,k}^{{{{\dagger}}} })\) annihilates (creates) a fermion (f) in the state k (with energy ϵα,k) of the αth fermionic bath. Analogously,

$${H}_{{{{{{{{\rm{b}}}}}}}}}=\mathop{\sum}\limits_{\beta }\mathop{\sum}\limits_{k}{\omega }_{\beta ,k}{b}_{\beta ,k}^{{{{\dagger}}} }{b}_{\beta ,k},$$
(3)

describes a generic bosonic environment which can accommodate multiple non-interacting bosonic baths in which bβ,k\(({b}_{\beta ,k}^{{{{\dagger}}} })\) is the bosonic annihilation (creation) operator associated to the kth mode (with frequency ωβ,k) in the βth bosonic bath. This bosonic environment can represent a broad range of physical environments, e.g., electromagnetic environments42,43, phonon environments44,45,46, surface plasmon modes47,48 and vibronic environments in molecules (e.g., nuclear motion in a photosynthetic complex22). The interaction Hamiltonian between a fermionic system and the fermionic environments can be written as

$${H}_{{{{{{{{\rm{sf}}}}}}}}}=\mathop{\sum}\limits_{\alpha ,k}\left({g}_{\alpha ,k}{c}_{\alpha ,k}^{{{{\dagger}}} }{d}_{{{{{{{{\rm{s}}}}}}}}}+{g}_{\alpha ,k}^{* }{d}_{{{{{{{{\rm{s}}}}}}}}}^{{{{\dagger}}} }{c}_{\alpha ,k}\right),$$
(4)

in terms of the coupling strengths gα,k. Analogously, the interaction between a bosonic or fermionic system and the exterior bosonic environments can be modeled by

$${H}_{{{{{{{{\rm{sb}}}}}}}}}={V}_{{{{{{{{\rm{s}}}}}}}}}\mathop{\sum}\limits_{\beta ,k}{g}_{\beta ,k}({b}_{\beta ,k}+{b}_{\beta ,k}^{{{{\dagger}}} }),$$
(5)

in terms of the coupling strengths gβ,k. Here, ds and Vs refer to the coupling operators acting on the system’s degrees of freedom. In particular, ds is a odd-parity operator destroying a fermion in the system, while Vs is in general a Hermitian operator which can act on both fermionic and bosonic systems. When Vs is acting on the fermionic system, it must have even-parity to be compatible with charge conservation. Furthermore, one can easily generalize to the case where the system contains multiple bosonic and fermionic quantum numbers (such as frequency, energy, or spin) interacting with either individual or shared environment(s) [see Example 1 and Example 2].

To derive the HEOM, we assume the following three conditions: (1) The system and the environments (baths) are initialized in a separable state. (2) Each of the fermionic (bosonic) baths is initially in thermal equilibrium characterized by a Fermi-Dirac (Bose-Einstein) distribution. (3) The bath operator within the system-bath interaction Hamiltonian should be linear in the bath annihilation and creation operators, as shown in Eq. (4) and Eq. (5).

Without resorting to any approximation, the reduced density matrix for the system at time t can be written in terms of the following Dyson series

$$\begin{array}{r}{\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p = +}(t)=\hat{{{{{{{{\mathcal{G}}}}}}}}}(t)\left[{\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p = +}(0)\right],\end{array}$$
(6)

where, the propagator \(\hat{{{{{{{{\mathcal{G}}}}}}}}}(t)[\cdot ]\) is a canonical superoperator49 which propagates the even-parity (p = + ) or odd-parity (p = − ) operator initially in \({\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p}(0)\). Furthermore, the reduced density matrix of the system has even-parity and can be written as \({\rho }_{{{{{{{{\rm{s}}}}}}}}}^{+}(0)\). The propagator takes the form

$$\hat{{{{{{{{\mathcal{G}}}}}}}}}(t)[\cdot ]=\hat{{{{{{{{\mathcal{T}}}}}}}}}\exp \left\{-\int\nolimits_{0}^{t}d{t}_{1}\int\nolimits_{0}^{{t}_{1}}d{t}_{2}\left[{\hat{{{{{{{{\mathcal{W}}}}}}}}}}_{{{{{\rm{f}}}}}}({t}_{1},{t}_{2})[\cdot ]+{\hat{{{{{{{{\mathcal{W}}}}}}}}}}_{{{{{\rm{b}}}}}}({t}_{1},{t}_{2})[\cdot ]\right]\!\right\},$$
(7)

in terms of the time-ordering operator \(\hat{{{{{{{{\mathcal{T}}}}}}}}}\), together with fermionic49 and bosonic15,16 operators explicitly written as

$${\hat{{{{{{{{\mathcal{W}}}}}}}}}}_{{{{{\rm{f}}}}}}({t}_{1},{t}_{2})[\cdot ]= \mathop{\sum}\limits_{\alpha }\,\mathop{\sum}\limits_{p=\pm }\,\mathop{\sum}\limits_{\nu =\pm 1}\left\{{C}_{\alpha }^{\nu }({t}_{1},{t}_{2}){\left[{d}_{{{{{{{{\rm{s}}}}}}}}}^{\bar{\nu }}({t}_{2}),{d}_{{{{{{{{\rm{s}}}}}}}}}^{\nu }({t}_{1})\cdot \right]}_{-p} \right. \\ \left. +{C}_{\alpha }^{\nu }({t}_{2},{t}_{1}){\left[\cdot {d}_{{{{{{{{\rm{s}}}}}}}}}^{\bar{\nu }}({t}_{2}),{d}_{{{{{{{{\rm{s}}}}}}}}}^{\nu }({t}_{1})\right]}_{-p}\right\},$$
(8)

and

$${\hat{{{{{{{{\mathcal{W}}}}}}}}}}_{{{{{\rm{b}}}}}}({t}_{1},{t}_{2})[\cdot ] =\mathop{\sum}\limits_{\beta }{\left[{V}_{{{{{{{{\rm{s}}}}}}}}}({t}_{1}),\left({C}_{\beta }^{{\mathbb{R}}}({t}_{1},{t}_{2}){[{V}_{{{{{{{{\rm{s}}}}}}}}}({t}_{2}),\cdot ]}_{-} \!+i{C}_{\beta }^{{\mathbb{I}}}({t}_{1},{t}_{2}){[{V}_{{{{{{{{\rm{s}}}}}}}}}({t}_{2}),\cdot ]}_{+}\right)\right]}_{-},$$
(9)

respectively. For simplicity, we define ν to denote the presence (ν = + 1) or absence (ν = − 1) of a Hermitian conjugation and \(\bar{\nu }:= -\nu\). Here, [, ] and [, ]+ represent the commutator and the anti-commutator introduced to allow the propagator to keep track of the parity sector (labeled by p = ± ) it is acting on. This dependence intuitively originates from the properties of partial traces over composite fermionic spaces, where operators do not necessarily commute.

As an example, for an environment made out of a single fermion, the reduced matrix elements \(\left\langle i\right\vert {\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p}\left\vert j\right\rangle\) (in a basis labeled by \(\left\langle i\right\vert\) and \(\left\vert j\right\rangle\)) involve the perturbative sum of expressions of the form \(\left\langle i\right\vert (c{\tilde{\rho }}_{{{{{{{{\rm{e}}}}}}}}}{\tilde{\rho }}_{{{{{{{{\rm{s}}}}}}}}}^{p}{c}^{{{{\dagger}}} }+{\tilde{\rho }}_{{{{{{{{\rm{e}}}}}}}}}{\tilde{\rho }}_{{{{{{{{\rm{s}}}}}}}}}^{p})\left\vert j\right\rangle\) (in terms of environmental operators \({\tilde{\rho }}_{{{{{{{{\rm{e}}}}}}}}}\), system operators \({\tilde{\rho }}_{{{{{{{{\rm{s}}}}}}}}}^{p}\) with parity p, and the environment-annihilation operator c). These quantities depend on the commutator between \({\tilde{\rho }}_{{{{{{{{\rm{s}}}}}}}}}^{p}\) and c, which is trivial only for even-parity (p = + ). In the odd-parity (p = − ) case, the partial trace over the environment requires further anti-commutations, ultimately resulting in extra minus signs in the expression for the effective propagator describing the reduced dynamics49. It is important to explicitly note that, here, by parity we do not refer to the presence of an odd or even number of fermions in the system but, rather, to the number of fermionic operators needed to represent \({\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p}\). In summary, while commutators ( − p = − ) appear for the propagation of even-parity operators \({\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p = +}(0)\) (which include the reduced density operator of the system), anti-commutators ( − p = + ) appear for the propagation of odd-parity operators \({\rho }_{{{{{{{{\rm{s}}}}}}}}}^{p = -}(0)\) [e.g., \({d}_{{{{{{{{\rm{s}}}}}}}}}{\rho }_{{{{{{{{\rm{s}}}}}}}}}^{+}(0)\) or \({d}_{{{{{{{{\rm{s}}}}}}}}}^{{{{\dagger}}} }{\rho }_{{{{{{{{\rm{s}}}}}}}}}^{+}(0)\)], which appear in the computation of observables such as the density of states (see the Methods section: Numerical computation of the spectrum).

As it can be seen in Eq. (8) and Eq. (9), the effects of fermionic and bosonic environments [initially in thermal equilibrium (eq) and linearly coupled to the system] are completely encoded in the two-time correlation functions C(t1, t2). In the fermionic case, they depend on the spectral density Jα(ω) = 2πkgα,k2δ(ω − ωk) and the Fermi-Dirac distribution \({n}_{\alpha }^{{{{{\rm{eq}}}}}}(\omega )={\{\exp [(\omega -{\mu }_{\alpha })/{k}_{{{{{{{{\rm{B}}}}}}}}}{T}_{\alpha }]+1\}}^{-1}\) as

$${C}_{\alpha }^{\nu }({t}_{1},{t}_{2})=\frac{1}{2\pi }\int\nolimits_{-\infty }^{\infty }d\omega {J}_{\alpha }(\omega )\left[\frac{1-\nu }{2}+\nu {n}_{\alpha }^{{{{{\rm{eq}}}}}}(\omega )\right]{e}^{\nu i\omega ({t}_{1}-{t}_{2})}.$$
(10)

Analogously, in the bosonic case, they depend on the spectral density \({J}_{\beta }(\omega )=2\pi {\sum }_{k}{g}_{\beta ,k}^{2}\delta (\omega -{\omega }_{k})\) and the Bose-Einstein distribution \({n}_{\beta }^{{{{{\rm{eq}}}}}}(\omega )={\{\exp [\omega /{k}_{{{{{{{{\rm{B}}}}}}}}}{T}_{\beta }]-1\}}^{-1}\) as

$${C}_{\beta }({t}_{1},{t}_{2})=\frac{1}{2\pi }\int\nolimits_{0}^{\infty }d\omega {J}_{\beta }(\omega )\left[{n}_{\beta }^{{{{{\rm{eq}}}}}}(\omega ){e}^{i\omega ({t}_{1}-{t}_{2})}+({n}_{\beta }^{{{{{\rm{eq}}}}}}(\omega )+1){e}^{-i\omega ({t}_{1}-{t}_{2})}\right].$$
(11)

Here, kB is the Boltzmann constant and Tα(Tβ) represents the absolute temperature of the α-fermionic (β-bosonic) bath. A non-zero chemical potential (μα ≠ 0) in the α-fermionic bath can account for non-equilibrium physics.

A more practical representation of Eq. (6) can be found by expressing the bath correlation functions as a sum of exponential terms (exponents). This allows to define an iterative procedure which leads to the celebrated hierarchical equations of motion (HEOM). Specifically, different approaches, such as the Matsubara50 or the Padé51 spectral decompositions, can be used (see Methods) to write the fermionic and bosonic correlation functions as, respectively,

$${C}_{\alpha }^{\nu }(\tau )=\mathop{\sum }\limits_{h=1}^{{N}_{\alpha }}{\eta }_{\alpha ,h}^{\nu }\exp (-{\gamma }_{\alpha ,h}^{\nu }\tau ),$$
(12)

and

$$\begin{array}{r}{C}_{\beta }(\tau )=\mathop{\sum }\limits_{l=1}^{{N}_{\beta }}{\xi }_{\beta ,l}\exp (-{\chi }_{\beta ,l}\tau ),\end{array}$$
(13)

where τ = t1 − t2, and Nα (Nβ) is the total number of exponentials for the α-fermionic (β-bosonic) bath. When \({\chi }_{\beta ,l}\, \ne \, {\chi }_{\beta ,l}^{* }\), a closed form for the HEOM can be obtained by further decomposing the bosonic correlation function into its real (\({\mathbb{R}}\)) and imaginary (\({\mathbb{I}}\)) parts as

$$\begin{array}{r}{C}_{\beta }(\tau )=\mathop{\sum}\limits_{u={\mathbb{R}},{\mathbb{I}}}({\delta }_{u,{\mathbb{R}}}+i{\delta }_{u,{\mathbb{I}}}){C}_{\beta }^{u}(\tau )\end{array}$$
(14)

where δ is the Kronecker delta function and where

$$\begin{array}{r}{C}_{\beta }^{u}(\tau )=\mathop{\sum }\limits_{l=1}^{{N}_{\beta }^{u}}{\xi }_{\beta ,l}^{u}\exp (-{\chi }_{\beta ,l}^{u}\tau ).\end{array}$$
(15)

The expressions for the fermionic [Eq. (12)] and bosonic [Eq. (14)] correlation functions can now be used in Eq. (7). The resulting expression can be recursively differentiated in time18,49,52 to define a local master equation in an enlarged space made out of auxiliary density operators (ADOs) \({\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}(t)\). Intuitively, these variables encode environmental effects related to different exponential terms present in the correlation function and provide an iterative description of high-order system-baths memory effects. In \({\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}(t)\), the tuple (m, n, p) represents the mth-level-bosonic-and-nth-level-fermionic ADO with parity p, and j (q) denotes a vector [jm, … , j1] ([qn, … , q1]), where each j (q) represents a specific multi-index ensemble {β, u, l, σb} ({α, ν, h, σf}). The indexes σb and σf are used to specify other quantum numbers (such as energy or spin) of the system interacting with a bosonic or fermionic bath, respectively. In this way, the hierarchical equations of motion in the Schrödinger picture can be expressed as

$${\partial }_{t}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}(t) \equiv \,\, \hat{{{{{{{{\mathcal{M}}}}}}}}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}(t)\\ = -\left(i{\hat{{{{{{{{\mathcal{L}}}}}}}}}}_{{{{{\rm{s}}}}}}+\mathop{\sum }\limits_{r=1}^{m}{\chi }_{{j}_{r}}+\mathop{\sum }\limits_{w=1}^{n}{\gamma }_{{q}_{w}}\right){\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}(t) \\ - i\mathop{\sum}\limits_{{q}^{{\prime} }\notin {{{{{{{\bf{q}}}}}}}}}{\hat{{{{{{{{\mathcal{A}}}}}}}}}}_{{q}^{{\prime} }}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{{\bf{q}}}}}}}}}^{+}}^{(m,n+1,p)}(t)-i\mathop{\sum}\limits_{{j}^{{\prime} }}{\hat{{{{{{{{\mathcal{B}}}}}}}}}}_{{j}^{{\prime} }}{\rho }_{{{{{{{{{\bf{j}}}}}}}}}^{+}| {{{{{{{\bf{q}}}}}}}}}^{(m+1,n,p)}(t)\\ - i\mathop{\sum }\limits_{w=1}^{n}{(-1)}^{n-w}{\hat{{{{{{{{\mathcal{C}}}}}}}}}}_{{q}_{w}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{{\bf{q}}}}}}}}}_{w}^{-}}^{(m,n-1,p)}(t)-i\mathop{\sum }\limits_{r=1}^{m}{\hat{{{{{{{{\mathcal{D}}}}}}}}}}_{{j}_{r}}{\rho }_{{{{{{{{{\bf{j}}}}}}}}}_{r}^{-}| {{{{{{{\bf{q}}}}}}}}}^{(m-1,n,p)}(t),$$
(16)

where we used the multi-index notations:

$${{{{{{{{\bf{j}}}}}}}}}^{+} = \left[{j}^{{\prime} },{j}_{m}, \ldots \,,{j}_{1}\right],\\ {{{{{{{{\bf{q}}}}}}}}}^{+} = \left[{q}^{{\prime} },{q}_{n}, \ldots \,,{q}_{1}\right],\\ {{{{{{{{\bf{j}}}}}}}}}_{r}^{-} = \left[{j}_{m},\ldots \,,{j}_{r+1},{j}_{r-1},\ldots \,,{j}_{1}\right],\\ {{{{{{{{\bf{q}}}}}}}}}_{w}^{-} = \left[{q}_{n},\ldots \,,{q}_{w+1},{q}_{w-1},\ldots \,,{q}_{1}\right].$$
(17)

Here, \({j}^{{\prime} }\) can be chosen from any one of the elements in j or any other bosonic multi-index ensemble that has not yet be considered in j, whereas \({q}^{{\prime} }\, \notin \, {{{{{{{\bf{q}}}}}}}}\) due to the Pauli exclusion principle.

Furthermore, we defined \(\hat{{{{{{{{\mathcal{L}}}}}}}}}_{{{{{\rm{s}}}}}}[\cdot ]={[{H}_{{{{{\rm{s}}}}}}(t),\cdot ]}_{-}\) characterizing the bare system dynamics. System-bath interactions are encoded by the fermionic superoperators \({\hat{{{{{{{{\mathcal{A}}}}}}}}}}_{q}\), \({\hat{{{{{{{{\mathcal{C}}}}}}}}}}_{q}\) (to couple the nth-level-fermionic ADOs to the (n + 1)th-level- and (n − 1)th-level- fermionic ADOs, respectively), and the bosonic superoperators \({\hat{{{{{{{{\mathcal{B}}}}}}}}}}_{j}\), \({\hat{{{{{{{{\mathcal{D}}}}}}}}}}_{j}\) (to couple the mth-level-bosonic ADOs to the (m + 1)th-level- and (m − 1)th-level- bosonic ADOs, respectively). Their explicit forms are given by

$${\hat{{{{{{{{\mathcal{A}}}}}}}}}}_{q}[\cdot ] ={(-1)}^{{\delta }_{p,-}}\left\{{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\bar{\nu }}[\cdot ]-{\hat{{{{{{{{\mathcal{P}}}}}}}}}}_{{{{{\rm{s}}}}}}\left[[\cdot ]{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\bar{\nu }}\right]\right\},\\ {\hat{{{{{{{{\mathcal{C}}}}}}}}}}_{q}[\cdot ] ={(-1)}^{{\delta }_{p,-}}\left\{{\eta }_{\alpha ,h}^{\nu }{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\nu }[\cdot ]+{({\eta }_{\alpha ,h}^{\bar{\nu }})}^{* }{\hat{{{{{{{{\mathcal{P}}}}}}}}}}_{{{{{\rm{s}}}}}}\left[[\cdot ]{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\nu }\right]\right\},\\ {\hat{{{{{{{{\mathcal{B}}}}}}}}}}_{j}[\cdot ] ={\left[{V}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}},\cdot \right]}_{-},\\ {\hat{{{{{{{{\mathcal{D}}}}}}}}}}_{j}[\cdot ] ={\delta }_{u,{\mathbb{R}}}{\xi }_{\beta ,l}^{{\mathbb{R}}}{\left[{V}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}},\cdot \right]}_{-}+i{\delta }_{u,{\mathbb{I}}}{\xi }_{\beta ,l}^{{\mathbb{I}}}{\left[{V}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}},\cdot \right]}_{+},\\ \hat{{{{{{{{{\mathcal{P}}}}}}}}}_{{{{{\rm{s}}}}}}}\left[{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,\pm )}(t){d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\nu }\right] =\mp {(-1)}^{n}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,\pm )}(t){d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\nu }.$$
(18)

The form of the HEOM in Eq. (16) can be applied to auxiliary density operators with arbitrary parity symmetry. For example, \({\rho }_{| }^{(0,0,+)}(t)\) is the system reduced density operator, and the odd-parity operator \({\rho }_{| }^{(0,0,-)}(t)\) can take the form \({d}_{{{{{{{{\rm{s}}}}}}}}}^{\nu }{\rho }_{| }^{(0,0,+)}(t)\) as mentioned after Eq. (9). To project in the different parity system sub-spaces, we introduced the superoperator

$${\hat{{{{{{{{\mathcal{P}}}}}}}}}}_{{{{{\rm{s}}}}}}[\cdot ]=\left(\mathop{\prod}\limits_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}\exp \left[i\pi {d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}\right]\right)[\cdot ]\left(\mathop{\prod}\limits_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}\exp \left[i\pi {d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}\right]\right).$$
(19)

Overall, the HEOM Liouvillian superoperator (HEOMLS) \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) characterizes the dynamics in the full ADOs space and it can, numerically, be expressed as a matrix.

In practice, the dimensions of this matrix must be finite and the hierarchical equations must be truncated at a suitable bosonic-level (\({m}_{\max }\)) and fermionic-level (\({n}_{\max }\)). Previous works23,53 showed that the computational effort can be optimized by associating an importance value to each ADO and then discarding all ADOs (in the second and higher levels) whose importance value is smaller than a threshold value \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\). The importance value \({{{{{{{\mathcal{I}}}}}}}}\) for a given ADO \({\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}\) is defined as

$${{{{{{{\mathcal{I}}}}}}}}\left({\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}\right)=\left\vert \mathop{\prod }\limits_{r=1}^{m}\left(\frac{{\xi }_{{j}_{r}}}{{{{{{{{\rm{Re}}}}}}}}\left[{\chi }_{{j}_{r}}\right]}\frac{1}{\mathop{\sum }\nolimits_{x=1}^{r}{{{{{{{\rm{Re}}}}}}}}\left[{\chi }_{{j}_{x}}\right]}\right)\right\vert \times \left\vert \mathop{\prod }\limits_{w=1}^{n}\left(\frac{{\eta }_{{q}_{w}}}{{{{{{{{\rm{Re}}}}}}}}\left[{\gamma }_{{q}_{w}}\right]}\frac{1}{\mathop{\sum }\nolimits_{x=1}^{w}{{{{{{{\rm{Re}}}}}}}}\left[{\gamma }_{{q}_{x}}\right]}\right)\right\vert ,$$
(20)

where the first and second absolute value represents the importance of the bosonic part26 and fermionic part54 of the hierarchy, respectively. Note that for hybrid (consider bosonic and fermionic baths at the same time) cases, we retain all the ADOs where their hierarchy levels (m, n)  {(0, 0), (0, 1), (1, 0), (1, 1)}, and all the other high-level ADOs may be neglected if their importance value is less than \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\). Moreover, the full hierarchical equations can be recovered in the limiting case \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\to 0\). We will provide a concrete example and detailed discussion later.

Package architecture and design philosophy

The package HierarchicalEOM.jl is designed to integrate the efficiency of Julia with the functionalities provided by other existing HEOM packages15,24,55,56,57. This leads to an intuitive interface to construct arbitrary Hamiltonians and initial states (which can be accomplished directly with the built-in library for linear algebra in Julia or by taking advantage of the package QuantumOptics.jl36). We now introduce the ecosystem of the package as summarized in Fig. 1.

Following Fig. 1(a) and Fig. 1(b), users should specify the system Hamiltonian Hs(t), system coupling operators Vs (ds) describing the interaction with bosonic (fermionic) baths, and the bath correlation functions. For the bath correlation functions in Eq. (10) and Eq. (11), users can specify them by an exponential series as shown in Eqs. ((12)–(15)). HierarchicalEOM.jl provides built-in functions to construct these series from physical parameters (e.g., coupling strength, temperature, etc.). For example, it is possible to choose a Drude-Lorentz spectral density for bosonic baths and a Lorentzian spectral density for fermionic baths. For each of these cases, the correlations are computed using either the Matsubara50 or Padé spectral decomposition51. Alternatively, HierarchicalEOM.jl offers the possibility to manually define the correlation functions (simply supplying the list of exponents). Additional spectral densities could be incorporated into the built-in functions in future releases. We explicitly note that the package allows for any combination of fermionic and bosonic baths.

After the definition of the bath, users can further construct the HEOMLS matrix \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) in Eq. (16) together with the system Hamiltonian Hs(t), see Fig. 1c. At this stage, HierarchicalEOM.jl offers the possibility to optimize this matrix by neglecting all the ADOs (at second or higher level) whose importance values in Eq. (20) are below the user-specified threshold \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\). It is also possible to construct \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) within the even- or odd-parity sector depending on the parity of the auxiliary density operator upon which the HEOMLS matrix is acting on (see the Methods section: Numerical computation of the spectrum). Moreover, our package allows users to further add a Lindbladian (superoperator) to \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\). The Lindbladian describes the dissipative interaction between the system and extra environment while its explicit form is given by

$$\hat{{{{{{{{\mathcal{J}}}}}}}}}(F)\left[\cdot \right]=F\left[\cdot \right]{F}^{{{{\dagger}}} }-\frac{1}{2}{\left[{F}^{{{{\dagger}}} }F,\cdot \right]}_{+},$$
(21)

where F is the jump operator and describes the dissipation dynamics of the system. Including such Lindbladians when some of the baths are weakly coupled to the system is more efficient than solving the full HEOM since it does not require any ADOs for such baths and hence reduces the size of \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) (see Example 2 for more details).

As shown in Fig. 1d, with this information it is possible to proceed with solving for the dynamics of all the ADOs as described in Eq. (16). HierarchicalEOM.jl provides two distinct methods to compute the dynamics. The first one relies on DifferentialEquations.jl39 which provides a set of low-level solvers for ordinary differential equations. The second method directly builds the propagator when the system Hamiltonian is time-independent: \(\hat{{{{{{{{\mathcal{G}}}}}}}}}(t)=\exp (\hat{{{{{{{{\mathcal{M}}}}}}}}}t)\) using FastExpm.jl41 which is optimized for the exponentiation of either large-dense or sparse matrices. In addition, HierarchicalEOM.jl can also directly solve for the stationary states of all the ADOs using LinearSolve.jl40, which offers a unified interface to solve linear equations in Julia.

To allow further analysis of specific physical properties, HierarchicalEOM.jl provides a hierarchy dictionary, as depicted in Fig. 1e, f. This dictionary translates the index of each ADO in terms of the corresponding exponential terms of the bath, and vice-versa. This feature is designed to allow a high-level description of the ADOs, which can be useful in the analysis of electronic currents21,23, heat currents19,58,59, and higher-order moments of heat currents60. Moreover, HierarchicalEOM.jl can calculate the spectrum for both bosonic and fermionic systems using LinearSolve.jl (see the Methods section: Numerical computation of the spectrum).

We now demonstrate the use of HierarchicalEOM.jl with two examples: a single impurity strongly coupled to fermionic reservoirs and an ultra-strongly coupled charge-cavity system interacting with both bosonic and fermionic reservoirs.

Example 1: Electronic system strongly interacting with fermionic reservoirs

The investigation of the Kondo effect in electronic systems is crucial as it serves both as a valuable testing ground for the theories of the Kondo effect and has the potential to lead to a better understanding of this intrinsic many-body phenomena61,62,63, with applications in building new generation nanoscale electronic devices64,65,66 and quantum computation67. In this sense, we here consider a single-level electronic system [which can be populated by a spin up, σf = , or spin down electron, σf = ] coupled to two [left (L) and right (R)] fermionic reservoirs, as illustrated in Fig. 2. In this case, the different Hamiltonian terms in Eq. (1) take the form

$${H}_{{{{{{{{\rm{s}}}}}}}}} =\epsilon \left({d}_{\uparrow }^{{{{\dagger}}} }{d}_{\uparrow }+{d}_{\downarrow }^{{{{\dagger}}} }{d}_{\downarrow }\right)+U\left({d}_{\uparrow }^{{{{\dagger}}} }{d}_{\uparrow }{d}_{\downarrow }^{{{{\dagger}}} }{d}_{\downarrow }\right),\\ {H}_{{{{{{{{\rm{f}}}}}}}}} =\mathop{\sum}\limits_{\alpha ={{{{{{{\rm{L}}}}}}}},{{{{{{{\rm{R}}}}}}}}}\mathop{\sum}\limits_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}=\uparrow ,\downarrow }\mathop{\sum}\limits_{k}{\epsilon }_{\alpha ,{\sigma }_{{{{{{{{\rm{f}}}}}}}}},k}{c}_{\alpha ,{\sigma }_{{{{{{{{\rm{f}}}}}}}}},k}^{{{{\dagger}}} }{c}_{\alpha ,{\sigma }_{{{{{{{{\rm{f}}}}}}}}},k},\\ {H}_{{{{{{{{\rm{sf}}}}}}}}} =\mathop{\sum}\limits_{\alpha ={{{{{{{\rm{L}}}}}}}},{{{{{{{\rm{R}}}}}}}}}\mathop{\sum}\limits_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}=\uparrow ,\downarrow }\mathop{\sum}\limits_{k}{g}_{\alpha ,k}{c}_{\alpha ,{\sigma }_{{{{{{{{\rm{f}}}}}}}}},k}^{{{{\dagger}}} }{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}+{g}_{\alpha ,k}^{* }{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{c}_{\alpha ,{\sigma }_{{{{{{{{\rm{f}}}}}}}}},k},$$
(22)

where ϵ is the energy of the impurity and U is the Coulomb repulsion energy for double occupation. We further assume both fermionic reservoirs to have a Lorentzian-shaped spectral density. As we discussed above, the correlation function in Eq. (10) can be expressed as a sum of exponential terms, see Eq. (12), using the Padé decomposition (see Methods). These spectral densities depend on the following physical parameters: the coupling strength ΓL = ΓR = Γ between system and reservoirs, the band-width Wα, the temperature T, and the chemical potential μL = − μR = eΦ/2, where e is the elementary charge, and Φ is the bias voltage. We summarize the values of these parameters in Table. 1. With these choices, it is now possible to use HierarchicalEOM.jl to construct the HEOMLS matrix \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) and solve for the stationary states of all the auxiliary density operators (ADOs).

Fig. 2: Schematic illustration of a light-matter system (an electron coupled to a bosonic mode in a cavity) interacting with bosonic and fermionic reservoirs.
figure 2

Here, g is the coupling strength between the electron and cavity, Δ is the coupling strength between the cavity and the bosonic reservoir, and ΓL = ΓR = Γ are the coupling strengths between the electron and its fermionic reservoirs.

Table 1 Parameters used in the examples.

By using the built-in function in HierarchicalEOM.jl, we first compute the spectrum of the system (also known as density of states (DOS); see Methods) in the stationary state and plot the results in Fig. 3a. The DOS of the system exhibits two Hubbard peaks and an additional central peak. The negative frequency Hubbard peak is a consequence of the singly occupied electron state with either spin-up or spin-down. Similarly, double occupation of the state contributes to the resonance at energy ϵ + U. When the system is in equilibrium, the Kondo-resonance central peak is a consequence of the many-body entanglement between the single electron populating the system and the electrons in the fermionic reservoirs. As the bias voltage Φ is increased, the central peak splits into two68. This ultimately results in two distinct energies for the Kondo cloud which depend on the Fermi-level of the fermionic reservoirs69,70.

Fig. 3: The Kondo resonance from equilibrium to non-equilibrium.
figure 3

In a, the black dashed, red dash-dotted, orange dotted, green solid, and blue dashed curves represent the density of states A(ω) for bias voltage Φ at 0, 1, 2, 3, and 4mV, respectively. One can observe that the density of states of the electronic system exhibits two Hubbard peaks and an additional central peak at equilibrium (i.e., bias voltage Φ = 0). By increasing the bias voltage Φ to non-equilibrium, the central peak is suppressed and splits into two. In b, the black curve shows the effects of the Kondo resonance on the differential conductance as a function of bias voltage Φ. The conductance G has a peak at Φ = 0 as the Kondo resonance acts as a transport channel for the electron.

Alternatively, the Kondo effect can also be probed by calculating the differential conductance G = dI/dΦ between the system and fermionic reservoirs. To compute this quantity, we first compute the electronic current in the stationary states of the ADOs (see Methods) as a function of the bias voltage Φ and then take the derivative numerically. The zero-bias conductance peak shown in Fig. 3b is another manifestation of the existence of a single-channel spin-1/2 Kondo resonance. In fact, in this regime, the system effectively acts as a one-dimensional channel for the moving electrons thereby increasing the conductance71.

Example 2: The ultra-strongly coupled charge-cavity system interacting with bosonic and fermionic reservoirs

A crucial aspect of quantum transport research involves investigating impurities, coupled to normal metal contacts, whose charge degree of freedom is strongly coupled to cavity photons72,73,74. By integrating quantum dots with microwave cavities, researchers can investigate such novel cavity quantum electrodynamics systems75, yielding insights into a diverse range of quantum phenomena such as out-of-equilibrium state occupation in double quantum dots76, reservoir-induced charge relaxation in single dots77, and photo-assisted tunneling processes72,78. Going beyond the strong coupling regime, we here consider a single-level electronic system ultra-strongly coupled to a single-mode cavity79. The electronic impurity is in contact with two distinct, left (L) and right (R), fermionic reservoirs, while the cavity is in contact with a bosonic reservoir, as illustrated in Fig. 2. In order to focus on the charge-photon interaction, this model neglects the electronic spin degree of freedom. As a consequence, the different contributions to the total Hamiltonian, as given in Eq. (1), can be expressed as

$${H}_{{{{{{{{\rm{s}}}}}}}}} =\epsilon {d}^{{{{\dagger}}} }d+{\omega }_{c}{a}^{{{{\dagger}}} }a+g{d}^{{{{\dagger}}} }d\left(a+{a}^{{{{\dagger}}} }\right),\\ {H}_{{{{{{{{\rm{f}}}}}}}}} =\mathop{\sum}\limits_{\alpha ={{{{{{{\rm{L}}}}}}}},{{{{{{{\rm{R}}}}}}}}}\mathop{\sum}\limits_{k}{\epsilon }_{\alpha ,k}{c}_{\alpha ,k}^{{{{\dagger}}} }{c}_{\alpha ,k},\\ {H}_{{{{{{{{\rm{b}}}}}}}}} =\mathop{\sum}\limits_{k}{\omega }_{k}{b}_{k}^{{{{\dagger}}} }{b}_{k},\\ {H}_{{{{{{{{\rm{sf}}}}}}}}} =\mathop{\sum}\limits_{\alpha ={{{{{{{\rm{L}}}}}}}},{{{{{{{\rm{R}}}}}}}}}\mathop{\sum}\limits_{k}{g}_{\alpha ,k}{c}_{\alpha ,k}^{{{{\dagger}}} }d+{g}_{\alpha ,k}^{* }{d}^{{{{\dagger}}} }{c}_{\alpha ,k},\\ {H}_{{{{{{{{\rm{sb}}}}}}}}} =\mathop{\sum}\limits_{k}{g}_{k}\left(a+{a}^{{{{\dagger}}} }\right)\left({b}_{k}+{b}_{k}^{{{{\dagger}}} }\right),\\ $$
(23)

in terms of the energy ϵ of the electronic state, the frequency ωc of the single-mode cavity, the electron-cavity coupling strength g, and the annihilation (creation) operator a (a) of the single-mode cavity. We assume a Drude-Lorentz (Lorentzian) spectral density for the bosonic (fermionic) reservoir(s). As previously discussed, the correlation function in Eq. (10) and Eq. (11) can be expressed as a sum of exponential terms using the Padé decomposition, as shown in Eq. (12) and Eq. (13), respectively.

The environmental spectral densities depend on the following physical parameters: the coupling strength ΓL = ΓR = Γ between the electron and the fermionic reservoirs, the coupling strength Δ between the single-mode cavity and the bosonic reservoir, the band-width Wα (Wβ) of the fermionic (bosonic) reservoirs, the chemical potentials μL = − μR = eΦ/2 for the left and right fermionic reservoirs, and the temperature T common to all reservoirs. All values of the parameters are summarized in Table. 1. Using these parameters as input in HierarchicalEOM.jl, we can construct the HEOMLS matrix \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) and solve for the stationary states of all the ADOs.

We now compute the spectra (see Methods) of both the charge (density of states; DOS) and cavity (power spectral density; PSD) using the built-in function in HierarchicalEOM.jl, and plot the results in Fig. 4. Here, we consider the bias voltage Φ = 6, such that the site energy of the charge system aligns with the Fermi-level of one of the fermionic reservoirs, increasing the likelihood of electron tunneling to the fermionic reservoirs. We first discuss the DOS of the charge system, as shown in Fig. 4a. As the coupling strength g between the charge and the cavity increases, the DOS of the charge system decreases and its peak shifts towards lower energies. This can be attributed to the energy shift induced by the cavity field on the electronic level. To explore the charge-cavity interaction, we now analyze the PSD of the cavity system, see Fig. 4b. The PSD of the cavity exhibits a single large peak at ω = Γ = ωc for g (0, 0.5], indicating that the cavity resonance is largely unaffected by the electronic system, but that it does induce additional broadening.

Fig. 4: Effects of the electron-cavity coupling on the spectra of the charge and cavity system.
figure 4

In a, the black dashed, red dotted, and blue solid curves represent the density of states A(ω) for the charge-cavity coupling strength g at 0, 0.25Γ, and 0.5Γ, respectively. The resonance in the density of states of the charge system is reduced and shifts towards lower energies as g increases. In b, we plot the power spectral density S(ω) of the cavity and uses two different methods [HEOM (red dotted and blue solid curves for g at 0.25Γ and 0.5Γ, respectively) and perturbative master equation (abbreviated as ME, which is represented by orange dash-dotted and green dashed curves for g at 0.25Γ and 0.5Γ, respectively)] to describe the interaction between the cavity and the bosonic reservoir. Both approaches show a single peak at ω = ωc for g (0, 0.5]. The Born-Markov approximation used to derive the ME may result in an inaccurate estimation of the magnitude of the S(ω) compared to the HEOM, especially in the high-frequency range.

It is interesting to further compare the differences between the HEOM and a perturbative master equation (ME) approach. We do this by reducing the interaction strength Δ = 0.01ωc between the cavity and its bosonic reservoir to a weak-coupling regime. We model the interaction between the system and bosonic reservoir with a Born-Markov master equation80 using the Lindbladian given in Eq. (21). More specifically, we replace the bosonic part of HEOM with the following term

$${J}_{\beta }({\omega }_{{{{{{{{\rm{c}}}}}}}}})\left[\left({n}_{\beta }^{{{{{{{{\rm{eq}}}}}}}}}({\omega }_{{{{{{{{\rm{c}}}}}}}}})+1\right)\hat{{{{{{{{\mathcal{J}}}}}}}}}(a)+{n}_{\beta }^{{{{{{{{\rm{eq}}}}}}}}}\left({\omega }_{{{{{{{{\rm{c}}}}}}}}}\right)\hat{{{{{{{{\mathcal{J}}}}}}}}}\left({a}^{{{{\dagger}}} }\right)\right]{\rho }_{\,| {{{{{{{\bf{q}}}}}}}}}^{(0,n,p)}(t)$$
(24)

on the right-hand side of Eq. (16). Here, Jβ is the spectral density of the bosonic bath (assumed to be Drude-Lorentz in this case) and \({n}_{\beta }^{{{{{{{{\rm{eq}}}}}}}}}\) is the Bose-Einstein distribution. In this specific scenario, it is evident that the outcomes derived from the master equation approach may overestimate the magnitude when compared to the HEOM results in the high-frequency range of the PSD. The origin of this inconsistency can be attributed to the non-Markovian effect5,9,81,82 arising from the bosonic reservoir, characterized by the narrow band-width of the Drude-Lorentz spectral density (Wβ = 0.2) we use to describe it; even though the coupling strength is weak, this narrow width implies the environment can still have memory. In addition, the master equation has limited capability in addressing the combined influence of electron-cavity interactions and electron-fermionic-reservoir hybridization. Nevertheless, these challenges can be effectively tackled using the HEOM approach.

Applying the same methodology as in the previous example, one can also calculate the conductance between the charge system and the fermionic reservoirs, as shown in Fig. 5. We begin by examining the case when the charge system is not coupled to the cavity (g = 0). In this scenario, due to the finite band-width of the fermionic reservoirs Wα and a site energy of the charge system ϵ = − 3 being far away from the Fermi-level, a local minimum of the conductance is observed at Φ = 0. Additionally, the conductance increases with increasing Φ, reaching its maximum value when the site energy ϵ coincides with the Fermi-level of one of the fermionic reservoirs, resulting in the splitting of the peaks in the conductance.

Fig. 5: Effect of the electron-cavity coupling on the conductance between the charge system and fermionic reservoirs.
figure 5

The black dashed, red dotted, and blue solid curves represent the conductance G for the charge-cavity coupling strength g at 0, 0.25Γ, and 0.5Γ, respectively. The conductance depends on the absolute value of the bias voltage Φ and reaches its maximum when the average energy of the charge system is equal to the Fermi-level of one of the fermionic reservoirs, i.e., when \(e\left\vert {{\Phi }}\right\vert /2=\epsilon\). As the electron-cavity coupling g increases, both the conductance G and the average energy of the charge system decrease, resulting in a wider splitting of the conductance peaks.

Conversely, when the charge is coupled to the cavity (g > 0), the average energy of the charge in the electronic system decreases away from the Fermi-levels of the fermionic reservoirs, resulting in a decrease in conductance. It should be noted that the maximum conductance will be achieved with larger Φ, leading to a wider splitting of the conductance peak.

Capabilities of HierarchicalEOM.jl and comparison with other packages

Recent developments in the field of HEOM have lead to an explosion of open source software, such as PHI55, HEOM-QUICK24, DM-HEOM56, PyHEOM57, and QuTiP-BoFiN15,83,84. These packages are written in different programming languages which have different capabilities. Thus, in Table 2, we briefly compare their differences and similarities with respect to HierarchicalEOM.jl.

Table 2 Comparison between different open source HEOM packages.

We first emphasize the advantage of specifying the importance threshold \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\) and estimating the importance for each ADOs with Eq. (20), which are not available for other packages listed in Table 2. The main computational complexity can be quantified by the total number of ADOs because it directly affects the size of \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\). The importance criterion \({{{{{{{\mathcal{I}}}}}}}}\left({\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,p)}\right)\ge {{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\) allows us to only consider the ADOs which affects the dynamics more, and thus, reduce the size of \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\). Table 3 summarizes the number of ADOs with respect to different truncation level \({n}_{\max }\) and importance thresholds \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\). We observe a reduction in the number of auxiliary density operators when \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\) increases.

Table 3 Number of auxiliary density operators for different truncation values of the fermionic hierarchy level and different thresholds of the importance value.

We further discuss the consistency of the importance criterion and consider the parameter settings in example 1 (see Table 1). In this case, we first increase the truncation level until we find out that the values of electronic current converges at \({n}_{\max }=4\), which requires 396,607 ADOs (as shown in Table. 3) to describe the dynamics. The effects on the convergence of the electronic current while using the importance criterion are shown in Fig. 6. For the equilibrium case (Φ = 0), one can observe that the electronic current already converged at \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}=1{0}^{-5}\). However, by increasing the bias voltage to non-equilibrium Φ > 0, the results obtained with a higher \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\) show larger deviation from the converged results. The results converge at \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}=1{0}^{-7}\) and require only 49,713 ADOs (as shown in Table. 3). For too large thresholds \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\ge 1{0}^{-4}\), we observe unphysical negative electronic currents or even fail to obtain the stationary states of the ADOs.

Fig. 6: Convergence of the electronic current with respect to the importance threshold.
figure 6

Here, we consider the parameters setting in example 1 (see Table 1) and show the electronic current IL (from the left-hand side fermionic reservoir into the system) as a function of bias voltage Φ where the red dashed, green dash-dotted, blue solid curves, and black dots correspond to the importance threshold \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}\) at 10−5, 10−6, 10−7, and 0, respectively. The values of electronic current converge when \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}=1{0}^{-7}\), which reduces the number of ADOs from 396,607 (\({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}=0\)) to 49,713, as shown in Table 3.

We now compare the performance in constructing HEOMLS matrix \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\), solving time evolution (TE) of ADOs, and solving the stationary states (SS) of ADOs between HierarchicalEOM.jl and QuTiP-BoFiN15,83,84. This choice is motivated by the fact that QuTiP-BoFiN served as an inspiration and guide for the development of this package, and thus has similar features, and by the fact that they are both purely written in high-level languages (Python and Julia). For this comparison, we consider the same setting in example 1 (see Table 1). The benchmark result of constructing \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) are shown in Fig. 7a. HierarchicalEOM.jl not only improves the computational time on single-thread processing but also supports multi-threading to make the process of constructing \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) faster. Note that we only consider the importance threshold \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}=0.0\) in this benchmark because QuTiP-BoFiN does not support this functionality at this time. On top of the speed up in constructing \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\), we emphasize that HierarchicalEOM.jl is also faster in computing the time evolution and stationary states of the ADOs, as shown in Fig. 7(b), largely because of underlying performance beneftis of the numerical libraries in Julia39,40,41. For example, DifferentialEquations.jl39 provides a unified user interface to solve the differential equations with various choices of solver. HierarchicalEOM.jl wrapped a subset of the functions in DifferentialEquations.jl for solving TE of the ADOs, and users can optimize their solver choice depending on the problem. We have also wrapped some of the functions in LinearSolver.jl40 for users to solve the stationary states of ADOs and the spectrum of the system with different solvers. These functionalities improve both runtime and accuracy compared to the libraries currently available in Python.

Fig. 7: Benchmark of the performance between HierarchicalEOM.jl and QuTiP-BoFiN.
figure 7

We consider the parameters used in example 1 (see Table 1). Note that QuTiP-BoFiN15,83,84 currently does not support the estimation of importance for ADOs, and thus, we set \({{{{{{{{\mathcal{I}}}}}}}}}_{{{{{{{{\rm{th}}}}}}}}}=0\) here. The benchmark was done on a workstation with two Intel(R) Xeon(R) Silver 4110 @2.10GHz CPUs and 256 GB memory. The software versions were QuTiP 4.7.1, HierarchicalEOM.jl 0.1.0, Python 3.7.6, and Julia 1.8.2. The operating system was CentOS Linux 8.1.1911. In a, we show the total runtime versus truncation level \({n}_{\max }\) for the construction of the HEOMLS matrices \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) using QuTiP-BoFiN (red crosses) and HierarchicalEOM.jl (black tirangles and blue circles represent 1 and 8 threads used during the process of constructing the matrices, respectively). Note that QuTiP-BoFiN currently only supports single-thread process for the construction of \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\). In b, we show the total runtime versus truncation level \({n}_{\max }\) for calculating the stationary states (SS), represented as dashed lines, and time evolution (TE), represented as solid lines, of the auxiliary density operators using QuTiP-BoFiN (red crosses and green squares) and HierarchicalEOM.jl (blue circles and black triangles).

Conclusion

In conclusion, the HierarchicalEOM.jl software package provides a user-friendly and efficient tool for simulating complex open quantum systems, including non-Markovian effects due to non-perturbative interaction with one, or multiple, environments. The following characteristics define the package:

  • It decreases the number of ADOs and the size of the HEOMLS matrices by allowing the users to specify importance thresholds23,26.

  • It provides built-in functions to calculate the spectrum for both bosonic and fermionic systems based on LinearSolve.jl40.

  • It provides a dictionary translating the index of the ADOs to the corresponding bath exponential-expansion series, and vice versa. This allows an easy way to interrogate the ADOs to gain access to bath properties, like electronic and heat currents.

  • Users can choose to construct the HEOMLS matrices within even- or odd-parity. It depends on the parity of the operator which the HEOMLS matrix is acting on.

  • It provides built-in functions for the users to further add Lindbladians to the HEOMLS matrices while keeping the size of HEOMLS matrices unchanged (it does not extend the ADO space). The Lindbladian describes the dissipative interactions (under Born-Markov approximation80) between the system and extra environments.

Moreover, HierarchicalEOM.jl also takes advantage of other available packages for the following features:

  • It is written in Julia.

  • It supports different choices of spectral densities and spectral decomposition methods to accurately compute bath correlation functions.

  • It supports time-dependent system Hamiltonians.

  • It constructs the HEOMLS matrices for different types (bosonic, fermionic, or hybrid) of baths.

  • The HEOMLS matrices are constructed using multi-threading.

  • It provides different methods based on DifferentialEquations.jl39, LinearSolve.jl40, and FastExpm.jl41 to compute the dynamics and stationary states of all ADOs.

We exemplified the functionalities of HierarchicalEOM.jl using two physics examples where we observed order of magnitudes speedups with respect to QuTiP-BoFiN in constructing HEOMLS matrices and solving dynamics and stationary states for all ADOs. As a result, we believe that HierarchicalEOM.jl will be a valuable tool for researchers working in different fields such as quantum biology, quantum optics, quantum thermodynamics, quantum information, quantum transport, and condensed matter physics.

We further plan to extend the software for future releases in two different directions. First, we aim to add fitting routines to the decomposition methods used to compute correlation functions, thereby expanding the domain of spectral densities supported by the HEOM approach. Second, we aim to improve the computational efficiency of the package by reducing the complexity of the HEOM (for example imposing Hermiticity23,24) and by including support for distributed computing on clusters and GPU computing.

Methods

Table of symbols

Table 4 summarizes the most relevant symbols used throughout the article.

Table 4 List of symbols.

Fermion correlation function with Lorentzian spectral density

In this subsection, we present an example for the decomposition of a α-fermionic reservoir correlation function as a sum of Nα-exponential terms. In particular, we focus on the following Lorentzian spectral density

$${J}_{\alpha }(\omega )=\frac{{{{\Gamma }}}_{\alpha }{W}_{\alpha }^{2}}{{(\omega -{\mu }_{\alpha })}^{2}+{W}_{\alpha }^{2}},$$
(25)

where Γα represents the coupling strength between system and α-fermionic reservoir with band-width Wα and chemical potential μα. We now express the Fermi-Dirac distribution \({n}_{\alpha }^{{{{{\rm{eq}}}}}\,}(x)={\{\exp (x)+1\}}^{-1}\) as a series by employing the Padé decomposition51 (which has been reported15,52 to enjoy a faster convergence than the Matsubara one50) to obtain

$${n}_{\alpha }^{{{{{\rm{eq}}}}}\,}(x)\approx {n}_{\alpha }^{{{{{{{{\rm{Pad}}}}}}}}\acute{{{{{{{{\rm{e}}}}}}}}}}(x)=\frac{1}{2}-\mathop{\sum }\limits_{h=2}^{{N}_{\alpha }}\frac{2{\kappa }_{h}x}{{x}^{2}+{\zeta }_{h}^{2}},$$
(26)

where the parameters κh and ζh are described in previous work51 and depend on the choice of Nα. Thus, the integration in Eq. (10) can be analytically performed using the residue theorem and results in Eq. (12), which explicitly reads

$${C}_{\alpha }^{\nu }(\tau )\approx \mathop{\sum }\limits_{h=1}^{{N}_{\alpha }}{\eta }_{\alpha ,h}^{\nu }\exp \left(-{\gamma }_{\alpha ,h}^{\nu }\tau \right)$$
(27)

with

$${\eta }_{\alpha ,1}^{\nu } =\frac{{{{\Gamma }}}_{\alpha }{W}_{\alpha }}{2}{n}_{\alpha }^{{{{{{{{\rm{Pad}}}}}}}}\acute{{{{{{{{\rm{e}}}}}}}}}}\left(\frac{i{W}_{\alpha }}{{k}_{{{{{{{{\rm{B}}}}}}}}}T}\right),\\ {\gamma }_{\alpha ,1}^{\nu } ={W}_{\alpha }-\nu i{\mu }_{\alpha },\\ {\eta }_{\alpha ,h\ne 1}^{\nu } =-i{\kappa }_{h}{k}_{{{{{{{{\rm{B}}}}}}}}}T\cdot \frac{{{{\Gamma }}}_{\alpha }{W}_{\alpha }^{2}}{-{({\zeta }_{h}{k}_{{{{{{{{\rm{B}}}}}}}}}T)}^{2}+{W}_{\alpha }^{2}},\\ {\eta }_{\alpha ,h\ne 1}^{\nu } ={\zeta }_{h}{k}_{{{{{{{{\rm{B}}}}}}}}}T-\nu i{\mu }_{\alpha }.$$
(28)

Boson correlation function with Drude-Lorentz spectral density

In this subsection, we present an example for the decomposition of a β-bosonic reservoir correlation function as a sum of Nβ-exponential terms. In particular, we focus on the following Drude-Lorentz spectral density

$${J}_{\beta }(\omega )=\frac{4{{{\Delta }}}_{\beta }{W}_{\beta }\omega }{{\omega }^{2}+{W}_{\beta }^{2}},$$
(29)

in which Δβ represents the coupling strength between the system and the β-bosonic reservoir with band-width Wβ. Similarly as in the fermionic case, we can now express the Bose-Einstein distribution \({n}_{\beta }^{{{{{\rm{eq}}}}}\,}(x)={\{\exp (x)-1\}}^{-1}\) as a series by employing the Padé decomposition51, to obtain

$${n}_{\beta }^{{{{{\rm{eq}}}}}\,}(x)\approx {n}_{\beta }^{{{{{{{{\rm{Pad}}}}}}}}\acute{{{{{{{{\rm{e}}}}}}}}}}(x)=\frac{1}{x}-\frac{1}{2}+\mathop{\sum }\limits_{l=2}^{{N}_{\beta }}\frac{2{\kappa }_{l}x}{{x}^{2}+{\zeta }_{l}^{2}},$$
(30)

where the parameters κl and ζl are described in previous work51 and depend on the choice of Nβ. Using this decomposition, the integration in Eq. (11) can be analytically performed using the residue theorem and results in Eq. (13), which explicitly reads

$${C}_{\beta }(\tau )\approx \mathop{\sum }\limits_{l=1}^{{N}_{\beta }}{\xi }_{\beta ,l}\exp \left(-{\chi }_{\beta ,l}\tau \right)$$
(31)

with

$${\xi }_{\beta ,1} ={{{\Delta }}}_{\beta }{W}_{\beta }\left[-i+\cot \left(\frac{{W}_{\beta }}{2{k}_{{{{{{{{\rm{B}}}}}}}}}T}\right)\right],\\ {\chi }_{\beta ,1} ={W}_{\beta },\\ {\xi }_{\beta ,l\ne 1} =-2{\kappa }_{l}{k}_{{{{{{{{\rm{B}}}}}}}}}T\cdot \frac{2{{{\Delta }}}_{\beta }{W}_{\beta }\cdot {\zeta }_{l}{k}_{{{{{{{{\rm{B}}}}}}}}}T}{-{({\zeta }_{l}{k}_{{{{{{{{\rm{B}}}}}}}}}T)}^{2}+{W}_{\beta }^{2}},\\ {\chi }_{\beta ,l\ne 1} ={\zeta }_{l}{k}_{{{{{{{{\rm{B}}}}}}}}}T.$$
(32)

Contrary to the fermionic case, we note that, here, the correlation function does not have to be further decomposed into its real and imaginary part since \({\chi }_{\beta ,l}={\chi }_{\beta ,l}^{* }\,\forall \,l\).

Numerical computation of the spectrum

In this subsection, we briefly summarize how to numerically compute the spectrum associated with the system degree of freedom. Previous work13 showed that the spectrum can be evaluated either in time or frequency domain. HierarchicalEOM.jl provides a built-in function which performs the calculation in frequency domain. In the following, we first focus on the bosonic case (to compute the power spectral density) and, next, on fermionic case (to compute the density of states).

In order to compute the power spectral density in the time-domain, we write the system correlation function in terms of the propagator \(\hat{{{{{{{{\mathcal{G}}}}}}}}}(t)=\exp (\hat{{{{{{{{\mathcal{M}}}}}}}}}t)\), for t > 0, when the system Hamiltonian is time-independent. The power spectral density associated with σb can be obtained as

$$\pi {S}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}(\omega ) ={{{{{{{\rm{Re}}}}}}}}\left\{\int\nolimits_{0}^{\infty }dt{\left\langle {a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }(t){a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}(0)\right\rangle }^{* }{e}^{i\omega t}\right\}\\ ={{{{{{{\rm{Re}}}}}}}}\left\{\int\nolimits_{0}^{\infty }dt\left\langle {a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }(t){a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}(0)\right\rangle {e}^{-i\omega t}\right\}\\ ={{{{{{{\rm{Re}}}}}}}}\left\{\int\nolimits_{0}^{\infty }dt\left\langle {a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }{e}^{\hat{{{{{{{{\mathcal{M}}}}}}}}}t}{a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}\right\rangle {e}^{-i\omega t}\right\}\\ ={{{{{{{\rm{Re}}}}}}}}\left\{\int\nolimits_{0}^{\infty }dt\left\langle {a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }{e}^{(\hat{{{{{{{{\mathcal{M}}}}}}}}}-i\omega )t}{a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}\right\rangle \right\}\\ ={{{{{{{\rm{Re}}}}}}}}\left\{-\left\langle {a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }{(\hat{{{{{{{{\mathcal{M}}}}}}}}}-i\omega )}^{-1}{a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}\right\rangle \right\}\\ =-{{{{{{{\rm{Re}}}}}}}}\left\{{{{{{{{\rm{Tr}}}}}}}}\left[{a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }{(\hat{{{{{{{{\mathcal{M}}}}}}}}}-i\omega )}^{-1}{a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}\right]\right\}\\ =-{{{{{{{\rm{Re}}}}}}}}\left\{{{{{{{{\rm{Tr}}}}}}}}\left[{a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}^{{{{\dagger}}} }{{{{{{{\bf{x}}}}}}}}\right]\right\},$$
(33)

where a half-Fourier transform has been introduced in the fifth line. To determine x at a fixed frequency ω, one can express all of the ADOs in a vector form and then solve the linear problem Ax = b (where \({{{{{{{\bf{A}}}}}}}} = \, \hat{{{{{{{{\mathcal{M}}}}}}}}}-i\omega\) and \({{{{{{{\bf{b}}}}}}}}={a}_{{\sigma }_{{{{{{{{\rm{b}}}}}}}}}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}\)) using the package LinearSolve.jl40. We note that, while in principle all the ADOs are required to solve for x, only the reduced density operator (m = 0 and n = 0) is considered when taking the final trace.

In order to compute the density of states, we start from the retarded Green’s function13

$${G}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{{\rm{R}}}}}}(t)=-i{{\Theta }}(t)\left\{\left\langle {d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}(t){d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }(0)\right\rangle +{\left\langle {d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }(t){d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}(0)\right\rangle }^{* }\right\},$$
(34)

in which the Heaviside function Θ(t) is needed to impose causality. Similarly to the bosonic case, the density of states associated with σf can be written in compact form as

$$\pi {A}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}(\omega ) = -{{{{{{{\rm{Im}}}}}}}}\int\nolimits_{-\infty }^{\infty }{G}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{{\rm{R}}}}}}(t){e}^{i\omega t}dt\\ = \,\,{{{{{{{\rm{Re}}}}}}}}\left\{\int\nolimits_{0}^{\infty }dt\left[\left\langle {d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}(t){d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }(0)\right\rangle +{\left\langle {d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }(t){d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}(0)\right\rangle }^{* }\right]{e}^{i\omega t}\right\}\\ = -{{{{{{{\rm{Re}}}}}}}}\left\{{{{{{{{\rm{Tr}}}}}}}}\left[{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}{(\hat{{{{{{{{\mathcal{M}}}}}}}}}+i\omega )}^{-1}{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}\right]\right. \\ +\left. {{{{{{{\rm{Tr}}}}}}}}\left[{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{(\hat{{{{{{{{\mathcal{M}}}}}}}}}-i\omega )}^{-1}{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}\right]\right\}\\ = -{{{{{{{\rm{Re}}}}}}}}\left\{{{{{{{{\rm{Tr}}}}}}}}\left[{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}{{{{{{{{\bf{x}}}}}}}}}_{+}\right]+{{{{{{{\rm{Tr}}}}}}}}\left[{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{{{{{{{{\bf{x}}}}}}}}}_{-}\right]\right\},$$
(35)

where x+ is determined by solving

$$(\hat{{{{{{{{\mathcal{M}}}}}}}}}+i\omega ){{{{{{{{\bf{x}}}}}}}}}_{+}={d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)},$$
(36)

and x is determined by solving

$$(\hat{{{{{{{{\mathcal{M}}}}}}}}}-i\omega ){{{{{{{{\bf{x}}}}}}}}}_{-}={d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}.$$
(37)

Here, the HEOMLS matrix \(\hat{{{{{{{{\mathcal{M}}}}}}}}}\) acts on the odd-parity (p = − ) space, compatibly with the parity of both the operators \({d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}\) and \({d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{{{{\dagger}}} }{\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}\). As for the computation of the power spectral density, we only need the reduced density operator (m = 0 and n = 0) to take the final trace operation.

Electronic current

In this subsection, we discuss how to compute an environmental observable: the electronic current. Within the influence functional approach21,23, the expectation value of the electronic current from the α-fermionic bath into the system can be written in terms of the first-level-fermionic (n = 1) auxiliary density operators, namely

$$\left\langle {I}_{\alpha }(t)\right\rangle = (-e)\frac{d\left\langle {{{{{{{{\mathcal{N}}}}}}}}}_{\alpha }\right\rangle }{dt}\\ = ie\mathop{\sum}\limits_{\nu ,h,{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}{(-1)}^{{\delta }_{\nu ,-}}\,{{{{{{{\rm{Tr}}}}}}}}\left[{d}_{{\sigma }_{{{{{{{{\rm{f}}}}}}}}}}^{\bar{\nu }}{\rho }_{| \{\alpha ,\nu ,h,{\sigma }_{{{{{{{{\rm{f}}}}}}}}}\}}^{(0,1,+)}(t)\right],$$
(38)

where e represents the value of the elementary charge, and \({{{{{{{{\mathcal{N}}}}}}}}}_{\alpha }={\sum }_{k}{c}_{\alpha ,k}^{{{{\dagger}}} }{c}_{\alpha ,k}\) is the occupation number operator for the α-fermionic bath. To compute this quantity, it is possible to first use HierarchicalEOM.jl to obtain the stationary states for the ADOs \({\rho }_{{{{{{{{\bf{j}}}}}}}}| {{{{{{{\bf{q}}}}}}}}}^{(m,n,+)}(t)\), and then use the hierarchy dictionary [as shown in Fig. 1e] to identify all the zeroth-level-bosonic-and-first-level-fermionic (m = 0 and n = 1) ADOs and their corresponding indices α, ν, h, and σf to be used in Eq. (38).