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

B3LYP works

This commit is contained in:
Pierre-Francois Loos 2021-02-14 21:54:10 +01:00
parent 05acc90332
commit da8c1c691e
9 changed files with 23 additions and 124 deletions

View File

@ -1,26 +1,26 @@
# Restricted or unrestricted KS calculation # Restricted or unrestricted KS calculation
eDFT-UKS eDFT-UKS
# exchange rung: # exchange rung:
# Hartree = 0 # Hartree = 0: H
# LDA = 1: S51,CC-S51 # LDA = 1: S51,CC-S51
# GGA = 2: B88,G96,PBE # GGA = 2: B88,G96,PBE
# Hybrid = 4: B3LYP,PBE0 # MGGA = 3:
# Hartree-Fock = 666 # Hybrid = 4: HF,B3,PBE
2 B88 4 B3
# correlation rung: # correlation rung:
# Hartree = 0: H # Hartree = 0: H
# LDA = 1: VWN5,eVWN5 # LDA = 1: VWN5,eVWN5
# GGA = 2: LYP,PBE # GGA = 2: LYP,PBE
# Hybrid = 4: # MGGA = 3:
# Hartree-Fock = 666 # Hybrid = 4: HF,B88,PBE
2 LYP 4 LYP
# quadrature grid SG-n # quadrature grid SG-n
1 1
# Number of states in ensemble (nEns) # Number of states in ensemble (nEns)
3 3
# occupation numbers # occupation numbers
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0

View File

@ -1,5 +1,5 @@
# RHF UHF KS MOM # RHF UHF KS MOM
T F T F F F T F
# MP2* MP3 MP2-F12 # MP2* MP3 MP2-F12
F F F F F F
# CCD DCD CCSD CCSD(T) # CCD DCD CCSD CCSD(T)
@ -9,7 +9,7 @@
# CIS* CIS(D) CID CISD # CIS* CIS(D) CID CISD
F F F F F F F F
# RPA* RPAx* ppRPA # RPA* RPAx* ppRPA
F F F F T F
# G0F2 evGF2 G0F3 evGF3 # G0F2 evGF2 G0F3 evGF3
F F F F F F F F
# G0W0* evGW* qsGW* # G0W0* evGW* qsGW*

View File

@ -1,58 +0,0 @@
subroutine lda_exchange_potential(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,nBas,AO,rho,Fx)
! Select LDA correlation potential
implicit none
include 'parameters.h'
! Input variables
logical,intent(in) :: LDA_centered
character(len=12),intent(in) :: DFA
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) :: AO(nBas,nGrid)
double precision,intent(in) :: rho(nGrid)
! Output variables
double precision,intent(out) :: Fx(nBas,nBas)
! Select exchange functional
select case (DFA)
case ('RS51')
call RS51_lda_exchange_potential(nGrid,weight,nBas,AO,rho,Fx)
case ('US51')
call US51_lda_exchange_potential(nGrid,weight,nBas,AO,rho,Fx)
case ('RMFL20')
call RMFL20_lda_exchange_potential(LDA_centered,nEns,wEns,nGrid,weight,nBas,AO,rho,Fx)
case ('RCC')
call RCC_lda_exchange_potential(nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,nBas,AO,rho,Fx)
case ('UCC')
call UCC_lda_exchange_potential(nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,nBas,AO,rho,Fx)
case default
call print_warning('!!! LDA exchange functional not available !!!')
stop
end select
end subroutine lda_exchange_potential

View File

@ -18,10 +18,6 @@ subroutine unrestricted_correlation_energy(rung,DFA,nEns,wEns,nGrid,weight,rho,d
! Local variables ! Local variables
double precision :: EcLDA(nsp)
double precision :: EcGGA(nsp)
double precision :: aC
! Output variables ! Output variables
double precision,intent(out) :: Ec(nsp) double precision,intent(out) :: Ec(nsp)
@ -56,12 +52,7 @@ subroutine unrestricted_correlation_energy(rung,DFA,nEns,wEns,nGrid,weight,rho,d
case(4) case(4)
aC = 0.81d0 call unrestricted_hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
call unrestricted_lda_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,EcLDA)
call unrestricted_gga_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,EcGGA)
Ec(:) = EcLDA(:) + aC*(EcGGA(:) - EcLDA(:))
end select end select

