From 9741b0bb60c69239a1fa82cb89c6cc263ba21cda Mon Sep 17 00:00:00 2001 From: Nuwan Yapa Date: Thu, 7 Mar 2024 19:47:45 -0500 Subject: [PATCH] Switched to sparse matrices --- ho_basis.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ho_basis.jl b/ho_basis.jl index b77939e..82d8238 100644 --- a/ho_basis.jl +++ b/ho_basis.jl @@ -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)