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 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

Quick start

Check out our comprehensive tutorial!

Here is some python code illustrating the API:

# Compute IR basis for fermions and β = 10, W <= 4.2
import sparse_ir, numpy
basis = sparse_ir.FiniteTempBasis(statistics='F', beta=10, wmax=4.2)

# Assume spectrum is a single pole at ω = 2.5, compute G(iw)
# on the first few Matsubara frequencies. (Fermionic/bosonic Matsubara
# frequencies are denoted by odd/even integers.)
gl = basis.s * basis.v(2.5)
giw = gl @ basis.uhat([1, 3, 5, 7])

# Reconstruct same coefficients from sparse sampling on the Matsubara axis:
smpl_iw = sparse_ir.MatsubaraSampling(basis)
giw = -1/(1j * numpy.pi/basis.beta * smpl_iw.wn - 2.5)
gl_rec = smpl_iw.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.

Refer to the online documentation for more details.

License

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

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-0.13.0.tar.gz (44.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sparse_ir-0.13.0-py3-none-any.whl (42.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sparse-ir-0.13.0.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sparse-ir-0.13.0.tar.gz
Algorithm Hash digest
SHA256 bb0a40577019e0eab14d29ab5268bcdb73a415a125f1bbe79bee95799abebd53
MD5 17a051eadfed37f06b4b752b90b160c6
BLAKE2b-256 fa32160aecb7ce328d53766f2a9bd98de6d3accd49f10611063e12c0b64a0e07

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sparse_ir-0.13.0-py3-none-any.whl
  • Upload date:
  • Size: 42.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for sparse_ir-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c1c5cd5cf2a2283476a55b60ccf567a073c2b7ad224757ee9de5d3ce0889b93
MD5 db60e11684acf50f270e1c37c63fb54c
BLAKE2b-256 73454bde92cd7079600d1d273564632306b095f354491c8586632013ec269b1a

See more details on using hashes here.

Supported by

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