13
13
from triqs_tprf .tight_binding import TBLattice
14
14
from triqs_tprf .lattice import lattice_dyson_g0_wk
15
15
from triqs .gf .meshes import MeshDLRImFreq
16
+
16
17
from triqs_tprf .lattice import dlr_on_imfreq
17
18
from triqs_tprf .lattice import lindhard_chi00
18
19
20
+ from triqs_tprf .lattice_utils import imtime_bubble_chi0_wk
21
+
19
22
# ----------------------------------------------------------------------
20
23
21
24
@@ -39,6 +42,7 @@ def test_square_lattice_chi00_dlr():
39
42
40
43
n_k = (2 , 2 , 1 )
41
44
nw = 50
45
+ nw_f = 1024
42
46
lamb = 10.
43
47
eps = 1e-8
44
48
@@ -80,17 +84,37 @@ def test_square_lattice_chi00_dlr():
80
84
kmesh = t_r .get_kmesh (n_k )
81
85
e_k = t_r .fourier (kmesh )
82
86
87
+ wmesh = MeshImFreq (beta = beta , S = 'Fermion' , n_max = nw_f )
88
+ DLRwmesh = MeshDLRImFreq (beta , 'Fermion' , lamb , eps )
89
+
83
90
wmesh_bose = MeshImFreq (beta = beta , S = 'Boson' , n_max = nw )
84
91
DLRwmesh_bose = MeshDLRImFreq (beta , 'Boson' , lamb , eps )
85
92
86
-
87
93
print ('--> chi00_wk analytic' )
88
94
chi00_wk_analytic = lindhard_chi00 (e_k = e_k , mesh = wmesh_bose , mu = mu )
89
95
chi00_Dwk_analytic = lindhard_chi00 (e_k = e_k , mesh = DLRwmesh_bose , mu = mu )
90
96
91
97
print ('--> compare' )
92
98
compare_g_Dwk_and_g_wk (chi00_Dwk_analytic , chi00_wk_analytic )
93
99
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
+
94
118
# ----------------------------------------------------------------------
95
119
if __name__ == '__main__' :
96
120
test_square_lattice_chi00_dlr ()
0 commit comments