Aligned with develop

This commit is contained in:
fabrizio22 2019-05-08 12:14:35 +02:00
commit 7cabcd6a46
26 changed files with 751 additions and 848 deletions

View File

@ -1,3 +1,6 @@
New in development branch:
* turbo_eels code of TDDFPT module now works with ultrasoft pseudopotentials and spin-orbit coupling together (Oleksandr Motornyi, Andrea Dal Corso, Nathalie Vast). lr_sm1_psi.f90 of LR_Modules is rewritten and simplified.
Problems fixed in development branch :
* Bug in spin-polarized meta-GGA (noticed by Shoaib Muhammad,
Sungkyunkwan U.)

View File

@ -31,7 +31,6 @@ SUBROUTINE hp_ef_shift (drhoscf, ldos, ldoss, dos_ef, dbecsum, becsum1)
USE gvect, ONLY : gg
USE buffers, ONLY : get_buffer, save_buffer
USE lsda_mod, ONLY : nspin
USE wvfct, ONLY : npw, npwx, et
USE klist, ONLY : degauss, ngauss, ngk
USE noncollin_module, ONLY : noncolin, npol, nspin_mag, nspin_lsda
USE mp_bands, ONLY : intra_bgrp_comm

File diff suppressed because it is too large Load Diff

View File

@ -154,6 +154,7 @@ MODULE lrus
COMPLEX (DP), ALLOCATABLE :: bbk(:,:,:) ! nkb, nkb, nks)
! for k points
COMPLEX (DP), ALLOCATABLE :: bbnc(:,:,:,:) ! nkb, nkb, nspin_mag, nks)
COMPLEX (DP), ALLOCATABLE :: bbnc_sm1(:,:,:) ! nkb, nkb, nspin_mag, nks)
! for the noncollinear case
! bbg = < beta^N_i | beta^P_j >
! bbg/bbk/bbnc are the scalar products of beta functions

View File

@ -261,7 +261,7 @@ lr_sm1_psi.o : ../Modules/control_flags.o
lr_sm1_psi.o : ../Modules/invmat.o
lr_sm1_psi.o : ../Modules/ions_base.o
lr_sm1_psi.o : ../Modules/kind.o
lr_sm1_psi.o : ../Modules/mp_bands.o
lr_sm1_psi.o : ../Modules/mp_global.o
lr_sm1_psi.o : ../Modules/noncol.o
lr_sm1_psi.o : ../Modules/uspp.o
lr_sm1_psi.o : ../PW/src/pwcom.o

View File

@ -52,7 +52,7 @@ PROGRAM do_ppacf
USE funct, ONLY : get_iexch, get_icorr, get_igcx, get_igcc
USE funct, ONLY : set_exx_fraction,set_auxiliary_flags,enforce_input_dft, init_lda_xc
USE xc_lda_lsda, ONLY : xc_lda, xc_lsda
USE wvfct, ONLY : npw, npwx
USE wvfct, ONLY : npwx
USE environment, ONLY : environment_start, environment_end
USE kernel_table, ONLY : Nqs, vdw_table_name, kernel_file_name
USE vdW_DF, ONLY : get_potential, vdW_energy
@ -111,6 +111,7 @@ PROGRAM do_ppacf
REAL(DP), ALLOCATABLE :: tot_grad_rho(:,:),grad_rho(:,:,:)
REAL(DP), ALLOCATABLE :: tot_rho(:)
INTEGER :: npw ! number of plane waves
INTEGER :: ik ! counter on k points
INTEGER, ALLOCATABLE :: igk_buf(:)
REAL(dp), ALLOCATABLE :: gk(:) ! work space

View File

@ -23,7 +23,7 @@ SUBROUTINE stres_mgga( sigmaxc )
USE klist, ONLY : nks, xk, ngk
USE buffers, ONLY : get_buffer
USE io_files, ONLY : iunwfc, nwordwfc
USE wvfct, ONLY : nbnd, npwx, npw, wg
USE wvfct, ONLY : nbnd, npwx, wg
USE lsda_mod, ONLY : lsda, nspin, current_spin, isk
USE fft_interfaces, ONLY : fwfft, invfft
USE fft_base, ONLY : dfftp, dffts
@ -37,7 +37,7 @@ SUBROUTINE stres_mgga( sigmaxc )
!
! Internal variables
!
INTEGER :: ix, iy, ir, ipol, iss, incr, ibnd, ik
INTEGER :: ix, iy, ir, ipol, iss, incr, ibnd, ik, npw
INTEGER :: ipol2xy(3,3)
REAL(DP), PARAMETER :: epsr = 1.0d-6, epsg = 1.0d-10, e2 = 2.d0
COMPLEX(DP), ALLOCATABLE :: gradwfc (:,:), crosstaus(:,:,:)

