Sparse sampling#
We consider how to compute the \(L\) expansion coefficients of a Green’s function in IR from its numerical values known on a finite set of imaginary times or imaginary frequencies. This builds on the IR expansion
introduced in Intermediate representation (IR).
The idea of the sparse sampling is simple. If we want to determine \(L\) coefficients \(G_l\), we need to know \(G(\tau)\) on only up to \(L\) sampling points. Let \(\bar{\tau}_1 < \cdots < \bar{\tau}_{N_\mathrm{smpl}}\) (\(N_\mathrm{smpl}\ge L\)) be such sampling points, one can evaluate the expansion coefficients as
where we define \((\Fmat)_{kl} = U_l(\tauk)\) and \(\Fmat^+\) is its pseudo inverse. The numerical stability of this ``fitting’’ scheme is determined by the condition number of the coefficient matrix \(\Fmat\). An empirically good choice, which the libraries use by default, is to use the roots of \(U_L(\tau)\), the first singular function beyond the basis; they lie in \((0, \beta)\). From experience, the fitting can be done in the most stable way using SVD of the fitting matrix (already implemented in sparse-ir).
The following figure shows the default sampling points in the imaginary-time domain generated for \(\beta=10\) and \(\wmax=10\) (\(L=30\)), together with \(U_L(\tau)\), whose roots they are.
One can transform numerical data in the Matsubara-frequency domain using sparse-sampling techniques [Li et al., 2020]. For fermions, the IR basis functions \(\hat U_l(\iv)\) are purely imaginary for even \(l\) and real for odd \(l\); for bosons it is the other way round. Although the basis functions \(\hat U_l(\iv)\) are defined only on discrete points, the respective parts have sign structures similarly to those of \(U_l(\tau)\). The default sampling frequencies are the sign changes of the first discarded transform \(\hat U_l(\iv)\), with \(l \ge L\) chosen to fit the parity; bosonic sets always include \(n = 0\) (see Notation and conventions). The figure shown below shows \(\hat U_l(\iv)\) for \(l = 9\) and for the largest \(l = L-1\) of the given basis as well as the sampling frequencies. A sign change generally takes place between two adjacent Matsubara frequencies. A segment between two adjacent “roots” of \(\hat U_{L-1}(\iv)\) contains at least one sampling point.
Let \(\bar{\nu}_1 < \cdots < \bar{\nu}_{N_\mathrm{smpl}}\) (\(N_\mathrm{smpl}\ge L\)) be such sampling frequencies, one can evaluate the expansion coefficients as
where \((\hat{\Fmat})_{kl} = \hat U_l(\ii\vk)\).
If \(G(-\iv) = G(\iv)^*\) (real coefficients \(G_l\)), MatsubaraSampling(basis, positive_only=True) samples only the non-negative frequencies \(n \ge 0\).
The following figure shows the sampling points in the imaginary-frequency domain generated for \(\beta=10\) and \(\wmax=10\).
Condition number#
The condition number of the fitting scales roughly as \(\sqrt{\Lambda}\).
cond_tau = []
cond_matsu = []
lambdas = [1e+1, 1e+2, 1e+3, 1e+4, 1e+5]
for lambda_ in lambdas:
basis = sparse_ir.FiniteTempBasis("F", beta, lambda_/beta, eps=1e-15)
cond_tau.append(sparse_ir.TauSampling(basis).cond)
cond_matsu.append(sparse_ir.MatsubaraSampling(basis).cond)
plt.loglog(lambdas, cond_tau, marker="o", label="time")
plt.loglog(lambdas, cond_matsu, marker="x", label="frequency")
plt.loglog(lambdas, np.sqrt(lambdas), marker="", ls="--", label=r"$\sqrt{\Lambda}$")
plt.xlabel(r"$\Lambda$")
plt.ylabel("Condition number")
plt.legend(frameon=False)
plt.show()