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