10
1
mirror of https://github.com/pfloos/quack synced 2024-12-22 12:23:42 +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
eDFT-UKS
# exchange rung:
# Hartree = 0
# Hartree = 0: H
# LDA = 1: S51,CC-S51
# GGA = 2: B88,G96,PBE
# Hybrid = 4: B3LYP,PBE0
# Hartree-Fock = 666
2 B88
# MGGA = 3:
# Hybrid = 4: HF,B3,PBE
4 B3
# correlation rung:
# Hartree = 0: H
# LDA = 1: VWN5,eVWN5
# GGA = 2: LYP,PBE
# Hybrid = 4:
# Hartree-Fock = 666
2 LYP
# MGGA = 3:
# Hybrid = 4: HF,B88,PBE
4 LYP
# quadrature grid SG-n
1
# Number of states in ensemble (nEns)
3
# occupation numbers
1 1 1 1 1 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
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
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
T F T F
F F T F
# MP2* MP3 MP2-F12
F F F
# CCD DCD CCSD CCSD(T)
@ -9,7 +9,7 @@
# CIS* CIS(D) CID CISD
F F F F
# RPA* RPAx* ppRPA
F F F
F T F
# G0F2 evGF2 G0F3 evGF3
F F F F
# 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
double precision :: EcLDA(nsp)
double precision :: EcGGA(nsp)
double precision :: aC
! Output variables
double precision,intent(out) :: Ec(nsp)
@ -56,12 +52,7 @@ subroutine unrestricted_correlation_energy(rung,DFA,nEns,wEns,nGrid,weight,rho,d
case(4)
aC = 0.81d0
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(:))
call unrestricted_hybrid_correlation_energy(DFA,nEns,wEns,nGrid,weight,rho,drho,Ec)
end select

View File

@ -61,14 +61,7 @@ subroutine unrestricted_correlation_potential(rung,DFA,nEns,wEns,nGrid,weight,nB
case(4)
allocate(FcLDA(nBas,nBas,nspin),FcGGA(nBas,nBas,nspin))
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(:,:,:))
call unrestricted_hybrid_correlation_potential(DFA,nEns,wEns,nGrid,weight,nBas,AO,dAO,rho,drho,Fc)
end select

View File

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

View File

@ -67,18 +67,8 @@ subroutine unrestricted_exchange_potential(rung,DFA,LDA_centered,nEns,wEns,aCC_w
case(4)
allocate(FxLDA(nBas,nBas),FxGGA(nBas,nBas))
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(:,:))
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)
end select

View File

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

View File

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