We introduce libdlr, a library implementing the recently introduced discrete Lehmann representation (DLR) of imaginary time Green's functions. The DLR basis consists of a collection of exponentials chosen by the interpolative decomposition to ensure stable and efficient recovery of Green's functions from imaginary time or Matsubara frequency samples. The library provides subroutines to build the DLR basis and grids, and to carry out various standard operations. The simplicity of the DLR makes it straightforward to incorporate into existing codes as a replacement for less efficient representations of imaginary time Green's functions, and libdlr is intended to facilitate this process. libdlr is written in Fortran, provides a C header interface, and contains a Python module pydlr. We also introduce a stand-alone Julia implementation, Lehmann.jl. Program Title: libdlr CPC Library link to program files: https://doi.org/10.17632/56z594pzsj.1 Developer's repository link: https://github.com/jasonkaye/libdlr Licensing provisions: Apache-2.0 Programming language: Fortran, C, Python, Julia Nature of problem: Discretization and compression of functions (Green's functions and self-energies) with an imaginary time variable. Solution method: Explicit basis functions and discretization points obtained by low rank compression of the analytical continuation kernel.
We present an efficient basis for imaginary time Green's functions based on a low-rank decomposition of the spectral Lehmann representation. The basis functions are simply a set of well-chosen exponentials, so the corresponding expansion may be thought of as a discrete form of the Lehmann representation using an effective spectral density which is a sum of $\ensuremath{\delta}$ functions. The basis is determined only by an upper bound on the product $\ensuremath{\beta}{\ensuremath{\omega}}_{max}$, with $\ensuremath{\beta}$ the inverse temperature and ${\ensuremath{\omega}}_{max}$ an energy cutoff, and a user-defined error tolerance $\ensuremath{\epsilon}$. The number
r of basis functions scales as $O(log(\ensuremath{\beta}{\ensuremath{\omega}}_{max})log(1/\ensuremath{\epsilon}))$. The discrete Lehmann representation of a particular imaginary time Green's function can be recovered by interpolation at a set of
r imaginary time nodes. Both the basis functions and the interpolation nodes can be obtained rapidly using standard numerical linear algebra routines. Due to the simple form of the basis, the discrete Lehmann representation of a Green's function can be explicitly transformed to the Matsubara frequency domain, or obtained directly by interpolation on a Matsubara frequency grid. We benchmark the efficiency of the representation on simple cases, and with a high-precision solution of the Sachdev-Ye-Kitaev equation at low temperature. We compare our approach with the related intermediate representation method, and introduce an improved algorithm to build the intermediate representation basis and a corresponding sampling grid.