Parallelized V matrix construction
This commit is contained in:
parent
84a3c61cd5
commit
47b02cf78a
|
|
@ -71,14 +71,14 @@ function sp_T_matrix(ns, ls; ω=1.0, μ=1.0)
|
||||||
end
|
end
|
||||||
|
|
||||||
function sp_V_matrix(V_l, ns, ls; dtype=Float64)
|
function sp_V_matrix(V_l, ns, ls; dtype=Float64)
|
||||||
mat = spzeros(dtype, length(ns), length(ns))
|
mat = zeros(dtype, length(ns), length(ns))
|
||||||
for idx in CartesianIndices(mat)
|
Threads.@threads for idx in CartesianIndices(mat)
|
||||||
(i, j) = Tuple(idx)
|
(i, j) = Tuple(idx)
|
||||||
if ls[i] == ls[j]
|
if ls[i] == ls[j]
|
||||||
mat[idx] = V_l(ls[i], ns[i], ns[j])
|
mat[idx] = V_l(ls[i], ns[i], ns[j])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return mat
|
return sparse(mat)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Moshinsky_transform(Es, n1s, l1s, n2s, l2s, Λ)
|
function Moshinsky_transform(Es, n1s, l1s, n2s, l2s, Λ)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue