4
1
mirror of https://github.com/pfloos/quack synced 2024-06-26 15:12:17 +02:00
This commit is contained in:
Pierre-Francois Loos 2020-03-15 20:33:18 +01:00
parent 81ca41a2f6
commit 444a9f7bf1
9 changed files with 241 additions and 107 deletions

View File

@ -2,4 +2,4 @@
2 9 9 0 0
# Znuc x y z
F 0. 0. 0.
F 0. 0. 3.3
F 0. 0. 2

View File

@ -1,82 +0,0 @@
subroutine LF19_lda_correlation_potential(nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
! Compute Loos-Fromager weight-dependent LDA correlation potential
implicit none
include 'parameters.h'
! Input variables
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,nspin)
! Local variables
logical :: LDA_centered = .false.
integer :: iEns
double precision,allocatable :: aLF(:,:)
double precision,allocatable :: FcLDA(:,:,:)
double precision,allocatable :: FceLDA(:,:,:,:)
! Output variables
double precision,intent(out) :: Fc(nBas,nBas,nspin)
! Allocation
allocate(aLF(3,nEns),FcLDA(nBas,nBas,nspin),FceLDA(nBas,nBas,nspin,nEns))
! Parameters for weight-dependent LDA correlation functional
aLF(1,1) = -0.0238184d0
aLF(2,1) = +0.00575719d0
aLF(3,1) = +0.0830576d0
aLF(1,2) = -0.0282814d0
aLF(2,2) = +0.00340758d0
aLF(3,2) = +0.0663967d0
aLF(1,3) = -0.0144633d0
aLF(2,3) = -0.0504501d0
aLF(3,3) = +0.0331287d0
! Compute correlation energy for ground, singly-excited and doubly-excited states
do iEns=1,nEns
call elda_correlation_potential(nEns,aLF(:,iEns),nGrid,weight,nBas,AO,rho,FceLDA(:,:,:,iEns))
end do
! LDA-centered functional
FcLDA(:,:,:) = 0d0
if(LDA_centered) then
call VWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,FcLDA)
do iEns=1,nEns
FceLDA(:,:,:,iEns) = FceLDA(:,:,:,iEns) + FcLDA(:,:,:) - FceLDA(:,:,:,1)
end do
end if
! Weight-denpendent functional for ensembles
Fc(:,:,:) = 0d0
do iEns=1,nEns
Fc(:,:,:) = Fc(:,:,:) + wEns(iEns)*FceLDA(:,:,:,iEns)
enddo
end subroutine LF19_lda_correlation_potential

View File

@ -1,6 +1,7 @@
subroutine LF19_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
subroutine RMFL20_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
! Compute eLDA correlation energy
! Compute the restricted version of the Marut-Fromager-Loos weight-dependent correlation functional
! The RMFL20 is a two-state, single-weight correlation functional for spin-unpolarized systems
implicit none
include 'parameters.h'
@ -15,10 +16,10 @@ subroutine LF19_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
! Local variables
logical :: LDA_centered = .false.
logical :: LDA_centered = .true.
integer :: iEns,isp
double precision :: EcLDA(nsp)
double precision,allocatable :: aLF(:,:)
double precision,allocatable :: aMFL(:,:)
double precision,allocatable :: EceLDA(:,:)
! Output variables
@ -27,27 +28,23 @@ subroutine LF19_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
! Allocation
allocate(aLF(3,nEns),EceLDA(nsp,nEns))
allocate(aMFL(3,nEns),EceLDA(nsp,nEns))
! Parameters for weight-dependent LDA correlation functional
aLF(1,1) = -0.0238184d0
aLF(2,1) = +0.00575719d0
aLF(3,1) = +0.0830576d0
aMFL(1,1) = -0.0238184d0
aMFL(2,1) = +0.00540994d0
aMFL(3,1) = +0.0830766d0
aLF(1,2) = -0.0282814d0
aLF(2,2) = +0.00340758d0
aLF(3,2) = +0.0663967d0
aLF(1,3) = -0.0144633d0
aLF(2,3) = -0.0504501d0
aLF(3,3) = +0.0331287d0
aMFL(1,2) = -0.0144633d0
aMFL(2,2) = -0.0506019d0
aMFL(3,2) = +0.0331417d0
! Compute correlation energy for ground, singly-excited and doubly-excited states
do iEns=1,nEns
call elda_correlation_energy(nEns,aLF(:,iEns),nGrid,weight(:),rho(:,:),EceLDA(:,iEns))
call elda_correlation_energy(nEns,aMFL(:,iEns),nGrid,weight(:),rho(:,:),EceLDA(:,iEns))
end do
@ -81,4 +78,4 @@ subroutine LF19_lda_correlation_energy(nEns,wEns,nGrid,weight,rho,Ec)
end do
end do
end subroutine LF19_lda_correlation_energy
end subroutine RMFL20_lda_correlation_energy

View File

@ -0,0 +1,78 @@
subroutine RMFL20_lda_correlation_potential(nEns,wEns,nGrid,weight,nBas,AO,rho,Fc)
! Compute Loos-Fromager weight-dependent LDA correlation potential
implicit none
include 'parameters.h'
! Input variables
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
logical :: LDA_centered = .true.
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
aMFL(1,2) = -0.0144633d0
aMFL(2,2) = -0.0506019d0
aMFL(3,2) = +0.0331417d0
! Compute correlation energy for ground, singly-excited and doubly-excited states
do iEns=1,nEns
call elda_correlation_potential(nEns,aMFL(:,iEns),nGrid,weight,nBas,AO,rho,FceLDA(:,:,iEns))
end do
! LDA-centered functional
FcLDA(:,:) = 0d0
if(LDA_centered) then
call RVWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,FcLDA)
do iEns=1,nEns
FceLDA(:,:,iEns) = FceLDA(:,:,iEns) + FcLDA(:,:) - FceLDA(:,:,1)
end do
end if
! Weight-denpendent functional for ensembles
Fc(:,:) = 0d0
do iEns=1,nEns
Fc(:,:) = Fc(:,:) + wEns(iEns)*FceLDA(:,:,iEns)
enddo
end subroutine RMFL20_lda_correlation_potential

View File

@ -1,6 +1,7 @@
subroutine RMFL20_lda_exchange_energy(nEns,wEns,nGrid,weight,rho,Ex)
! Compute restricted version of Marut-Fromager-Loos weight-dependent LDA exchange energy
! Compute the restricted version of the Marut-Fromager-Loos weight-dependent exchange functional
! The RMFL20 is a two-state, single-weight exchange functional
implicit none
include 'parameters.h'

View File

@ -0,0 +1,62 @@
subroutine RVWN5_lda_correlation_energy(nGrid,weight,rho,Ec)
! Compute the restricted VWN5 LDA correlation energy
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rho(nGrid)
! Local variables
integer :: iG
double precision :: r,rs,x
double precision :: a_p,x0_p,xx0_p,b_p,c_p,x_p,q_p
double precision :: ec_p
! Output variables
double precision :: Ec(nsp)
! Parameters of the functional
a_p = +0.0621814D0/2D0
x0_p = -0.10498d0
b_p = +3.72744d0
c_p = +12.9352d0
! Initialization
Ec = 0d0
do iG=1,nGrid
r = max(0d0,rho(iG))
if(r > threshold) then
rs = (4d0*pi*r/3d0)**(-1d0/3d0)
x = sqrt(rs)
x_p = x*x + b_p*x + c_p
xx0_p = x0_p*x0_p + b_p*x0_p + c_p
q_p = sqrt(4d0*c_p - b_p*b_p)
ec_p = a_p*( log(x**2/x_p) + 2d0*b_p/q_p*atan(q_p/(2d0*x + b_p)) &
- b_p*x0_p/xx0_p*( log((x - x0_p)**2/x_p) + 2d0*(b_p + 2d0*x0_p)/q_p*atan(q_p/(2d0*x + b_p)) ) )
Ec = Ec + weight(iG)*ec_p*r
end if
end do
end subroutine RVWN5_lda_correlation_energy

View File

@ -0,0 +1,78 @@
subroutine RVWN5_lda_correlation_potential(nGrid,weight,nBas,AO,rho,Fc)
! Compute the restricted VWN5 LDA correlation potential
implicit none
include 'parameters.h'
! Input variables
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 :: mu,nu,iG
double precision :: r,rs,x
double precision :: a_p,x0_p,xx0_p,b_p,c_p,x_p,q_p
double precision :: dxdrs,dxdx_p,decdx_p
double precision :: drsdra,decdra_p
double precision :: ec_p
! Output variables
double precision :: Fc(nBas,nBas)
! Parameters of the functional
a_p = +0.0621814D0/2D0
x0_p = -0.10498d0
b_p = +3.72744d0
c_p = +12.9352d0
! Initialization
Fc(:,:) = 0d0
do mu=1,nBas
do nu=1,nBas
do iG=1,nGrid
r = max(0d0,rho(iG))
if(r > threshold) then
rs = (4d0*pi*r/3d0)**(-1d0/3d0)
x = sqrt(rs)
x_p = x*x + b_p*x + c_p
xx0_p = x0_p*x0_p + b_p*x0_p + c_p
q_p = sqrt(4d0*c_p - b_p*b_p)
ec_p = a_p*( log(x**2/x_p) + 2d0*b_p/q_p*atan(q_p/(2d0*x + b_p)) &
- b_p*x0_p/xx0_p*( log((x - x0_p)**2/x_p) + 2d0*(b_p + 2d0*x0_p)/q_p*atan(q_p/(2d0*x + b_p)) ) )
drsdra = - (36d0*pi)**(-1d0/3d0)*r**(-4d0/3d0)
dxdrs = 0.5d0/sqrt(rs)
dxdx_p = 2d0*x + b_p
decdx_p = a_p*( 2d0/x - 4d0*b_p/( (b_p+2d0*x)**2 + q_p**2) - dxdx_p/x_p &
- b_p*x0_p/xx0_p*( 2/(x-x0_p) - 4d0*(b_p+2d0*x0_p)/( (b_p+2d0*x)**2 + q_p**2) - dxdx_p/x_p ) )
decdra_p = drsdra*dxdrs*decdx_p
Fc(mu,nu,1) = Fc(mu,nu,1) + weight(iG)*AO(mu,iG)*AO(nu,iG)*(ec_p + decdra_p*r)
end if
end do
end do
end do
end subroutine RVWN5_lda_correlation_potential

View File

@ -44,11 +44,11 @@ subroutine lda_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,Ec)
call C16_lda_correlation_energy(nGrid,weight(:),rho(:,:),Ec(:))
! Loos-Fromager weight-dependent correlation functional: Loos and Fromager (in preparation)
! Restricted version of the Marut-Fromager-Loos weight-dependent correlation functional
case ('LF19')
case ('RMFL20')
call LF19_lda_correlation_energy(nEns,wEns(:),nGrid,weight(:),rho(:,:),Ec(:))
call RMFL20_lda_correlation_energy(nEns,wEns(:),nGrid,weight(:),rho(:,:),Ec(:))
case default

View File

@ -48,11 +48,11 @@ include 'parameters.h'
call C16_lda_correlation_potential(nGrid,weight(:),nBas,AO(:,:),rho(:,:),Fc(:,:,:))
! Loos-Fromager weight-dependent correlation functional: Loos and Fromager (in preparation)
! Restricted version of the Marut-Fromager-Loos weight-dependent correlation functional
case ('LF19')
case ('RMFL20')
call LF19_lda_correlation_potential(nEns,wEns(:),nGrid,weight(:),nBas,AO(:,:),rho(:,:),Fc(:,:,:))
call RMFL20_lda_correlation_potential(nEns,wEns(:),nGrid,weight(:),nBas,AO(:,:),rho(:,:),Fc(:,:,:))
case default