6 subroutine genephmat(iq,ik,de,a,dvmt,dvir,ephmat)
11 integer,
intent(in) :: iq,ik
12 real(8),
intent(in) :: de
13 complex(8),
intent(in) :: a(nbph,nbph)
14 complex(8),
intent(in) :: dvmt(npcmtmax,natmtot,nbph),dvir(ngtc,nbph)
15 complex(8),
intent(out) :: ephmat(nstsv,nstsv,nbph)
17 integer jk,jkq,isym,ld
18 integer nst,nstq,ist,jst
19 integer ispn,jspn,is,ias
20 integer npc,nq,igp,i,j,l
23 integer idx(nstsv),idxq(nstsv)
24 integer ngp(nspnfv),ngpq(nspnfv)
25 complex(4) cfmt1(npcmtmax),cfmt2(npcmtmax),c(ngkmax)
28 integer,
allocatable :: igpig(:,:),igpqig(:,:)
29 complex(4),
allocatable :: wfmt(:,:,:,:),wfgp(:,:,:)
30 complex(4),
allocatable :: wfmtq(:,:,:,:),wfgpq(:,:,:)
31 complex(4),
allocatable :: wfir1(:),wfir2(:)
35 vpql(1:3)=
vkl(1:3,ik)+
vql(1:3,iq)
52 allocate(igpig(ngkmax,nspnfv))
53 allocate(wfmt(npcmtmax,natmtot,
nspinor,nst),wfgp(ngkmax,
nspinor,nst))
54 call genwfsvp_sp(.false.,.true.,nst,idx,
ngridg,
igfft,
vkl(:,ik),ngp,igpig,wfmt, &
56 allocate(igpqig(ngkmax,nspnfv))
57 allocate(wfmtq(npcmtmax,natmtot,
nspinor,nstq),wfgpq(ngkmax,
nspinor,nstq))
58 call genwfsvp_sp(.false.,.true.,nstq,idxq,
ngridg,
igfft,vpql,ngpq,igpqig,wfmtq, &
61 ephmat(1:nstsv,1:nstsv,1:nbph)=0.d0
73 cfmt1(1:npc)=wfmtq(1:npc,ias,1,i)*conjg(wfmt(1:npc,ias,1,j)) &
74 +wfmtq(1:npc,ias,2,i)*conjg(wfmt(1:npc,ias,2,j))
76 cfmt1(1:npc)=wfmtq(1:npc,ias,1,i)*conjg(wfmt(1:npc,ias,1,j))
80 ephmat(ist,jst,l)=ephmat(ist,jst,l) &
81 +dot_product(cfmt2(1:npc),dvmt(1:npc,ias,l))
86 deallocate(wfmt,wfmtq)
90 allocate(wfir1(ngtc),wfir2(ngtc))
99 wfir1(
igfc(igpig(igp,jspn)))=wfgp(igp,ispn,j)
104 wfir2(1:ngtc)=dvir(1:ngtc,l)*wfir1(1:ngtc)
108 c(igp)=wfir2(
igfc(igpqig(igp,jspn)))
113 ephmat(ist,jst,l)=ephmat(ist,jst,l) &
114 +dot_product(wfgpq(1:nq,ispn,i),c(1:nq))
119 deallocate(wfir1,wfir2)
126 x(1:nbph)=ephmat(ist,jst,1:nbph)
127 call zgemv(
'T',nbph,nbph,
zone,a,nbph,x,1,
zzero,ephmat(ist,jst,1),ld)
130 deallocate(igpig,igpqig,wfgp,wfgpq)
integer, dimension(maxspecies) npcmt
integer, dimension(3) ngridg
real(8), dimension(:,:), allocatable evalsv
subroutine genwfsvp_sp(tsh, tgp, nst, idx, ngridg_, igfft_, vpl, ngp, igpig, wfmt, ld, wfir)
integer, dimension(:,:,:), allocatable ivkik
complex(8), parameter zone
subroutine genephmat(iq, ik, de, a, dvmt, dvir, ephmat)
subroutine cfsht(nr, nri, cfmt1, cfmt2)
subroutine cfftifc(nd, n, sgn, c)
integer, dimension(:), allocatable igfft
integer, dimension(:), allocatable igfc
real(8), dimension(:,:), allocatable vql
complex(8), parameter zzero
real(8), dimension(:,:), allocatable vkl
integer, dimension(maxatoms *maxspecies) idxis
integer, dimension(3) ngdgc
integer, dimension(maxspecies) nrcmt
integer, dimension(maxspecies) nrcmti
subroutine findkpt(vpl, isym, ik)
integer, dimension(2) jspnfv
integer, dimension(:,:), allocatable ivk