diff --git a/input/dft b/input/dft index a3810e3..53337d0 100644 --- a/input/dft +++ b/input/dft @@ -13,7 +13,7 @@ # GGA = 2: LYP # Hybrid = 4: B3LYP # Hartree-Fock = 666 - 1 RVWN5 + 1 RMFL20 # quadrature grid SG-n 1 # Number of states in ensemble (nEns) diff --git a/src/eDFT/RMFL20_lda_correlation_energy.f90 b/src/eDFT/RMFL20_lda_correlation_energy.f90 index 6a5f736..d1fb9d4 100644 --- a/src/eDFT/RMFL20_lda_correlation_energy.f90 +++ b/src/eDFT/RMFL20_lda_correlation_energy.f90 @@ -12,23 +12,22 @@ subroutine RMFL20_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec) double precision,intent(in) :: wEns(nEns) integer,intent(in) :: nGrid double precision,intent(in) :: weight(nGrid) - double precision,intent(in) :: rho(nGrid,nspin) + double precision,intent(in) :: rho(nGrid) ! Local variables - logical :: LDA_centered = .true. - integer :: iEns,isp - double precision :: EcLDA(nsp) + integer :: iEns + double precision :: EcLDA double precision,allocatable :: aMFL(:,:) - double precision,allocatable :: EceLDA(:,:) + double precision,allocatable :: EceLDA(:) ! Output variables - double precision :: Ec(nsp) + double precision :: Ec ! Allocation - allocate(aMFL(3,nEns),EceLDA(nsp,nEns)) + allocate(aMFL(3,nEns),EceLDA(nEns)) ! 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(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 - 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 ! 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 - do isp=1,nsp + EceLDA(iEns) = EceLDA(iEns) + EcLDA - EceLDA(1) - EceLDA(isp,iEns) = EceLDA(isp,iEns) + EcLDA(isp) - EceLDA(isp,1) - - end do - end do - - end if + end do ! Weight-denpendent functional for ensembles - Ec(:) = 0d0 + Ec = 0d0 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 subroutine RMFL20_lda_correlation_energy diff --git a/src/eDFT/RMFL20_lda_correlation_potential.f90 b/src/eDFT/RMFL20_lda_correlation_potential.f90 index 1281591..81cc3ad 100644 --- a/src/eDFT/RMFL20_lda_correlation_potential.f90 +++ b/src/eDFT/RMFL20_lda_correlation_potential.f90 @@ -1,6 +1,6 @@ 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 include 'parameters.h' @@ -17,7 +17,6 @@ include 'parameters.h' ! Local variables - logical :: LDA_centered = .true. integer :: iEns double precision,allocatable :: aMFL(:,:) double precision,allocatable :: FcLDA(:,:) @@ -45,7 +44,7 @@ include 'parameters.h' 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 @@ -53,17 +52,13 @@ include 'parameters.h' 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 if + end do ! Weight-denpendent functional for ensembles diff --git a/src/eDFT/restricted_elda_correlation_energy.f90 b/src/eDFT/restricted_elda_correlation_energy.f90 index 8986566..6dd50fb 100644 --- a/src/eDFT/restricted_elda_correlation_energy.f90 +++ b/src/eDFT/restricted_elda_correlation_energy.f90 @@ -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 @@ -8,7 +8,7 @@ subroutine restricted_elda_correlation_energy(nEns,aLF,nGrid,weight,rho,Ec) ! Input variables integer,intent(in) :: nEns - double precision,intent(in) :: aLF(nEns) + double precision,intent(in) :: aMFL(3) integer,intent(in) :: nGrid double precision,intent(in) :: weight(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 - 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