From b0f650f2e388889455bd80601b02f812cf2f34fc Mon Sep 17 00:00:00 2001 From: Nuwan Yapa Date: Wed, 30 Oct 2024 18:04:16 -0400 Subject: [PATCH] Parallelized --- ho_basis.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ho_basis.jl b/ho_basis.jl index e884f76..c956845 100644 --- a/ho_basis.jl +++ b/ho_basis.jl @@ -158,11 +158,11 @@ function get_jacobi_V2_matrix(V_of_r, E_max, Λ, μω_global; atol=10^-6, maxeva end function get_2p_p1p2_matrix(n1s, l1s, n2s, l2s, Λ, μ1ω1, μ2ω2) - mat = spzeros(Float64, length(n1s), length(n1s)) - for idx in CartesianIndices(mat) + mat = zeros(Float64, length(n1s), length(n1s)) + Threads.@threads for idx in CartesianIndices(mat) (i, j) = Tuple(idx) val = racahs_reduction_formula(n1s[i], l1s[i], n2s[i], l2s[i], n1s[j], l1s[j], n2s[j], l2s[j], Λ, μ1ω1, μ2ω2) if !(val ≈ 0); mat[idx] = val; end end - return mat + return sparse(mat) end