From 6d1ffa0c0c6d3fd43de0a3e29f939fa29e6b5e96 Mon Sep 17 00:00:00 2001 From: Nuwan Yapa Date: Thu, 22 Feb 2024 19:24:59 -0500 Subject: [PATCH] XZ method for new system --- XZ_technique.jl | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/XZ_technique.jl b/XZ_technique.jl index bab5589..b037a49 100644 --- a/XZ_technique.jl +++ b/XZ_technique.jl @@ -4,11 +4,11 @@ include("p_space.jl") μ = 0.5 l = 0 -V1 = -5 -R1 = sqrt(3) -V2 = 2 -R2 = sqrt(10) -n_max = 15 +V1 = -8.6 +R1 = 1.75 +V2 = 3.4 +R2 = 3.2 +n_max = 20 ns = collect(0:n_max) ls = fill(l, n_max + 1) @@ -16,29 +16,35 @@ ls = fill(l, n_max + 1) T = 1/μ * sp_T_matrix(ns, ls) V = V1 .* V_Gaussian.(R1, l, ns, transpose(ns)) + V2 .* V_Gaussian.(R2, l, ns, transpose(ns)) -n_EC = 4 -train_cs = (0.7 .+ 0.05 * randn(n_EC)) - 1im * (0.2 .+ 0.05 * randn(n_EC)) -target_cs = range(0.77, 0.22, 6) +n_EC = 16 +train_cs = (2.2 - 0.7im) .+ (0.1 .* randn(n_EC)) .+ (0.1im * randn(n_EC)) +target_cs = range(2.0, 0.8, 6) train_E = zeros(ComplexF64, n_EC) EC_basis = zeros(ComplexF64, (n_max + 1, length(train_cs))) exact_E = zeros(ComplexF64, length(target_cs)) extrapolate_E = similar(exact_E) -near_E = 0.2 + 0.2im +near_E_bound = 1.5 + 1.2im for (j, c) in enumerate(train_cs) H = T + c .* V evals, evecs = eigen(H) - i = argmin(abs.(evals .- near_E)) + i = argmin(abs.(evals .- near_E_bound)) train_E[j] = evals[i] EC_basis[:, j] = evecs[:, i] end N_EC = transpose(EC_basis) * EC_basis +near_E_res = 1.5 - 0.4im + for (j, c) in enumerate(target_cs) - exact_E[j] = quick_pole_E((p, q) -> c*(V1*g0(R1, p, q) + V2*g0(R2, p, q)), μ; cs_angle=0.5) + mesh_p, mesh_w = get_mesh([0, 8 * exp(-0.5im)], 256) + p_space_H = get_H_matrix((p, q) -> c*(V1*g0(R1, p, q) + V2*g0(R2, p, q)), mesh_p, mesh_w, μ) + evals = eigvals(p_space_H) + i = argmin(abs.(evals .- near_E_res)) + exact_E[j] = evals[i] H = T + c .* V H_EC = transpose(EC_basis) * H * EC_basis @@ -50,5 +56,5 @@ end scatter(real.(train_E), imag.(train_E), label="training") scatter!(real.(exact_E), imag.(exact_E), label="exact") scatter!(real.(extrapolate_E), imag.(extrapolate_E), label="extrapolated") -xlims!(-0.2,0.3) -ylims!(-0.3,0.3) +xlims!(-0.5,2.0) +ylims!(-1.5,1.5)