Private names index

These are not considered API and therefore not covered by any semver promises.

Core.IntMethod

Get prefactor n for the Matsubara frequency ω = n*π/β

source
SparseIR.AbstractAugmentationType
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

source
SparseIR.AbstractBasisType
AbstractBasis

Abstract base class for bases on the imaginary-time axis.

Let basis be an abstract basis. Then we can expand a two-point propagator G(τ), where τ is imaginary time, into a set of basis functions:

G(τ) == sum(basis.u[l](τ) * g[l] for l in 1:length(basis)) + ϵ(τ),

where basis.u[l] is the l-th basis function, g[l] is the associated expansion coefficient and ϵ(τ) is an error term. Similarly, the Fourier transform Ĝ(n), where n is now a Matsubara frequency, can be expanded as follows:

Ĝ(n) == sum(basis.uhat[l](n) * g[l] for l in 1:length(basis)) + ϵ(n),

where basis.uhat[l] is now the Fourier transform of the basis function.

source
SparseIR.AbstractKernelType
AbstractKernel

Integral kernel K(x, y).

Abstract base type for an integral kernel, i.e. a AbstractFloat binary function $K(x, y)$ used in a Fredhold integral equation of the first kind:

\[ u(x) = ∫ K(x, y) v(y) dy\]

where $x ∈ [x_\mathrm{min}, x_\mathrm{max}]$ and $y ∈ [y_\mathrm{min}, y_\mathrm{max}]$. For its SVE to exist, the kernel must be square-integrable, for its singular values to decay exponentially, it must be smooth.

In general, the kernel is applied to a scaled spectral function $ρ'(y)$ as:

