diff --git a/ho_basis.jl b/ho_basis.jl index e1cc7ed..d97f53a 100644 --- a/ho_basis.jl +++ b/ho_basis.jl @@ -49,7 +49,23 @@ end get_V_matrix(V_l, ls, ns) = throw("unimplemented") -get_T_matrix(ns, ls) = throw("unimplemented") +function sp_T_matrix(ns, ls) + mat = zeros(length(ns), length(ns)) + 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]) + end + end + end + return mat +end get_H_matrix(V_l, ns, ls) = get_T_matrix(ns, ls) + get_V_matrix(V_l, ns, ls)