View File

@ -29,6 +29,10 @@ lr_normalise.o \
lr_lanczos.o \
lr_apply_liouvillian.o \
lr_dv_setup.o \
compute_intq.o \
set_intq_nc.o \
transform_intq_nc.o \
transform_intq_so.o \
lr_solve_e.o \
lr_dvpsi_e.o \
stop_lr.o \

View File

@ -0,0 +1,89 @@
!
! Copyright (C) 2001-2008 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!
!----------------------------------------------------------------------
SUBROUTINE compute_intq
!----------------------------------------------------------------------
!
! This routine computes the contribution of the selfconsistent
! change of the potential to the known part of the linear
! system and adds it to dvpsi.
!
USE kinds, ONLY : DP
USE ions_base, ONLY : nat, ityp, ntyp => nsp
USE noncollin_module, ONLY : noncolin
USE cell_base, ONLY : omega
USE uspp, ONLY : okvan
USE uspp_param, ONLY : upf, lmaxq, nh, nhm
USE lr_variables, ONLY : intq
USE qpoint, ONLY : xq, eigqts
IMPLICIT NONE
INTEGER :: na, ig, nt, ir, ih, jh
! countera
REAL(DP), ALLOCATABLE :: ylmk0 (:,:)
! the modulus of q+G
! the values of q+G
! the spherical harmonics
! work space
COMPLEX(DP) :: qgm(1), aux1
REAL(DP) :: qmod(1), zero(3,1), qg(3,1)
IF (.NOT.okvan) RETURN
CALL start_clock ('compute_intq')
intq (:,:,:) = (0.D0, 0.0D0)
ALLOCATE (ylmk0(1 , lmaxq * lmaxq))
!
! first compute the spherical harmonics
!
zero=0.0_DP
CALL setqmod (1, xq, zero, qmod, qg)
CALL ylmr2 (lmaxq * lmaxq, 1, qg, qmod, ylmk0)
qmod(1) = SQRT (qmod(1) )
DO nt = 1, ntyp
IF (upf(nt)%tvanp ) THEN
DO ih = 1, nh (nt)
DO jh = ih, nh (nt)
CALL qvan2 (1, ih, jh, nt, qmod, qgm, ylmk0)
DO na = 1, nat
IF (ityp (na) == nt) THEN
aux1 = qgm(1) * eigqts(na)
intq(ih,jh,na) = omega * CONJG(aux1)
ENDIF
ENDDO
ENDDO
ENDDO
DO na = 1, nat
IF (ityp(na) == nt) THEN
!
! We use the symmetry properties of the ps factor
!
DO ih = 1, nh (nt)
DO jh = ih, nh (nt)
intq(jh,ih,na) = intq(ih,jh,na)
ENDDO
ENDDO
ENDIF
ENDDO
ENDIF
ENDDO
IF (noncolin) CALL set_intq_nc()
DEALLOCATE (ylmk0)
CALL stop_clock ('compute_intq')
RETURN
END SUBROUTINE compute_intq

View File

@ -0,0 +1,110 @@
!
! Copyright (C) 2001-2019 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!----------------------------------------------------------------------
SUBROUTINE dveqpsi_us_only (npwq, ik)
!----------------------------------------------------------------------
!
! This routine computes the contribution of the Fourier transform
! of the augmentation function at the given q, and adds it to
! dvpsi.
!
USE kinds, ONLY : DP
USE uspp_param, ONLY : upf, nh
USE uspp, ONLY : vkb, okvan
! modules from pwcom
USE lsda_mod, ONLY : lsda, current_spin, isk
USE ions_base, ONLY : ntyp => nsp, nat, ityp
USE wvfct, ONLY : nbnd, npwx
USE noncollin_module, ONLY : noncolin, npol
! modules from phcom
USE qpoint, ONLY : ikks
! USE optical, ONLY : intq, intq_nc
USE lrus, ONLY : becp1
USE eqv, ONLY : dvpsi
IMPLICIT NONE
!
! The dummy variables
!
INTEGER :: ik, npwq
! input: the k point
! input: number of plane waves at the q point
! And the local variables
!
INTEGER :: na, nt, ibnd, ih, jh, ijkb0, ikk, ikb, jkb, is, js, ijs
! counter on atoms
! counter on atomic types
! counter on bands
! counter on beta functions
! counter on beta functions
! auxiliary variable for indexing
! counter on the k points
! counter on vkb
! counter on vkb
COMPLEX(DP) :: sum0, sum_nc(npol)
! auxiliary variable
IF (.NOT.okvan) RETURN
CALL start_clock ('dveqpsi_us_only')
ikk = ikks(ik)
IF (lsda) current_spin = isk (ikk)
ijkb0 = 0
DO nt = 1, ntyp
IF (upf(nt)%tvanp ) THEN
DO na = 1, nat
IF (ityp (na)==nt) THEN
!
! we multiply the integral for the becp term and the beta_n
!
DO ibnd = 1, nbnd
DO ih = 1, nh (nt)
ikb = ijkb0 + ih
IF (noncolin) THEN
sum_nc = (0.d0, 0.d0)
ELSE
sum0 = (0.d0, 0.d0)
END IF
DO jh = 1, nh (nt)
jkb = ijkb0 + jh
IF (noncolin) THEN
ijs=0
DO is=1,npol
DO js=1,npol
ijs=ijs+1
sum_nc(is)=sum_nc(is)+ &
intq_nc(ih,jh,na,ijs)* &
becp1(ik)%nc(jkb, js, ibnd)
ENDDO
ENDDO
ELSE
sum0 = sum0 + intq (ih, jh, na)* &
becp1(ik)%k(jkb, ibnd)
ENDIF
ENDDO
IF (noncolin) THEN
CALL zaxpy(npwq,sum_nc(1),vkb(1,ikb),1,dvpsi(1,ibnd),1)
CALL zaxpy(npwq,sum_nc(2),vkb(1,ikb),1, &
dvpsi(1+npwx,ibnd),1)
ELSE
CALL zaxpy(npwq,sum0,vkb(1,ikb),1,dvpsi(1,ibnd),1)
ENDIF
ENDDO
ENDDO
ijkb0 = ijkb0 + nh (nt)
ENDIF
ENDDO
ELSE
DO na = 1, nat
IF (ityp (na)==nt) ijkb0 = ijkb0 + nh (nt)
ENDDO
ENDIF
ENDDO
CALL stop_clock ('dveqpsi_us_only')
RETURN
END SUBROUTINE dveqpsi_us_only

View File

