IR Basis
- class sparse_ir.FiniteTempBasis(statistics: str, beta: float, wmax: float, eps: float = np.float64(2.220446049250313e-16), sve_result: SVEResult | None = None, max_size: int = -1)
Intermediate representation (IR) basis for given temperature.
For a continuation kernel from real frequencies, ω ∈ [-ωmax, ωmax], to imaginary time, τ ∈ [0, beta], this class stores the truncated singular value expansion or IR basis:
\[K(\tau, \omega) \approx \sum_{l=0}^{L-1} U_l(\tau) S_l V_l(\omega),\]where U are the IR basis functions on the imaginary-time axis, stored in
u, S are the singular values, stored ins, and V are the IR basis functions on the real-frequency axis, stored inV. The IR basis functions in Matsubara frequency are stored inuhat.Example
The following example code assumes the spectral function is a single pole at ω = 2.5:
# Compute IR basis for fermions and β = 10, W <= 4.2 import sparse_ir 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 gl = basis.s * basis.v(2.5) giw = gl @ basis.uhat([1, 3, 5, 7])
- property accuracy
Overall accuracy bound.
- property beta
Inverse temperature
- default_matsubara_sampling_points(npoints=None, positive_only=False)
Get default Matsubara sampling points.
- default_omega_sampling_points(npoints=None)
Return default sampling points in imaginary time.
- Parameters:
npoints (int) –
Minimum number of sampling points to return.
Added in version 1.1.
- default_tau_sampling_points(npoints=None)
Get default tau sampling points.
- property kernel
The kernel used to generate the basis.
- property lambda_
Basis cutoff parameter, Λ = β * wmax
- rescale(new_beta)
Return a basis for different temperature.
Uses the same kernel with the same
eps, but a different temperature. Note that this implies a different UV cutoffwmax, sincelambda_ == beta * wmaxstays constant.
- property s
Vector of singular values of the continuation kernel
- property shape
Shape of the basis function set
- property significance
Relative significance of basis functions.
- property size
Number of basis functions / singular values
- property statistics
Quantum statistic (‘F’ for fermionic, ‘B’ for bosonic)
- property sve_result
The singular value expansion result.
- 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, use:
ultau = basis.u[l](tau) # l-th basis function at time tau
Note that u supports vectorization both over l and tau.
- 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:
û(n) = ∫₀^β dτ exp(iπnτ/β) u(τ)
To get the l-th basis function at some reduced frequency wn of some basis, use:
uln = basis.uhat[l](wn) # l-th basis function at freq wn
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 v
Basis functions on the real frequency axis.
Set of IR basis functions on the real frequency (omega) axis, where omega is a real number of magnitude less than
wmax. To get thel-th basis function at real frequencyomegaof some basisbasis, use:ulomega = basis.v[l](omega) # l-th basis function at freq. omega
Note that
vsupports vectorization both overlandomega. In particular, omitting the subscript yields a vector with all basis functions, evaluated at that position:basis.v(omega) == [basis.v[l](omega) for l in range(basis.size)]
Similarly, supplying a vector of omega points yields a matrix
A, whereA[l,n]corresponds to thel-th basis function evaluated atomega[n]:omega = [0.5, 1.0] basis.v(omega) == \ [[basis.v[l](t) for t in omega] for l in range(basis.size)]
- property wmax
Real frequency cutoff
Piecewise polynomials
- class sparse_ir.poly.PiecewiseLegendrePoly(funcs: FunctionSet, xmin: float, xmax: float)
Piecewise Legendre polynomial.
Models a function on the interval
[-1, 1]as a set of segments on the intervalsS[i] = [a[i], a[i+1]], where on each interval the function is expanded in scaled Legendre polynomials.- __call__(x)
Evaluate basis functions at given points.
Note
Additional polynomial classes are currently being refactored. Please refer to the concrete polynomial classes above for the current API.