Private names index
These are not considered API and therefore not covered by any semver promises.
Core.Int — MethodGet prefactor n for the Matsubara frequency ω = n*π/β
Core.Integer — MethodGet prefactor n for the Matsubara frequency ω = n*π/β
SparseIR.AbstractAugmentation — TypeAbstractAugmentationScalar 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
SparseIR.AbstractBasis — TypeAbstractBasisAbstract 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.
SparseIR.AbstractKernel — TypeAbstractKernelIntegral 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)$.
SparseIR.AbstractSVEHints — TypeAbstractSVEHintsDiscretization hints for singular value expansion of a given kernel.
SparseIR.AbstractSampling — TypeAbstractSamplingAbstract 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 |___________________|SparseIR.PiecewiseLegendreFTVector — TypePiecewiseLegendreFTVectorFourier 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)SparseIR.PiecewiseLegendrePoly — TypePiecewiseLegendrePoly <: FunctionPiecewise 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.
SparseIR.PiecewiseLegendrePolyVector — TypePiecewiseLegendrePolyVectorContains a Vector{PiecewiseLegendrePoly}.
SparseIR.SVEResult — TypeSVEResult(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 ≥cutoffare kept. Defaults toeps(Float64)(≈ 2.22e-16).cutoff::Real: Accuracy target for the basis. Controls the precision to which singular values and singular vectors are computed. Defaults toNaN(uses internal default).lmax::Integer: Maximum basis size. If given, only at most thelmaxmost 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 toSPIR_TWORK_AUTOwhich 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 toSamplingSVE, optionally wrapped inside of aCentrosymmSVEif 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.
SparseIR.Statistics — TypeStatistics(zeta)Abstract type for quantum statistics (fermionic/bosonic/etc.)
SparseIR.accuracy — Functionaccuracy(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).
SparseIR.basis — Methodbasis(sampling::AbstractSampling)Return the IR basis associated with sampling.
SparseIR.cover_domain — Methodcover_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.
SparseIR.default_matsubara_sampling_points — Functiondefault_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.
SparseIR.default_tau_sampling_points — Functiondefault_tau_sampling_points(basis::AbstractBasis)Default sampling points on the imaginary time/x axis.
SparseIR.eval_matrix — Functioneval_matrix(T, basis, x)Return evaluation matrix from coefficients to sampling points. T <: AbstractSampling.
SparseIR.finite_temp_bases — Methodfinite_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).
SparseIR.iswellconditioned — Methodiswellconditioned(basis::AbstractBasis)Returns true if the sampling is expected to be well-conditioned.
SparseIR.rescale — Methodrescale(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 rescalenew_beta: New inverse temperature
Returns
A new FiniteTempBasis with the same statistics type and accuracy but different temperature.
SparseIR.s — Functions(basis::AbstractBasis)Get the singular values of the basis.
SparseIR.significance — Functionsignificance(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).
SparseIR.statistics — Methodstatistics(basis::AbstractBasis)Quantum statistic (Statistics instance, Fermionic() or Bosonic()).
SparseIR.u — Functionu(basis::AbstractBasis)Get the u basis functions (imaginary time).
SparseIR.uhat — Functionuhat(basis::AbstractBasis)Get the uhat basis functions (Matsubara frequency).
SparseIR.v — Functionv(basis::AbstractBasis)Get the v basis functions (real frequency).
SparseIR.value — MethodGet value of the Matsubara frequency ω = n*π/β
SparseIR.valueim — MethodGet complex value of the Matsubara frequency iω = iπ/β * n
SparseIR.zeta — MethodGet statistics ζ for Matsubara frequency ω = (2*m+ζ)*π/β
SparseIR.Λ — FunctionΛ(basis::AbstractBasis)
lambda(basis::AbstractBasis)Basis cutoff parameter, Λ = β * ωmax, or None if not present
SparseIR.β — Methodβ(basis::AbstractBasis)
beta(basis::AbstractBasis)Inverse temperature of the basis.
Returns the inverse temperature parameter β used in the basis construction.
SparseIR.ωmax — Functionωmax(basis::AbstractBasis)
wmax(basis::AbstractBasis)Real frequency cutoff or nothing if unscaled basis.