Augmented bases

class sparse_ir.augment.AugmentedBasis(basis, *augmentations)

Augmented basis on the imaginary-time/frequency axis.

Groups a set of additional functions, augmentations, with a given basis. The augmented functions then form the first basis functions, while the rest is provided by the regular basis, i.e.:

u[l](x) == augmentations[l](x) if l < naug else basis.u[l-naug](x),

where naug = len(augmentations) is the number of added basis functions through augmentation. Similar expressions hold for Matsubara frequencies.

Augmentation is useful in constructing bases for vertex-like quantities such as self-energies [1]. It is also useful when constructing a two-point kernel that serves as a base for multi-point functions [2].

Example

For constructing the vertex basis and the augmented basis, one can use:

import sparse_ir, sparse_ir.augment as aug
basis = sparse_ir.FiniteTempBasis('B', beta=10, wmax=2.0)
vertex_basis = aug.AugmentedBasis(basis, aug.MatsubaraConst)
aug_basis = aug.AugmentedBasis(basis, aug.TauConst, aug.TauLinear)

Warning

Bases augmented with TauConst and TauLinear tend to be poorly conditioned. Care must be taken while fitting and compactness should be enforced if possible to regularize the problem.

While vertex bases, i.e., bases augmented with MatsubaraConst, stay reasonably well-conditioned, it is still good practice to treat the Hartree–Fock term separately rather than including it in the basis, if possible.

See also

property accuracy

Accuracy of the basis.

Upper bound to the relative error of reprensenting a propagator with the given number of basis functions (number between 0 and 1).

property beta

Inverse temperature

default_matsubara_sampling_points(*, npoints=None, positive_only=False)

Default sampling points on the imaginary frequency axis

Parameters:
  • npoints (int) –

    Minimum number of sampling points to return.

  • positive_only (bool) – Only return non-negative frequencies. This is useful if the object to be fitted is symmetric in Matsubura frequency, ghat(w) == ghat(-w).conj(), or, equivalently, real in imaginary time.

default_tau_sampling_points(*, npoints=None)

Default sampling points on the imaginary time axis

Parameters:

npoints (int) –

Minimum number of sampling points to return.

property is_well_conditioned

Returns True if the sampling is expected to be well-conditioned

property lambda_

Basis cutoff parameter, Λ == β * wmax, or None if not present

property shape

Shape of the basis function set

property significance

Significances of the basis functions

Vector of significance values, one for each basis function. Each value is a number between 0 and 1 which is a a-priori bound on the (relative) error made by discarding the associated coefficient.

property size

Number of basis functions / singular values

property statistics

Quantum statistic (“F” for fermionic, “B” for bosonic)

property u

Basis functions on the imaginary time axis.

Set of IR basis functions on the imaginary time (tau) axis, where tau is a real number between zero and beta. To get the l-th basis function at imaginary time tau of some basis basis, use:

ultau = basis.u[l](tau)        # l-th basis function at time tau

Note that u supports vectorization both over l and tau. In particular, omitting the subscript yields a vector with all basis functions, evaluated at that position:

basis.u(tau) == [basis.u[l](tau) for l in range(basis.size)]

Similarly, supplying a vector of tau points yields a matrix A, where A[l,n] corresponds to the l-th basis function evaluated at tau[n]:

tau = [0.5, 1.0]
basis.u(tau) == \
    [[basis.u[l](t) for t in tau] for l in range(basis.size)]
property uhat

Basis functions on the reduced Matsubara frequency (wn) axis.

Set of IR basis functions reduced Matsubara frequency (wn) axis, where wn is an integer. These are related to u by the following Fourier transform:

\[\hat u(n) = \int_0^\beta d\tau \exp(i\pi n \tau/\beta) u(\tau)\]

To get the l-th basis function at some reduced frequency wn of some basis basis, use:

uln = basis.uhat[l](wn)        # l-th basis function at freq wn

uhat supports vectorization both over l and wn. In particular, omitting the subscript yields a vector with all basis functions, evaluated at that position:

basis.uhat(wn) == [basis.uhat[l](wn) for l in range(basis.size)]

Similarly, supplying a vector of wn points yields a matrix A, where A[l,n] corresponds to the l-th basis function evaluated at wn[n]:

wn = [1, 3]
basis.uhat(wn) == \\
    [[basis.uhat[l](wi) for wi in wn] for l in range(basis.size)]

Note

Instead of the value of the Matsubara frequency, these functions expect integers corresponding to the prefactor of pi over beta. For example, the first few positive fermionic frequencies would be specified as [1, 3, 5, 7], and the first bosonic frequencies are [0, 2, 4, 6]. This is also distinct to an index!

property wmax

Real frequency cutoff or None if not present

Available augmentations

class sparse_ir.augment.TauConst(beta)

Constant in imaginary time/discrete delta in frequency

__call__(tau)

Evaluate the function at imaginary time tau

classmethod create(basis)

Factory method constructing an augmented term for a basis

deriv(n=1)

Derivative of order n of the function

hat(n)

Evaluate the Fourier transform at reduced frequency n

class sparse_ir.augment.TauLinear(beta)

Linear function in imaginary time, antisymmetric around beta/2

__call__(tau)

Evaluate the function at imaginary time tau

classmethod create(basis)

Factory method constructing an augmented term for a basis

deriv(n=1)

Derivative of order n of the function

hat(n)

Evaluate the Fourier transform at reduced frequency n

class sparse_ir.augment.MatsubaraConst(beta)

Constant in Matsubara, undefined in imaginary time

__call__(tau)

Evaluate the function at imaginary time tau

classmethod create(basis)

Factory method constructing an augmented term for a basis

deriv(n=1)

Derivative of order n of the function

hat(n)

Evaluate the Fourier transform at reduced frequency n

Base classes

class sparse_ir.augment.AbstractAugmentation

Scalar function in imaginary time/frequency.

This represents a single function in imaginary time and frequency, together with some auxiliary methods that make it suitable for augmenting a basis.

See also

AugmentedBasis

__call__(tau)

Evaluate the function at imaginary time tau

classmethod create(basis)

Factory method constructing an augmented term for a basis

deriv(n)

Derivative of order n of the function

hat(n)

Evaluate the Fourier transform at reduced frequency n