[Pw_forum] how to get one-electron kinetic energy for each orbit
张珅
alanzs at mail.ustc.edu.cn
Fri Nov 15 17:41:24 CET 2013
Dear all:
I want to get kinetic energy for each orbit using pwscf. I have read electron.f90,
c_bands.f90, g2_kin.f90, cegterg.f90, h_psi.f90.
I figure out that for each k points, in g2_kin.f90 it calculate (k+G)**2, and in cegterg.f90
psi is normalized, and then it calls h_psi.f90 to calculate \h|\psi>. I added a 'write' command
to print <\psi|(k+G)**2|\psi> and <\psi|\psi> at the beginning of h_psi. However, the results
is somehow suspicious because <\psi|\psi> is not normalized and is different for each orbit.
Can anybody tell me how to get the kinetic energy for each orbit?
Thank you very much!
I use qe-4.3.2.
Source code of cegterg.f90 begin with 258 line
...
...
! ... "normalize" correction vectors psi(:,nb1:nbase+notcnv) in
! ... order to improve numerical stability of subspace diagonalization
! ... (cdiaghg) ew is used as work array :
!
! ... ew = <psi_i|psi_i>, i = nbase + 1, nbase + notcnv
!
DO n = 1, notcnv
!
nbn = nbase + n
!
IF ( npol == 1 ) THEN
!
ew(n) = ddot( 2*npw, psi(1,1,nbn), 1, psi(1,1,nbn), 1 )
!
ELSE
!
ew(n) = ddot( 2*npw, psi(1,1,nbn), 1, psi(1,1,nbn), 1 ) + &
ddot( 2*npw, psi(1,2,nbn), 1, psi(1,2,nbn), 1 )
!
END IF
!
END DO
!
CALL mp_sum( ew( 1:notcnv ), intra_pool_comm )
!
DO n = 1, notcnv
!
psi(:,:,nbase+n) = psi(:,:,nbase+n) / SQRT( ew(n) )
WRITE(stdout,'(5X,"n=",I5,5X,"ew=",F16.9)')n,ew(n)
!
END DO
!
! ... here compute the hpsi and spsi of the new functions
!
!
CALL h_psi( npwx, npw, notcnv, psi(1,1,nb1), hpsi(1,1,nb1) )
Source code of h_psi
...
...
DO ibnd = 1, m
hpsi (1:n, ibnd) = g2kin (1:n) * psi (1:n, ibnd)
hpsi (n+1:lda,ibnd) = (0.0_dp, 0.0_dp)
kin_psi (1:n, ibnd) = DCONJG(psi(1:n,ibnd))*g2kin (1:n) * psi (1:n, ibnd)
kin_psi (n+1:lda,ibnd) = (0.0_dp, 0.0_dp)
rho_psi (1:n, ibnd) = DCONJG(psi(1:n,ibnd)) * psi (1:n, ibnd)
rho_psi (n+1:lda,ibnd) = (0.0_dp, 0.0_dp)
IF ( noncolin ) THEN
hpsi (lda+1:lda+n, ibnd) = g2kin (1:n) * psi (lda+1:lda+n, ibnd)
hpsi (lda+n+1:lda*npol, ibnd) = (0.0_dp, 0.0_dp)
kin_psi (lda+1:lda+n, ibnd)=DCONJG(psi (lda+1:lda+n, ibnd))*&
g2kin (1:n) *psi (lda+1:lda+n, ibnd)
kin_psi (lda+n+1:lda*npol, ibnd) = (0.0_dp, 0.0_dp)
rho_psi (lda+1:lda+n, ibnd)=DCONJG(psi (lda+1:lda+n, ibnd))*&
psi(lda+1:lda+n, ibnd)
rho_psi (lda+n+1:lda*npol, ibnd) = (0.0_dp, 0.0_dp)
END IF
kin_energy=0
rho=0
DO i=1,n
kin_energy=kin_energy+REAL(kin_psi(i,ibnd))
rho=rho+REAL(rho_psi(i,ibnd))
WRITE(stdout,'(5X,"ibnd=",I5,5X,"kinetic energy= ",F10.3,5X,"rho=",F10.3)')&
ibnd,kin_energy,rho
END DO
END DO
output file
-------h_psi-------
ibnd= 1 kinetic energy= 20.348 rho= 0.110
ibnd= 2 kinetic energy= 3.210 rho= 0.334
ibnd= 3 kinetic energy= 4.039 rho= 0.121
ibnd= 4 kinetic energy= 5.575 rho= 0.088
ibnd= 5 kinetic energy= 6.083 rho= 0.201
ibnd= 6 kinetic energy= 2.956 rho= 0.189
ibnd= 7 kinetic energy= 2.049 rho= 0.463
ibnd= 8 kinetic energy= 7.203 rho= 0.166
ibnd= 9 kinetic energy= 4.522 rho= 0.204
ibnd= 10 kinetic energy= 6.414 rho= 0.131
-------END of h_psi-------
n= 1 ew= 0.000000000
n= 2 ew= 0.000000000
n= 3 ew= 0.000000000
n= 4 ew= 0.000000000
n= 5 ew= 0.000000000
-------h_psi-------
ibnd= 1 kinetic energy= 9.129 rho= 0.138
ibnd= 2 kinetic energy= 4.785 rho= 0.290
ibnd= 3 kinetic energy= 4.685 rho= 0.225
ibnd= 4 kinetic energy= 9.690 rho= 0.107
ibnd= 5 kinetic energy= 4.565 rho= 0.148
-------END of h_psi-------
-------END of Cegterg-------
--
Alan Zhang
Department of Modern Mechanics, University of Science and Technology of China
E-mail address: alanzs at mail.ustc.edu.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20131116/1e0cef48/attachment.html>
More information about the users
mailing list