10
1
mirror of https://github.com/pfloos/quack synced 2024-11-03 20:53:53 +01:00

CC-B88 kappa in DD and many other things

This commit is contained in:
Clotilde Marut 2022-02-07 10:40:50 +01:00
commit 5b436558ed
125 changed files with 995 additions and 641 deletions

View File

@ -19,25 +19,25 @@
# Number of states in ensemble (nEns)
4
# occupation numbers
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
# Ensemble weights: wEns(1),...,wEns(nEns-1)
1.0 0. 0.0
1 0.0 0.0
# Ncentered ?
F
# Parameters for CC weight-dependent exchange functional
4
0.60601 -0.0631565 -0.0289751 0.00244785
-1.28842 -0.173117 0.0900511 -0.0118975
-0.718713,-0.133321,0.226288,-0.250718
-0.525899,0.687216,-0.13866,-0.0226579
0.0 0.0 0.0 0.0
# choice of UCC exchange coefficient : 1 for Cx1, 2 for Cx2, 3 for Cx1*Cx2
1

View File

@ -1,11 +1,11 @@
# HF: maxSCF thresh DIIS n_diis guess_type ortho_type mix_guess stability
1024 0.00001 T 5 1 1 T F
1024 0.00001 T 2 1 1 F F
# MP:
# CC: maxSCF thresh DIIS n_diis
64 0.00001 T 5
# spin: TDA singlet triplet spin_conserved spin_flip
F T F T T
F T T T T
# GF: maxSCF thresh DIIS n_diis lin eta renorm reg
256 0.00001 T 5 T 0.0 3 F
# GW: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0 reg

View File

@ -1,4 +1,4 @@
2
H 0. 0. 0.
H 0. 0. 2.000000
H 0.0 0.0 0.0
H 0.0 0.0 0.7

View File

@ -86,7 +86,7 @@ subroutine CISD(singlet_manifold,triplet_manifold,nBasin,nCin,nOin,nVin,nRin,ERI
write(*,*) 'nH = ',nH
write(*,*)
maxH = min(nH,21)
maxH = min(nH,41)
! Memory allocation

View File

@ -70,6 +70,7 @@ subroutine evGF2(BSE,TDA,dBSE,dTDA,evDyn,maxSCF,thresh,max_diis,singlet,triplet,
error_diis(:,:) = 0d0
eGF2(:) = eHF(:)
eOld(:) = eHF(:)
rcond = 0d0
!------------------------------------------------------------------------
! Main SCF loop

View File

@ -102,6 +102,7 @@ subroutine evUGF2(maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,evDyn,spin_conserved,
eGF2(:,:) = eHF(:,:)
eOld(:,:) = eHF(:,:)
Z(:,:) = 1d0
rcond(:) = 0d0
!------------------------------------------------------------------------
! Main loop

View File

@ -94,6 +94,8 @@ subroutine qsGF2(maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,evDyn,singlet,triplet,
nBasSq = nBas*nBas
print*,maxSCF
! TDA
if(TDA) then
@ -119,7 +121,7 @@ subroutine qsGF2(maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,evDyn,singlet,triplet,
c(:,:) = cHF(:,:)
F_diis(:,:) = 0d0
error_diis(:,:) = 0d0
rcond = 1d0
rcond = 0d0
!------------------------------------------------------------------------
! Main loop

View File

@ -135,7 +135,7 @@ subroutine qsUGF2(maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,evDyn,spin_conserved,
c(:,:,:) = cHF(:,:,:)
F_diis(:,:,:) = 0d0
error_diis(:,:,:) = 0d0
rcond = 1d0
rcond(:) = 0d0
!------------------------------------------------------------------------
! Main loop

View File

@ -58,7 +58,8 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
integer :: iblock
double precision :: EcRPA(nspin)
double precision,allocatable :: TA(:,:),TB(:,:)
double precision,allocatable :: TAs(:,:),TBs(:,:)
double precision,allocatable :: TAt(:,:),TBt(:,:)
double precision,allocatable :: OmBSE(:,:)
double precision,allocatable :: XpY_BSE(:,:,:)
double precision,allocatable :: XmY_BSE(:,:,:)
@ -69,16 +70,12 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
! Memory allocation
allocate(TA(nS,nS),TB(nS,nS),OmBSE(nS,nspin),XpY_BSE(nS,nS,nspin),XmY_BSE(nS,nS,nspin))
allocate(TAs(nS,nS),TBs(nS,nS),TAt(nS,nS),TBt(nS,nS), &
OmBSE(nS,nspin),XpY_BSE(nS,nS,nspin),XmY_BSE(nS,nS,nspin))
! Initialize T matrix
TA(:,:) = 0d0
TB(:,:) = 0d0
!----------------------------------------------
! Compute T-matrix for alpha-beta block
!----------------------------------------------
!---------------------------------------!
! Compute T-matrix for alpha-beta block !
!---------------------------------------!
ispin = 1
iblock = 3
@ -88,17 +85,17 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
! call excitation_density_Tmatrix(iblock,nBas,nC,nO,nV,nR,nOOs,nVVs,ERI,X1s,Y1s,rho1s,X2s,Y2s,rho2s)
call static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,ERI,Omega1s,rho1s,Omega2s,rho2s,TA)
if(.not.TDA) call static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,ERI,Omega1s,rho1s,Omega2s,rho2s,TB)
call static_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,Omega1s,rho1s,Omega2s,rho2s,TAs)
if(.not.TDA) call static_Tmatrix_B(eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,Omega1s,rho1s,Omega2s,rho2s,TBs)
! print*,'aa block of TA'
! call matout(nS,nS,TA)
! print*,'aa block of TB'
! call matout(nS,nS,TB)
! print*,'ab block of TA'
! call matout(nS,nS,TAs)
! print*,'ab block of TB'
! call matout(nS,nS,TBs)
!----------------------------------------------
! Compute T-matrix for alpha-alpha block
!----------------------------------------------
!----------------------------------------!
! Compute T-matrix for alpha-alpha block !
!----------------------------------------!
ispin = 2
iblock = 4
@ -108,17 +105,17 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
! call excitation_density_Tmatrix(iblock,nBas,nC,nO,nV,nR,nOOt,nVVt,ERI,X1t,Y1t,rho1t,X2t,Y2t,rho2t)
call static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,ERI,Omega1t,rho1t,Omega2t,rho2t,TA)
if(.not.TDA) call static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,ERI,Omega1t,rho1t,Omega2t,rho2t,TB)
call static_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,Omega1t,rho1t,Omega2t,rho2t,TAt)
if(.not.TDA) call static_Tmatrix_B(eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,Omega1t,rho1t,Omega2t,rho2t,TBt)
! print*,'aa+ab block of TA'
! call matout(nS,nS,TA)
! print*,'aa+ab block of TB'
! call matout(nS,nS,TB)
! print*,'aa block of TA'
! call matout(nS,nS,TAt)
! print*,'aa block of TB'
! call matout(nS,nS,TBt)
!-------------------
! Singlet manifold
!-------------------
!------------------!
! Singlet manifold !
!------------------!
if(singlet) then
@ -127,17 +124,13 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
! Compute BSE singlet excitation energies
call linear_response_Tmatrix(ispin,.false.,TDA,eta,nBas,nC,nO,nV,nR,nS,1d0,eGT,ERI,TA,TB, &
call linear_response_Tmatrix(ispin,.false.,TDA,eta,nBas,nC,nO,nV,nR,nS,1d0,eGT,ERI,TAt+TAs,TBt+TBs, &
EcBSE(ispin),OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
call print_excitation('BSE@GT ',ispin,nS,OmBSE(:,ispin))
call print_transition_vectors(.true.,nBas,nC,nO,nV,nR,nS,dipole_int, &
OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
!-------------------------------------------------
! Compute the dynamical screening at the BSE level
!-------------------------------------------------
if(dBSE) then
! Compute dynamic correction for BSE via perturbation theory (iterative or renormalized)
@ -149,17 +142,19 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
! OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
else
call Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,Omega1s,Omega2s,rho1s,rho2s, &
eT,eGT,dipole_int,OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
call Bethe_Salpeter_Tmatrix_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,nOOt,nVVt, &
Omega1s,Omega2s,Omega1t,Omega2t,rho1s,rho2s,rho1t,rho2t,eT,eGT, &
dipole_int,OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin), &
TAs,TBs,TAt,TBt)
end if
end if
end if
!-------------------
! Triplet manifold
!-------------------
!------------------!
! Triplet manifold !
!------------------!
if(triplet) then
@ -168,30 +163,27 @@ subroutine Bethe_Salpeter_Tmatrix(TDA_T,TDA,dBSE,dTDA,evDyn,singlet,triplet,eta,
! Compute BSE triplet excitation energies
call linear_response_Tmatrix(ispin,.false.,TDA,eta,nBas,nC,nO,nV,nR,nS,1d0,eGT,ERI,TA,TB, &
call linear_response_Tmatrix(ispin,.false.,TDA,eta,nBas,nC,nO,nV,nR,nS,1d0,eGT,ERI,TAt-TAs,TBt-TBs, &
EcBSE(ispin),OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
call print_excitation('BSE@GT ',ispin,nS,OmBSE(:,ispin))
call print_transition_vectors(.false.,nBas,nC,nO,nV,nR,nS,dipole_int, &
OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
!-------------------------------------------------
! Compute the dynamical screening at the BSE level
!-------------------------------------------------
if(dBSE) then
! Compute dynamic correction for BSE via perturbation theory (iterative or renormalized)
if(evDyn) then
print*, ' Iterative dynamical correction for BSE@GT NYI'
! call Bethe_Salpeter_dynamic_perturbation_iterative(dTDA,eta,nBas,nC,nO,nV,nR,nS,eGW,dipole_int,OmRPA,rho_RPA, &
! OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
else
call Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,Omega1t,Omega2t,rho1t,rho2t, &
eT,eGT,dipole_int,OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin))
call Bethe_Salpeter_Tmatrix_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,nOOt,nVVt, &
Omega1s,Omega2s,Omega1t,Omega2t,rho1s,rho2s,rho1t,rho2t,eT,eGT, &
dipole_int,OmBSE(:,ispin),XpY_BSE(:,:,ispin),XmY_BSE(:,:,ispin), &
TAs,TBs,TAt,TBt)
end if
end if

View File

@ -1,5 +1,7 @@
subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,Omega1,Omega2,rho1,rho2, &
eT,eGT,dipole_int,OmBSE,XpY,XmY)
subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(ispin,dTDA,eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,nOOt,nVVt, &
Omega1s,Omega2s,Omega1t,Omega2t,rho1s,rho2s,rho1t,rho2t,eT,eGT, &
dipole_int,OmBSE,XpY,XmY,TAs,TBs,TAt,TBt)
! Compute dynamical effects via perturbation theory for BSE@GT
implicit none
@ -7,6 +9,7 @@ subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR
! Input variables
integer,intent(in) :: ispin
logical,intent(in) :: dTDA
double precision,intent(in) :: eta
integer,intent(in) :: nBas
@ -16,8 +19,10 @@ subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR
integer,intent(in) :: nR
integer,intent(in) :: nS
integer,intent(in) :: nOO
integer,intent(in) :: nVV
integer,intent(in) :: nOOs
integer,intent(in) :: nVVs
integer,intent(in) :: nOOt
integer,intent(in) :: nVVt
double precision,intent(in) :: eT(nBas)
double precision,intent(in) :: eGT(nBas)
@ -26,16 +31,25 @@ subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR
double precision,intent(in) :: XpY(nS,nS)
double precision,intent(in) :: XmY(nS,nS)
double precision,intent(in) :: Omega1(nVV)
double precision,intent(in) :: Omega2(nOO)
double precision,intent(in) :: rho1(nBas,nBas,nVV)
double precision,intent(in) :: rho2(nBas,nBas,nOO)
double precision,intent(in) :: Omega1s(nVVs)
double precision,intent(in) :: Omega2s(nOOs)
double precision,intent(in) :: rho1s(nBas,nBas,nVVs)
double precision,intent(in) :: rho2s(nBas,nBas,nOOs)
double precision,intent(in) :: Omega1t(nVVt)
double precision,intent(in) :: Omega2t(nOOt)
double precision,intent(in) :: rho1t(nBas,nBas,nVVt)
double precision,intent(in) :: rho2t(nBas,nBas,nOOt)
double precision,intent(in) :: TAs(nS,nS)
double precision,intent(in) :: TBs(nS,nS)
double precision,intent(in) :: TAt(nS,nS)
double precision,intent(in) :: TBt(nS,nS)
! Local variables
integer :: ia
integer,parameter :: maxS = 10
integer :: maxS = 10
double precision :: gapGT
double precision,allocatable :: OmDyn(:)
@ -43,30 +57,63 @@ subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR
double precision,allocatable :: X(:)
double precision,allocatable :: Y(:)
double precision,allocatable :: Ap_dyn(:,:)
double precision,allocatable :: ZAp_dyn(:,:)
double precision,allocatable :: dTAs(:,:)
double precision,allocatable :: ZAs(:,:)
double precision,allocatable :: Bp_dyn(:,:)
double precision,allocatable :: ZBp_dyn(:,:)
double precision,allocatable :: Am_dyn(:,:)
double precision,allocatable :: ZAm_dyn(:,:)
double precision,allocatable :: Bm_dyn(:,:)
double precision,allocatable :: ZBm_dyn(:,:)
double precision,allocatable :: dTAt(:,:)
double precision,allocatable :: ZAt(:,:)
! Memory allocation
allocate(OmDyn(nS),ZDyn(nS),X(nS),Y(nS),Ap_dyn(nS,nS),ZAp_dyn(nS,nS))
if(.not.dTDA) allocate(Am_dyn(nS,nS),ZAm_dyn(nS,nS),Bp_dyn(nS,nS),ZBp_dyn(nS,nS),Bm_dyn(nS,nS),ZBm_dyn(nS,nS))
maxS = min(nS,maxS)
allocate(OmDyn(maxS),ZDyn(maxS),X(nS),Y(nS),dTAs(nS,nS),ZAs(nS,nS),dTAt(nS,nS),ZAt(nS,nS))
if(dTDA) then
write(*,*)
write(*,*) '*** dynamical TDA activated ***'
write(*,*)
else
print*, ' Beyond-TDA dynamical correction for BSE@GT NYI'
return
end if
OmDyn(:) = 0d0
ZDyn(:) = 0d0
do ia=1,maxS
! Compute dynamical T-matrix for alpha-beta block
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOs,nVVs,1d0,eGT,Omega1s,Omega2s,rho1s,rho2s,OmBSE(ia),dTAs,ZAs)
! Compute dynamical T-matrix for alpha-beta block
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOOt,nVVt,1d0,eGT,Omega1t,Omega2t,rho1t,rho2t,OmBSE(ia),dTAt,ZAt)
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
! First-order correction
if(ispin == 1) then
ZDyn(ia) = - dot_product(X,matmul(ZAt+ZAs,X))
OmDyn(ia) = - dot_product(X,matmul(dTAt+dTAs,X)) + dot_product(X,matmul(TAt+TAs,X))
end if
if(ispin == 2) then
ZDyn(ia) = - dot_product(X,matmul(ZAt-ZAs,X))
OmDyn(ia) = - dot_product(X,matmul(dTAt-dTAs,X)) + dot_product(X,matmul(TAt-TAs,X))
end if
ZDyn(ia) = 1d0/(1d0 - ZDyn(ia))
OmDyn(ia) = ZDyn(ia)*OmDyn(ia)
end do
!--------------!
! Dump results !
!--------------!
gapGT = eGT(nO+1) - eGT(nO)
write(*,*) '---------------------------------------------------------------------------------------------------'
@ -77,54 +124,11 @@ subroutine Bethe_Salpeter_Tmatrix_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR
write(*,'(2X,A5,1X,A20,1X,A20,1X,A20,1X,A20)') '#','Static (eV)','Dynamic (eV)','Correction (eV)','Renorm. (eV)'
write(*,*) '---------------------------------------------------------------------------------------------------'
do ia=1,min(nS,maxS)
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
! First-order correction
if(dTDA) then
! Resonant part of the BSE correction for dynamical TDA
call dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,1d0,eGT,Omega1,Omega2,rho1,rho2,OmBSE(ia),Ap_dyn,Zap_dyn)
ZDyn(ia) = dot_product(X,matmul(ZAp_dyn,X))
OmDyn(ia) = dot_product(X,matmul( Ap_dyn,X))
else
print*, ' Beyond-TDA dynamical correction for BSE@GT NYI'
! Resonant and anti-resonant part of the BSE correction
! call dynamic_Tmatrix_TAB(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,1d0,eGT,Omega1,Omega2,rho1,rho2,OmBSE(ia), &
! Ap_dyn,Am_dyn,Bp_dyn,Bm_dyn)
! Renormalization factor of the resonant and anti-resonant parts
! call dynamic_Tmatrix_ZAB(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,1d0,eGT,Omega1,Omega2,rho1,rho2,OmBSE(ia), &
! ZAp_dyn,ZAm_dyn,ZBp_dyn,ZBm_dyn)
ZDyn(ia) = dot_product(X,matmul(ZAp_dyn,X)) &
- dot_product(Y,matmul(ZAm_dyn,Y)) &
+ dot_product(X,matmul(ZBp_dyn,Y)) &
- dot_product(Y,matmul(ZBm_dyn,X))
OmDyn(ia) = dot_product(X,matmul(Ap_dyn,X)) &
- dot_product(Y,matmul(Am_dyn,Y)) &
+ dot_product(X,matmul(Bp_dyn,Y)) &
- dot_product(Y,matmul(Bm_dyn,X))
end if
ZDyn(ia) = 1d0/(1d0 - ZDyn(ia))
OmDyn(ia) = ZDyn(ia)*OmDyn(ia)
do ia=1,maxS
write(*,'(2X,I5,5X,F15.6,5X,F15.6,5X,F15.6,5X,F15.6)') &
ia,OmBSE(ia)*HaToeV,(OmBSE(ia)+OmDyn(ia))*HaToeV,OmDyn(ia)*HaToeV,ZDyn(ia)
end do
write(*,*) '---------------------------------------------------------------------------------------------------'
write(*,*)

View File

@ -48,6 +48,7 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
double precision :: EcRPA(nspin)
double precision :: EcBSE(nspin)
double precision :: EcAC(nspin)
double precision :: EcGM
double precision,allocatable :: Omega1s(:),Omega1t(:)
double precision,allocatable :: X1s(:,:),X1t(:,:)
double precision,allocatable :: Y1s(:,:),Y1t(:,:)
@ -60,11 +61,6 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
double precision,allocatable :: SigT(:)
double precision,allocatable :: Z(:)
double precision,allocatable :: Omega(:,:)
double precision,allocatable :: XpY(:,:,:)
double precision,allocatable :: XmY(:,:,:)
double precision,allocatable :: rho(:,:,:,:)
! Output variables
double precision,intent(out) :: eG0T0(nBas)
@ -81,6 +77,8 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
nOOs = nO*nO
nVVs = nV*nV
! nOOs = nO*(nO + 1)/2
! nVVs = nV*(nV + 1)/2
nOOt = nO*(nO - 1)/2
nVVt = nV*(nV - 1)/2
@ -101,6 +99,7 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
ispin = 1
iblock = 3
! iblock = 1
! Compute linear response
@ -109,8 +108,8 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
! EcRPA(ispin) = 1d0*EcRPA(ispin)
! call print_excitation('pp-RPA (N+2)',iblock,nVVs,Omega1s(:))
! call print_excitation('pp-RPA (N-2)',iblock,nOOs,Omega2s(:))
call print_excitation('pp-RPA (N+2)',iblock,nVVs,Omega1s(:))
call print_excitation('pp-RPA (N-2)',iblock,nOOs,Omega2s(:))
!----------------------------------------------
! alpha-alpha block
@ -127,34 +126,51 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
! EcRPA(ispin) = 2d0*EcRPA(ispin)
! EcRPA(ispin) = 3d0*EcRPA(ispin)
! call print_excitation('pp-RPA (N+2)',iblock,nVVt,Omega1t(:))
! call print_excitation('pp-RPA (N-2)',iblock,nOOt,Omega2t(:))
call print_excitation('pp-RPA (N+2)',iblock,nVVt,Omega1t(:))
call print_excitation('pp-RPA (N-2)',iblock,nOOt,Omega2t(:))
!----------------------------------------------
! Compute T-matrix version of the self-energy
!----------------------------------------------
EcGM = 0d0
SigT(:) = 0d0
Z(:) = 0d0
iblock = 3
! iblock = 1
call excitation_density_Tmatrix(iblock,nBas,nC,nO,nV,nR,nOOs,nVVs,ERI_MO,X1s,Y1s,rho1s,X2s,Y2s,rho2s)
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF,Omega1s,rho1s,Omega2s,rho2s,SigT)
if(regularize) then
call regularized_self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF,Omega1s,rho1s,Omega2s,rho2s,EcGM,SigT)
call regularized_renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF,Omega1s,rho1s,Omega2s,rho2s,Z)
else
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF,Omega1s,rho1s,Omega2s,rho2s,EcGM,SigT)
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eHF,Omega1s,rho1s,Omega2s,rho2s,Z)
end if
iblock = 4
call excitation_density_Tmatrix(iblock,nBas,nC,nO,nV,nR,nOOt,nVVt,ERI_MO,X1t,Y1t,rho1t,X2t,Y2t,rho2t)
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF,Omega1t,rho1t,Omega2t,rho2t,SigT)
if(regularize) then
call regularized_self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF,Omega1t,rho1t,Omega2t,rho2t,EcGM,SigT)
call regularized_renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF,Omega1t,rho1t,Omega2t,rho2t,Z)
else
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF,Omega1t,rho1t,Omega2t,rho2t,EcGM,SigT)
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eHF,Omega1t,rho1t,Omega2t,rho2t,Z)
Z(:) = 1d0/(1d0 - Z(:))
end if
Z(:) = 1d0/(1d0 - Z(:))
!----------------------------------------------
! Compute the exchange part of the self-energy
@ -184,6 +200,8 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
ispin = 1
iblock = 3
! iblock = 1
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOs,nVVs,1d0,eG0T0,ERI_MO, &
Omega1s,X1s,Y1s,Omega2s,X2s,Y2s,EcRPA(ispin))
ispin = 2
@ -194,7 +212,7 @@ subroutine G0T0(doACFDT,exchange_kernel,doXBS,BSE,TDA_T,TDA,dBSE,dTDA,evDyn,sing
EcRPA(1) = EcRPA(1) - EcRPA(2)
EcRPA(2) = 3d0*EcRPA(2)
call print_G0T0(nBas,nO,eHF,ENuc,ERHF,SigT,Z,eG0T0,EcRPA)
call print_G0T0(nBas,nO,eHF,ENuc,ERHF,SigT,Z,eG0T0,EcGM,EcRPA)
! Perform BSE calculation

View File

@ -1,4 +1,4 @@
subroutine dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,eGT,Omega1,Omega2,rho1,rho2,OmBSE,A_dyn,ZA_dyn)
subroutine dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,eGT,Omega1,Omega2,rho1,rho2,OmBSE,TA,ZA)
! Compute the dynamic part of the Bethe-Salpeter equation matrices for GT
@ -36,13 +36,13 @@ subroutine dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,eGT,Omega1,O
! Output variables
double precision,intent(out) :: A_dyn(nS,nS)
double precision,intent(out) :: ZA_dyn(nS,nS)
double precision,intent(out) :: TA(nS,nS)
double precision,intent(out) :: ZA(nS,nS)
! Initialization
A_dyn(:,:) = 0d0
ZA_dyn(:,:) = 0d0
TA(:,:) = 0d0
ZA(:,:) = 0d0
! Build dynamic A matrix
@ -58,44 +58,30 @@ subroutine dynamic_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,eGT,Omega1,O
chi = 0d0
do cd=1,nVV
eps = - Omega1(cd)
chi = chi + rho1(i,b,cd)*rho1(j,a,cd)*eps/(eps**2 + eta**2)
eps = + OmBSE - Omega1(cd) + (eGT(i) + eGT(j))
chi = chi + rho1(i,b,cd)*rho1(a,j,cd)*eps/(eps**2 + eta**2)
end do
do kl=1,nOO
eps = + Omega2(kl)
chi = chi + rho2(i,b,kl)*rho2(j,a,kl)*eps/(eps**2 + eta**2)
eps = + OmBSE + Omega2(kl) - (eGT(a) + eGT(b))
chi = chi + rho2(i,b,kl)*rho2(a,j,kl)*eps/(eps**2 + eta**2)
end do
A_dyn(ia,jb) = A_dyn(ia,jb) - lambda*chi
TA(ia,jb) = TA(ia,jb) - lambda*chi
chi = 0d0
do cd=1,nVV
eps = + OmBSE - Omega1(cd) + (eGT(i) + eGT(j))
chi = chi + rho1(i,b,cd)*rho1(j,a,cd)*eps/(eps**2 + eta**2)
chi = chi + rho1(i,b,cd)*rho1(a,j,cd)*(eps**2 - eta**2)/(eps**2 + eta**2)**2
end do
do kl=1,nOO
eps = + OmBSE + Omega2(kl) - (eGT(a) + eGT(b))
chi = chi + rho2(i,b,kl)*rho2(j,a,kl)*eps/(eps**2 + eta**2)
chi = chi + rho2(i,b,kl)*rho2(a,j,kl)*(eps**2 - eta**2)/(eps**2 + eta**2)**2
end do
A_dyn(ia,jb) = A_dyn(ia,jb) + 1d0*lambda*chi
chi = 0d0
do cd=1,nVV
eps = + OmBSE - Omega1(cd) + (eGT(i) + eGT(j))
chi = chi + rho1(i,b,cd)*rho1(j,a,cd)*(eps**2 - eta**2)/(eps**2 + eta**2)**2
end do
do kl=1,nOO
eps = + OmBSE + Omega2(kl) - (eGT(a) + eGT(b))
chi = chi + rho2(i,b,kl)*rho2(j,a,kl)*(eps**2 - eta**2)/(eps**2 + eta**2)**2
end do
ZA_dyn(ia,jb) = ZA_dyn(ia,jb) - 1d0*lambda*chi
ZA(ia,jb) = ZA(ia,jb) + lambda*chi
end do
end do

View File

@ -0,0 +1,91 @@
subroutine dynamic_Tmatrix_B(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,eGT,Omega1,Omega2,rho1,rho2,OmBSE,TB,ZB)
! Compute the off-diagonal dynamic part of the Bethe-Salpeter equation matrices for GT
implicit none
include 'parameters.h'
! Input variables
double precision,intent(in) :: eta
integer,intent(in) :: nBas
integer,intent(in) :: nC
integer,intent(in) :: nO
integer,intent(in) :: nV
integer,intent(in) :: nR
integer,intent(in) :: nS
integer,intent(in) :: nOO
integer,intent(in) :: nVV
double precision,intent(in) :: lambda
double precision,intent(in) :: eGT(nBas)
double precision,intent(in) :: OmBSE
double precision,intent(in) :: Omega1(nVV)
double precision,intent(in) :: Omega2(nOO)
double precision,intent(in) :: rho1(nBas,nBas,nVV)
double precision,intent(in) :: rho2(nBas,nBas,nOO)
! Local variables
double precision :: chi
double precision :: eps
integer :: i,j,a,b,ia,jb,cd,kl
! Output variables
double precision,intent(out) :: TB(nS,nS)
double precision,intent(out) :: ZB(nS,nS)
! Initialization
TB(:,:) = 0d0
ZB(:,:) = 0d0
! Build dynamic A matrix
ia = 0
do i=nC+1,nO
do a=nO+1,nBas-nR
ia = ia + 1
jb = 0
do j=nC+1,nO
do b=nO+1,nBas-nR
jb = jb + 1
chi = 0d0
do cd=1,nVV
eps = + OmBSE - Omega1(cd) + (eGT(i) + eGT(b))
chi = chi + rho1(i,j,cd)*rho1(b,a,cd)*eps/(eps**2 + eta**2)
end do
do kl=1,nOO
eps = + OmBSE + Omega2(kl) - (eGT(a) + eGT(j))
chi = chi + rho2(i,j,kl)*rho2(b,a,kl)*eps/(eps**2 + eta**2)
end do
TB(ia,jb) = TB(ia,jb) + lambda*chi
chi = 0d0
do cd=1,nVV
eps = + OmBSE - Omega1(cd) + (eGT(i) + eGT(b))
chi = chi + rho1(i,j,cd)*rho1(b,a,cd)*(eps**2 - eta**2)/(eps**2 + eta**2)**2
end do
do kl=1,nOO
eps = + OmBSE + Omega2(kl) - (eGT(a) + eGT(j))
chi = chi + rho2(i,a,kl)*rho2(b,a,kl)*(eps**2 - eta**2)/(eps**2 + eta**2)**2
end do
ZB(ia,jb) = ZB(ia,jb) - lambda*chi
end do
end do
end do
end do
end subroutine dynamic_Tmatrix_B

View File

@ -46,7 +46,6 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
! Local variables
logical :: linear_mixing
integer :: nSCF
integer :: n_diis
double precision :: rcond
@ -55,6 +54,7 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
integer :: iblock
integer :: nOOs,nOOt
integer :: nVVs,nVVt
double precision :: EcGM
double precision :: EcRPA(nspin)
double precision :: EcBSE(nspin)
double precision :: EcAC(nspin)
@ -117,6 +117,7 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
eGT(:) = eG0T0(:)
eOld(:) = eGT(:)
Z(:) = 1d0
rcond = 0d0
!------------------------------------------------------------------------
! Main loop
@ -148,10 +149,14 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOt,nVVt,1d0,eGT,ERI_MO, &
Omega1t,X1t,Y1t,Omega2t,X2t,Y2t,EcRPA(ispin))
EcRPA(1) = EcRPA(1) - EcRPA(2)
EcRPA(2) = 3d0*EcRPA(2)
!----------------------------------------------
! Compute T-matrix version of the self-energy
!----------------------------------------------
EcGM = 0d0
SigT(:) = 0d0
Z(:) = 0d0
@ -161,7 +166,7 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
X1s,Y1s,rho1s,X2s,Y2s,rho2s)
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eGT, &
Omega1s,rho1s,Omega2s,rho2s,SigT)
Omega1s,rho1s,Omega2s,rho2s,EcGM,SigT)
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eGT, &
Omega1s,rho1s,Omega2s,rho2s,Z)
@ -172,7 +177,7 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
X1t,Y1t,rho1t,X2t,Y2t,rho2t)
call self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eGT, &
Omega1t,rho1t,Omega2t,rho2t,SigT)
Omega1t,rho1t,Omega2t,rho2t,EcGM,SigT)
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eGT, &
Omega1t,rho1t,Omega2t,rho2t,Z)
@ -195,7 +200,7 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
! Dump results
!----------------------------------------------
call print_evGT(nBas,nO,nSCF,Conv,eHF,SigT,Z,eGT)
call print_evGT(nBas,nO,nSCF,Conv,eHF,ENuc,ERHF,SigT,Z,eGT,EcGM,EcRPA)
! DIIS extrapolation
@ -219,29 +224,6 @@ subroutine evGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS, &
! End main loop
!------------------------------------------------------------------------
! Compute the ppRPA correlation energy
ispin = 1
iblock = 3
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOs,nVVs,1d0,eGT,ERI_MO, &
Omega1s,X1s,Y1s,Omega2s,X2s,Y2s,EcRPA(ispin))
ispin = 2
iblock = 4
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOt,nVVt,1d0,eGT,ERI_MO, &
Omega1t,X1t,Y1t,Omega2t,X2t,Y2t,EcRPA(ispin))
EcRPA(1) = EcRPA(1) - EcRPA(2)
EcRPA(2) = 3d0*EcRPA(2)
write(*,*)
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@evGT correlation energy (singlet) =',EcRPA(1)
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@evGT correlation energy (triplet) =',EcRPA(2)
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@evGT correlation energy =',EcRPA(1) + EcRPA(2)
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@evGT total energy =',ENuc + ERHF + EcRPA(1) + EcRPA(2)
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
! Perform BSE calculation
if(BSE) then

View File

@ -22,8 +22,8 @@ subroutine excitation_density_Tmatrix(ispin,nBas,nC,nO,nV,nR,nOO,nVV,ERI,X1,Y1,r
! Local variables
integer :: k,l
integer :: c,d
integer :: i,j,k,l
integer :: a,b,c,d
integer :: p,q
integer :: ab,cd,ij,kl
double precision,external :: Kronecker_delta
@ -47,45 +47,71 @@ subroutine excitation_density_Tmatrix(ispin,nBas,nC,nO,nV,nR,nOO,nVV,ERI,X1,Y1,r
do p=nC+1,nBas-nR
do q=nC+1,nBas-nR
do ab=1,nVV
! do ab=1,nVV
ab = 0
do a=nO+1,nBas-nR
do b=a,nBas-nR
ab = ab + 1
cd = 0
do c=nO+1,nBas-nR
! do d=nO+1,c
do d=c,nBas-nR
cd = cd + 1
rho1(p,q,ab) = rho1(p,q,ab) + ERI(p,q,c,d)*X1(cd,ab)
rho1(p,q,ab) = rho1(p,q,ab) &
+ (1d0*ERI(p,q,c,d) + 0d0*ERI(p,q,d,c))*X1(cd,ab)
! + ERI(p,q,c,d)*X1(cd,ab)/sqrt((1d0 + Kronecker_delta(c,d)))
! + (ERI(p,q,c,d) + ERI(p,q,d,c))*X1(cd,ab)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d)))
end do
end do
kl = 0
do k=nC+1,nO
! do l=nC+1,k
do l=k,nO
kl = kl + 1
rho1(p,q,ab) = rho1(p,q,ab) + ERI(p,q,k,l)*Y1(kl,ab)
rho1(p,q,ab) = rho1(p,q,ab) &
+ (1d0*ERI(p,q,k,l) + 0d0*ERI(p,q,l,k))*Y1(kl,ab)
! + ERI(p,q,k,l)*Y1(kl,ab)/sqrt((1d0 + Kronecker_delta(k,l)))
! + (ERI(p,q,k,l) + ERI(p,q,l,k))*Y1(kl,ab)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(k,l)))
end do
end do
end do
end do
do ij=1,nOO
! do ij=1,nOO
ij = 0
do i=nC+1,nO
do j=i,nO
ij = ij + 1
cd = 0
do c=nO+1,nBas-nR
! do d=nO+1,c
do d=c,nBas-nR
cd = cd + 1
rho2(p,q,ij) = rho2(p,q,ij) + ERI(p,q,c,d)*X2(cd,ij)
rho2(p,q,ij) = rho2(p,q,ij) &
+ (1d0*ERI(p,q,c,d) + 0d0*ERI(p,q,d,c))*X2(cd,ij)
! + ERI(p,q,c,d)*X2(cd,ij)/sqrt((1d0 + Kronecker_delta(c,d)))
! + (ERI(p,q,c,d) + ERI(p,q,d,c))*X2(cd,ij)/sqrt((1d0 + Kronecker_delta(i,j))*(1d0 + Kronecker_delta(c,d)))
end do
end do
kl = 0
do k=nC+1,nO
! do l=nC+1,k
do l=k,nO
kl = kl + 1
rho2(p,q,ij) = rho2(p,q,ij) + ERI(p,q,k,l)*Y2(kl,ij)
rho2(p,q,ij) = rho2(p,q,ij) &
+ (1d0*ERI(p,q,k,l) + 0d0*ERI(p,q,l,k))*Y2(kl,ij)
! + ERI(p,q,k,l)*Y2(kl,ij)/sqrt((1d0 + Kronecker_delta(k,l)))
! + (ERI(p,q,k,l) + ERI(p,q,l,k))*Y2(kl,ij)/sqrt((1d0 + Kronecker_delta(i,j))*(1d0 + Kronecker_delta(k,l)))
end do
end do
end do
end do
end do
end do

View File

@ -1,13 +1,15 @@
subroutine print_G0T0(nBas,nO,eHF,ENuc,ERHF,SigT,Z,eGT,EcRPA)
subroutine print_G0T0(nBas,nO,eHF,ENuc,ERHF,SigT,Z,eGT,EcGM,EcRPA)
! Print one-electron energies and other stuff for G0T0
implicit none
include 'parameters.h'
integer,intent(in) :: nBas,nO
integer,intent(in) :: nBas
integer,intent(in) :: nO
double precision,intent(in) :: ENuc
double precision,intent(in) :: ERHF
double precision,intent(in) :: EcGM
double precision,intent(in) :: EcRPA(nspin)
double precision,intent(in) :: eHF(nBas)
double precision,intent(in) :: SigT(nBas)
@ -50,10 +52,12 @@ subroutine print_G0T0(nBas,nO,eHF,ENuc,ERHF,SigT,Z,eGT,EcRPA)
write(*,'(2X,A50,F15.6,A3)') 'G0T0 LUMO energy (eV) =',eGT(LUMO)*HaToeV,' eV'
write(*,'(2X,A50,F15.6,A3)') 'G0T0 HOMO-LUMO gap (eV) =',Gap*HaToeV,' eV'
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(2X,A50,F20.10,A3)') 'Tr@RPA@G0T0 correlation energy (singlet) =',EcRPA(1),' au'
write(*,'(2X,A50,F20.10,A3)') 'Tr@RPA@G0T0 correlation energy (triplet) =',EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') 'Tr@RPA@G0T0 correlation energy =',EcRPA(1) + EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') 'Tr@RPA@G0T0 total energy =',ENuc + ERHF + EcRPA(1) + EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 correlation energy (singlet) =',EcRPA(1),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 correlation energy (triplet) =',EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 correlation energy =',EcRPA(1) + EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 total energy =',ENuc + ERHF + EcRPA(1) + EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' GM@G0T0 correlation energy =',EcGM,' au'
write(*,'(2X,A50,F20.10,A3)') ' GM@G0T0 total energy =',ENuc + ERHF + EcGM,' au'
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)

View File

@ -1,4 +1,4 @@
subroutine print_evGT(nBas,nO,nSCF,Conv,eHF,SigT,Z,eGT)
subroutine print_evGT(nBas,nO,nSCF,Conv,eHF,ENuc,ERHF,SigT,Z,eGT,EcGM,EcRPA)
! Print one-electron energies and other stuff for evGT
@ -10,6 +10,10 @@ subroutine print_evGT(nBas,nO,nSCF,Conv,eHF,SigT,Z,eGT)
integer,intent(in) :: nSCF
double precision,intent(in) :: Conv
double precision,intent(in) :: eHF(nBas)
double precision,intent(in) :: ENuc
double precision,intent(in) :: ERHF
double precision,intent(in) :: EcGM
double precision,intent(in) :: EcRPA(nspin)
double precision,intent(in) :: SigT(nBas)
double precision,intent(in) :: Z(nBas)
double precision,intent(in) :: eGT(nBas)
@ -49,6 +53,13 @@ subroutine print_evGT(nBas,nO,nSCF,Conv,eHF,SigT,Z,eGT)
write(*,'(2X,A30,F15.6)') 'evGT LUMO energy (eV):',eGT(LUMO)*HaToeV
write(*,'(2X,A30,F15.6)') 'evGT HOMO-LUMO gap (eV):',Gap*HaToeV
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 correlation energy (singlet) =',EcRPA(1),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 correlation energy (triplet) =',EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 correlation energy =',EcRPA(1) + EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' Tr@ppRPA@G0T0 total energy =',ENuc + ERHF + EcRPA(1) + EcRPA(2),' au'
write(*,'(2X,A50,F20.10,A3)') ' GM@G0T0 correlation energy =',EcGM,' au'
write(*,'(2X,A50,F20.10,A3)') ' GM@G0T0 total energy =',ENuc + ERHF + EcGM,' au'
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
end subroutine print_evGT

