4
1
mirror of https://github.com/pfloos/quack synced 2024-11-07 06:33:55 +01:00

eLDA correlation potential under work

This commit is contained in:
Pierre-Francois Loos 2020-03-17 11:50:05 +01:00
parent 52fe50f992
commit 871f11ef40
4 changed files with 25 additions and 39 deletions

View File

@ -13,7 +13,7 @@
# GGA = 2: LYP # GGA = 2: LYP
# Hybrid = 4: B3LYP # Hybrid = 4: B3LYP
# Hartree-Fock = 666 # Hartree-Fock = 666
1 RVWN5 1 RMFL20
# quadrature grid SG-n # quadrature grid SG-n
1 1
# Number of states in ensemble (nEns) # Number of states in ensemble (nEns)

View File

@ -12,23 +12,22 @@ subroutine RMFL20_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
double precision,intent(in) :: wEns(nEns) double precision,intent(in) :: wEns(nEns)
integer,intent(in) :: nGrid integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid) double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rho(nGrid,nspin) double precision,intent(in) :: rho(nGrid)
! Local variables ! Local variables
logical :: LDA_centered = .true. integer :: iEns
integer :: iEns,isp double precision :: EcLDA
double precision :: EcLDA(nsp)
double precision,allocatable :: aMFL(:,:) double precision,allocatable :: aMFL(:,:)
double precision,allocatable :: EceLDA(:,:) double precision,allocatable :: EceLDA(:)
! Output variables ! Output variables
double precision :: Ec(nsp) double precision :: Ec
! Allocation ! Allocation
allocate(aMFL(3,nEns),EceLDA(nsp,nEns)) allocate(aMFL(3,nEns),EceLDA(nEns))
! Parameters for weight-dependent LDA correlation functional ! Parameters for weight-dependent LDA correlation functional
@ -40,42 +39,34 @@ subroutine RMFL20_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
aMFL(2,2) = -0.0506019d0 aMFL(2,2) = -0.0506019d0
aMFL(3,2) = +0.0331417d0 aMFL(3,2) = +0.0331417d0
! Compute correlation energy for ground, singly-excited and doubly-excited states ! Compute correlation energy for ground and doubly-excited states
do iEns=1,nEns do iEns=1,nEns
call elda_correlation_energy(nEns,aMFL(:,iEns),nGrid,weight(:),rho(:,:),EceLDA(:,iEns)) call restricted_elda_correlation_energy(nEns,aMFL(:,iEns),nGrid,weight(:),rho(:),EceLDA(iEns))
end do end do
! LDA-centered functional ! LDA-centered functional
EcLDA(:) = 0d0 EcLDA = 0d0
if(LDA_centered) then call RVWN5_lda_correlation_energy(nGrid,weight(:),rho(:),EcLDA)
call VWN5_lda_correlation_energy(nGrid,weight(:),rho(:,:),EcLDA(:)) do iEns=1,nEns
do iEns=1,nEns EceLDA(iEns) = EceLDA(iEns) + EcLDA - EceLDA(1)
do isp=1,nsp
EceLDA(isp,iEns) = EceLDA(isp,iEns) + EcLDA(isp) - EceLDA(isp,1) end do
end do
end do
end if
! Weight-denpendent functional for ensembles ! Weight-denpendent functional for ensembles
Ec(:) = 0d0 Ec = 0d0
do iEns=1,nEns do iEns=1,nEns
do isp=1,nsp
Ec(isp) = Ec(isp) + wEns(iEns)*EceLDA(isp,iEns) Ec = Ec + wEns(iEns)*EceLDA(iEns)
end do
end do end do
end subroutine RMFL20_lda_correlation_energy end subroutine RMFL20_lda_correlation_energy

View File

@ -1,6 +1,6 @@
subroutine RMFL20_lda_correlation_potential(nEns,wEns,nGrid,weight,nBas,AO,rho,Fc) subroutine RMFL20_lda_correlation_potential(nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
! Compute Loos-Fromager weight-dependent LDA correlation potential ! Compute Marut-Fromager-Loos weight-dependent LDA correlation potential
implicit none implicit none
include 'parameters.h' include 'parameters.h'
@ -17,7 +17,6 @@ include 'parameters.h'
! Local variables ! Local variables
logical :: LDA_centered = .true.
integer :: iEns integer :: iEns
double precision,allocatable :: aMFL(:,:) double precision,allocatable :: aMFL(:,:)
double precision,allocatable :: FcLDA(:,:) double precision,allocatable :: FcLDA(:,:)
@ -45,7 +44,7 @@ include 'parameters.h'
do iEns=1,nEns do iEns=1,nEns
call elda_correlation_potential(nEns,aMFL(:,iEns),nGrid,weight,nBas,AO,rho,FceLDA(:,:,iEns)) call restricted_elda_correlation_potential(nEns,aMFL(:,iEns),nGrid,weight,nBas,AO,rho,FceLDA(:,:,iEns))
end do end do
@ -53,17 +52,13 @@ include 'parameters.h'
FcLDA(:,:) = 0d0 FcLDA(:,:) = 0d0
if(LDA_centered) then call RVWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,FcLDA)
call RVWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,FcLDA) do iEns=1,nEns
do iEns=1,nEns FceLDA(:,:,iEns) = FceLDA(:,:,iEns) + FcLDA(:,:) - FceLDA(:,:,1)
FceLDA(:,:,iEns) = FceLDA(:,:,iEns) + FcLDA(:,:) - FceLDA(:,:,1) end do
end do
end if
! Weight-denpendent functional for ensembles ! Weight-denpendent functional for ensembles

View File

@ -1,4 +1,4 @@
subroutine restricted_elda_correlation_energy(nEns,aLF,nGrid,weight,rho,Ec) subroutine restricted_elda_correlation_energy(nEns,aMFL,nGrid,weight,rho,Ec)
! Compute the restricted LDA correlation energy of 2-glomium for various states ! Compute the restricted LDA correlation energy of 2-glomium for various states
@ -8,7 +8,7 @@ subroutine restricted_elda_correlation_energy(nEns,aLF,nGrid,weight,rho,Ec)
! Input variables ! Input variables
integer,intent(in) :: nEns integer,intent(in) :: nEns
double precision,intent(in) :: aLF(nEns) double precision,intent(in) :: aMFL(3)
integer,intent(in) :: nGrid integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid) double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rho(nGrid) double precision,intent(in) :: rho(nGrid)
@ -33,7 +33,7 @@ subroutine restricted_elda_correlation_energy(nEns,aLF,nGrid,weight,rho,Ec)
if(r > threshold) then if(r > threshold) then
ec_p = aLF(1)/(1d0 + aLF(2)*r**(-1d0/6d0) + aLF(3)*r**(-1d0/3d0)) ec_p = aMFL(1)/(1d0 + aMFL(2)*r**(-1d0/6d0) + aMFL(3)*r**(-1d0/3d0))
Ec = Ec + weight(iG)*ec_p*r Ec = Ec + weight(iG)*ec_p*r