Public names index
SparseIR.pioverbeta — Constant
pioverbetaThe fermionic Matsubara frequency π/β, FermionicFreq(1). Multiples give other frequencies: 3 * pioverbeta == FermionicFreq(3), 2 * pioverbeta == BosonicFreq(2).
SparseIR.AugmentedBasis — Type
AugmentedBasis <: AbstractBasisAugmented 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. with Julia's 1-based index i:
u[i](τ) == i ≤ naug ? augmentations[i](τ) : basis.u[i-naug](τ),
uhat[i](n) == i ≤ naug ? augmentations[i](n) : basis.uhat[i-naug](n),where naug = length(augmentations) is the number of added basis functions through augmentation, τ ∈ [-β, β] and n is a reduced frequency (or a MatsubaraFreq).
AugmentedBasis(basis, augmentations...) takes each augmentation as a type (TauConst, TauLinear, MatsubaraConst), which is then built for the β and the statistics of basis, or as an instance, which must have the β of basis and, except for a MatsubaraConst, its statistics (ArgumentError otherwise). TauConst and TauLinear exist for bosons only; MatsubaraConst works for both statistics, and an instance of it adopts the statistics of the basis.
The default sampling points are those for L = naug + length(basis) functions, the size of the augmented basis: the roots of U_L in imaginary time, always folded into (0, β), and the sign changes of the first discarded Û_l (l ≥ L) in Matsubara frequency.
Augmentation is useful in constructing bases for vertex-like quantities such as self-energies [wallerberger2021] and when constructing a two-point kernel that serves as a base for multi-point functions [shinaoka2018].
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: MatsubaraConst for vertex basis [wallerberger2021], TauConst, TauLinear for multi-point [shinaoka2018]
SparseIR.Bosonic — Type
Bosonic statistics, parity ζ = 0: a function of imaginary time is periodic, G(τ + β) = G(τ), and its Matsubara frequencies are ν = nπ/β with even n.
SparseIR.BosonicFreq — Type
BosonicFreq(n)Bosonic Matsubara frequency n π/β with even n; an alias of MatsubaraFreq{Bosonic}. An odd n throws DomainError.
SparseIR.DiscreteLehmannRepresentation — Type
DiscreteLehmannRepresentation(basis::AbstractBasis, poles=default_omega_sampling_points(basis))Construct a DLR basis from an IR basis.
If poles is not provided, uses the default omega sampling points from the IR basis: the roots of V_L (see default_omega_sampling_points).
poles may be any real-valued AbstractVector (including Vector{Int} and Vector{Float32}); it is converted to Vector{Float64} — the element type the C API reads — before the pointer is taken, so no narrower type is ever reinterpreted as Float64. The poles must be finite and pairwise distinct (otherwise ArgumentError) and lie in [-ωmax, ωmax] (otherwise DomainError).
SparseIR.DiscreteLehmannRepresentation — Type
DiscreteLehmannRepresentation{S,B} <: AbstractBasis{S}Discrete Lehmann representation (DLR), with the poles by default at the roots of V_L, the first real-frequency basis function beyond the IR basis.
This type wraps the C API DLR functionality. The DLR basis is a variant of the IR basis that represents the spectral function, for both statistics, by poles ω̄_p on the real-frequency axis,
ρ(ω) = Σ_p c_p δ(ω - ω̄_p),where ρ is the weighted spectral function of FiniteTempBasis (ρ = A for fermions, ρ = A/tanh(βω/2) for bosons) and the c_p are the DLR coefficients. Then
G(τ) = Σ_p c_p u_p(τ), u_p(τ) = -exp(-τ ω̄_p) / (1 + exp(-β ω̄_p)),
G(iν) = Σ_p c_p û_p(iν),where u_p(τ) is minus the logistic kernel at ω = ω̄_p and
û_p(iν) = 1/(iν - ω̄_p) for fermions,
û_p(iν) = tanh(β ω̄_p/2)/(iν - ω̄_p) for bosons.So G(iν) = Σ_p c_p/(iν - ω̄_p) holds for fermions only; for bosons the spectral weights are A(ω) = Σ_p c_p tanh(β ω̄_p/2) δ(ω - ω̄_p).
Fields
ptr::Ptr{spir_basis}: Pointer to the C DLR objectbasis::B: The underlying IR basispoles::Vector{Float64}: Pole locationsω̄_pon the real-frequency axisu: the DLR basis functionsu_p(τ)in imaginary time, so thattranspose(dlr.u(τ)) * cevaluates the DLR coefficientsc. They acceptτ ∈ [-β, β], with the extension to negativeτand the endpoint rules ofFiniteTempBasis.u(seeFiniteTempBasis).uhat: their Fourier transformsû_p(iν), called with the reduced frequencyn(ν = nπ/β) or aMatsubaraFreq
The DLR basis functions are not piecewise polynomials: deriv, knots and overlap are not supported for them and throw SparseIRError.
SparseIR.Fermionic — Type
Fermionic statistics, parity ζ = 1: a function of imaginary time is anti-periodic, G(τ + β) = -G(τ), and its Matsubara frequencies are ν = nπ/β with odd n.
SparseIR.FermionicFreq — Type
FermionicFreq(n)Fermionic Matsubara frequency n π/β with odd n; an alias of MatsubaraFreq{Fermionic}. An even n throws DomainError.
SparseIR.FiniteTempBasis — Type
FiniteTempBasis <: AbstractBasisIntermediate representation (IR) basis for given temperature.
For a continuation kernel K from real frequencies, ω ∈ [-ωmax, ωmax], to imaginary time, τ ∈ [0, β], this type stores the truncated singular value expansion or IR basis:
K(τ, ω) ≈ sum(U_l(τ) * S_l * V_l(ω) for l in 0:L-1),where L = length(basis), S_0 ≥ S_1 ≥ … > 0, and Julia's basis.u[l+1], basis.s[l+1] and basis.v[l+1] are U_l, S_l and V_l. The U_l are orthonormal on [0, β], the V_l on [-ωmax, ωmax], and their sign is fixed by U_l(β⁻) > 0. The basis keeps the functions with S_l/S_0 ≥ ε.
This basis is inferred from a reduced form by appropriate scaling of the variables: with x = 2τ/β - 1 and y = ω/ωmax, the dimensionless SVE K(x, y) = Σ_l s_l u_l(x) v_l(y) (see SVEResult) of the default LogisticKernel gives
U_l(τ) = √(2/β) u_l(x), V_l(ω) = √(1/ωmax) v_l(y), S_l = √(β ωmax/2) s_l.With the LogisticKernel, fermions and bosons share U_l, S_l and V_l; only uhat differs. A Green's function is expanded as
G(τ) ≈ Σ_l G_l U_l(τ), G(iν) ≈ Σ_l G_l Û_l(iν),
G_l = -S_l ρ_l, ρ_l = ∫ dω ρ(ω) V_l(ω),where ρ(ω) = A(ω) for fermions and ρ(ω) = A(ω)/tanh(βω/2) for bosons, and A(ω) is the spectral function (see LogisticKernel).
Fields
u::PiecewiseLegendrePolyVector: Set of IR basis functionsU_l(τ)on the imaginary time (tau) axis. These functions are stored as piecewise Legendre polynomials.To obtain the value of all basis functions at a point or an array of points
τ, you can call the functionu(τ).u[l+1]is the single basis functionU_l, andu[range]a subset.uacceptsτ ∈ [-β, β]and throwsDomainErroroutside. Forτ < 0it returnsu(τ) = (-1)^ζ u(τ + β), where the parityζis 1 for fermions and 0 for bosons. The endpoints are read as one-sided limits:+0.0is0⁺,βisβ⁻,-0.0is0⁻(the value(-1)^ζ U_l(β⁻)) and-βis(-β)⁺(the value(-1)^ζ U_l(0⁺)).uhat::PiecewiseLegendreFTVector: Set of IR basis functionsÛ_l(iν)on the Matsubara frequency axis, the Fourier transformsÛ_l(iν) = ∫₀^β dτ exp(iντ) U_l(τ), ν = nπ/β.To obtain the value of all basis functions at a Matsubara frequency or an array of frequencies, you can call the function
uhat(n). Note that we expect reduced frequenciesn, which are simply even/odd numbers for bosonic/fermionic objects, orMatsubaraFreqs.uhat[l+1]is the single functionÛ_l, anduhat[range]a subset. For fermions,Û_l(iν)is purely imaginary for evenland real for oddl; for bosons it is the other way round.s: Vector of singular valuesS_lof the continuation kernelv::PiecewiseLegendrePolyVector: Set of IR basis functionsV_l(ω)on the real frequency axis,ω ∈ [-ωmax, ωmax]. These functions are stored as piecewise Legendre polynomials.To obtain the value of all basis functions at a point or an array of points
ω, you can call the functionv(ω).v[l+1]is the single basis functionV_l, andv[range]a subset.
SparseIR.FiniteTempBasis — Method
FiniteTempBasis{S}(β, ωmax, ε; kernel=LogisticKernel(β * ωmax), sve_result=SVEResult(kernel, ε), max_size=-1)Construct a finite temperature basis suitable for the given S (Fermionic or Bosonic), inverse temperature β and frequency cutoff ωmax.
Arguments
β: Inverse temperature (must be positive)ωmax: Frequency cutoff (must be positive). The spectral function must vanish outside[-ωmax, ωmax].ε: This parameter controls the number of basis functions. Only the singular values withS_l/S_0 ≥ εare kept. Typical values are 1e-6 to 1e-12 depending on the desired accuracy for your calculations. If ε is smaller than 1e-8, the library will automatically use higher (double-double) precision for the singular value expansion, resulting in longer computation time for basis generation.kernel: The kernel; its cutoff must beΛ = β * ωmax(otherwiseArgumentError).sve_result: The SVE ofkernel, or of a kernel of the same type andΛ.max_size: Maximum number of basis functions,-1for no limit.
The number of basis functions grows logarithmically as log(1/ε) log (β * ωmax).
SparseIR.FiniteTempBasis — Method
FiniteTempBasis(stat::Statistics, β, ωmax, ε; kernel=LogisticKernel(β * ωmax), sve_result=SVEResult(kernel, ε), max_size=-1)Convenience constructor, the same as FiniteTempBasis{typeof(stat)}(β, ωmax, ε; kernel, sve_result, max_size).
Construct a finite temperature basis for the given statistics, inverse temperature and frequency cutoff.
Arguments
stat: Statistics instance (Fermionic()orBosonic())β: Inverse temperature (must be positive)ωmax: Frequency cutoff (must be positive)ε: Accuracy target for the basis. This parameter controls the number of basis functions. Only the singular values withS_l/S_0 ≥ εare kept. Typical values are 1e-6 to 1e-12 depending on the desired accuracy for your calculations. If ε is smaller than 1e-8, the library will automatically use higher (double-double) precision for the singular value expansion, resulting in longer computation time for basis generation.
The number of basis functions grows logarithmically as log(1/ε) log (β * ωmax).
SparseIR.FiniteTempBasisSet — Type
FiniteTempBasisSetType for holding IR bases and sparse-sampling objects.
An object of this type holds IR bases for fermions and bosons and associated sparse-sampling objects.
Fields
- basis_f::FiniteTempBasis: Fermion basis
- basis_b::FiniteTempBasis: Boson basis
- tau::Vector{Float64}: Sampling points in the imaginary-time domain (those of
smpl_tau_f; the default points of both bases are the same) - wn_f::Vector{FermionicFreq}: Sampling fermionic frequencies
- wn_b::Vector{BosonicFreq}: Sampling bosonic frequencies
- smpltauf::TauSampling: Sparse sampling for tau & fermion
- smpltaub::TauSampling: Sparse sampling for tau & boson
- smplwnf::MatsubaraSampling: Sparse sampling for Matsubara frequency & fermion
- smplwnb::MatsubaraSampling: Sparse sampling for Matsubara frequency & boson
- sve_result::SVEResult: Result of the singular value expansion shared by both bases
The Matsubara samplers use the full default point sets (positive_only = false).
Getters
These are functions, not properties:
SparseIR.β(bset)orSparseIR.beta(bset): Inverse temperatureSparseIR.ωmax(bset)orSparseIR.wmax(bset): Cut-off frequency
SparseIR.LogisticKernel — Type
LogisticKernel <: AbstractKernelLogistic kernel, the default kernel for both statistics.
In imaginary time $τ$ and real frequency $ω$ it reads
\[ K(τ, ω) = \frac{e^{-τ ω}}{1 + e^{-β ω}},\]
and it relates a Green's function $G(τ) = -⟨T_τ c(τ) c^†(0)⟩$ to the spectral function $A(ω)$ by
\[ G(τ) = -∫_{-ω_\mathrm{max}}^{ω_\mathrm{max}} dω\, K(τ, ω) ρ(ω), \qquad ρ(ω) = \begin{cases} A(ω) & \text{fermions}, \\ A(ω)/\tanh(βω/2) & \text{bosons}. \end{cases}\]
For both statistics, its Fourier transform $G(\mathrm{i}ν) = ∫_0^β dτ\, e^{\mathrm{i}ντ} G(τ)$ is $G(\mathrm{i}ν) = ∫ dω\, A(ω)/(\mathrm{i}ν - ω)$.
In dimensionless variables $x = 2 τ/β - 1$, $y = β ω/Λ$, with the cutoff $Λ = β ω_\mathrm{max}$, the integral kernel is a function on $[-1, 1] × [-1, 1]$:
\[ K(x, y) = \frac{e^{-Λ y (x + 1) / 2}}{1 + e^{-Λ y}}\]
For fermions it acts on the spectral function itself. For bosons, the $τ$ dependence of a bosonic correlation function is modeled as follows:
\[ ∫ \frac{e^{-Λ y (x + 1) / 2}}{1 - e^{-Λ y}} A(y) dy = ∫ K(x, y) ρ(y) dy,\]
with
\[ ρ(y) = w(y) A(y),\]
where the weight function is given by
\[ w(y) = \frac{1}{\tanh(Λ y/2)}.\]
SparseIR.MatsubaraConst — Type
MatsubaraConst{S} <: AbstractAugmentation{S}Constant in Matsubara, undefined in imaginary time: its value is 1 at every Matsubara frequency, and it returns NaN for τ ∈ [-β, β] (DomainError outside).
Type Parameters
S: Statistics type (Fermionic or Bosonic). This is required for type consistency, though MatsubaraConst works identically for both statistics.MatsubaraConst(β)is bosonic; as an augmentation, both the bare type and an instance take the statistics of the basis they augment.
SparseIR.MatsubaraFreq — Type
MatsubaraFreq(n)Matsubara frequency ν = nπ/β, stored as its reduced frequency n.
Struct representing the Matsubara frequency ν entering the Fourier transform of a propagator G(τ) on imaginary time τ to its Matsubara equivalent G(iν) on the imaginary-frequency axis:
β
G(iν) = ∫ dτ exp(iντ) G(τ) with ν = n π/β,
0
G(τ) = (1/β) Σ_ν exp(-iντ) G(iν),where β is inverse temperature and by convention we include the imaginary unit in the frequency argument, i.e., G(iν); the argument tells the function and its transform apart. The frequencies depend on the statistics of the propagator through its parity ζ (1 for fermions, 0 for bosons, see zeta):
G(τ + β) = (-1)^ζ G(τ).The reduced frequency n is an integer with n ≡ ζ (mod 2):
- Bosonic frequency (
S == Bosonic):neven (periodic in β) - Fermionic frequency (
S == Fermionic):nodd (anti-periodic in β)
MatsubaraFreq(n) takes the statistics from the parity of n; MatsubaraFreq{S}(n), FermionicFreq and BosonicFreq throw DomainError for the wrong parity.
SparseIR.MatsubaraSampling — Type
MatsubaraSampling{T,B} <: AbstractSampling
Sparse sampling in Matsubara frequencies using the C API.
Allows transformation between IR basis coefficients G_l and the values G(iν_i) = Σ_l G_l Û_l(iν_i) at the sampling frequencies ν_i = n_i π/β.
SparseIR.MatsubaraSampling — Method
MatsubaraSampling(basis::AbstractBasis; positive_only=false, sampling_points=nothing)Construct a MatsubaraSampling object from a basis. If sampling_points is not provided, the default Matsubara sampling points from the basis are used: the sign changes of the first discarded transform Û_l, with l ≥ L = length(basis) chosen to fit the parity (see default_matsubara_sampling_points). Bosonic sets always include n = 0.
sampling_points, when given, are reduced frequencies n (integers of the parity of the statistics: odd for fermions, even for bosons) or MatsubaraFreqs of the statistics of the basis; they are stored, and returned by sampling_points, as a Vector{FermionicFreq} or Vector{BosonicFreq}.
positive_only = true asserts that the caller's data satisfies the symmetry G(-iν) = conj(G(iν)), i.e. that the underlying quantity is real in imaginary time; the sampling object then holds only the non-negative frequencies, n ≥ 0 (for bosons including n = 0). It is a statement about the data, not a display option, and its default is false (the general case). The assertion is not checked and cannot be checked from the sampled values alone — see the warning in fit — so data violating it is fitted to silently meaningless coefficients.
The sampling points must be non-empty and pairwise distinct; otherwise an ArgumentError is thrown before any call into libsparseir. They may be given in any order: evaluate and fit follow the order of sampling_points.
SparseIR.RegularizedBoseKernel — Type
RegularizedBoseKernel <: AbstractKernelRegularized bosonic analytical continuation kernel.
Use LogisticKernel, the default kernel for both statistics. RegularizedBoseKernel will be removed in a future release. For ωmax ≠ 1, libsparseir releases without the fix of SpM-lab/sparse-ir-rs#273 scale the singular values of its bases by $ω_\mathrm{max}^{-1}$ instead of $ω_\mathrm{max}^{+1}$.
In dimensionless variables $x = 2 τ/β - 1$, $y = β ω/Λ$, the bosonic integral kernel is a function on $[-1, 1] × [-1, 1]$:
\[ K(x, y) = y \frac{e^{-Λ y (x + 1) / 2}}{1 - e^{-Λ y}}\]
In physical units it is $K(τ, ω) = ω_\mathrm{max} K(x, y) = ω e^{-τω} / (1 - e^{-βω})$, which acts on $A(ω)/ω$ (N. Chikano et al., Computer Physics Communications 240, 181 (2019), Eqs. (1)-(3)). Care has to be taken in evaluating this expression around $y = 0$. It can only be used with Bosonic statistics: a fermionic FiniteTempBasis with this kernel throws ArgumentError.
SparseIR.TauConst — Type
TauConst{Bosonic} <: AbstractAugmentation{Bosonic}Constant function in imaginary time, 1/√β on [0, β] and periodic, whose Matsubara transform is √β at ν = 0 and zero at every other frequency.
Defined for bosons only: TauConst{Fermionic} throws ArgumentError.
SparseIR.TauLinear — Type
TauLinear{Bosonic} <: AbstractAugmentation{Bosonic}Linear function in imaginary time, √(3/β) (2τ/β - 1) on [0, β], antisymmetric around β/2 and periodic, whose Matsubara transform is 2√(3/β)/(iν) and zero at ν = 0.
Defined for bosons only: TauLinear{Fermionic} throws ArgumentError.
SparseIR.TauSampling — Type
TauSampling{T,B} <: AbstractSampling
Sparse sampling in imaginary time using the C API.
Allows transformation between IR basis coefficients G_l and the values G(τ_i) = Σ_l G_l U_l(τ_i) at the sampling points τ_i in imaginary time.
SparseIR.TauSampling — Method
TauSampling(basis::AbstractBasis; sampling_points=nothing, use_positive_taus=true)Construct a TauSampling object from a basis. If sampling_points is not provided, the default tau sampling points from the basis are used: the roots of U_L, the first basis function beyond a basis of size L (see default_tau_sampling_points).
If use_positive_taus=true, the sampling points are folded into (0, β) and sorted [default].
If use_positive_taus=false, the sampling points are unfolded, in (-β/2, β/2]: pairs ±τ, plus β/2 when their number is odd.
For an AugmentedBasis there is no use_positive_taus keyword: its default points, the roots of U_L for L = length(basis), are always folded into (0, β).
Given points are read as for basis.u: τ < 0 stands for τ + β with the sign (-1)^ζ, and -0.0 is 0⁻ (see FiniteTempBasis).
sampling_points, when given, may be any real-valued AbstractVector (including Vector{Int} and Vector{Float32}); it is converted to Vector{Float64} — the element type the C API reads — before the pointer is taken, so a narrower element type is never reinterpreted as Float64. The points must be non-empty, finite, pairwise distinct and inside [-β, β]; otherwise an ArgumentError (or DomainError for the range) is thrown before any call into libsparseir.
SparseIR.default_omega_sampling_points — Method
default_omega_sampling_points(basis::AbstractBasis)Get the default real-frequency sampling points for a basis.
These are the roots of V_L, the first real-frequency basis function beyond a basis of size L. They are the default poles of the DLR.
SparseIR.evaluate! — Method
evaluate!(output::Array, sampling::AbstractSampling, al::AbstractArray; dim=1)In-place version of evaluate. Write results to the pre-allocated output, which must be an Array{Float64} or Array{ComplexF64} of the right shape (ComplexF64 for MatsubaraSampling); any other output throws ArgumentError.
SparseIR.evaluate — Method
evaluate(sampling::AbstractSampling, al::AbstractArray; dim=1)Evaluate basis coefficients at the sampling points using the C API.
For multidimensional arrays, dim specifies which dimension corresponds to the basis coefficients.
al may be any AbstractArray with a real or complex element type: it is converted to Array{Float64} or Array{ComplexF64} (the types the C API reads) before the call, so narrower types such as Float32 contribute only their own precision. The result is Float64/ComplexF64 for TauSampling (following the input) and always ComplexF64 for MatsubaraSampling. Non-finite entries and a wrong length along dim throw before the call.
For a MatsubaraSampling built with positive_only = true, genuinely complex coefficients violate its assumption of real coefficients and throw ArgumentError.
The result holds G(τ_i) = Σ_l G_l U_l(τ_i) for a TauSampling and G(iν_i) = Σ_l G_l Û_l(iν_i) for a MatsubaraSampling.
SparseIR.fit! — Method
fit!(output::Array, sampling::AbstractSampling, al::AbstractArray; dim=1)In-place version of fit. Write results to the pre-allocated output, which must be an Array{Float64} or Array{ComplexF64} of the right shape; any other output throws ArgumentError. A Float64 output for a MatsubaraSampling is accepted only if the fitted coefficients are real to the accuracy of the basis.
SparseIR.fit — Method
fit(sampling::AbstractSampling, al::AbstractArray; dim=1)Fit basis coefficients from values at sampling points using the C API.
This is the least-squares inverse of evaluate: it returns the IR coefficients G_l whose values Σ_l G_l U_l(τ_i) or Σ_l G_l Û_l(iν_i) best match the given values at the sampling points.
For multidimensional arrays, dim specifies which dimension corresponds to the sampling points.
Element type of the result
TauSampling:Float64for real input,ComplexF64for complex input.MatsubaraSampling: alwaysComplexF64, because the IR expansion coefficients of a general Green's function are complex. The imaginary part is never projected away.
al may be any AbstractArray with a real or complex element type; it is converted to Array{Float64} or Array{ComplexF64} before the call (real Matsubara data to ComplexF64), so narrower types contribute only their own precision. Non-finite entries and a wrong length along dim throw before the call.
positive_only
When sampling was built with positive_only = true, the caller asserts the symmetry G(-iν) = conj(G(iν)) — equivalently, that the underlying quantity is real in imaginary time, so that its IR coefficients are real. Only the non-negative frequencies are then sampled, and each complex sampling point contributes two real equations, so the fit solves an exactly determined real system and always returns coefficients whose imaginary part is exactly zero.
Because the default point set makes the real system exactly determined, data that violates G(-iν) = conj(G(iν)) is fitted with a vanishing residual and produces silently meaningless coefficients: the violation cannot be detected from the sampled values alone, and neither this wrapper nor libsparseir raises. Use positive_only = true only for a quantity you know to be real in imaginary time; otherwise use the default positive_only = false.
SparseIR.from_IR — Function
from_IR(dlr::DiscreteLehmannRepresentation, gl::AbstractArray, dims=1)Transform from IR basis coefficients G_l to DLR coefficients c_p, the inverse of to_IR: for the default poles, from_IR(dlr, to_IR(dlr, c)) ≈ c.
Arguments
dlr: The DLR basisgl: IR basis coefficientsdims: Dimension along which the basis coefficients are stored
Returns
DLR coefficients with the same shape as input, but with size length(dlr) along dimension dims.
gl may be any AbstractArray with a real or complex element type. It is converted to Array{Float64} or Array{ComplexF64} — the element types the C entry points read — before the call, so Float32, ComplexF32 or integer input contributes only its own precision. The result is Float64 for real input and ComplexF64 for complex input. Non-finite entries throw ArgumentError, a wrong length along dims DimensionMismatch.
SparseIR.get_poles — Method
get_poles(dlr::DiscreteLehmannRepresentation)Get the pole locations ω̄_p for the DLR basis.
Returns a vector of pole locations on the real-frequency axis.
SparseIR.iscentrosymmetric — Method
iscentrosymmetric(kernel::AbstractKernel)Return whether the kernel satisfies K(x, y) == K(-x, -y) for all values of x and y. Defaults to false.
A centrosymmetric kernel can be block-diagonalized, speeding up the singular value expansion by a factor of 4.
SparseIR.npoints — Method
npoints(sampling::AbstractSampling)Get the number of sampling points.
SparseIR.npoles — Method
npoles(dlr::DiscreteLehmannRepresentation)Get the number of poles in the DLR basis.
SparseIR.overlap — Method
overlap(poly::PiecewiseLegendrePoly, f, xmin::Float64, xmax::Float64;
rtol=eps(), return_error=false, maxevals=10^4, points=Float64[])Evaluate overlap integral of poly with arbitrary function f.
Given the function f, evaluate the integral
∫_{xmin}^{xmax} dt f(t) poly(t)using adaptive Gauss-Legendre quadrature, where t is the variable of poly (τ for basis.u, ω for basis.v) and [xmin, xmax] must lie in its domain.
points is a sequence of break points in the integration interval where local difficulties of the integrand may occur (e.g. singularities, discontinuities).
SparseIR.overlap — Method
overlap(poly::PiecewiseLegendrePoly, f;
rtol=eps(), return_error=false, maxevals=10^4, points=Float64[])Evaluate overlap integral of poly with arbitrary function f using default range.
Given the function f, evaluate the integral of f times poly over the default integration range, using adaptive Gauss-Legendre quadrature:
∫₀^β dτ f(τ) U_l(τ) for poly = basis.u[l+1],
∫_{-ωmax}^{ωmax} dω f(ω) V_l(ω) for poly = basis.v[l+1].The default range of a function of imaginary time is [0, β], not its evaluation domain [-β, β].
points is a sequence of break points in the integration interval where local difficulties of the integrand may occur (e.g. singularities, discontinuities).
SparseIR.overlap — Method
overlap(polys::PiecewiseLegendrePolyVector, f;
rtol=eps(), return_error=false, maxevals=10^4, points=Float64[])Evaluate overlap integral of polys with arbitrary function f using default range.
Given the function f, evaluate the integral
∫ dt f(t) polys[i](t)for each polynomial in the vector using adaptive Gauss-Legendre quadrature with the default integration range: [0, β] for basis.u (so that overlap(basis.u, f)[l+1] is ∫₀^β dτ f(τ) U_l(τ)) and [-ωmax, ωmax] for basis.v.
SparseIR.sampling_points — Method
sampling_points(sampling::AbstractSampling)Return sampling points: a Vector{Float64} of imaginary times τ for a TauSampling, a Vector{FermionicFreq} or Vector{BosonicFreq} for a MatsubaraSampling. For a DLR, sampling_points(dlr) returns its poles.
SparseIR.to_IR — Function
to_IR(dlr::DiscreteLehmannRepresentation, g_dlr::AbstractArray, dims=1)Transform from DLR coefficients c_p to IR basis coefficients, for both statistics
G_l = -S_l Σ_p V_l(ω̄_p) c_p,i.e. to_IR(dlr, c) ≈ -dlr.basis.s .* (dlr.basis.v(dlr.poles) * c).
Arguments
dlr: The DLR basisg_dlr: DLR coefficientsdims: Dimension along which the DLR coefficients are stored
Returns
IR basis coefficients with the same shape as input, but with size length(dlr.basis) along dimension dims.
Element types, conversion and validation are as for from_IR.
- wallerberger2021https://doi.org/10.1103/PhysRevResearch.3.033168
- shinaoka2018https://doi.org/10.1103/PhysRevB.97.205111