Switched to sparse matrices

This commit is contained in:
Nuwan Yapa 2024-03-07 19:47:45 -05:00
parent dc545da8e8
commit 9741b0bb60
1 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
using SparseArrays
using NuclearToolkit
using SpecialFunctions
include("helper.jl")
@ -56,7 +57,7 @@ end
get_V_matrix(V_l, ls, ns) = throw("unimplemented")
function sp_T_matrix(ns, ls; ω=1.0, μ=1.0)
mat = zeros(length(ns), length(ns))
mat = spzeros(length(ns), length(ns))
for idx in CartesianIndices(mat)
(i, j) = Tuple(idx)
if ls[i] == ls[j]
@ -85,7 +86,7 @@ function Moshinsky_transform(Es, n1s, l1s, n2s, l2s, Λ)
dcgm0 = NuclearToolkit.prep_dcgm0(l_max);
d6j = NuclearToolkit.prep_d6j_int(E_max, j_max, to);
mat = zeros(length(Es), length(Es))
mat = spzeros(length(Es), length(Es))
s = hcat(Es, n1s, l1s, n2s, l2s)
for idx in CartesianIndices(mat)
(i, j) = Tuple(idx)