@ -1,12 +1,13 @@
!
! Copyright (C) 2001-2016 Quantum ESPRESSO group
! Copyright (C) 2001-2019 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!-----------------------------------------------------------------------------
SUBROUTINE lr_addus_dvpsi ( ik, lda, n, m, psi, dpsi )
SUBROUTINE lr_addus_dvpsi (npwq, ik,psi,dvpsi)
!----------------------------------------------------------------------
!---------------------------------------------------------------------------
!
! ... Calculate the ultrasoft term of the perturbation exp(iq*r),
@ -20,118 +21,102 @@ SUBROUTINE lr_addus_dvpsi ( ik, lda, n, m, psi, dpsi )
! ... m number of bands of psi
!
! Written by Iurii Timrov (2015)
! Generalized to the relativistic case by Andrea Dal Corso (2018)
!
USE kinds, ONLY : DP
USE ions_base, ONLY : nat, ityp, ntyp => nsp
USE uspp, ONLY : okvan
USE uspp_param, ONLY : upf, lmaxq, nh
USE paw_variables, ONLY : okpaw
USE noncollin_module, ONLY : npol, noncolin
USE uspp, ONLY : vkb, nkb, indv_ijkb0
USE cell_base, ONLY : omega
USE lrus, ONLY : becp1
USE qpoint, ONLY : xq, eigqts
!
USE kinds, ONLY : DP
USE uspp_param, ONLY : upf, nh
USE uspp, ONLY : vkb, okvan
USE lsda_mod, ONLY : lsda, current_spin, isk
USE ions_base, ONLY : ntyp => nsp, nat, ityp
USE wvfct, ONLY : nbnd, npwx
USE noncollin_module, ONLY : noncolin, npol
USE qpoint, ONLY : ikks
USE lr_variables, ONLY : intq, intq_nc
USE lrus, ONLY : becp1
IMPLICIT NONE
!
INTEGER, INTENT(in) :: ik, lda, n, m
COMPLEX(DP), INTENT(in) :: psi(lda*npol,m)
! The dummy variables
!
COMPLEX(DP), INTENT(in) :: psi(npwx*npol,nbnd)
! input: wavefunction u_n,k
COMPLEX(DP), INTENT(out) :: dpsi(lda*npol,m)
COMPLEX(DP), INTENT(out) :: dvpsi(npwx*npol,nbnd)
! output: sum of the input wavefunction and the USPP term
INTEGER :: ik, npwq
! input: the k point
! input: number of plane waves at the q point
! And the local variables
!
! the local variables
!
INTEGER :: na, nt, ih, jh
INTEGER :: na, nt, ibnd, ih, jh, ijkb0, ikk, ikb, jkb, is, js, ijs
! counter on atoms
! counter on atomic type
! counter on atomic types
! counter on bands
! counter on beta functions
! counter on beta functions
!
REAL(DP) :: qmod ! the modulus of q
REAL(DP), ALLOCATABLE :: ylmk0(:) ! the spherical harmonics
COMPLEX(DP) :: qgm(1) ! FFT of Q(r)
COMPLEX(DP), ALLOCATABLE :: ps(:,:), qqc(:,:),qqc_d(:,:) ! auxiliary arrays
!
dpsi = psi
!
! auxiliary variable for indexing
! counter on the k points
! counter on vkb
! counter on vkb
COMPLEX(DP) :: sum0, sum_nc(npol)
! auxiliary variable
IF (.NOT.okvan) RETURN
!
CALL start_clock ('lr_addus_dvpsi')
!
IF (noncolin) CALL errore( 'lr_addus_dvpsi', 'Noncollinear case is not supported', 1 )
IF (okpaw) CALL errore( 'lr_addus_dvpsi', 'PAW is not supported', 1 )
!
ALLOCATE (ylmk0(lmaxq*lmaxq))
ALLOCATE (ps(nkb,m))
ps(:,:) = (0.d0, 0.d0)
!
qmod = xq(1)**2 + xq(2)**2 + xq(3)**2
!
! Calculate sphrecial harmonics
!
CALL ylmr2 (lmaxq*lmaxq, 1, xq, qmod, ylmk0)
!
qmod = sqrt(qmod)
!
dvpsi=psi
ikk = ikks(ik)
IF (lsda) current_spin = isk (ikk)
ijkb0 = 0
DO nt = 1, ntyp
IF (upf(nt)%tvanp) THEN
!
! Calculate the Fourier transform of the Q functions.
!
ALLOCATE (qqc(nh(nt),nh(nt)))
ALLOCATE (qqc_d(nh(nt),nh(nt)))
qqc(:,:) = (0.d0, 0.d0)
!
DO ih = 1, nh(nt)
DO jh = ih, nh(nt)
!
CALL qvan2 (1, ih, jh, nt, qmod, qgm(1), ylmk0)
qqc(ih,jh) = omega * qgm(1)
qqc(jh,ih) = qqc(ih,jh)
!
IF (upf(nt)%tvanp ) THEN
DO na = 1, nat
IF (ityp (na)==nt) THEN
!
! we multiply the integral for the becp term and the beta_n
!
DO ibnd = 1, nbnd
DO ih = 1, nh (nt)
ikb = ijkb0 + ih
IF (noncolin) THEN
sum_nc = (0.d0, 0.d0)
ELSE
sum0 = (0.d0, 0.d0)
END IF
DO jh = 1, nh (nt)
jkb = ijkb0 + jh
IF (noncolin) THEN
ijs=0
DO is=1,npol
DO js=1,npol
ijs=ijs+1
sum_nc(is)=sum_nc(is)+ &
intq_nc(ih,jh,na,ijs)* &
becp1(ik)%nc(jkb, js, ibnd)
ENDDO
ENDDO
ELSE
sum0 = sum0 + intq (ih, jh, na)* &
becp1(ik)%k(jkb, ibnd)
ENDIF
ENDDO
IF (noncolin) THEN
CALL zaxpy(npwq,sum_nc(1),vkb(1,ikb),1,dvpsi(1,ibnd),1)
CALL zaxpy(npwq,sum_nc(2),vkb(1,ikb),1, &
dvpsi(1+npwx,ibnd),1)
ELSE
CALL zaxpy(npwq,sum0,vkb(1,ikb),1,dvpsi(1,ibnd),1)
ENDIF
ENDDO
ENDDO
ijkb0 = ijkb0 + nh (nt)
ENDIF
ENDDO
ENDDO
!
! Calculate a product of Q^*(q) with <beta|evc>
!
DO na = 1, nat
IF (ityp (na).eq.nt) THEN
!
qqc_d = qqc * eigqts(na)
!
CALL ZGEMM('C','N', nh(nt), m, nh(nt), (1.0_dp,0.0_dp), &
& qqc_d, nh(nt), becp1(ik)%k(indv_ijkb0(na)+1,1), nkb, &
& (0.0_dp,0.0_dp), ps(indv_ijkb0(na)+1,1), nkb )
!
ENDIF
ENDDO
!
DEALLOCATE (qqc)
DEALLOCATE (qqc_d)
!
ENDIF
ELSE
DO na = 1, nat
IF (ityp (na)==nt) ijkb0 = ijkb0 + nh (nt)
ENDDO
ENDIF
ENDDO
!
! Sum up the normal and ultrasoft terms.
!
IF ( m == 1 ) THEN
!
CALL ZGEMV( 'N', n, nkb, ( 1.D0, 0.D0 ), vkb, lda, &
& ps, 1, ( 1.D0, 0.D0 ), dpsi, 1 )
!
ELSE
!
CALL ZGEMM( 'N', 'N', n, m, nkb, ( 1.D0, 0.D0 ), vkb, lda, &
& ps, nkb, ( 1.D0, 0.D0 ), dpsi, lda )
!
ENDIF
!
DEALLOCATE (ylmk0)
DEALLOCATE (ps)
!
CALL stop_clock ('lr_addus_dvpsi')
!
RETURN
!
END SUBROUTINE lr_addus_dvpsi

