4
1
mirror of https://github.com/pfloos/quack synced 2024-11-09 07:33:55 +01:00
quack/src/eDFT/RMFL20_lda_correlation_potential.f90

74 lines
1.9 KiB
Fortran
Raw Normal View History

subroutine RMFL20_lda_correlation_potential(LDA_centered,nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
2020-03-15 20:33:18 +01:00
2020-03-17 11:50:05 +01:00
! Compute Marut-Fromager-Loos weight-dependent LDA correlation potential
2020-03-15 20:33:18 +01:00
implicit none
2020-03-31 22:15:45 +02:00
include 'parameters.h'
2020-03-15 20:33:18 +01:00
! Input variables
logical,intent(in) :: LDA_centered
2020-03-15 20:33:18 +01:00
integer,intent(in) :: nEns
double precision,intent(in) :: wEns(nEns)
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
integer,intent(in) :: nBas
double precision,intent(in) :: AO(nBas,nGrid)
double precision,intent(in) :: rho(nGrid)
! Local variables
integer :: iEns
double precision,allocatable :: aMFL(:,:)
double precision,allocatable :: FcLDA(:,:)
double precision,allocatable :: FceLDA(:,:,:)
! Output variables
double precision,intent(out) :: Fc(nBas,nBas)
! Allocation
allocate(aMFL(3,nEns),FcLDA(nBas,nBas),FceLDA(nBas,nBas,nEns))
! Parameters for weight-dependent LDA correlation functional
aMFL(1,1) = -0.0238184d0
aMFL(2,1) = +0.00540994d0
aMFL(3,1) = +0.0830766d0
2020-04-26 23:17:27 +02:00
aMFL(1,2) = -0.0282814d0
aMFL(2,2) = +0.00273925d0
aMFL(3,2) = +0.0664914d0
aMFL(1,3) = -0.0144633d0
aMFL(2,3) = -0.0506019d0
aMFL(3,3) = +0.0331417d0
2020-03-15 20:33:18 +01:00
2020-03-31 22:15:45 +02:00
! Compute correlation energy for ground- and doubly-excited states
2020-03-15 20:33:18 +01:00
do iEns=1,nEns
2020-03-31 22:15:45 +02:00
call restricted_elda_correlation_potential(aMFL(1:3,iEns),nGrid,weight(:),nBas,AO(:,:),rho(:),FceLDA(:,:,iEns))
2020-03-15 20:33:18 +01:00
end do
! LDA-centered functional
2020-03-29 18:34:09 +02:00
if(LDA_centered) then
2020-03-31 22:15:45 +02:00
call RVWN5_lda_correlation_potential(nGrid,weight(:),nBas,AO(:,:),rho(:),FcLDA(:,:))
2020-04-26 23:17:27 +02:00
FceLDA(:,:,3) = FcLDA(:,:) + wEns(3)*(FceLDA(:,:,3) - FceLDA(:,:,1))
2020-03-31 22:15:45 +02:00
FceLDA(:,:,2) = FcLDA(:,:) + wEns(2)*(FceLDA(:,:,2) - FceLDA(:,:,1))
FceLDA(:,:,1) = FcLDA(:,:)
2020-03-31 12:39:26 +02:00
end if
2020-03-15 20:33:18 +01:00
! Weight-denpendent functional for ensembles
Fc(:,:) = 0d0
do iEns=1,nEns
Fc(:,:) = Fc(:,:) + wEns(iEns)*FceLDA(:,:,iEns)
enddo
end subroutine RMFL20_lda_correlation_potential