View File

@ -48,9 +48,9 @@ subroutine print_qsGT(nBas,nO,nSCF,Conv,thresh,eHF,eGT,c,SigC,Z,ENuc,ET,EV,EJ,Ex
write(*,*)'-------------------------------------------------------------------------------'
if(nSCF < 10) then
write(*,'(1X,A21,I1,A1,I1,A12)')' Self-consistent qsG',nSCF,'W',nSCF,' calculation'
write(*,'(1X,A21,I1,A1,I1,A12)')' Self-consistent qsG',nSCF,'T',nSCF,' calculation'
else
write(*,'(1X,A21,I2,A1,I2,A12)')' Self-consistent qsG',nSCF,'W',nSCF,' calculation'
write(*,'(1X,A21,I2,A1,I2,A12)')' Self-consistent qsG',nSCF,'T',nSCF,' calculation'
endif
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(1X,A1,1X,A3,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X,A15,1X,A1,1X)') &
@ -73,7 +73,7 @@ subroutine print_qsGT(nBas,nO,nSCF,Conv,thresh,eHF,eGT,c,SigC,Z,ENuc,ET,EV,EJ,Ex
write(*,'(2X,A30,F15.6,A3)') ' qsGT total energy:',ENuc + EqsGT,' au'
write(*,'(2X,A30,F15.6,A3)') ' qsGT exchange energy:',Ex,' au'
write(*,'(2X,A30,F15.6,A3)') ' GM@qsGT correlation energy:',EcGM,' au'
write(*,'(2X,A30,F15.6,A3)') 'RPA@qsGT correlation energy:',sum(EcRPA(:)),' au'
write(*,'(2X,A30,F15.6,A3)') 'ppRPA@qsGT correlation energy:',sum(EcRPA(:)),' au'
write(*,*)'-------------------------------------------'
write(*,*)

View File

@ -70,7 +70,6 @@ subroutine qsGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_T,T
integer :: nOOs,nOOt
integer :: nVVs,nVVt
logical :: print_W = .false.
double precision,allocatable :: error_diis(:,:)
double precision,allocatable :: F_diis(:,:)
double precision,allocatable :: c(:,:)
@ -160,7 +159,7 @@ subroutine qsGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_T,T
c(:,:) = cHF(:,:)
F_diis(:,:) = 0d0
error_diis(:,:) = 0d0
rcond = 1d0
rcond = 0d0
!------------------------------------------------------------------------
! Main loop
@ -198,8 +197,12 @@ subroutine qsGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_T,T
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOt,nVVt,1d0,eGT,ERI_MO, &
Omega1t,X1t,Y1t,Omega2t,X2t,Y2t,EcRPA(ispin))
EcRPA(1) = EcRPA(1) - EcRPA(2)
EcRPA(2) = 3d0*EcRPA(2)
! Compute correlation part of the self-energy
EcGM = 0d0
SigT(:,:) = 0d0
Z(:) = 0d0
@ -208,23 +211,48 @@ subroutine qsGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_T,T
call excitation_density_Tmatrix(iblock,nBas,nC,nO,nV,nR,nOOs,nVVs,ERI_MO, &
X1s,Y1s,rho1s,X2s,Y2s,rho2s)
if(regularize) then
call regularized_self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eGT, &
Omega1s,rho1s,Omega2s,rho2s,EcGM,SigT)
call regularized_renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eGT, &
Omega1s,rho1s,Omega2s,rho2s,Z)
else
call self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eGT, &
Omega1s,rho1s,Omega2s,rho2s,SigT)
Omega1s,rho1s,Omega2s,rho2s,EcGM,SigT)
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOs,nVVs,eGT, &
Omega1s,rho1s,Omega2s,rho2s,Z)
end if
iblock = 4
call excitation_density_Tmatrix(iblock,nBas,nC,nO,nV,nR,nOOt,nVVt,ERI_MO, &
X1t,Y1t,rho1t,X2t,Y2t,rho2t)
if(regularize) then
call self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eGT, &
Omega1t,rho1t,Omega2t,rho2t,SigT)
Omega1t,rho1t,Omega2t,rho2t,EcGM,SigT)
call renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eGT, &
Omega1t,rho1t,Omega2t,rho2t,Z)
else
call regularized_self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eGT, &
Omega1t,rho1t,Omega2t,rho2t,EcGM,SigT)
call regularized_renormalization_factor_Tmatrix(eta,nBas,nC,nO,nV,nR,nOOt,nVVt,eGT, &
Omega1t,rho1t,Omega2t,rho2t,Z)
end if
Z(:) = 1d0/(1d0 - Z(:))
! Make correlation self-energy Hermitian and transform it back to AO basis
@ -302,28 +330,6 @@ subroutine qsGT(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_T,T
! End main loop
!------------------------------------------------------------------------
! Compute the ppRPA correlation energy
ispin = 1
iblock = 3
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOs,nVVs,1d0,eGT,ERI_MO, &
Omega1s,X1s,Y1s,Omega2s,X2s,Y2s,EcRPA(ispin))
ispin = 2
iblock = 4
call linear_response_pp(iblock,TDA_T,nBas,nC,nO,nV,nR,nOOt,nVVt,1d0,eGT,ERI_MO, &
Omega1t,X1t,Y1t,Omega2t,X2t,Y2t,EcRPA(ispin))
EcRPA(1) = EcRPA(1) - EcRPA(2)
EcRPA(2) = 3d0*EcRPA(2)
write(*,*)
write(*,*)'-------------------------------------------------------------------------------'
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@qsGT correlation energy (singlet) =',EcRPA(1)
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@qsGT correlation energy (triplet) =',EcRPA(2)
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@qsGT correlation energy =',EcRPA(1) + EcRPA(2)
write(*,'(2X,A50,F20.10)') 'Tr@ppRPA@qsGT total energy =',ENuc + ERHF + EcRPA(1) + EcRPA(2)
write(*,*)'-------------------------------------------------------------------------------'
write(*,*)
! Did it actually converge?
if(nSCF == maxSCF+1) then

View File

@ -1,4 +1,4 @@
subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,SigT)
subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,EcGM,SigT)
! Compute the correlation part of the T-matrix self-energy
@ -23,11 +23,12 @@ subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2
! Local variables
integer :: i,a,p,q,cd,kl
integer :: i,j,a,b,p,q,cd,kl
double precision :: eps
! Output variables
double precision,intent(inout):: EcGM
double precision,intent(inout):: SigT(nBas,nBas)
!----------------------------------------------
@ -60,4 +61,26 @@ subroutine self_energy_Tmatrix(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2
enddo
enddo
!----------------------------------------------
! Galitskii-Migdal correlation energy
!----------------------------------------------
do i=nC+1,nO
do j=nC+1,nO
do cd=1,nVV
eps = e(i) + e(j) - Omega1(cd)
EcGM = EcGM + rho1(i,j,cd)*rho1(i,j,cd)*eps/(eps**2 + eta**2)
enddo
enddo
enddo
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
do kl=1,nOO
eps = e(a) + e(b) - Omega2(kl)
EcGM = EcGM - rho2(a,b,kl)*rho2(a,b,kl)*eps/(eps**2 + eta**2)
enddo
enddo
enddo
end subroutine self_energy_Tmatrix

View File

@ -1,4 +1,4 @@
subroutine self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,SigT)
subroutine self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,Omega2,rho2,EcGM,SigT)
! Compute diagonal of the correlation part of the T-matrix self-energy
@ -23,11 +23,12 @@ subroutine self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,O
! Local variables
integer :: i,a,p,cd,kl
integer :: i,j,a,b,p,cd,kl
double precision :: eps
! Output variables
double precision,intent(inout) :: EcGM
double precision,intent(inout) :: SigT(nBas)
!----------------------------------------------
@ -56,4 +57,26 @@ subroutine self_energy_Tmatrix_diag(eta,nBas,nC,nO,nV,nR,nOO,nVV,e,Omega1,rho1,O
enddo
enddo
!----------------------------------------------
! Galitskii-Migdal correlation energy
!----------------------------------------------
do i=nC+1,nO
do j=nC+1,nO
do cd=1,nVV
eps = e(i) + e(j) - Omega1(cd)
EcGM = EcGM + rho1(i,j,cd)*rho1(i,j,cd)*eps/(eps**2 + eta**2)
enddo
enddo
enddo
do a=nO+1,nBas-nR
do b=nO+1,nBas-nR
do kl=1,nOO
eps = e(a) + e(b) - Omega2(kl)
EcGM = EcGM - rho2(a,b,kl)*rho2(a,b,kl)*eps/(eps**2 + eta**2)
enddo
enddo
enddo
end subroutine self_energy_Tmatrix_diag

View File

@ -1,4 +1,4 @@
subroutine static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Omega1,rho1,Omega2,rho2,TA)
subroutine static_Tmatrix_A(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,Omega1,rho1,Omega2,rho2,TA)
! Compute the OOVV block of the static T-matrix for the resonant block
@ -7,7 +7,6 @@ subroutine static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
! Input variables
integer,intent(in) :: ispin
double precision,intent(in) :: eta
integer,intent(in) :: nBas
integer,intent(in) :: nC
@ -18,7 +17,6 @@ subroutine static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
integer,intent(in) :: nOO
integer,intent(in) :: nVV
double precision,intent(in) :: lambda
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
double precision,intent(in) :: Omega1(nVV)
double precision,intent(in) :: rho1(nBas,nBas,nVV)
double precision,intent(in) :: Omega2(nOO)
@ -34,6 +32,8 @@ subroutine static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
double precision,intent(out) :: TA(nS,nS)
TA(:,:) = 0d0
ia = 0
do i=nC+1,nO
do a=nO+1,nBas-nR
@ -46,13 +46,13 @@ subroutine static_Tmatrix_A(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
chi = 0d0
do cd=1,nVV
eps = - Omega1(cd)
eps = + Omega1(cd)
! chi = chi + lambda*rho1(i,j,cd)*rho1(a,b,cd)*eps/(eps**2 + eta**2)
chi = chi + rho1(i,b,cd)*rho1(a,j,cd)*eps/(eps**2 + eta**2)
enddo
do kl=1,nOO
eps = + Omega2(kl)
eps = - Omega2(kl)
! chi = chi - lambda*rho2(i,j,kl)*rho2(a,b,kl)*eps/(eps**2 + eta**2)
chi = chi + rho2(i,b,kl)*rho2(a,j,kl)*eps/(eps**2 + eta**2)
enddo

View File

@ -1,4 +1,4 @@
subroutine static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Omega1,rho1,Omega2,rho2,TB)
subroutine static_Tmatrix_B(eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,Omega1,rho1,Omega2,rho2,TB)
! Compute the OVVO block of the static T-matrix for the coupling block
@ -7,7 +7,6 @@ subroutine static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
! Input variables
integer,intent(in) :: ispin
double precision,intent(in) :: eta
integer,intent(in) :: nBas
integer,intent(in) :: nC
@ -18,7 +17,6 @@ subroutine static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
integer,intent(in) :: nOO
integer,intent(in) :: nVV
double precision,intent(in) :: lambda
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
double precision,intent(in) :: Omega1(nVV)
double precision,intent(in) :: rho1(nBas,nBas,nVV)
double precision,intent(in) :: Omega2(nOO)
@ -34,6 +32,8 @@ subroutine static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
double precision,intent(out) :: TB(nS,nS)
TB(:,:) = 0d0
ia = 0
do i=nC+1,nO
do a=nO+1,nBas-nR
@ -46,13 +46,13 @@ subroutine static_Tmatrix_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,lambda,ERI,Ome
chi = 0d0
do cd=1,nVV
eps = - Omega1(cd)
eps = + Omega1(cd)
! chi = chi + lambda*rho1(i,b,cd)*rho1(a,j,cd)*Omega1(cd)/Omega1(cd)**2 + eta**2
chi = chi + rho1(i,j,cd)*rho1(a,b,cd)*eps/(eps**2 + eta**2)
enddo
do kl=1,nOO
eps = + Omega2(kl)
eps = - Omega2(kl)
! chi = chi + lambda*rho2(i,b,kl)*rho2(a,j,kl)*Omega2(kl)/Omega2(kl)**2 + eta**2
chi = chi + rho2(i,j,kl)*rho2(a,b,kl)*eps/(eps**2 + eta**2)
enddo

View File

@ -29,7 +29,7 @@ subroutine Bethe_Salpeter_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR,nS,eW,e
integer :: ia
integer,parameter :: maxS = 10
integer :: maxS = 10
double precision :: gapGW
double precision,allocatable :: OmDyn(:)
@ -51,7 +51,8 @@ subroutine Bethe_Salpeter_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR,nS,eW,e
! Memory allocation
allocate(OmDyn(nS),ZDyn(nS),X(nS),Y(nS),Ap_dyn(nS,nS),ZAp_dyn(nS,nS))
maxS = min(nS,maxS)
allocate(OmDyn(maxS),ZDyn(maxS),X(nS),Y(nS),Ap_dyn(nS,nS),ZAp_dyn(nS,nS))
if(.not.dTDA) allocate(Am_dyn(nS,nS),ZAm_dyn(nS,nS),Bp_dyn(nS,nS),ZBp_dyn(nS,nS),Bm_dyn(nS,nS),ZBm_dyn(nS,nS))
@ -71,7 +72,7 @@ subroutine Bethe_Salpeter_dynamic_perturbation(dTDA,eta,nBas,nC,nO,nV,nR,nS,eW,e
write(*,'(2X,A5,1X,A20,1X,A20,1X,A20,1X,A20)') '#','Static (eV)','Dynamic (eV)','Correction (eV)','Renorm. (eV)'
write(*,*) '---------------------------------------------------------------------------------------------------'
do ia=1,min(nS,maxS)
do ia=1,maxS
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))

View File

@ -132,22 +132,26 @@ subroutine UG0W0(doACFDT,exchange_kernel,doXBS,COHSEX,BSE,TDA_W,TDA,dBSE,dTDA,ev
call unrestricted_excitation_density(nBas,nC,nO,nR,nS_aa,nS_bb,nS_sc,ERI_aaaa,ERI_aabb,ERI_bbbb,XpY_RPA,rho_RPA)
!---------------------!
! Compute self-energy !
!---------------------!
!------------------------------------------------!
! Compute self-energy and renormalization factor !
!------------------------------------------------!
do is=1,nspin
call self_energy_exchange_diag(nBas,cHF(:,:,is),PHF(:,:,is),ERI,SigX(:,is))
end do
if(regularize) then
call unrestricted_regularized_self_energy_correlation_diag(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_regularized_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,Z)
else
call unrestricted_self_energy_correlation_diag(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,SigC,EcGM)
!--------------------------------!
! Compute renormalization factor !
!--------------------------------!
call unrestricted_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,Z)
end if
!-----------------------------------!
! Solve the quasi-particle equation !
!-----------------------------------!

View File

@ -139,6 +139,7 @@ subroutine evGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE,
eGW(:) = eG0W0(:)
eOld(:) = eGW(:)
Z(:) = 1d0
rcond = 0d0
!------------------------------------------------------------------------
! Main loop

View File

@ -153,6 +153,7 @@ subroutine evUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
eGW(:,:) = eG0W0(:,:)
eOld(:,:) = eGW(:,:)
Z(:,:) = 1d0
rcond(:) = 0d0
!------------------------------------------------------------------------
! Main loop
@ -180,9 +181,25 @@ subroutine evUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
if(G0W) then
if(regularize) then
call unrestricted_regularized_self_energy_correlation_diag(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_regularized_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,Z)
else
call unrestricted_self_energy_correlation_diag(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,Z)
end if
else
if(regularize) then
call unrestricted_regularized_self_energy_correlation_diag(eta,nBas,nC,nO,nV,nR,nS_sc,eGW,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_regularized_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eGW,OmRPA,rho_RPA,Z)
else
call unrestricted_self_energy_correlation_diag(eta,nBas,nC,nO,nV,nR,nS_sc,eGW,OmRPA,rho_RPA,SigC,EcGM)
@ -190,6 +207,8 @@ subroutine evUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
end if
end if
!-----------------------------------!
! Solve the quasi-particle equation !
!-----------------------------------!

View File

@ -1,4 +1,4 @@
subroutine print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,cGW,PGW,Ov,T,V,J,K, &
subroutine print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,cGW,Ov, &
ENuc,ET,EV,EJ,Ex,EcGM,EcRPA,EqsGW,SigC,Z,dipole)
! Print one-electron energies and other stuff for qsUGW
@ -24,12 +24,7 @@ subroutine print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,cGW,PGW,Ov,T,V,J,K, &
double precision,intent(in) :: eHF(nBas,nspin)
double precision,intent(in) :: eGW(nBas,nspin)
double precision,intent(in) :: cGW(nBas,nBas,nspin)
double precision,intent(in) :: PGW(nBas,nBas,nspin)
double precision,intent(in) :: Ov(nBas,nBas)
double precision,intent(in) :: T(nBas,nBas)
double precision,intent(in) :: V(nBas,nBas)
double precision,intent(in) :: J(nBas,nBas,nspin)
double precision,intent(in) :: K(nBas,nBas,nspin)
double precision,intent(in) :: SigC(nBas,nBas,nspin)
double precision,intent(in) :: Z(nBas,nspin)
double precision,intent(in) :: dipole(ncart)

View File

@ -153,7 +153,7 @@ subroutine qsGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE,
c(:,:) = cHF(:,:)
F_diis(:,:) = 0d0
error_diis(:,:) = 0d0
rcond = 1d0
rcond = 0d0
!------------------------------------------------------------------------
! Main loop

View File

@ -166,7 +166,7 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
c(:,:,:) = cHF(:,:,:)
F_diis(:,:,:) = 0d0
error_diis(:,:,:) = 0d0
rcond = 1d0
rcond(:) = 0d0
!------------------------------------------------------------------------
! Main loop
@ -227,9 +227,25 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
if(G0W) then
if(regularize) then
call unrestricted_regularized_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_regularized_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,Z)
else
call unrestricted_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eHF,OmRPA,rho_RPA,Z)
end if
else
if(regularize) then
call unrestricted_regularized_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nS_sc,eGW,OmRPA,rho_RPA,SigC,EcGM)
call unrestricted_regularized_renormalization_factor(eta,nBas,nC,nO,nV,nR,nS_sc,eGW,OmRPA,rho_RPA,Z)
else
call unrestricted_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nS_sc,eGW,OmRPA,rho_RPA,SigC,EcGM)
@ -237,6 +253,8 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
end if
endif
! Make correlation self-energy Hermitian and transform it back to AO basis
do is=1,nspin
@ -348,7 +366,7 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,COHSEX,BSE
!------------------------------------------------------------------------
call dipole_moment(nBas,P(:,:,1)+P(:,:,2),nNuc,ZNuc,rNuc,dipole_int_AO,dipole)
call print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,c,P,S,T,V,J,K,ENuc,ET,EV,EJ,Ex,EcGM,EcRPA,EqsGW,SigCp,Z,dipole)
call print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,c,S,ENuc,ET,EV,EJ,Ex,EcGM,EcRPA,EqsGW,SigCp,Z,dipole)
enddo
!------------------------------------------------------------------------

View File

@ -28,8 +28,8 @@ subroutine self_energy_correlation(COHSEX,eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,Ec
! Output variables
double precision,intent(out) :: SigC(nBas,nBas)
double precision,intent(out) :: EcGM
double precision,intent(out) :: SigC(nBas,nBas)
! Initialize
@ -102,7 +102,7 @@ subroutine self_energy_correlation(COHSEX,eta,nBas,nC,nO,nV,nR,nS,e,Omega,rho,Ec
end do
end do
! GM correlation energy
! Galitskii-Migdal correlation energy
EcGM = 0d0
do i=nC+1,nO

View File

@ -33,6 +33,10 @@ subroutine ufG0W0(nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF)
double precision,allocatable :: eGW(:)
double precision,allocatable :: Z(:)
logical :: verbose = .true.
double precision,parameter :: cutoff1 = 0.01d0
double precision,parameter :: cutoff2 = 0.01d0
! Output variables
! Hello world
@ -183,9 +187,8 @@ subroutine ufG0W0(nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF)
! Compute weights !
!-----------------!
Z(:) = 0d0
do s=1,nH
Z(s) = Z(s) + cGW(1,s)**2
Z(s) = cGW(1,s)**2
end do
!--------------!
@ -207,6 +210,64 @@ subroutine ufG0W0(nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF)
write(*,*)'-------------------------------------------'
write(*,*)
if(verbose) then
do s=1,nH
if(Z(s) > cutoff1) then
write(*,*)'*************************************************************'
write(*,'(1X,A20,I3,A6,I3)')'Vector for orbital ',p,' and #',s
write(*,'(1X,A7,F10.6,A13,F10.6,1X)')' e_QP = ',eGW(s)*HaToeV,' eV and Z = ',Z(s)
write(*,*)'*************************************************************'
write(*,'(1X,A20,1X,A20,1X,A15,1X)') &
' Configuration ',' Coefficient ',' Weight '
write(*,*)'*************************************************************'
if(p <= nO) &
write(*,'(1X,A7,I3,A16,1X,F15.6,1X,F15.6)') &
' (',p,') ',cGW(1,s),cGW(1,s)**2
if(p > nO) &
write(*,'(1X,A16,I3,A7,1X,F15.6,1X,F15.6)') &
' (',p,') ',cGW(1,s),cGW(1,s)**2
klc = 0
do k=nC+1,nO
do l=nC+1,nO
do c=nO+1,nBas-nR
klc = klc + 1
! if(abs(cGW(1+klc,s)) > cutoff2) &
write(*,'(1X,A3,I3,A1,I3,A6,I3,A7,1X,F15.6,1X,F15.6)') &
' (',k,',',l,') -> (',c,') ',cGW(1+klc,s),cGW(1+klc,s)**2
end do
end do
end do
kcd = 0
do k=nC+1,nO
do c=nO+1,nBas-nR
do d=nO+1,nBas-nR
kcd = kcd + 1
! if(abs(cGW(1+n2h1p+kcd,s)) > cutoff2) &
write(*,'(1X,A7,I3,A6,I3,A1,I3,A3,1X,F15.6,1X,F15.6)') &
' (',k,') -> (',c,',',d,') ',cGW(1+n2h1p+kcd,s),cGW(1+n2h1p+kcd,s)**2
end do
end do
end do
write(*,*)'*************************************************************'
write(*,*)
end if
end do
end if
end do
end subroutine ufG0W0

View File

@ -1,4 +1,4 @@
subroutine unrestricted_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nSt,e,Omega,rho,SigC,EcGM)
subroutine unrestricted_regularized_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nSt,e,Omega,rho,SigC,EcGM)
! Compute diagonal of the correlation part of the self-energy
@ -130,4 +130,4 @@ subroutine unrestricted_self_energy_correlation(eta,nBas,nC,nO,nV,nR,nSt,e,Omega
end do
end do
end subroutine unrestricted_self_energy_correlation
end subroutine unrestricted_regularized_self_energy_correlation

View File

@ -94,6 +94,7 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,nNuc,ZNuc,rNuc,ENuc,nBas,nO,S,T
error_diis(:,:) = 0d0
Conv = 1d0
nSCF = 0
rcond = 0d0
!------------------------------------------------------------------------
! Main SCF loop
@ -204,6 +205,6 @@ subroutine RHF(maxSCF,thresh,max_diis,guess_type,nNuc,ZNuc,rNuc,ENuc,nBas,nO,S,T
! Compute Vx for post-HF calculations
call exchange_potential(nBas,c,K,Vx)
call mo_fock_exchange_potential(nBas,c,K,Vx)
end subroutine RHF

View File

@ -253,7 +253,7 @@ subroutine UHF(maxSCF,thresh,max_diis,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,nO
! Compute Vx for post-HF calculations
do ispin=1,nspin
call exchange_potential(nBas,c(:,:,ispin),K(:,:,ispin),Vx(:,ispin))
call mo_fock_exchange_potential(nBas,c(:,:,ispin),K(:,:,ispin),Vx(:,ispin))
end do
end subroutine UHF

View File

@ -1,4 +1,4 @@
subroutine exchange_potential(nBas,c,Fx,Vx)
subroutine mo_fock_exchange_potential(nBas,c,Fx,Vx)
! Compute the exchange potential in the MO basis
@ -31,4 +31,4 @@ subroutine exchange_potential(nBas,c,Fx,Vx)
end do
end do
end subroutine exchange_potential
end subroutine mo_fock_exchange_potential

View File

@ -42,14 +42,13 @@ subroutine linear_response_Tmatrix(ispin,dRPA,TDA,eta,nBas,nC,nO,nV,nR,nS,lambda
call linear_response_A_matrix(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,e,ERI,A)
if(ispin == 1) A(:,:) = A(:,:) + A_BSE(:,:)
if(ispin == 2) A(:,:) = A(:,:) - A_BSE(:,:)
! print*,'A'
! call matout(nS,nS,A)
! print*,'TA'
! call matout(nS,nS,A_BSE)
A(:,:) = A(:,:) - A_BSE(:,:)
! Tamm-Dancoff approximation
if(TDA) then
@ -64,14 +63,13 @@ subroutine linear_response_Tmatrix(ispin,dRPA,TDA,eta,nBas,nC,nO,nV,nR,nS,lambda
call linear_response_B_matrix(ispin,dRPA,nBas,nC,nO,nV,nR,nS,lambda,ERI,B)
if(ispin == 1) B(:,:) = B(:,:) + B_BSE(:,:)
if(ispin == 2) B(:,:) = B(:,:) - B_BSE(:,:)
! print*,'B'
! call matout(nS,nS,B)
! print*,'TB'
! call matout(nS,nS,B_BSE)
B(:,:) = B(:,:) - B_BSE(:,:)
! Build A + B and A - B matrices
ApB = A + B

View File

@ -451,8 +451,10 @@ program QuAcK
ket1 = 1
ket2 = 1
call AOtoMO_integral_transform(bra1,bra2,ket1,ket2,nBas,cHF,ERI_AO,ERI_MO)
F_MO(:,:) = F_AO(:,:)
call AOtoMO_transform(nBas,cHF,F_MO)
end if
end if

View File

@ -30,7 +30,7 @@ subroutine read_methods(doRHF,doUHF,doKS,doMOM, &
! Local variables
character(len=1) :: answer1,answer2,answer3,answer4,answer5,answer6,answer7
character(len=1) :: answer1,answer2,answer3,answer4,answer5
! Open file with method specification

View File

@ -195,15 +195,15 @@ subroutine read_options(maxSCF_HF,thresh_HF,DIIS_HF,n_diis_HF,guess_type,ortho_t
if(answer8 == 'T') regGW = .true.
if(.not.DIIS_GW) n_diis_GW = 1
! Read GF options
! Read GT options
maxSCF_GF = 64
thresh_GF = 1d-5
DIIS_GF = .false.
n_diis_GF = 5
linGF = .false.
eta_GF = 0d0
regGF = .false.
maxSCF_GT = 64
thresh_GT = 1d-5
DIIS_GT = .false.
n_diis_GT = 5
linGT = .false.
eta_GT = 0d0
regGT = .false.
TDA_T = .false.
read(1,*)

View File

@ -1,4 +1,4 @@
subroutine UB88_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
subroutine B88_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
! Compute Becke's 88 GGA exchange energy
@ -45,4 +45,4 @@ subroutine UB88_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
end do
end subroutine UB88_gga_exchange_energy
end subroutine B88_gga_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine UB88_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
subroutine B88_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
! Compute Becke's GGA exchange potential
@ -70,4 +70,4 @@ subroutine UB88_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
end do
end do
end subroutine UB88_gga_exchange_potential
end subroutine B88_gga_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine UC16_lda_correlation_energy(nGrid,weight,rho,Ec)
subroutine C16_lda_correlation_energy(nGrid,weight,rho,Ec)
! Compute unrestricted Chachiyo's LDA correlation energy
@ -90,4 +90,4 @@ subroutine UC16_lda_correlation_energy(nGrid,weight,rho,Ec)
Ec(2) = Ec(2) - Ec(1) - Ec(3)
end subroutine UC16_lda_correlation_energy
end subroutine C16_lda_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine UC16_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
subroutine C16_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
! Compute unrestricted LDA correlation potential
@ -128,4 +128,4 @@ include 'parameters.h'
enddo
enddo
end subroutine UC16_lda_correlation_potential
end subroutine C16_lda_correlation_potential

View File

@ -1,5 +1,6 @@
subroutine UCC_lda_exchange_derivative_discontinuity(nEns,wEns,nCC,aCC,nGrid,weight,rhow,Cx_choice,doNcentered,&
kappa,ExDD)
subroutine CC_lda_exchange_derivative_discontinuity(nEns,wEns,nCC,aCC,nGrid,weight,rhow,Cx_choice,&
doNcentered,kappa,ExDD)
! Compute the unrestricted version of the curvature-corrected exchange ensemble derivative
@ -152,26 +153,18 @@ subroutine UCC_lda_exchange_derivative_discontinuity(nEns,wEns,nCC,aCC,nGrid,wei
ExDD(:) = 0d0
do iEns=1,nEns
do jEns=2,nEns
if(doNcentered) then
do iEns=1,nEns
do jEns=2,nEns
ExDD(iEns) = ExDD(iEns) + (Kronecker_delta(iEns,jEns) - kappa(iEns)*wEns(jEns))*dExdw(jEns)
end do
end do
else
do iEns=1,nEns
do jEns=2,nEns
ExDD(iEns) = ExDD(iEns) + (Kronecker_delta(iEns,jEns) - wEns(jEns))*dExdw(jEns)
end do
end do
end if
end subroutine UCC_lda_exchange_derivative_discontinuity
end do
end do
end subroutine CC_lda_exchange_derivative_discontinuity

View File

@ -1,4 +1,4 @@
subroutine UCC_lda_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice,doNcentered,Ex)
subroutine CC_lda_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice,doNcentered,Ex)
! Compute the unrestricted version of the curvature-corrected exchange functional
@ -107,4 +107,4 @@ subroutine UCC_lda_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice,
enddo
end subroutine UCC_lda_exchange_energy
end subroutine CC_lda_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine UCC_lda_exchange_individual_energy(nEns,wEns,nCC,aCC,nGrid,weight,rhow,rho,Cx_choice,doNcentered,LZx,Ex)
subroutine CC_lda_exchange_individual_energy(nEns,wEns,nCC,aCC,nGrid,weight,rhow,rho,Cx_choice,doNcentered,LZx,Ex)
! Compute the unrestricted version of the curvature-corrected exchange functional
@ -128,4 +128,4 @@ subroutine UCC_lda_exchange_individual_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho
enddo
end subroutine UCC_lda_exchange_individual_energy
end subroutine CC_lda_exchange_individual_energy

View File

@ -1,4 +1,4 @@
subroutine UCC_lda_exchange_potential(nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,rho,Cx_choice,doNcentered,Fx)
subroutine CC_lda_exchange_potential(nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,rho,Cx_choice,doNcentered,Fx)
! Compute the unrestricted version of the curvature-corrected exchange potential
@ -116,4 +116,4 @@ subroutine UCC_lda_exchange_potential(nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,rho
enddo
enddo
end subroutine UCC_lda_exchange_potential
end subroutine CC_lda_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine UG96_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
subroutine G96_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
! Compute Gill's 96 GGA exchange energy
@ -45,4 +45,4 @@ subroutine UG96_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
end do
end subroutine UG96_gga_exchange_energy
end subroutine G96_gga_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine UG96_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
subroutine G96_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
! Compute Gill's GGA exchange poential
@ -61,4 +61,4 @@ subroutine UG96_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
enddo
enddo
end subroutine UG96_gga_exchange_potential
end subroutine G96_gga_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine ULYP_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
subroutine LYP_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
! Compute unrestricted LYP GGA correlation energy
@ -70,4 +70,4 @@ subroutine ULYP_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
end do
end subroutine ULYP_gga_correlation_energy
end subroutine LYP_gga_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine ULYP_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
subroutine LYP_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Compute LYP correlation potential
@ -153,4 +153,4 @@ subroutine ULYP_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
end do
end do
end subroutine ULYP_gga_correlation_potential
end subroutine LYP_gga_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine UPBE_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
subroutine PBE_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
! Compute unrestricted PBE GGA correlation energy
@ -169,4 +169,4 @@ subroutine UPBE_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
Ec(2) = Ec(2) - Ec(1) - Ec(3)
end subroutine UPBE_gga_correlation_energy
end subroutine PBE_gga_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine UPBE_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
subroutine PBE_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Compute LYP correlation potential
@ -36,7 +36,7 @@ subroutine UPBE_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Compute matrix elements in the AO basis
call UPW92_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
call PW92_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
do mu=1,nBas
do nu=1,nBas
@ -85,4 +85,4 @@ subroutine UPBE_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
end do
end do
end subroutine UPBE_gga_correlation_potential
end subroutine PBE_gga_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine UPBE_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
subroutine PBE_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
! Compute PBE GGA exchange energy
@ -46,4 +46,4 @@ subroutine UPBE_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
end do
end subroutine UPBE_gga_exchange_energy
end subroutine PBE_gga_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine UPBE_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
subroutine PBE_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
! Compute PBE GGA exchange potential
@ -64,4 +64,4 @@ subroutine UPBE_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
end do
end do
end subroutine UPBE_gga_exchange_potential
end subroutine PBE_gga_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine UPW92_lda_correlation_energy(nGrid,weight,rho,Ec)
subroutine PW92_lda_correlation_energy(nGrid,weight,rho,Ec)
! Compute unrestricted PW92 LDA correlation energy
@ -117,4 +117,4 @@ subroutine UPW92_lda_correlation_energy(nGrid,weight,rho,Ec)
Ec(2) = Ec(2) - Ec(1) - Ec(3)
end subroutine UPW92_lda_correlation_energy
end subroutine PW92_lda_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine UPW92_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
subroutine PW92_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
! Compute unrestricted PW92 LDA correlation potential
@ -182,4 +182,4 @@ subroutine UPW92_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
end do
end do
end subroutine UPW92_lda_correlation_potential
end subroutine PW92_lda_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine US51_lda_exchange_energy(nGrid,weight,rho,Ex)
subroutine S51_lda_exchange_energy(nGrid,weight,rho,Ex)
! Compute Slater's LDA exchange energy
@ -31,4 +31,4 @@ subroutine US51_lda_exchange_energy(nGrid,weight,rho,Ex)
enddo
end subroutine US51_lda_exchange_energy
end subroutine S51_lda_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine US51_lda_exchange_individual_energy(nEns,nGrid,weight,rhow,rho,LZx,Ex)
subroutine S51_lda_exchange_individual_energy(nEns,nGrid,weight,rhow,rho,LZx,Ex)
! Compute the restricted version of Slater's LDA exchange individual energy
@ -58,4 +58,4 @@ subroutine US51_lda_exchange_individual_energy(nEns,nGrid,weight,rhow,rho,LZx,Ex
enddo
end subroutine US51_lda_exchange_individual_energy
end subroutine S51_lda_exchange_individual_energy

View File

@ -1,4 +1,4 @@
subroutine US51_lda_exchange_potential(nGrid,weight,nBas,AO,rho,Fx)
subroutine S51_lda_exchange_potential(nGrid,weight,nBas,AO,rho,Fx)
! Compute Slater's LDA exchange potential
@ -42,4 +42,4 @@ subroutine US51_lda_exchange_potential(nGrid,weight,nBas,AO,rho,Fx)
enddo
enddo
end subroutine US51_lda_exchange_potential
end subroutine S51_lda_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine UVWN3_lda_correlation_energy(nGrid,weight,rho,Ec)
subroutine VWN3_lda_correlation_energy(nGrid,weight,rho,Ec)
! Compute unrestricted VWN3 LDA correlation energy
@ -134,4 +134,4 @@ subroutine UVWN3_lda_correlation_energy(nGrid,weight,rho,Ec)
Ec(2) = Ec(2) - Ec(1) - Ec(3)
end subroutine UVWN3_lda_correlation_energy
end subroutine VWN3_lda_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine UVWN3_lda_correlation_individual_energy(nEns,nGrid,weight,rhow,rho,doNcentered,LZc,Ec)
subroutine VWN3_lda_correlation_individual_energy(nEns,nGrid,weight,rhow,rho,doNcentered,LZc,Ec)
! Compute VWN3 LDA correlation potential
@ -178,4 +178,4 @@ subroutine UVWN3_lda_correlation_individual_energy(nEns,nGrid,weight,rhow,rho,do
end do
end subroutine UVWN3_lda_correlation_individual_energy
end subroutine VWN3_lda_correlation_individual_energy

View File

@ -1,4 +1,4 @@
subroutine UVWN3_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
subroutine VWN3_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
! Compute unrestricted VWN3 LDA correlation potential
@ -193,4 +193,4 @@ subroutine UVWN3_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
end do
end do
end subroutine UVWN3_lda_correlation_potential
end subroutine VWN3_lda_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine UVWN5_lda_correlation_energy(nGrid,weight,rho,Ec)
subroutine VWN5_lda_correlation_energy(nGrid,weight,rho,Ec)
! Compute unrestricted VWN5 LDA correlation energy
@ -134,4 +134,4 @@ subroutine UVWN5_lda_correlation_energy(nGrid,weight,rho,Ec)
Ec(2) = Ec(2) - Ec(1) - Ec(3)
end subroutine UVWN5_lda_correlation_energy
end subroutine VWN5_lda_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine UVWN5_lda_correlation_individual_energy(nEns,nGrid,weight,rhow,rho,LZc,Ec)
subroutine VWN5_lda_correlation_individual_energy(nEns,nGrid,weight,rhow,rho,LZc,Ec)
! Compute VWN5 LDA correlation potential
@ -181,4 +181,4 @@ subroutine UVWN5_lda_correlation_individual_energy(nEns,nGrid,weight,rhow,rho,LZ
end do
end subroutine UVWN5_lda_correlation_individual_energy
end subroutine VWN5_lda_correlation_individual_energy

View File

@ -1,4 +1,4 @@
subroutine UVWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
subroutine VWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
! Compute unrestricted VWN5 LDA correlation potential
@ -190,4 +190,4 @@ subroutine UVWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
end do
end do
end subroutine UVWN5_lda_correlation_potential
end subroutine VWN5_lda_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine UW38_lda_correlation_energy(nGrid,weight,rho,Ec)
subroutine W38_lda_correlation_energy(nGrid,weight,rho,Ec)
! Compute the unrestricted version of the Wigner's LDA correlation energy
@ -49,4 +49,4 @@ subroutine UW38_lda_correlation_energy(nGrid,weight,rho,Ec)
Ec(2) = -4d0*a*Ec(2)
end subroutine UW38_lda_correlation_energy
end subroutine W38_lda_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine UW38_lda_correlation_individual_energy(nGrid,weight,rhow,rho,Ec)
subroutine W38_lda_correlation_individual_energy(nGrid,weight,rhow,rho,Ec)
! Compute the unrestricted version of the Wigner's LDA individual energy
@ -59,4 +59,4 @@ subroutine UW38_lda_correlation_individual_energy(nGrid,weight,rhow,rho,Ec)
Ec(2) = -4d0*a*Ec(2)
end subroutine UW38_lda_correlation_individual_energy
end subroutine W38_lda_correlation_individual_energy

View File

@ -1,4 +1,4 @@
subroutine UW38_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
subroutine W38_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
! Compute the unrestricted version of the Wigner's LDA correlation potential
@ -73,4 +73,4 @@ include 'parameters.h'
Fc(:,:,:) = -4d0*a*Fc(:,:,:)
end subroutine UW38_lda_correlation_potential
end subroutine W38_lda_correlation_potential

View File

@ -1,5 +1,4 @@
subroutine allocate_grid(nNuc,ZNuc,max_ang_mom,min_exponent,max_exponent, &
radial_precision,nAng,nGrid)
subroutine allocate_grid(nNuc,ZNuc,max_ang_mom,min_exponent,max_exponent,radial_precision,nAng,nGrid)
! Allocate quadrature grid with numgrid (Radovan Bast)

View File

@ -1,4 +1,4 @@
subroutine unrestricted_auxiliary_energy(nBas,nEns,eps,occnum,Eaux)
subroutine auxiliary_energy(nBas,nEns,eps,occnum,Eaux)
! Compute the auxiliary KS energies
@ -52,4 +52,4 @@ subroutine unrestricted_auxiliary_energy(nBas,nEns,eps,occnum,Eaux)
end do
end subroutine unrestricted_auxiliary_energy
end subroutine auxiliary_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_correlation_derivative_discontinuity(rung,DFA,nEns,wEns,nGrid,weight,rhow,drhow,Ec)
subroutine correlation_derivative_discontinuity(rung,DFA,nEns,wEns,nGrid,weight,rhow,drhow,Ec)
! Compute the correlation part of the derivative discontinuity
@ -34,26 +34,26 @@ subroutine unrestricted_correlation_derivative_discontinuity(rung,DFA,nEns,wEns,
case(1)
call unrestricted_lda_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
call lda_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
! GGA functionals
case(2)
call unrestricted_gga_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
call gga_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
! MGGA functionals
case(3)
call unrestricted_mgga_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
call mgga_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
! Hybrid functionals
case(4)
call unrestricted_hybrid_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
call hybrid_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
end select
end subroutine unrestricted_correlation_derivative_discontinuity
end subroutine correlation_derivative_discontinuity

View File

@ -1,4 +1,4 @@
subroutine unrestricted_correlation_energy(rung,DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
subroutine correlation_energy(rung,DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
! Compute the unrestricted version of the correlation energy
@ -34,26 +34,26 @@ subroutine unrestricted_correlation_energy(rung,DFA,nEns,wEns,nGrid,weight,rho,d
case(1)
call unrestricted_lda_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,Ec)
call lda_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,Ec)
! GGA functionals
case(2)
call unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
call gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
! MGGA functionals
case(3)
call unrestricted_mgga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
call mgga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
! Hybrid functionals
case(4)
call unrestricted_hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
call hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
end select
end subroutine unrestricted_correlation_energy
end subroutine correlation_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_correlation_individual_energy(rung,DFA,LDA_centered,nEns,wEns,nGrid,weight, &
subroutine correlation_individual_energy(rung,DFA,LDA_centered,nEns,wEns,nGrid,weight, &
rhow,drhow,rho,drho,LZc,Ec)
! Compute the correlation energy of individual states
@ -37,7 +37,7 @@ subroutine unrestricted_correlation_individual_energy(rung,DFA,LDA_centered,nEns
case(1)
call unrestricted_lda_correlation_individual_energy(DFA,LDA_centered,nEns,wEns,nGrid,weight,rhow,rho,LZc,Ec)
call lda_correlation_individual_energy(DFA,LDA_centered,nEns,wEns,nGrid,weight,rhow,rho,LZc,Ec)
! GGA functionals
@ -55,8 +55,8 @@ subroutine unrestricted_correlation_individual_energy(rung,DFA,LDA_centered,nEns
case(4)
call unrestricted_hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZc,Ec)
call hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZc,Ec)
end select
end subroutine unrestricted_correlation_individual_energy
end subroutine correlation_individual_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_correlation_potential(rung,DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
subroutine correlation_potential(rung,DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Compute the correlation potential
@ -43,26 +43,26 @@ subroutine unrestricted_correlation_potential(rung,DFA,nEns,wEns,nGrid,weight,nB
case(1)
call unrestricted_lda_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
call lda_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
! GGA functionals
case(2)
call unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! MGGA functionals
case(3)
call unrestricted_mgga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call mgga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Hybrid functionals
case(4)
call unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
end select
end subroutine unrestricted_correlation_potential
end subroutine correlation_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_density_matrix(nBas,nEns,c,P,occnum)
subroutine density_matrix(nBas,nEns,c,P,occnum)
! Calculate density matrices
@ -45,4 +45,4 @@ subroutine unrestricted_density_matrix(nBas,nEns,c,P,occnum)
end subroutine unrestricted_density_matrix
end subroutine density_matrix

View File

@ -163,6 +163,7 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
n_diis = 0
F_diis(:,:,:) = 0d0
err_diis(:,:,:) = 0d0
rcond(:) = 1d0
!------------------------------------------------------------------------
! Main SCF loop
@ -184,7 +185,7 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
! Compute density matrix
!------------------------------------------------------------------------
call unrestricted_density_matrix(nBas,nEns,c(:,:,:),P(:,:,:,:),occnum(:,:,:))
call density_matrix(nBas,nEns,c(:,:,:),P(:,:,:,:),occnum(:,:,:))
! Weight-dependent density matrix
@ -236,20 +237,20 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
! Compute Hartree potential
do ispin=1,nspin
call unrestricted_hartree_potential(nBas,Pw(:,:,ispin),ERI,J(:,:,ispin))
call hartree_potential(nBas,Pw(:,:,ispin),ERI,J(:,:,ispin))
end do
! Compute exchange potential
do ispin=1,nspin
call unrestricted_exchange_potential(x_rung,x_DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
call exchange_potential(x_rung,x_DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
Pw(:,:,ispin),ERI,AO,dAO,rhow(:,ispin),drhow(:,:,ispin), &
Cx_choice,doNcentered,Fx(:,:,ispin),FxHF(:,:,ispin))
end do
! Compute correlation potential
call unrestricted_correlation_potential(c_rung,c_DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rhow,drhow,Fc)
call correlation_potential(c_rung,c_DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rhow,drhow,Fc)
! Build Fock operator
@ -268,7 +269,7 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
! DIIS extrapolation
n_diis = min(n_diis+1,max_diis)
if(minval(rcond(:)) > 1d-7) then
if(minval(rcond(:)) > 1d-15) then
do ispin=1,nspin
call DIIS_extrapolation(rcond(ispin),nBasSq,nBasSq,n_diis, &
err_diis(:,:,ispin),F_diis(:,:,ispin),err(:,:,ispin),F(:,:,ispin))
@ -314,19 +315,19 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
! Hartree energy
call unrestricted_hartree_energy(nBas,Pw,J,EH)
call hartree_energy(nBas,Pw,J,EH)
! Exchange energy
do ispin=1,nspin
call unrestricted_exchange_energy(x_rung,x_DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
call exchange_energy(x_rung,x_DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
Pw(:,:,ispin),FxHF(:,:,ispin),rhow(:,ispin),drhow(:,:,ispin), &
Cx_choice,doNcentered,Ex(ispin))
end do
! Correlation energy
call unrestricted_correlation_energy(c_rung,c_DFA,nEns,wEns,nGrid,weight,rhow,drhow,Ec)
call correlation_energy(c_rung,c_DFA,nEns,wEns,nGrid,weight,rhow,drhow,Ec)
! Total energy
@ -346,6 +347,9 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
end do
write(*,*)'------------------------------------------------------------------------------------------'
! print*,'Ensemble energy:',Ew + ENuc,'au'
!------------------------------------------------------------------------
! End of SCF loop
!------------------------------------------------------------------------
@ -377,7 +381,7 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,nCC,aCC,nGrid,weight,max
! Compute individual energies from ensemble energy
!------------------------------------------------------------------------
call unrestricted_individual_energy(x_rung,x_DFA,c_rung,c_DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
call individual_energy(x_rung,x_DFA,c_rung,c_DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
AO,dAO,T,V,ERI,ENuc,eKS,Pw,rhow,drhow,J,Fx,FxHF,Fc,P,rho,drho,occnum,Cx_choice,doNcentered,Ew)
end subroutine eDFT_UKS

View File

@ -1,4 +1,4 @@
subroutine unrestricted_exchange_derivative_discontinuity(rung,DFA,nEns,wEns,nCC,aCC,nGrid,weight,rhow,drhow,&
subroutine exchange_derivative_discontinuity(rung,DFA,nEns,wEns,nCC,aCC,nGrid,weight,rhow,drhow,&
Cx_choice,doNcentered,kappa,ExDD)
! Compute the exchange part of the derivative discontinuity
@ -41,27 +41,27 @@ subroutine unrestricted_exchange_derivative_discontinuity(rung,DFA,nEns,wEns,nCC
case(1)
call unrestricted_lda_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nCC,aCC,nGrid,weight(:),&
call lda_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nCC,aCC,nGrid,weight(:),&
rhow(:),Cx_choice,doNcentered,kappa,ExDD(:))
! GGA functionals
case(2)
call unrestricted_gga_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nGrid,weight(:),rhow(:),drhow(:,:),ExDD(:))
call gga_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nGrid,weight(:),rhow(:),drhow(:,:),ExDD(:))
! MGGA functionals
case(3)
call unrestricted_mgga_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nGrid,weight(:),rhow(:),drhow(:,:),ExDD(:))
call mgga_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nGrid,weight(:),rhow(:),drhow(:,:),ExDD(:))
! Hybrid functionals
case(4)
call unrestricted_hybrid_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nCC,aCC,nGrid,weight(:),&
call hybrid_exchange_derivative_discontinuity(DFA,nEns,wEns(:),nCC,aCC,nGrid,weight(:),&
rhow(:),Cx_choice,doNcentered,ExDD(:))
end select
end subroutine unrestricted_exchange_derivative_discontinuity
end subroutine exchange_derivative_discontinuity

View File

@ -1,4 +1,4 @@
subroutine unrestricted_exchange_energy(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P,FxHF, &
subroutine exchange_energy(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P,FxHF, &
rho,drho,Cx_choice,doNcentered,Ex)
! Compute the exchange energy
@ -43,27 +43,27 @@ subroutine unrestricted_exchange_energy(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,
case(1)
call unrestricted_lda_exchange_energy(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice,doNcentered,Ex)
call lda_exchange_energy(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,rho,Cx_choice,doNcentered,Ex)
! GGA functionals
case(2)
call unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ex)
call gga_exchange_energy(DFA,nEns,wEns,nCC,aCC,nGrid,weight,rho,drho,Cx_choice,Ex)
! MGGA functionals
case(3)
call unrestricted_mgga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ex)
call mgga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ex)
! Hybrid functionals
case(4)
call unrestricted_hybrid_exchange_energy(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P,FxHF, &
call hybrid_exchange_energy(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P,FxHF, &
rho,drho,Cx_choice,doNcentered,Ex)
end select
end subroutine unrestricted_exchange_energy
end subroutine exchange_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_exchange_individual_energy(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
subroutine exchange_individual_energy(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas, &
ERI,Pw,rhow,drhow,P,rho,drho,Cx_choice,doNcentered,LZx,Ex)
! Compute the exchange individual energy
@ -45,27 +45,27 @@ subroutine unrestricted_exchange_individual_energy(rung,DFA,LDA_centered,nEns,wE
case(1)
call unrestricted_lda_exchange_individual_energy(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,&
call lda_exchange_individual_energy(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,&
rhow,rho,Cx_choice,doNcentered,LZx,Ex)
! GGA functionals
case(2)
call unrestricted_gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZx,Ex)
call gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZx,Ex)
! MGGA functionals
case(3)
call unrestricted_mgga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZx,Ex)
call mgga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZx,Ex)
! Hybrid functionals
case(4)
call unrestricted_hybrid_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,nBas,ERI,Pw,rhow,drhow,P,rho,drho,LZx,Ex)
call hybrid_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,nBas,ERI,Pw,rhow,drhow,P,rho,drho,LZx,Ex)
end select
end subroutine unrestricted_exchange_individual_energy
end subroutine exchange_individual_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_exchange_potential(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P, &
subroutine exchange_potential(rung,DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P, &
ERI,AO,dAO,rho,drho,Cx_choice,doNcentered,Fx,FxHF)
! Compute the exchange potential
@ -52,28 +52,29 @@ subroutine unrestricted_exchange_potential(rung,DFA,LDA_centered,nEns,wEns,nCC,a
case(1)
call unrestricted_lda_exchange_potential(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,rho,&
call lda_exchange_potential(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,rho,&
Cx_choice,doNcentered,Fx)
! GGA functionals
case(2)
call unrestricted_gga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
call gga_exchange_potential(DFA,nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,dAO,rho,drho,&
Cx_choice,Fx)
! MGGA functionals
case(3)
call unrestricted_mgga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
call mgga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
! Hybrid functionals
case(4)
call unrestricted_hybrid_exchange_potential(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P, &
call hybrid_exchange_potential(DFA,LDA_centered,nEns,wEns,nCC,aCC,nGrid,weight,nBas,P, &
ERI,AO,dAO,rho,drho,Cx_choice,doNcentered,Fx,FxHF)
end select
end subroutine unrestricted_exchange_potential
end subroutine exchange_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_fock_exchange_energy(nBas,P,Fx,Ex)
subroutine fock_exchange_energy(nBas,P,Fx,Ex)
! Compute the (exact) Fock exchange energy
@ -22,4 +22,4 @@ subroutine unrestricted_fock_exchange_energy(nBas,P,Fx,Ex)
Ex = 0.5d0*trace_matrix(nBas,matmul(P,Fx))
end subroutine unrestricted_fock_exchange_energy
end subroutine fock_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_fock_exchange_individual_energy(nBas,nEns,Pw,P,ERI,LZx,Ex)
subroutine fock_exchange_individual_energy(nBas,nEns,Pw,P,ERI,LZx,Ex)
! Compute the HF individual energy in the unrestricted formalism
@ -32,7 +32,7 @@ subroutine unrestricted_fock_exchange_individual_energy(nBas,nEns,Pw,P,ERI,LZx,E
do ispin=1,nspin
call unrestricted_fock_exchange_potential(nBas,Pw(:,:,ispin),ERI,Fx(:,:,ispin))
call fock_exchange_potential(nBas,Pw(:,:,ispin),ERI,Fx(:,:,ispin))
LZx(ispin) = - 0.5d0*trace_matrix(nBas,matmul(Pw(:,:,ispin),Fx(:,:,ispin)))
@ -43,4 +43,4 @@ subroutine unrestricted_fock_exchange_individual_energy(nBas,nEns,Pw,P,ERI,LZx,E
end do
end subroutine unrestricted_fock_exchange_individual_energy
end subroutine fock_exchange_individual_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_fock_exchange_potential(nBas,P,ERI,Fx)
subroutine fock_exchange_potential(nBas,P,ERI,Fx)
! Compute the Fock exchange potential
@ -31,4 +31,4 @@ subroutine unrestricted_fock_exchange_potential(nBas,P,ERI,Fx)
enddo
enddo
end subroutine unrestricted_fock_exchange_potential
end subroutine fock_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_gga_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
subroutine gga_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
! Compute the correlation GGA part of the derivative discontinuity
@ -41,4 +41,4 @@ subroutine unrestricted_gga_correlation_derivative_discontinuity(DFA,nEns,wEns,n
end select
end subroutine unrestricted_gga_correlation_derivative_discontinuity
end subroutine gga_correlation_derivative_discontinuity

View File

@ -1,4 +1,4 @@
subroutine unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
subroutine gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
! Compute unrestricted GGA correlation energy
@ -28,11 +28,11 @@ subroutine unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,dr
case (1)
call ULYP_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
call LYP_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
case (2)
call UPBE_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
call PBE_gga_correlation_energy(nGrid,weight,rho,drho,Ec)
case default
@ -41,4 +41,4 @@ subroutine unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,dr
end select
end subroutine unrestricted_gga_correlation_energy
end subroutine gga_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
subroutine gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Compute unrestricted GGA correlation potential
@ -30,11 +30,11 @@ subroutine unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBa
case (1)
call ULYP_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call LYP_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
case (2)
call UPBE_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call PBE_gga_correlation_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
case default
@ -43,4 +43,4 @@ subroutine unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBa
end select
end subroutine unrestricted_gga_correlation_potential
end subroutine gga_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_gga_exchange_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,drhow,ExDD)
subroutine gga_exchange_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,drhow,ExDD)
! Compute the exchange GGA part of the derivative discontinuity
@ -45,4 +45,4 @@ subroutine unrestricted_gga_exchange_derivative_discontinuity(DFA,nEns,wEns,nGri
end select
end subroutine unrestricted_gga_exchange_derivative_discontinuity
end subroutine gga_exchange_derivative_discontinuity

View File

@ -1,4 +1,4 @@
subroutine unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ex)
subroutine gga_exchange_energy(DFA,nEns,wEns,nCC,aCC,nGrid,weight,rho,drho,Cx_choice,Ex)
! Select GGA exchange functional for energy calculation
@ -11,11 +11,15 @@ subroutine unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,
integer,intent(in) :: DFA
integer,intent(in) :: nEns
double precision,intent(in) :: wEns(nEns)
integer,intent(in) :: nCC
double precision,intent(in) :: aCC(nCC,nEns-1)
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rho(nGrid)
integer,intent(in) :: Cx_choice
double precision,intent(in) :: drho(ncart,nGrid)
! Output variables
double precision :: Ex
@ -24,15 +28,20 @@ subroutine unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,
case (1)
call UG96_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
call G96_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
case (2)
call UB88_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
call B88_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
case (3)
call UPBE_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
call PBE_gga_exchange_energy(nGrid,weight,rho,drho,Ex)
case (4)
call CC_B88_gga_exchange_energy(nEns,wEns,nCC,aCC,nGrid,weight,rho,drho,&
Cx_choice,Ex)
case default
@ -41,4 +50,4 @@ subroutine unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,
end select
end subroutine unrestricted_gga_exchange_energy
end subroutine gga_exchange_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZx,Ex)
subroutine gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,LZx,Ex)
! Compute GGA exchange energy for individual states
@ -33,4 +33,4 @@ subroutine unrestricted_gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weigh
end select
end subroutine unrestricted_gga_exchange_individual_energy
end subroutine gga_exchange_individual_energy

View File

@ -1,4 +1,5 @@
subroutine unrestricted_gga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
subroutine gga_exchange_potential(DFA,nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,dAO,&
rho,drho,Cx_choice,Fx)
! Select GGA exchange functional for potential calculation
@ -10,6 +11,8 @@ subroutine unrestricted_gga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,A
integer,intent(in) :: DFA
integer,intent(in) :: nEns
double precision,intent(in) :: wEns(nEns)
integer,intent(in) :: nCC
double precision,intent(in) :: aCC(nCC,nEns-1)
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
integer,intent(in) :: nBas
@ -17,6 +20,7 @@ subroutine unrestricted_gga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,A
double precision,intent(in) :: dAO(3,nBas,nGrid)
double precision,intent(in) :: rho(nGrid)
double precision,intent(in) :: drho(3,nGrid)
integer,intent(in) :: Cx_choice
! Output variables
@ -28,15 +32,20 @@ subroutine unrestricted_gga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,A
case (1)
call UG96_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
call G96_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
case (2)
call UB88_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
call B88_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
case (3)
call UPBE_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
call PBE_gga_exchange_potential(nGrid,weight,nBas,AO,dAO,rho,drho,Fx)
case (4)
call CC_B88_gga_exchange_potential(nEns,wEns,nCC,aCC,nGrid,weight,nBas,AO,dAO,rho,drho,&
Cx_choice,Fx)
case default
@ -45,4 +54,4 @@ subroutine unrestricted_gga_exchange_potential(DFA,nEns,wEns,nGrid,weight,nBas,A
end select
end subroutine unrestricted_gga_exchange_potential
end subroutine gga_exchange_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hartree_energy(nBas,P,J,EH)
subroutine hartree_energy(nBas,P,J,EH)
! Compute the unrestricted version of the Hartree energy
@ -26,4 +26,4 @@ subroutine unrestricted_hartree_energy(nBas,P,J,EH)
+ 0.5d0*trace_matrix(nBas,matmul(P(:,:,2),J(:,:,1)))
EH(3) = 0.5d0*trace_matrix(nBas,matmul(P(:,:,2),J(:,:,2)))
end subroutine unrestricted_hartree_energy
end subroutine hartree_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hartree_individual_energy(nBas,nEns,Pw,P,ERI,LZH,EH)
subroutine hartree_individual_energy(nBas,nEns,Pw,P,ERI,LZH,EH)
! Compute the hartree contribution to the individual energies
@ -35,7 +35,7 @@ subroutine unrestricted_hartree_individual_energy(nBas,nEns,Pw,P,ERI,LZH,EH)
EH(:,:) = 0.d0
do ispin=1,nspin
call unrestricted_hartree_potential(nBas,Pw(:,:,ispin),ERI,J(:,:,ispin))
call hartree_potential(nBas,Pw(:,:,ispin),ERI,J(:,:,ispin))
end do
LZH(1) = - 0.5d0*trace_matrix(nBas,matmul(Pw(:,:,1),J(:,:,1)))
@ -52,4 +52,4 @@ subroutine unrestricted_hartree_individual_energy(nBas,nEns,Pw,P,ERI,LZH,EH)
end do
end subroutine unrestricted_hartree_individual_energy
end subroutine hartree_individual_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hartree_potential(nBas,P,ERI,J)
subroutine hartree_potential(nBas,P,ERI,J)
! Compute the unrestricted version of the Hartree potential
@ -30,4 +30,4 @@ subroutine unrestricted_hartree_potential(nBas,P,ERI,J)
enddo
end subroutine unrestricted_hartree_potential
end subroutine hartree_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hybrid_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
subroutine hybrid_correlation_derivative_discontinuity(DFA,nEns,wEns,nGrid,weight,rhow,Ec)
! Compute the correlation hybrid part of the derivative discontinuity
@ -43,4 +43,4 @@ subroutine unrestricted_hybrid_correlation_derivative_discontinuity(DFA,nEns,wEn
end select
end subroutine unrestricted_hybrid_correlation_derivative_discontinuity
end subroutine hybrid_correlation_derivative_discontinuity

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
subroutine hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
! Compute the unrestricted version of the correlation energy for hybrid functionals
@ -35,18 +35,18 @@ subroutine unrestricted_hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho
aC = 0.81d0
call unrestricted_lda_correlation_energy(3,nEns,wEns,nGrid,weight,rho,EcLDA)
call unrestricted_gga_correlation_energy(1,nEns,wEns,nGrid,weight,rho,drho,EcGGA)
call lda_correlation_energy(3,nEns,wEns,nGrid,weight,rho,EcLDA)
call gga_correlation_energy(1,nEns,wEns,nGrid,weight,rho,drho,EcGGA)
Ec(:) = EcLDA(:) + aC*(EcGGA(:) - EcLDA(:))
case(3)
call unrestricted_gga_correlation_energy(1,nEns,wEns,nGrid,weight,rho,drho,Ec)
call gga_correlation_energy(1,nEns,wEns,nGrid,weight,rho,drho,Ec)
case(4)
call unrestricted_gga_correlation_energy(2,nEns,wEns,nGrid,weight,rho,drho,Ec)
call gga_correlation_energy(2,nEns,wEns,nGrid,weight,rho,drho,Ec)
case default
@ -55,4 +55,4 @@ subroutine unrestricted_hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho
end select
end subroutine unrestricted_hybrid_correlation_energy
end subroutine hybrid_correlation_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid,weight, &
subroutine hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid,weight, &
rhow,drhow,rho,drho,LZc,Ec)
! Compute the hybrid correlation energy for individual states
@ -39,4 +39,4 @@ subroutine unrestricted_hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid
end select
end subroutine unrestricted_hybrid_correlation_individual_energy
end subroutine hybrid_correlation_individual_energy

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
subroutine hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
! Compute the correlation potential for hybrid functionals
@ -42,8 +42,8 @@ subroutine unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,
aC = 0.81d0
call unrestricted_lda_correlation_potential(3,nEns,wEns,nGrid,weight,nBas,AO,rho,FcLDA)
call unrestricted_gga_correlation_potential(1,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FcGGA)
call lda_correlation_potential(3,nEns,wEns,nGrid,weight,nBas,AO,rho,FcLDA)
call gga_correlation_potential(1,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FcGGA)
Fc(:,:,:) = FcLDA(:,:,:) + aC*(FcGGA(:,:,:) - FcLDA(:,:,:))
@ -51,13 +51,13 @@ subroutine unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,
allocate(FcGGA(nBas,nBas,nspin))
call unrestricted_gga_correlation_potential(1,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call gga_correlation_potential(1,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
case(4)
allocate(FcGGA(nBas,nBas,nspin))
call unrestricted_gga_correlation_potential(2,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
call gga_correlation_potential(2,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
case default
@ -66,4 +66,4 @@ subroutine unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,
end select
end subroutine unrestricted_hybrid_correlation_potential
end subroutine hybrid_correlation_potential

View File

@ -1,4 +1,4 @@
subroutine unrestricted_hybrid_exchange_derivative_discontinuity(DFA,nEns,wEns,nCC,aCC,nGrid,weight,rhow,&
subroutine hybrid_exchange_derivative_discontinuity(DFA,nEns,wEns,nCC,aCC,nGrid,weight,rhow,&
Cx_choice,doNcentered,ExDD)
! Compute the exchange part of the derivative discontinuity for hybrid functionals
@ -50,4 +50,4 @@ subroutine unrestricted_hybrid_exchange_derivative_discontinuity(DFA,nEns,wEns,n
end select
end subroutine unrestricted_hybrid_exchange_derivative_discontinuity
end subroutine hybrid_exchange_derivative_discontinuity

Some files were not shown because too many files have changed in this diff Show More