\[ ∫ K(x, y) ρ'(y) dy,\]

where $ρ'(y) = w(y) ρ(y)$.

source
SparseIR.AbstractSamplingType
AbstractSampling

Abstract type for sparse sampling.

Encodes the "basis transformation" of a propagator from the truncated IR basis coefficients G_ir[l] to time/frequency sampled on sparse points G(x[i]) together with its inverse, a least squares fit:

     ________________                   ___________________
    |                |    evaluate     |                   |
    |     Basis      |---------------->|     Value on      |
    |  coefficients  |<----------------|  sampling points  |
    |________________|      fit        |___________________|
source
SparseIR.PiecewiseLegendreFTVectorType
PiecewiseLegendreFTVector

Fourier transform of piecewise Legendre polynomials.

For a given frequency index n, the Fourier transform of the Legendre function is defined as:

    p̂(n) == ∫ dx exp(im * π * n * x / (xmax - xmin)) p(x)
source
SparseIR.PiecewiseLegendrePolyType
PiecewiseLegendrePoly <: Function

Piecewise Legendre polynomial.

Models a function on the interval $[xmin, xmax]$ as a set of segments on the intervals $S[i] = [a[i], a[i+1]]$, where on each interval the function is expanded in scaled Legendre polynomials.

source
SparseIR.SVEResultType
SVEResult(kernel::AbstractKernel;
    Twork=nothing, ε=nothing, lmax=typemax(Int),
    n_gauss=nothing, svd_strat=:auto,
    sve_strat=iscentrosymmetric(kernel) ? CentrosymmSVE : SamplingSVE
)

Perform truncated singular value expansion of a kernel.

Perform a truncated singular value expansion (SVE) of an integral kernel kernel : [xmin, xmax] x [ymin, ymax] -> ℝ:

kernel(x, y) == sum(s[l] * u[l](x) * v[l](y) for l in (1, 2, 3, ...)),

where s[l] are the singular values, which are ordered in non-increasing fashion, u[l](x) are the left singular functions, which form an orthonormal system on [xmin, xmax], and v[l](y) are the right singular functions, which form an orthonormal system on [ymin, ymax].

The SVE is mapped onto the singular value decomposition (SVD) of a matrix by expanding the kernel in piecewise Legendre polynomials (by default by using a collocation).

Arguments

  • K::AbstractKernel: Integral kernel to take SVE from.

  • ϵ::Real: Relative cutoff for the singular values. Only singular values with relative magnitude ≥ cutoff are kept. Defaults to eps(Float64) (≈ 2.22e-16).

  • cutoff::Real: Accuracy target for the basis. Controls the precision to which singular values and singular vectors are computed. Defaults to NaN (uses internal default).

  • lmax::Integer: Maximum basis size. If given, only at most the lmax most significant singular values and associated singular functions are returned.

  • `n_gauss (int): Order of Legendre polynomials. Defaults to kernel hinted value.

  • Twork::Integer: Working data type. Defaults to SPIR_TWORK_AUTO which automatically selects the appropriate precision based on the accuracy requirements. Available options:

    • SPIR_TWORK_AUTO: Automatically select the best precision (default)
    • SPIR_TWORK_FLOAT64: Use double precision (64-bit)
    • SPIR_TWORK_FLOAT64X2: Use extended precision (128-bit)
  • sve_strat::AbstractSVE: SVE to SVD translation strategy. Defaults to SamplingSVE, optionally wrapped inside of a CentrosymmSVE if the kernel is centrosymmetric.

  • svd_strat ('fast' or 'default' or 'accurate'): SVD solver. Defaults to fast (ID/RRQR) based solution when accuracy goals are moderate, and more accurate Jacobi-based algorithm otherwise.

Returns: An SVEResult containing the truncated singular value expansion.

source
SparseIR.accuracyFunction
accuracy(basis::AbstractBasis)

Accuracy of the basis.

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

source
SparseIR.basisMethod
basis(sampling::AbstractSampling)

Return the IR basis associated with sampling.

source
SparseIR.cover_domainMethod
cover_domain(knots::Vector{Float64}, xmin::Float64, xmax::Float64, period::Float64, poly_xmin::Float64, poly_xmax::Float64)

Generate knots that cover the integration domain, handling periodic functions.

This function extends the basic knots to cover the entire integration domain, taking into account periodicity if applicable.

source
SparseIR.default_matsubara_sampling_pointsFunction
default_matsubara_sampling_points(basis::AbstractBasis; positive_only=false)

Default sampling points on the imaginary frequency axis.

Arguments

  • positive_only::Bool: Only return non-negative frequencies. This is useful if the object to be fitted is symmetric in Matsubura frequency, ĝ(ω) == conj(ĝ(-ω)), or, equivalently, real in imaginary time.
source
SparseIR.eval_matrixFunction
eval_matrix(T, basis, x)

Return evaluation matrix from coefficients to sampling points. T <: AbstractSampling.

source
SparseIR.finite_temp_basesMethod
finite_temp_bases(β::Real, ωmax::Real, ε;
                  kernel=LogisticKernel(β * ωmax), sve_result=SVEResult(kernel, ε))

Construct FiniteTempBasis objects for fermion and bosons using the same LogisticKernel instance.

Arguments

  • β: Inverse temperature (must be positive)
  • ωmax: Frequency cutoff (must be non-negative)
  • ε: This parameter controls the number of basis functions. Only singular values ≥ ε * s[1] are kept. Typical values are 1e-6 to 1e-12 depending on the desired accuracy for your calculations. If ε is smaller than the square root of double precision machine epsilon (≈ 1.49e-8), the library will automatically use higher precision for the singular value decomposition, resulting in longer computation time for basis generation.

The number of basis functions grows logarithmically as log(1/ε) log (β * ωmax).

source
SparseIR.rescaleMethod
rescale(basis::FiniteTempBasis, new_beta)

Return a basis for different temperature.

Creates a new basis with the same accuracy $ε$ but different temperature. The new kernel is constructed with the same cutoff parameter $Λ = β * ωmax$, which implies a different UV cutoff $ωmax$ since $Λ$ stays constant.

Arguments

  • basis: The original basis to rescale
  • new_beta: New inverse temperature

Returns

A new FiniteTempBasis with the same statistics type and accuracy but different temperature.

source
SparseIR.sFunction
s(basis::AbstractBasis)

Get the singular values of the basis.

source
SparseIR.significanceFunction
significance(basis::AbstractBasis)

Return vector σ, where 0 ≤ σ[i] ≤ 1 is the significance level of the i-th basis function. If ϵ is the desired accuracy to which to represent a propagator, then any basis function where σ[i] < ϵ can be neglected.

For the IR basis, we simply have that σ[i] = s[i] / first(s).

source
SparseIR.statisticsMethod
statistics(basis::AbstractBasis)

Quantum statistic (Statistics instance, Fermionic() or Bosonic()).

source
SparseIR.uFunction
u(basis::AbstractBasis)

Get the u basis functions (imaginary time).

source
SparseIR.uhatFunction
uhat(basis::AbstractBasis)

Get the uhat basis functions (Matsubara frequency).

source
SparseIR.vFunction
v(basis::AbstractBasis)

Get the v basis functions (real frequency).

source
SparseIR.ΛFunction
Λ(basis::AbstractBasis)
lambda(basis::AbstractBasis)

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

source
SparseIR.βMethod
β(basis::AbstractBasis)
beta(basis::AbstractBasis)

Inverse temperature of the basis.

Returns the inverse temperature parameter β used in the basis construction.

source
SparseIR.ωmaxFunction
ωmax(basis::AbstractBasis)
wmax(basis::AbstractBasis)

Real frequency cutoff or nothing if unscaled basis.

source