s.p. T matrix (untested)
This commit is contained in:
parent
1d84deedcb
commit
da91031577
18
ho_basis.jl
18
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)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue