From af1391197c52a59a7fce8382f348d475546923fc Mon Sep 17 00:00:00 2001 From: Nuwan Yapa Date: Tue, 23 Apr 2024 13:40:21 -0400 Subject: [PATCH] 3 boson resonance from ComplexScaling-FV paper --- 3body_resonance.jl | 52 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 3body_resonance.jl diff --git a/3body_resonance.jl b/3body_resonance.jl new file mode 100644 index 0000000..e1d67c5 --- /dev/null +++ b/3body_resonance.jl @@ -0,0 +1,52 @@ +using Arpack, SparseArrays +include("ho_basis.jl") +include("p_space.jl") + +Λ = 0 +m = 1.0 +V_of_r(r) = 2 * exp(-(r-3)^2 / (1.5)^2) + +E_max = 24 +μω_global = 0.5 * exp(-2im * pi / 9) + +# due to Jacobi coordinates +μ1ω1 = μω_global * 1/2 +μ2ω2 = μω_global * 2 +μ1 = m * 1/2 +μ2 = m * 2/3 + +println("No of threads = ", Threads.nthreads()) + +@time "Basis" begin + Es, n1s, l1s, n2s, l2s = get_2p_basis(E_max) + l_max = max(maximum(l1s), maximum(l2s)) + n_max = max(maximum(n1s), maximum(n2s)) + mask1 = (n2s .== n2s') .&& (l2s .== l2s') + mask2 = (n1s .== n1s') .&& (l1s .== l1s') +end + +println("Basis size = ", length(Es)) + +println("Constructing KE matrices") + +@time "T1" T1 = sp_T_matrix(n1s, l1s; mask=mask1, μω_gen=μ1ω1, μ=μ1) +@time "T2" T2 = sp_T_matrix(n2s, l2s; mask=mask2, μω_gen=μ2ω2, μ=μ2) + +println("Constructing PE matrices") + +V1_elem(l, n1, n2) = V_numerical(V_of_r, l, n1, n2; μω_gen=μ1ω1) +V_relative_elem(l, n1, n2) = V_numerical(V_of_r, l, n1, n2; μω_gen=μω_global) +V1_cache = fill(Complex(NaN), 1+l_max, 1+n_max, 1+n_max) +V_relative_cache = fill(Complex(NaN), 1+l_max, 1+n_max, 1+n_max) + +@time "V1" V1 = sp_V_matrix(V1_elem, n1s, l1s; mask=mask1, dtype=ComplexF64, cache=V1_cache) +@time "V relative" V_relative = sp_V_matrix(V_relative_elem, n1s, l1s; mask=mask1, dtype=ComplexF64, cache=V_relative_cache) + sp_V_matrix(V_relative_elem, n2s, l2s; mask=mask2, dtype=ComplexF64, cache=V_relative_cache) +@time "Moshinsky brackets" U = Moshinsky_transform(Es, n1s, l1s, n2s, l2s, Λ) +@time "V2" V2 = U' * V_relative * U + +println("Calculating spectrum") + +@time "H" H = T1 + T2 + V1 + V2 +@time "Eigenvalues" evals, _ = eigs(H, nev=5, ncv=50, which=:LI, maxiter=5000, tol=1e-5, ritzvec=false, check=1) + +display(evals) \ No newline at end of file