View File

@ -61,14 +61,7 @@ subroutine unrestricted_correlation_potential(rung,DFA,nEns,wEns,nGrid,weight,nB
case(4) case(4)
allocate(FcLDA(nBas,nBas,nspin),FcGGA(nBas,nBas,nspin)) call unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
aC = 0.81d0
call unrestricted_lda_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,rho,FcLDA)
call unrestricted_gga_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,FcGGA)
Fc(:,:,:) = FcLDA(:,:,:) + aC*(FcGGA(:,:,:) - FcLDA(:,:,:))
end select end select

View File

@ -26,9 +26,6 @@ subroutine unrestricted_exchange_energy(rung,DFA,LDA_centered,nEns,wEns,aCC_w1,a
! Local variables ! Local variables
double precision :: ExLDA,ExGGA,ExMGGA,ExHF
double precision :: cX,aX,aC
! Output variables ! Output variables
double precision,intent(out) :: Ex double precision,intent(out) :: Ex
@ -46,41 +43,26 @@ subroutine unrestricted_exchange_energy(rung,DFA,LDA_centered,nEns,wEns,aCC_w1,a
case(1) case(1)
call unrestricted_lda_exchange_energy(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,& call unrestricted_lda_exchange_energy(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,&
rho,ExLDA,Cx_choice) rho,Ex,Cx_choice)
Ex = ExLDA
! GGA functionals ! GGA functionals
case(2) case(2)
call unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,ExGGA) call unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ex)
Ex = ExGGA
! MGGA functionals ! MGGA functionals
case(3) case(3)
call unrestricted_mgga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,ExMGGA) call unrestricted_mgga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ex)
Ex = ExMGGA
! Hybrid functionals ! Hybrid functionals
case(4) case(4)
cX = 0.20d0 call unrestricted_hybrid_exchange_energy(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,nBas,P,FxHF, &
aX = 0.72d0 rho,drho,Ex,Cx_choice)
aC = 0.81d0
call unrestricted_lda_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,ExLDA,Cx_choice)
call unrestricted_gga_exchange_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,ExGGA)
call unrestricted_fock_exchange_energy(nBas,P,FxHF,ExHF)
Ex = ExLDA &
+ cX*(ExHF - ExLDA) &
+ aX*(ExGGA - ExLDA)
end select end select

View File

@ -67,18 +67,8 @@ subroutine unrestricted_exchange_potential(rung,DFA,LDA_centered,nEns,wEns,aCC_w
case(4) case(4)
allocate(FxLDA(nBas,nBas),FxGGA(nBas,nBas)) call 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)
cX = 0.20d0
aX = 0.72d0
call unrestricted_lda_exchange_potential(DFA,nGrid,weight,nBas,AO,rho,FxLDA,Cx_choice)
call unrestricted_gga_exchange_potential(DFA,nGrid,weight,nBas,AO,dAO,rho,drho,FxGGA)
call unrestricted_fock_exchange_potential(nBas,P,ERI,FxHF)
Fx(:,:) = FxLDA(:,:) &
+ cX*(FxHF(:,:) - FxLDA(:,:)) &
+ aX*(FxGGA(:,:) - FxLDA(:,:))
end select end select

View File

@ -36,7 +36,8 @@ subroutine unrestricted_lda_exchange_energy(DFA,LDA_centered,nEns,wEns,aCC_w1,aC
case default case default
call print_warning('!!! LDA exchange functional not available !!!') call print_warning('!!! LDA exchange energy not available !!!')
stop stop
end select end select

View File

@ -39,7 +39,7 @@ subroutine unrestricted_lda_exchange_potential(DFA,LDA_centered,nEns,wEns,aCC_w1
case default case default
call print_warning('!!! LDA exchange functional not available !!!') call print_warning('!!! LDA exchange potential not available !!!')
stop stop
end select end select