Skip to content

Commit b686c51

Browse files
committed
minor update
1 parent ed47e5c commit b686c51

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

test/svd.jl

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ function generate_grid(eps::T, Lambda::T, n_trunc::T, space::Symbol=:τ, regular
2929

3030
# generate fine n grid
3131

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))
3435
omega = (2*ngrid.+1)* π
3536
dlr = DLRGrid(Lambda, beta, eps, true, :none, dtype=T)
3637

@@ -89,19 +90,28 @@ function generate_grid(eps::T, Lambda::T, n_trunc::T, space::Symbol=:τ, regular
8990
end
9091

9192
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)
93103
# This test with U matrix
94104
# n space sparse grid: n_grid
95105
# n space fine grid: ngrid
96106
# τ space sparse grid: tau_grid
97107
# τ space fine grid: tgrid
98108

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;
100110
#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+
102112
# This test with K matrix
103113
#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;
105115
case = "SemiCircle", hasnoise = true, hasweight=hasweight, weight_tau = sqrt.(weight_t))
106116

107117
filename = "newDLReig.txt"
@@ -226,7 +236,7 @@ if abspath(PROGRAM_FILE) == @__FILE__
226236
isFermi = true
227237
symmetry = :none
228238
beta = datatype(1.0)
229-
Lambda = datatype(3000)
239+
Lambda = datatype(100000)
230240
eps = datatype(1e-6)
231241
n_trunc = datatype(10) #omega_n is truncated at n_trunc * Lambda
232242
expan_trunc = 100

0 commit comments

Comments
 (0)