Commit 222b7bf5 authored by sponce's avatar sponce

Beautifications + possible splitting between short and long-range part

in the case of polar materials. 



git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@12770 c92efa57-630b-4861-b058-cf58834340f0
parent b17798de
......@@ -42,7 +42,7 @@
nw_specfun, nw, nswi, nswfc, nswc, nstemp, nsmear, &
wsfc, wscut, write_wfn, wmin_specfun, wmin, &
wmax_specfun, wmax, wepexst, wannierize, &
vme, &
vme, longrange, shortrange, &
tempsmin, tempsmax, temps, delta_approx, title
! USE epwcom, ONLY : fildvscf0, tphases
USE elph2, ONLY : elph
......@@ -113,6 +113,8 @@
CALL mp_bcast (wmin_specfun, ionode_id, world_comm) !
CALL mp_bcast (wmax_specfun, ionode_id, world_comm) !
CALL mp_bcast (delta_approx, ionode_id, world_comm) !
CALL mp_bcast (longrange, ionode_id, world_comm) !
CALL mp_bcast (shortrange, ionode_id, world_comm) !
!
! integers
!
......
......@@ -60,11 +60,11 @@
!
! subtract the long-range term from D(q)
IF (lpolar) THEN
DO ik = 1, nq
CALL rgd_blk (nq1,nq2,nq3,nat,dynq(1,1,ik),xk(:,ik), & !xk has to be in cart. coord.
tau,epsi,zstar,bg,omega,-1.d0)
IF (iverbosity.eq.1) WRITE (6,'(a,i3)') "Done rigid ", ik
ENDDO
DO ik = 1, nq
!xk has to be in cart. coord.
CALL rgd_blk (nq1,nq2,nq3,nat,dynq(1,1,ik),xk(:,ik),tau,epsi,zstar,-1.d0)
!
ENDDO
ENDIF
!
!----------------------------------------------------------
......@@ -80,11 +80,6 @@
!
rdw ( :, :, :) = 0.d0
!
!DBSP
! DO ik = 1, nq
! write(*,*)'dynq ( :, :, ik )', SUM(dynq ( :, :, ik ))
! ENDDO
!END
DO ir = 1, nrr
!
DO ik = 1, nq
......
......@@ -9,28 +9,28 @@
!--------------------------------------------------------------------------
SUBROUTINE dynwan2bloch ( nbnd, nrr, irvec, ndegen, xq, cuf, eig)
!--------------------------------------------------------------------------
!
!
! WARNING: this SUBROUTINE is identical to hamwan2bloch.f90, except
! that here rdw is a real array, not a complex one. This is
! required to obtain proper phonon dispersion interpolation
! and corresponds to the reality of the interatomic force
! constants
!
! -------------------------------------------------------------------------
!
! From the Hamiltonian in Wannier representation, find the corresponding
! Hamiltonian in Bloch representation for a given k point
!
! input : number of bands nbnd
! number of WS vectors, coordinates and degeneracy
! Hamiltonian in Wannier representation chw(nbnd, nbnd, nrr)
! qpoint coordinate xq(3)
!
! output : rotation matrix cuf (nbnd, nbnd)
! interpolated hamiltonian eigenvalues eig(nbnd)
!
!
!!
!!
!! WARNING: this SUBROUTINE is identical to hamwan2bloch.f90, except
!! that here rdw is a real array, not a complex one. This is
!! required to obtain proper phonon dispersion interpolation
!! and corresponds to the reality of the interatomic force
!! constants
!!
!! -------------------------------------------------------------------------
!!
!! From the Hamiltonian in Wannier representation, find the corresponding
!! Hamiltonian in Bloch representation for a given k point
!!
!! input : number of bands nbnd
!! number of WS vectors, coordinates and degeneracy
!! Hamiltonian in Wannier representation chw(nbnd, nbnd, nrr)
!! qpoint coordinate xq(3)
!!
!! output : rotation matrix cuf (nbnd, nbnd)
!! interpolated hamiltonian eigenvalues eig(nbnd)
!!
!!
!--------------------------------------------------------------------------
!
USE kinds, ONLY : DP
......@@ -91,11 +91,11 @@
chf (:,:) = czero
!
DO ir = 1, nrr
!
rdotk = twopi * dot_product( xq, dble(irvec( :, ir) ))
cfac = exp( ci*rdotk ) / dble( ndegen(ir) )
chf = chf + cfac * rdw (:,:, ir )
!
!
rdotk = twopi * dot_product( xq, dble(irvec( :, ir) ))
cfac = exp( ci*rdotk ) / dble( ndegen(ir) )
chf = chf + cfac * rdw (:,:, ir )
!
ENDDO
!
! bring xq in cart. coordinates (needed for rgd_blk call)
......@@ -103,21 +103,21 @@
!
! add the long-range term to D(q)
IF (lpolar) THEN
CALL rgd_blk (nq1,nq2,nq3,nat,chf,xq, & !xq has to be in 2pi/a
tau,epsi,zstar,bg,omega,+1.d0)
!WRITE (6,'(a)') "Done rigid"
! xq has to be in 2pi/a
CALL rgd_blk (nq1,nq2,nq3,nat,chf,xq,tau,epsi,zstar,+1.d0)
!
ENDIF
!
! divide by the square root of masses
!
DO na = 1, nat
DO nb = 1, nat
DO nb = 1, nat
massfac = 1.d0 / sqrt ( amass(ityp(na)) * amass(ityp(nb)) )
!
chf(3*(na-1)+1:3*na, 3*(nb-1)+1:3*nb) = &
chf(3*(na-1)+1:3*na, 3*(nb-1)+1:3*nb) * massfac
!
ENDDO
ENDDO
ENDDO
!
! bring xq back to crystal coordinates
......
......@@ -579,7 +579,7 @@
CALL loadumat ( nbnd, nbndsub, nks, nkstot, xq, cu, cuq, lwin, lwinq )
!
! Calculate overlap U_k+q U_k^\dagger
IF (lpolar) CALL compute_bmn_para3 ( nbnd, nbndsub, nks, cu, cuq,bmat(:,:,:,nqc) )
IF (lpolar) CALL compute_umn_c ( nbnd, nbndsub, nks, cu, cuq, bmat(:,:,:,nqc) )
!
! calculate the sandwiches
!
......@@ -630,7 +630,7 @@
CALL loadumat ( nbnd, nbndsub, nks, nkstot, xq, cu, cuq, lwin, lwinq )
!
! Calculate overlap U_k+q U_k^\dagger
IF (lpolar) CALL compute_bmn_para3 ( nbnd, nbndsub, nks, cu, cuq,bmat(:,:,:,nqc) )
IF (lpolar) CALL compute_umn_c ( nbnd, nbndsub, nks, cu, cuq, bmat(:,:,:,nqc) )
!
CALL elphon_shuffle ( iq_irr, nqc_irr, nqc, gmapsym, eigv, isym, xq0, .true. )
!
......
......@@ -11,34 +11,38 @@
SUBROUTINE ephwan2bloch ( nbnd, nrr, irvec, ndegen, epmatw, &
xk, cufkk, cufkq, epmatf, nmodes)
!---------------------------------------------------------------------------
!
!!
!! Interpolation from Wannier to the fine Bloch grid of the electron-phonon
!! matrix elements
!!
USE kinds, ONLY : DP
USE constants_epw, ONLY : twopi, ci, czero, cone
implicit none
!
! input variables
!
integer :: nbnd, nrr, irvec ( 3, nrr), ndegen (nrr), nmodes
! number of bands (possibly in tyhe optimal subspace)
! number of WS points
! coordinates of WS points
! degeneracy of WS points
! number of phonon modes
complex(kind=DP) :: epmatw ( nbnd, nbnd, nrr, nmodes), cufkk (nbnd, nbnd), &
cufkq (nbnd, nbnd)
! e-p matrix in Wannier representation
! rotation matrix U(k)
! rotation matrix U(k+q)
real(kind=DP) :: xk(3)
! kpoint for the interpolation (WARNING: this must be in crystal coord!)
!
! output variables
!
complex(kind=DP) :: epmatf (nbnd, nbnd, nmodes)
! e-p matrix in Bloch representation, fine grid
INTEGER, INTENT (in) :: nbnd
!! number of bands (possibly in the optimal subspace)
INTEGER, INTENT (in) :: nrr
!! Number of Wigner-Size points
INTEGER, INTENT (in) :: irvec ( 3, nrr)
!! Coordinates of WS points
INTEGER, INTENT (in) :: ndegen (nrr)
!! Degeneracy of WS points
INTEGER, INTENT (in) :: nmodes
!! number of phonon modes
!
REAL(kind=DP), INTENT (in) :: xk(3)
!! kpoint for the interpolation (WARNING: this must be in crystal coord!)
!
COMPLEX(kind=DP), INTENT (in) :: epmatw ( nbnd, nbnd, nrr, nmodes)
!! e-p matrix in Wannier representation
COMPLEX(kind=DP), INTENT (in) :: cufkk (nbnd, nbnd)
!! rotation matrix U(k)
COMPLEX(kind=DP), INTENT (in) :: cufkq (nbnd, nbnd)
!! rotation matrix U(k+q)
COMPLEX(kind=DP), INTENT (out) :: epmatf (nbnd, nbnd, nmodes)
!! e-p matrix in Bloch representation, fine grid
!
! work variables
!
integer :: ir, imode
real(kind=DP) :: rdotk
complex(kind=DP) :: cfac, eptmp( nbnd, nbnd)
......
This diff is collapsed.
......@@ -53,7 +53,8 @@
pwc, nswc, nswfc, nswi, filukq, filukk, &
nbndsub, nbndskip, system_2d, delta_approx, &
title, int_mob, scissor, iterative_bte, scattering, &
ncarrier, carrier, scattering_serta, scattering_0rta
ncarrier, carrier, scattering_serta, &
scattering_0rta, longrange, shortrange
! USE epwcom, ONLY : tphases, fildvscf0
USE elph2, ONLY : elph
......@@ -116,7 +117,7 @@
ep_coupling, fila2f, max_memlt, efermi_read, fermi_energy, &
specfun, wmin_specfun, wmax_specfun, nw_specfun, system_2d, &
delta_approx, scattering, int_mob, scissor, ncarrier, carrier, &
iterative_bte, scattering_serta, scattering_0rta
iterative_bte, scattering_serta, scattering_0rta, longrange, shortrange
! tphases, fildvscf0
!
......@@ -233,21 +234,24 @@
! lpolar : if .true. enable the correct Wannier interpolation in the case of polar material.
!
! Added by SP
!
! scattering: if .true. scattering rates are calculated
! scattering_serta: if .true. scattering rates are calculated using self-energy relaxation-time-approx
! scattering_0rta: if .true. scattering rates are calculated using 0th order relaxation-time-approx
! int_mob : if .true. computes the intrinsic mobilities. This means that the
! electron and hole carrier density is equal.
! iterative_bte : if .true. computes the iterative solution to the BTE. Need a
! prior run with ERTA.
! scissor : Value of the scissor shitf in eV. This only affects the CBM of etf. Do you use in
! metals obviously.
! carrier : if .true. computes the doped carrier mobilities.
! ncarrier : Set the Fermi level so that the carrier concentration is
! "ncarrier". If ncarrier > 0, electron doping, hole doping otherwise
!
! scattering : if .true. scattering rates are calculated
! scattering_serta: if .true. scattering rates are calculated using self-energy relaxation-time-approx
! scattering_0rta : if .true. scattering rates are calculated using 0th order relaxation-time-approx
! int_mob : if .true. computes the intrinsic mobilities. This means that the
! electron and hole carrier density is equal.
! iterative_bte : if .true. computes the iterative solution to the BTE. Need a
! prior run with ERTA.
! scissor : Value of the scissor shitf in eV. This only affects the CBM of etf. Do you use in
! metals obviously.
! carrier : if .true. computes the doped carrier mobilities.
! ncarrier : Set the Fermi level so that the carrier concentration is
! " ncarrier". If ncarrier > 0, electron doping, hole doping otherwise
! longrange : if .true. computes the long-range part of the el-ph (can
! only be used with lpolar = .true. )
! shortrange : if .true. computes the short-range part of the el-ph (can
! only be used with lpolar = .true. )
!
CHARACTER (LEN=80) :: input_file
INTEGER :: nargs, iiarg, ierr
!
......@@ -416,6 +420,8 @@
scissor = 0.d0 ! eV
carrier = .false.
ncarrier = 0.d0 ! cm^-3
longrange = .false.
shortrange = .false.
!
! reading the namelist inputepw
!
......@@ -507,6 +513,10 @@
'The absolute value of the doping carrier concentration must be larger than 1E5 cm^-3',1)
IF ( (iterative_bte .AND. scattering_serta) .OR. (iterative_bte .AND.scattering_0rta) ) CALL errore('epw_init', &
'You should first do a run in the SRTA to get the initial scattering_rate files.',1)
IF ( (longrange .OR. shortrange) .AND. (.not. lpolar)) CALL errore('epw_init',&
&'Error: longrange or shortrange can only be true if lpolar is true as well.',1)
IF ( longrange .AND. shortrange) CALL errore('epw_init',&
&'Error: longrange and shortrange cannot be both true.',1)
!
! thickness and smearing width of the Fermi surface
! from eV to Ryd
......
......@@ -241,6 +241,10 @@
!! if .true. the iterative solution for BTE is compute. A first run with scattering_serta = .true. is required.
LOGICAL :: carrier
!! if .true. computes the doped electronic mobilities.
LOGICAL :: longrange
!! if .true. computes the long range interaction of el-ph. Can only be .true. if lpolar is also true.
LOGICAL :: shortrange
!! if .true. computes the long range interaction of el-ph. Can only be .true. if lpolar is also true.
!
CHARACTER(len=100) :: dvscf_dir ='./'
!! directory for .dvscf and .dyn files (wannier interpolation)
......
This diff is collapsed.
......@@ -78,19 +78,19 @@
! slim down to the first ndimwin(ikq),ndimwin(ik) states within the outer window
!
DO ik=1,nks
ibnd=0
DO i=1,nbnd
IF(lwinq(i,ik)) THEN
ibnd=ibnd+1
jbnd=0
DO j=1,nbnd
IF(lwin(j,ik)) THEN
jbnd=jbnd+1
epmatq_opt(ibnd,jbnd,ik,:)=epmatq(i,j,ik,:,iq)
END IF
END DO
END IF
END DO
ibnd=0
DO i=1,nbnd
IF(lwinq(i,ik)) THEN
ibnd=ibnd+1
jbnd=0
DO j=1,nbnd
IF(lwin(j,ik)) THEN
jbnd=jbnd+1
epmatq_opt(ibnd,jbnd,ik,:)=epmatq(i,j,ik,:,iq)
END IF
END DO
END IF
END DO
END DO
!
! ep_mode (j) = cfac * sum_i ep_cart(i) * u(i,j)
......@@ -107,7 +107,7 @@
!
IF (lpolar) THEN
IF( (abs(xq(1)).gt.eps) .or. (abs(xq(2)).gt.eps) .or. (abs(xq(3)).gt.eps) ) THEN
CALL rgd_blk_epw2 (nq1, nq2, nq3, xq, cz2t, eptmp, &
CALL rgd_blk_epw (nq1, nq2, nq3, xq, cz2t, eptmp, &
nmodes, epsi, zstar, bmat(ibnd,jbnd,ik,iq), -1.d0)
ENDIF
ENDIF
......
......@@ -33,7 +33,7 @@
USE io_global, ONLY : stdout
USE io_epw, ONLY : iunepmatf, linewidth_elself
USE phcom, ONLY : nmodes
USE epwcom, ONLY : nbndsub, lrepmatf, &
USE epwcom, ONLY : nbndsub, lrepmatf, shortrange, &
fsthick, eptemp, ngaussw, degaussw, &
etf_mem, eps_acustic, efermi_read, fermi_energy
USE pwcom, ONLY : ef !, nelec, isk
......@@ -259,7 +259,13 @@
! with hbar = 1 and M already contained in the eigenmodes
! g2 is Ry^2, wkf must already account for the spin factor
!
g2 = (abs(epf (jbnd, ibnd))**two)*inv_wq*g2_tmp
IF ( shortrange) THEN
! SP: The abs has to be removed. Indeed the epf can be a pure imaginary
! number, in which case its square will be a negative number.
g2 = (epf (jbnd, ibnd)**two)*inv_wq*g2_tmp
ELSE
g2 = (abs(epf (jbnd, ibnd))**two)*inv_wq*g2_tmp
ENDIF
!
! There is a sign error for wq in Eq. 9 of Comp. Phys. Comm. 181, 2140 (2010). - RM
! The sign was corrected according to Eq. (7.282) page 489 from Mahan's book
......@@ -488,7 +494,7 @@
USE io_global, ONLY : stdout
USE io_epw, ONLY : iunepmatf, linewidth_elself
USE phcom, ONLY : nmodes
USE epwcom, ONLY : nbndsub, lrepmatf, &
USE epwcom, ONLY : nbndsub, lrepmatf, shortrange, &
fsthick, eptemp, ngaussw, degaussw, &
etf_mem, eps_acustic, efermi_read, fermi_energy
USE pwcom, ONLY : ef !, nelec, isk
......@@ -665,7 +671,13 @@
! with hbar = 1 and M already contained in the eigenmodes
! g2 is Ry^2, wkf must already account for the spin factor
!
g2 = (abs(epf (jbnd, ibnd))**two)*inv_wq*g2_tmp
IF ( shortrange) THEN
! SP: The abs has to be removed. Indeed the epf can be a pure imaginary
! number, in which case its square will be a negative number.
g2 = (epf (jbnd, ibnd)**two)*inv_wq*g2_tmp
ELSE
g2 = (abs(epf (jbnd, ibnd))**two)*inv_wq*g2_tmp
ENDIF
!
! There is a sign error for wq in Eq. 9 of Comp. Phys. Comm. 181, 2140 (2010). - RM
! The sign was corrected according to Eq. (7.282) page 489 from Mahan's book
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment