10
1
mirror of https://github.com/pfloos/quack synced 2024-12-26 14:23:38 +01:00
QuAcK/src/eDFT/unrestricted_hybrid_exchange_potential.f90

88 lines
2.7 KiB
Fortran
Raw Normal View History

2021-02-14 22:52:17 +01:00
subroutine unrestricted_hybrid_exchange_potential(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,nBas,P, &
ERI,AO,dAO,rho,drho,Fx,FxHF,Cx_choice)
! Compute the exchange potential for hybrid functionals
implicit none
include 'parameters.h'
! Input variables
2021-10-25 12:20:25 +02:00
integer,intent(in) :: DFA
2021-02-14 22:52:17 +01:00
logical,intent(in) :: LDA_centered
integer,intent(in) :: nEns
double precision,intent(in) :: wEns(nEns)
double precision,intent(in) :: aCC_w1(3)
double precision,intent(in) :: aCC_w2(3)
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
integer,intent(in) :: nBas
double precision,intent(in) :: P(nBas,nBas)
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
double precision,intent(in) :: AO(nBas,nGrid)
double precision,intent(in) :: dAO(ncart,nBas,nGrid)
double precision,intent(in) :: rho(nGrid)
double precision,intent(in) :: drho(ncart,nGrid)
integer,intent(in) :: Cx_choice
! Local variables
double precision,allocatable :: FxLDA(:,:),FxGGA(:,:)
double precision :: a0,aX
! Output variables
double precision,intent(out) :: Fx(nBas,nBas),FxHF(nBas,nBas)
! Memory allocation
select case (DFA)
2021-10-25 12:20:25 +02:00
case(1)
2021-02-14 22:52:17 +01:00
call unrestricted_fock_exchange_potential(nBas,P,ERI,FxHF)
Fx(:,:) = FxHF(:,:)
2021-10-25 12:20:25 +02:00
case(2)
2021-02-14 22:52:17 +01:00
allocate(FxLDA(nBas,nBas),FxGGA(nBas,nBas))
a0 = 0.20d0
aX = 0.72d0
2021-10-26 11:42:50 +02:00
call unrestricted_lda_exchange_potential(1,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight, &
2021-02-14 22:52:17 +01:00
nBas,AO,rho,FxLDA,Cx_choice)
2021-10-26 11:42:50 +02:00
call unrestricted_gga_exchange_potential(2,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FxGGA)
2021-02-14 22:52:17 +01:00
call unrestricted_fock_exchange_potential(nBas,P,ERI,FxHF)
Fx(:,:) = FxLDA(:,:) &
+ a0*(FxHF(:,:) - FxLDA(:,:)) &
+ aX*(FxGGA(:,:) - FxLDA(:,:))
2021-10-25 12:20:25 +02:00
case(3)
2021-02-15 17:27:06 +01:00
allocate(FxGGA(nBas,nBas))
2021-10-26 11:42:50 +02:00
call unrestricted_gga_exchange_potential(2,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FxGGA)
2021-02-15 17:27:06 +01:00
call unrestricted_fock_exchange_potential(nBas,P,ERI,FxHF)
Fx(:,:) = 0.5d0*FxHF(:,:) + 0.5d0*FxGGA(:,:)
2021-10-25 12:20:25 +02:00
case(4)
2021-02-14 22:52:17 +01:00
allocate(FxGGA(nBas,nBas))
2021-10-26 11:42:50 +02:00
call unrestricted_gga_exchange_potential(3,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FxGGA)
2021-02-14 22:52:17 +01:00
call unrestricted_fock_exchange_potential(nBas,P,ERI,FxHF)
Fx(:,:) = 0.25d0*FxHF(:,:) + 0.75d0*FxGGA(:,:)
case default
call print_warning('!!! Hybrid exchange potential not available !!!')
stop
end select
end subroutine unrestricted_hybrid_exchange_potential