gftool.fourier.tau2iv_dft¶
-
gftool.fourier.
tau2iv_dft
(gf_tau, beta)[source]¶ Discrete Fourier transform of the real Green’s function gf_tau.
Fourier transformation of a bosonic imaginary-time Green’s function to Matsubara domain. The Fourier integral is replaced by a Riemann sum giving a discrete Fourier transform (DFT). We assume a real Green’s function gf_tau, which is the case for commutator Green’s functions \(G_{AB}(τ) = ⟨A(τ)B⟩\) with \(A = B^†\). The Fourier transform gf_iv is then Hermitian.
- Parameters
- gf_tau(…, N_tau) float np.ndarray
The Green’s function at imaginary times \(τ \in [0, β]\).
- betafloat
The inverse temperature \(beta = 1/k_B T\).
- Returns
- gf_iv(…, (N_iv + 1)/2) float np.ndarray
The Fourier transform of gf_tau for non-negative bosonic Matsubara frequencies \(iν_n\).
See also
tau2iv_ft_lin
Fourier integration using Filon’s method
Examples
>>> BETA = 50 >>> tau = np.linspace(0, BETA, num=2049, endpoint=True) >>> ivs = gt.matsubara_frequencies_b(range((tau.size+1)//2), beta=BETA)
>>> poles, weights = np.random.random(10), np.random.random(10) >>> weights = weights/np.sum(weights) >>> gf_tau = gt.pole_gf_tau(tau, poles=poles, weights=weights, beta=BETA) >>> gf_dft = gt.fourier.tau2iv_dft(gf_tau, beta=BETA) >>> gf_tau.size, gf_dft.size (2049, 1025) >>> gf_iv = gt.pole_gf_z(ivs, poles=poles, weights=weights)
>>> import matplotlib.pyplot as plt >>> __ = plt.plot(gf_iv.imag, label='exact Im') >>> __ = plt.plot(gf_dft.imag, '--', label='DFT Im') >>> __ = plt.plot(gf_iv.real, label='exact Re') >>> __ = plt.plot(gf_dft.real, '--', label='DFT Re') >>> __ = plt.legend() >>> plt.show()
>>> __ = plt.title('Error growing with frequency') >>> __ = plt.plot(abs(gf_iv - gf_dft)) >>> plt.yscale('log') >>> plt.show()
The method is resistant against noise:
>>> magnitude = 2e-3 >>> noise = np.random.normal(scale=magnitude, size=gf_tau.size) >>> gf_dft_noisy = gt.fourier.tau2iv_dft(gf_tau + noise, beta=BETA) >>> __ = plt.plot(abs(gf_iv - gf_dft_noisy), '--', label='noisy') >>> __ = plt.axhline(magnitude, color='black') >>> __ = plt.plot(abs(gf_iv - gf_dft), label='clean') >>> __ = plt.legend() >>> # plt.yscale('log') >>> plt.show()