Skip to main content

intermediate representation (IR) basis for electronic propagator

Project description

This library provides routines for constructing and working with the intermediate representation of correlation functions. It provides:

  • on-the-fly computation of basis functions for arbitrary cutoff Λ

  • basis functions and singular values are accurate to full precision

  • routines for sparse sampling

Installation

Install via pip:

pip install sparse-ir[xprec]

The above line is the recommended way to install sparse-ir. It automatically installs the xprec package, which allows one to compute the IR basis functions with greater accuracy. If you do not want to do this, simply remove the string [xprec] from the above command.

Install via conda:

conda install -c spm-lab sparse-ir xprec

Other than the optional xprec dependency, sparse-ir requires only numpy and scipy.

To manually install the current development version, you can use the following:

# Only recommended for developers - no automatic updates!
git clone https://github.com/SpM-lab/sparse-ir
pip install -e sparse-ir/[xprec]

Documentation and tutorial

Check out our comprehensive tutorial, where we self-contained notebooks for several many-body methods - GF(2), GW, Eliashberg equations, Lichtenstein formula, FLEX, … - are presented.

Refer to the API documentation for more details on how to work with the python library.

There is also a Julia library and (currently somewhat restricted) Fortran library available for the IR basis and sparse sampling.

Getting started

Here is a full second-order perturbation theory solver (GF(2)) in a few lines of Python code:

# Construct the IR basis and sparse sampling for fermionic propagators
import sparse_ir, numpy as np
basis = sparse_ir.FiniteTempBasis('F', beta=10, wmax=8, eps=1e-6)
stau = sparse_ir.TauSampling(basis)
siw = sparse_ir.MatsubaraSampling(basis, positive_only=True)

# Solve the single impurity Anderson model coupled to a bath with a
# semicircular states with unit half bandwidth.
U = 1.2
def rho0w(w):
    return np.sqrt(1-w.clip(-1,1)**2) * 2/np.pi

# Compute the IR basis coefficients for the non-interacting propagator
rho0l = basis.v.overlap(rho0w)
G0l = -basis.s * rho0l

# Self-consistency loop: alternate between second-order expression for the
# self-energy and the Dyson equation until convergence.
Gl = G0l
Gl_prev = 0
while np.linalg.norm(Gl - Gl_prev) > 1e-6:
    Gl_prev = Gl
    Gtau = stau.evaluate(Gl)
    Sigmatau = U**2 * Gtau**3
    Sigmal = stau.fit(Sigmatau)
    Sigmaiw = siw.evaluate(Sigmal)
    G0iw = siw.evaluate(G0l)
    Giw = 1/(1/G0iw - Sigmaiw)
    Gl = siw.fit(Giw)

You may want to start with reading up on the intermediate representation. It is tied to the analytic continuation of bosonic/fermionic spectral functions from (real) frequencies to imaginary time, a transformation mediated by a kernel K. The kernel depends on a cutoff, which you should choose to be lambda_ >= beta * W, where beta is the inverse temperature and W is the bandwidth.

One can now perform a singular value expansion on this kernel, which generates two sets of orthonormal basis functions, one set v[l](w) for real frequency side w, and one set u[l](tau) for the same obejct in imaginary (Euclidean) time tau, together with a “coupling” strength s[l] between the two sides.

By this construction, the imaginary time basis can be shown to be optimal in terms of compactness.

License and citation

This software is released under the MIT License. See LICENSE.txt for details.

If you find the intermediate representation, sparse sampling, or this software useful in your research, please consider citing the following papers:

If you are discussing sparse sampling in your research specifically, please also consider citing an independently discovered, closely related approach, the MINIMAX isometry method (Merzuk Kaltak and Georg Kresse, Phys. Rev. B 101, 205145, 2020).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sparse-ir-1.1.7.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

sparse_ir-1.1.7-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file sparse-ir-1.1.7.tar.gz.

File metadata

  • Download URL: sparse-ir-1.1.7.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for sparse-ir-1.1.7.tar.gz
Algorithm Hash digest
SHA256 8b79417a79405a206be182e4dfe3d6f12e2c0d5e966a46332dc4d6e2406812c3
MD5 926307b86798cae8e1582b3e7695469a
BLAKE2b-256 c4a6aaf8857f6f94eb2c657f0f723abf16cdb45059fac981416153d7d06f3cdd

See more details on using hashes here.

File details

Details for the file sparse_ir-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: sparse_ir-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 49.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for sparse_ir-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a285464605b2eb160d3540137e74064fea7c6b6f36b0ab7b0ba30330f8c7f412
MD5 e68c00063e9f340b1f27f70483c03a58
BLAKE2b-256 54bddb8dff16c5c97312cc391ca53f0892fce625fd22d046de1e6d354af8b01a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page