View File

@ -15,6 +15,7 @@ SUBROUTINE lr_alloc_init()
USE kinds, ONLY : dp
USE ions_base, ONLY : nat
USE uspp, ONLY : nkb, okvan
USE lrus, ONLY : bbk, bbg, bbnc_sm1
USE uspp_param, ONLY : nhm
USE fft_base, ONLY : dfftp, dffts
USE klist, ONLY : nks
@ -153,12 +154,13 @@ SUBROUTINE lr_alloc_init()
ENDIF
!
! Optical case: allocate the response charge-density
!
!
IF (.NOT.eels) THEN
!
IF (gamma_only) THEN
ALLOCATE(rho_1(dfftp%nnr,nspin_mag))
rho_1(:,:)=0.0d0
ALLOCATE(bbg(nkb,nkb))
ELSE
ALLOCATE(rho_1c(dfftp%nnr,nspin_mag))
rho_1c(:,:)=(0.0d0,0.0d0)
@ -181,6 +183,9 @@ SUBROUTINE lr_alloc_init()
IF (noncolin) THEN
ALLOCATE (int3_nc(nhm,nhm,nat,nspin,1))
int3_nc = (0.0d0, 0.0d0)
ALLOCATE(bbnc_sm1(nkb*npol, nkb*npol, nksq))
ELSE
ALLOCATE(bbk(nkb, nkb, nksq))
ENDIF
!
ENDIF

View File

