@@ -29,8 +29,9 @@ function generate_grid(eps::T, Lambda::T, n_trunc::T, space::Symbol=:τ, regular
29
29
30
30
# generate fine n grid
31
31
32
- # ngrid = nGrid_test(true, T(Lambda), 12, T(1.5))
33
- ngrid = uni_ngrid (true , T (n_trunc* Lambda))
32
+ ngrid = nGrid_test (true , T (Lambda), 12 , T (1.5 ))
33
+ # ngrid = uni_ngrid(true, T(n_trunc*Lambda))
34
+ fine_ngrid = uni_ngrid (true , T (n_trunc* Lambda))
34
35
omega = (2 * ngrid.+ 1 )* π
35
36
dlr = DLRGrid (Lambda, beta, eps, true , :none , dtype= T)
36
37
@@ -89,19 +90,28 @@ function generate_grid(eps::T, Lambda::T, n_trunc::T, space::Symbol=:τ, regular
89
90
end
90
91
91
92
maxidx = searchsortedfirst (eig. S./ eig. S[1 ], 1e-16 , rev= true )
92
-
93
+ fine_n_idx = zeros (Int, length (n_grid))
94
+ fidx = 1
95
+ for i in eachindex (n_grid)
96
+ while Int (n_grid[i]) != Int (fine_ngrid[fidx])
97
+ fidx += 1
98
+ end
99
+ fine_n_idx[i] = fidx
100
+ end
101
+ print (" test idx: $(fine_ngrid[fine_n_idx]) $(n_grid) \n " )
102
+ Kn_fine = Kfunc_freq (wgrid, Int .(fine_ngrid), weight_w, regular, omega0)
93
103
# This test with U matrix
94
104
# n space sparse grid: n_grid
95
105
# n space fine grid: ngrid
96
106
# τ space sparse grid: tau_grid
97
107
# τ space fine grid: tgrid
98
108
99
- test_err (dlr, tau_grid, tgrid, tgrid, :τ , :τ , Un_full[:, 1 : maxidx], n_idx, Utau_full[:, 1 : maxidx], tau_idx, collect (1 : maxidx), idx;
109
+ # test_err(dlr, tau_grid, tgrid, tgrid, :τ, :τ, Un_full[:, 1:maxidx], n_idx, Utau_full[:, 1:maxidx], tau_idx, collect(1:maxidx), idx;
100
110
# test_err(dlr, Int.(n_grid), Int.(ngrid), tgrid, :n, :τ, Un_full[:, 1:maxidx], n_idx, Utau_full[:, 1:maxidx], tau_idx, collect(1:maxidx), idx;
101
-
111
+
102
112
# This test with K matrix
103
113
# test_err(dlr, Int.(n_grid), Int.(ngrid), t_grid, :n, :τ, Kn, n_idx, Ktau, tau_idx, omega_idx, idx;
104
-
114
+ test_err (dlr, Int .(n_grid), Int .(fine_ngrid), t_grid, :n , :τ , Kn_fine, fine_n_idx, Ktau, tau_idx, omega_idx, idx;
105
115
case = " SemiCircle" , hasnoise = true , hasweight= hasweight, weight_tau = sqrt .(weight_t))
106
116
107
117
filename = " newDLReig.txt"
@@ -226,7 +236,7 @@ if abspath(PROGRAM_FILE) == @__FILE__
226
236
isFermi = true
227
237
symmetry = :none
228
238
beta = datatype (1.0 )
229
- Lambda = datatype (3000 )
239
+ Lambda = datatype (100000 )
230
240
eps = datatype (1e-6 )
231
241
n_trunc = datatype (10 ) # omega_n is truncated at n_trunc * Lambda
232
242
expan_trunc = 100
0 commit comments