29 subroutine direct(npw,kvec,evec,eval)
37 integer,
intent(in) :: npw
38 real(8),
intent(in) :: kvec(3)
39 complex(8),
intent(out) :: evec(npw,nbnd)
40 real(8),
intent(out) :: eval(nbnd)
42 integer :: info, ipw, jpw, lwork, dmill(3)
43 real(8) :: rwork(3*npw-2), eval_full(npw), kgv(3)
44 complex(8) :: ham(npw,npw), &
45 & VksG(g_rh%nft(1), g_rh%nft(2), g_rh%nft(3))
46 complex(8),
allocatable :: work(:)
55 dmill(1:3) = modulo(dmill(1:3),
g_rh%nft(1:3)) + 1
56 ham(jpw,ipw) = vksg(dmill(1), dmill(2), dmill(3))
63 kgv(1:3) = kvec(1:3) + matmul(
bvec(1:3,1:3), dble(
g_wf%mill(1:3,
g_wf%map(ipw))))
64 ham(ipw,ipw) = ham(ipw,ipw) + 0.5d0 * dot_product(kgv,kgv)
69 call zheev(
'V',
'U', npw, ham, npw, eval_full, work, lwork, rwork, info)
70 lwork = nint(dble(work(1)))
73 call zheev(
'V',
'U', npw, ham, npw, eval_full, work, lwork, rwork, info)
76 eval( 1:nbnd) = eval_full(1:nbnd)
77 evec(1:npw,1:nbnd) = ham(1:npw,1:nbnd)