@ -296,8 +296,10 @@ SUBROUTINE lr_apply_liouvillian( evc1, evc1_new, interaction )
!
DO ik = 1, nks
!
CALL lr_sm1_psi (.FALSE., ik, npwx, ngk(ik), nbnd, &
CALL lr_sm1_psi_tpw ( ik, npwx, ngk(ik), nbnd, &
& sevc1_new(1,1,ik), evc1_new(1,1,ik))
! CALL lr_sm1_psi (.FALSE., ik, npwx, ngk(ik), nbnd, &
! & sevc1_new(1,1,ik), evc1_new(1,1,ik))
!
ENDDO
!

View File

@ -291,7 +291,7 @@ SUBROUTINE lr_apply_liouvillian_eels ( evc1, evc1_new, interaction )
! evc1_new = S^{-1} * sevc1_new
! If not ultrasoft: evc1_new = sevc1_new
!
CALL lr_sm1_psiq (.FALSE., ik, npwx, npwq, nbnd_occ(ikk), &
CALL lr_sm1_psi_tpw ( ik, npwx, npwq, nbnd_occ(ikk), &
& sevc1_new(1,1,ik), evc1_new(1,1,ik))
!
ENDDO ! loop on ik

View File

@ -25,7 +25,7 @@ SUBROUTINE lr_dealloc()
USE lr_exx_kernel, ONLY : lr_exx_dealloc
USE becmod, ONLY : bec_type, becp, deallocate_bec_type
USE lrus, ONLY : int3, int3_nc, becp1, &
& bbg, bbk, bbnc
& bbg, bbk, bbnc_sm1, bbnc
USE qpoint, ONLY : ikks, ikqs, eigqts
USE eqv, ONLY : dmuxc, evq, dpsi, dvpsi
USE control_lr, ONLY : nbnd_occ
@ -53,6 +53,7 @@ SUBROUTINE lr_dealloc()
IF (allocated(bbg)) DEALLOCATE(bbg)
IF (allocated(bbk)) DEALLOCATE(bbk)
IF (allocated(bbnc)) DEALLOCATE(bbnc)
IF (allocated(bbnc_sm1)) DEALLOCATE(bbnc_sm1)
!
IF (project) THEN
DEALLOCATE(F)

View File

@ -147,7 +147,9 @@ SUBROUTINE lr_dvpsi_e(ik,ipol,dvpsi)
!
IF (okvan) THEN
ALLOCATE (spsi ( npwx*npol, nbnd))
CALL lr_sm1_psi (.TRUE.,ik,npwx,ngk(ik),nbnd,dvpsi,spsi)
CALL lr_sm1_initialize()
CALL lr_sm1_psi_tpw (ik,npwx,ngk(ik),nbnd,dvpsi,spsi)
! CALL lr_sm1_psi(.TRUE.,ik,npwx,ngk(ik),nbnd,dvpsi,spsi)
dvpsi(:,:) = spsi(:,:)
DEALLOCATE(spsi)
ENDIF

View File

@ -118,7 +118,7 @@ SUBROUTINE lr_dvpsi_eels (ik, dvpsi1, dvpsi2)
! Calculate beta-functions vkb at point k+q
CALL init_us_2(npwq, igk_k(1,ikq), xk(1,ikq), vkb)
!
CALL lr_addus_dvpsi (ik, npwx, npwq, nbnd_occ(ikk), dvpsi1, dpsi)
CALL lr_addus_dvpsi ( npwq,ik, dvpsi1, dpsi)
!
dvpsi1 = dpsi
dpsi(:,:) = (0.d0, 0.d0)
@ -139,7 +139,8 @@ SUBROUTINE lr_dvpsi_eels (ik, dvpsi1, dvpsi2)
!
dpsi(:,:) = (0.0d0, 0.0d0)
!
CALL lr_sm1_psiq (.TRUE., ik, npwx, npwq, nbnd_occ(ikk), dvpsi1, dpsi)
CALL lr_sm1_initialize()
CALL lr_sm1_psi_tpw ( ik, npwx, npwq, nbnd_occ(ikk), dvpsi1, dpsi)
!
dvpsi1 = dpsi
!

View File

@ -48,7 +48,6 @@ SUBROUTINE lr_readin
USE esm, ONLY : do_comp_esm
USE qpoint, ONLY : xq
USE io_rho_xml, ONLY : write_scf
USE noncollin_module, ONLY : noncolin
USE mp_bands, ONLY : ntask_groups
USE constants, ONLY : eps4
USE control_lr, ONLY : lrpa
@ -534,7 +533,6 @@ CONTAINS
!
IF (eels) THEN
!
IF (okvan .AND. noncolin) CALL errore( 'lr_readin', 'Ultrasoft PP + noncolin is not fully implemented', 1 )
IF (gamma_only) CALL errore( 'lr_readin', 'gamma_only is not supported', 1 )
!
! Tamm-Dancoff approximation is not recommended to be used with EELS, and

View File

@ -19,6 +19,7 @@ SUBROUTINE lr_restart(iter_restart,rflag)
USE control_flags, ONLY : gamma_only
USE klist, ONLY : nks, xk, ngk, igk_k
USE io_files, ONLY : tmp_dir, prefix, diropn, wfc_dir
USE uspp, ONLY : okvan
USE lr_variables, ONLY : itermax, evc1, evc1_old, &
restart, nwordrestart, iunrestart,project,nbnd_total,F, &
bgz_suffix, beta_store, gamma_store, zeta_store, norm0, &
@ -74,6 +75,7 @@ SUBROUTINE lr_restart(iter_restart,rflag)
ENDIF
!
! Reading Lanczos coefficients
IF (okvan) CALL lr_sm1_initialize()
!
IF (eels) THEN
filename = trim(prefix) // trim(bgz_suffix) // trim("dat")

View File

@ -27,9 +27,9 @@ SUBROUTINE lr_solve_e
USE klist, ONLY : nks, xk, ngk, igk_k, degauss
USE lr_variables, ONLY : nwordd0psi, iund0psi,LR_polarization, test_case_no, &
& n_ipol, evc0, d0psi, d0psi2, evc1, lr_verbosity, &
& d0psi_rs, eels, lr_exx
USE lsda_mod, ONLY : lsda, isk, current_spin
USE uspp, ONLY : vkb
& d0psi_rs, eels, lr_exx,intq, intq_nc
USE lsda_mod, ONLY : lsda, isk, current_spin,nspin
USE uspp, ONLY : vkb, okvan
USE wvfct, ONLY : nbnd, npwx, et, current_k
USE control_flags, ONLY : gamma_only
USE wavefunctions, ONLY : evc
@ -37,7 +37,10 @@ SUBROUTINE lr_solve_e
USE mp, ONLY : mp_max, mp_min, mp_barrier
USE control_lr, ONLY : alpha_pv
USE qpoint, ONLY : nksq
USE noncollin_module, ONLY : npol
USE noncollin_module, ONLY : npol,noncolin
USE uspp_param, ONLY : nhm
USE ions_base, ONLY : nat
!
IMPLICIT NONE
INTEGER :: ibnd, ik, is, ip
@ -55,6 +58,14 @@ SUBROUTINE lr_solve_e
IF (eels) THEN
!
! EELS case
IF (okvan) THEN
ALLOCATE (intq (nhm, nhm, nat) )
IF (noncolin) THEN
ALLOCATE(intq_nc( nhm, nhm, nat, nspin))
ENDIF
CALL compute_intq()
ENDIF
!
DO ik = 1, nksq
CALL lr_dvpsi_eels(ik, d0psi(:,:,ik,1), d0psi2(:,:,ik,1))

View File

@ -75,7 +75,12 @@ MODULE lr_variables
COMPLEX(kind=dp), ALLOCATABLE :: R(:,:,:) ! The oscillator strength from valence state (first index)
! to conduction state (second index), for each polarization
! direction (third index).
!
COMPLEX (DP), ALLOCATABLE :: &
intq(:,:,:), &! nhm, nhm, nat), integral of e^iqr Q
intq_nc(:,:,:,:) ! nhm, nhm, nat, nspin), integral of
! Lanczos Matrix
!
!

