From 3c72bbc7b63d9111540e002bd38ebd5ba05b08a9 Mon Sep 17 00:00:00 2001 From: Nuwan Yapa Date: Tue, 12 Mar 2024 18:46:52 -0400 Subject: [PATCH] Critical error in T matrix fixed --- ho_basis.jl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ho_basis.jl b/ho_basis.jl index b8992f6..a5f44e5 100644 --- a/ho_basis.jl +++ b/ho_basis.jl @@ -59,13 +59,11 @@ function sp_T_matrix(ns, ls; ω=1.0, μ=1.0) for idx in CartesianIndices(mat) (i, j) = Tuple(idx) if ls[i] == ls[j] - mat[idx] = ls[i] if ns[i] == ns[j] - mat[idx] += 1/4 * (4*ns[j] + 3) - elseif ns[i] == ns[j] + 1 - mat[idx] += -1/4 * sqrt((2*ns[j] + 2) * (2*ns[j] + 3)) - elseif ns[i] == ns[j] - 1 - mat[idx] += -1/4 * sqrt((2*ns[j] + 1) * 2*ns[j]) + mat[idx] = ns[j] + ls[i]/2 + 3/4 + elseif abs(ns[i]-ns[j]) == 1 + n_max = max(ns[i], ns[j]) + mat[idx] = -(1/2) * sqrt(n_max * (n_max + ls[i] + 1/2)) end end end