Skip to content

Commit f970d34

Browse files
committed
[test] imtime_bubble_chi0_wk static DLR implementation test
1 parent d81db51 commit f970d34

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

test/python/chi00_square_lattice_dlr.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@
1313
from triqs_tprf.tight_binding import TBLattice
1414
from triqs_tprf.lattice import lattice_dyson_g0_wk
1515
from triqs.gf.meshes import MeshDLRImFreq
16+
1617
from triqs_tprf.lattice import dlr_on_imfreq
1718
from triqs_tprf.lattice import lindhard_chi00
1819

20+
from triqs_tprf.lattice_utils import imtime_bubble_chi0_wk
21+
1922
# ----------------------------------------------------------------------
2023

2124

@@ -39,6 +42,7 @@ def test_square_lattice_chi00_dlr():
3942

4043
n_k = (2, 2, 1)
4144
nw = 50
45+
nw_f = 1024
4246
lamb = 10.
4347
eps = 1e-8
4448

@@ -80,17 +84,37 @@ def test_square_lattice_chi00_dlr():
8084
kmesh = t_r.get_kmesh(n_k)
8185
e_k = t_r.fourier(kmesh)
8286

87+
wmesh = MeshImFreq(beta=beta, S='Fermion', n_max=nw_f)
88+
DLRwmesh = MeshDLRImFreq(beta, 'Fermion', lamb, eps)
89+
8390
wmesh_bose = MeshImFreq(beta=beta, S='Boson', n_max=nw)
8491
DLRwmesh_bose = MeshDLRImFreq(beta, 'Boson', lamb, eps)
8592

86-
8793
print('--> chi00_wk analytic')
8894
chi00_wk_analytic = lindhard_chi00(e_k=e_k, mesh=wmesh_bose, mu=mu)
8995
chi00_Dwk_analytic = lindhard_chi00(e_k=e_k, mesh=DLRwmesh_bose, mu=mu)
9096

9197
print('--> compare')
9298
compare_g_Dwk_and_g_wk(chi00_Dwk_analytic, chi00_wk_analytic)
9399

100+
print('--> g0_wk')
101+
g0_wk = lattice_dyson_g0_wk(mu=mu, e_k=e_k, mesh=wmesh)
102+
103+
print('--> g0_Dwk')
104+
g0_Dwk = lattice_dyson_g0_wk(mu=mu, e_k=e_k, mesh=DLRwmesh)
105+
106+
print('--> chi00_wk')
107+
chi00_wk = imtime_bubble_chi0_wk(g0_wk, nw=1, verbose=False)
108+
109+
print('--> chi00_wk_DLR')
110+
chi00_wk_DLR = imtime_bubble_chi0_wk(g0_Dwk, nw=1, verbose=False)
111+
112+
diff = np.max(np.abs(chi00_wk.data - chi00_wk_DLR.data))
113+
print(f'diff = {diff:2.2E}')
114+
115+
np.testing.assert_array_almost_equal(chi00_wk.data, chi00_wk_DLR.data, decimal=4)
116+
117+
94118
# ----------------------------------------------------------------------
95119
if __name__ == '__main__':
96120
test_square_lattice_chi00_dlr()

0 commit comments

Comments
 (0)