View File

@ -8,13 +8,26 @@ bcast_lr_input.o : ../../UtilXlib/mp.o
bcast_lr_input.o : lr_charg_resp.o
bcast_lr_input.o : lr_dav_variables.o
bcast_lr_input.o : lr_variables.o
compute_intq.o : ../../LR_Modules/lrcom.o
compute_intq.o : ../../Modules/cell_base.o
compute_intq.o : ../../Modules/ions_base.o
compute_intq.o : ../../Modules/kind.o
compute_intq.o : ../../Modules/noncol.o
compute_intq.o : ../../Modules/uspp.o
compute_intq.o : lr_variables.o
dveqpsi_us_only.o : ../../LR_Modules/lrcom.o
dveqpsi_us_only.o : ../../Modules/ions_base.o
dveqpsi_us_only.o : ../../Modules/kind.o
dveqpsi_us_only.o : ../../Modules/noncol.o
dveqpsi_us_only.o : ../../Modules/uspp.o
dveqpsi_us_only.o : ../../PW/src/pwcom.o
lr_addus_dvpsi.o : ../../LR_Modules/lrcom.o
lr_addus_dvpsi.o : ../../Modules/cell_base.o
lr_addus_dvpsi.o : ../../Modules/ions_base.o
lr_addus_dvpsi.o : ../../Modules/kind.o
lr_addus_dvpsi.o : ../../Modules/noncol.o
lr_addus_dvpsi.o : ../../Modules/paw_variables.o
lr_addus_dvpsi.o : ../../Modules/uspp.o
lr_addus_dvpsi.o : ../../PW/src/pwcom.o
lr_addus_dvpsi.o : lr_variables.o
lr_alloc_init.o : ../../LR_Modules/lrcom.o
lr_alloc_init.o : ../../Modules/becmod.o
lr_alloc_init.o : ../../Modules/control_flags.o
@ -407,7 +420,6 @@ lr_readin.o : ../../Modules/io_global.o
lr_readin.o : ../../Modules/kind.o
lr_readin.o : ../../Modules/mp_bands.o
lr_readin.o : ../../Modules/mp_global.o
lr_readin.o : ../../Modules/noncol.o
lr_readin.o : ../../Modules/paw_variables.o
lr_readin.o : ../../Modules/recvec.o
lr_readin.o : ../../Modules/uspp.o
@ -558,6 +570,9 @@ sd0psi.o : ../../Modules/uspp.o
sd0psi.o : ../../PW/src/pwcom.o
sd0psi.o : ../../PW/src/realus.o
sd0psi.o : lr_variables.o
set_intq_nc.o : ../../Modules/ions_base.o
set_intq_nc.o : ../../Modules/uspp.o
set_intq_nc.o : lr_variables.o
stop_lr.o : ../../Modules/cell_base.o
stop_lr.o : ../../Modules/environment.o
stop_lr.o : ../../Modules/io_files.o
@ -569,3 +584,13 @@ stop_lr.o : ../../Modules/noncol.o
stop_lr.o : ../../PW/src/buffers.o
stop_lr.o : ../../PW/src/pwcom.o
stop_lr.o : lr_variables.o
transform_intq_nc.o : ../../Modules/ions_base.o
transform_intq_nc.o : ../../Modules/kind.o
transform_intq_nc.o : ../../Modules/uspp.o
transform_intq_nc.o : lr_variables.o
transform_intq_so.o : ../../Modules/ions_base.o
transform_intq_so.o : ../../Modules/kind.o
transform_intq_so.o : ../../Modules/noncol.o
transform_intq_so.o : ../../Modules/uspp.o
transform_intq_so.o : ../../PW/src/pwcom.o
transform_intq_so.o : lr_variables.o

