Critical error in T matrix fixed

This commit is contained in:
Nuwan Yapa 2024-03-12 18:46:52 -04:00
parent 4175152a8d
commit 3c72bbc7b6
1 changed files with 4 additions and 6 deletions

View File

@ -59,13 +59,11 @@ function sp_T_matrix(ns, ls; ω=1.0, μ=1.0)
for idx in CartesianIndices(mat) 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] = ls[i]
if ns[i] == ns[j] if ns[i] == ns[j]
mat[idx] += 1/4 * (4*ns[j] + 3) mat[idx] = ns[j] + ls[i]/2 + 3/4
elseif ns[i] == ns[j] + 1 elseif abs(ns[i]-ns[j]) == 1
mat[idx] += -1/4 * sqrt((2*ns[j] + 2) * (2*ns[j] + 3)) n_max = max(ns[i], ns[j])
elseif ns[i] == ns[j] - 1 mat[idx] = -(1/2) * sqrt(n_max * (n_max + ls[i] + 1/2))
mat[idx] += -1/4 * sqrt((2*ns[j] + 1) * 2*ns[j])
end end
end end
end end