Parallelized

This commit is contained in:
Nuwan Yapa 2024-10-30 18:04:16 -04:00
parent 262ab3d426
commit b0f650f2e3
1 changed files with 3 additions and 3 deletions

View File

@ -158,11 +158,11 @@ function get_jacobi_V2_matrix(V_of_r, E_max, Λ, μω_global; atol=10^-6, maxeva
end end
function get_2p_p1p2_matrix(n1s, l1s, n2s, l2s, Λ, μ1ω1, μ2ω2) function get_2p_p1p2_matrix(n1s, l1s, n2s, l2s, Λ, μ1ω1, μ2ω2)
mat = spzeros(Float64, length(n1s), length(n1s)) mat = zeros(Float64, length(n1s), length(n1s))
for idx in CartesianIndices(mat) Threads.@threads for idx in CartesianIndices(mat)
(i, j) = Tuple(idx) (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) 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 if !(val 0); mat[idx] = val; end
end end
return mat return sparse(mat)
end end