View File

@ -0,0 +1,35 @@
!
! Copyright (C) 2001-2019 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!----------------------------------------------------------------------------
SUBROUTINE set_intq_nc()
!----------------------------------------------------------------------------
USE ions_base, ONLY : nat, ntyp => nsp, ityp
USE uspp_param, ONLY : upf
USE lr_variables, ONLY : intq, intq_nc
IMPLICIT NONE
INTEGER :: npe
INTEGER :: np, na
intq_nc=(0.d0,0.d0)
DO np = 1, ntyp
IF ( upf(np)%tvanp ) THEN
DO na = 1, nat
IF (ityp(na)==np) THEN
IF (upf(np)%has_so) THEN
CALL transform_intq_so(intq,na)
ELSE
CALL transform_intq_nc(intq,na)
END IF
END IF
END DO
END IF
END DO
RETURN
END SUBROUTINE set_intq_nc
!

View File

@ -0,0 +1,39 @@
!
! Copyright (C) 2001-2019 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!----------------------------------------------------------------------------
SUBROUTINE transform_intq_nc(intq,na)
!----------------------------------------------------------------------------
!
! This routine multiply intq by the identity and the Pauli
! matrices and saves it in intq_nc.
!
USE kinds, ONLY : DP
USE ions_base, ONLY : nat, ityp
USE uspp_param, ONLY : nh, nhm
USE lr_variables, ONLY : intq_nc
!
IMPLICIT NONE
INTEGER :: na
COMPLEX(DP) :: intq(nhm,nhm,nat)
!
! ... local variables
!
INTEGER :: ih, jh, np
np=ityp(na)
DO ih = 1, nh(np)
DO jh = 1, nh(np)
intq_nc(ih,jh,na,1)=intq(ih,jh,na)
intq_nc(ih,jh,na,4)=intq(ih,jh,na)
END DO
END DO
RETURN
END SUBROUTINE transform_intq_nc

View File

@ -0,0 +1,58 @@
!
! Copyright (C) 2001-2019 Quantum ESPRESSO group
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
!----------------------------------------------------------------------------
SUBROUTINE transform_intq_so(intq,na)
!----------------------------------------------------------------------------
!
! This routine multiply intq by the identity and the Pauli
! matrices, rotate it as appropriate for the spin-orbit case
! and saves it in intq_nc.
!
USE kinds, ONLY : DP
USE ions_base, ONLY : nat, ityp
USE uspp_param, ONLY : nh, nhm
USE noncollin_module, ONLY : npol, nspin_mag
USE spin_orb, ONLY : fcoef, domag
USE lr_variables, ONLY : intq_nc
!
IMPLICIT NONE
COMPLEX(DP) :: intq(nhm,nhm,nat)
INTEGER :: na
!
! ... local variables
!
INTEGER :: ih, jh, lh, kh, np, npert, is1, is2, ijs
LOGICAL :: same_lj
np=ityp(na)
DO ih = 1, nh(np)
DO kh = 1, nh(np)
IF (same_lj(kh,ih,np)) THEN
DO jh = 1, nh(np)
DO lh= 1, nh(np)
IF (same_lj(lh,jh,np)) THEN
ijs=0
DO is1=1,npol
DO is2=1,npol
ijs=ijs+1
intq_nc(ih,jh,na,ijs)= &
intq_nc(ih,jh,na,ijs) + intq (kh,lh,na)* &
(fcoef(ih,kh,is1,1,np)*fcoef(lh,jh,1,is2,np) + &
fcoef(ih,kh,is1,2,np)*fcoef(lh,jh,2,is2,np) )
ENDDO
ENDDO
ENDIF
ENDDO
ENDDO
ENDIF
ENDDO
ENDDO
!
RETURN
END SUBROUTINE transform_intq_so

View File

@ -28,7 +28,7 @@ YAMBO_URL=http://www.yambo-code.org/files/yambo-stable-latest.tar.gz
#
# Package maintainer:
W90=wannier90-3.0.0
W90_URL=https://github.com/wannier-developers/wannier90/archive/v3.0.0.tar.gz
W90_URL=https://codeload.github.com/wannier-developers/wannier90/tar.gz/v3.0.0
#
# Package maintainer: Layla Martin-Samos
SAX=sax-2.0.3