4
1
mirror of https://github.com/pfloos/quack synced 2024-11-07 14:43:58 +01:00

HF individual energy working

This commit is contained in:
Pierre-Francois Loos 2021-11-08 09:55:39 +01:00
parent ac5955ab27
commit 388db3ca6e
9 changed files with 104 additions and 34 deletions

View File

@ -6,14 +6,14 @@
# GGA = 2: B88,G96,PBE # GGA = 2: B88,G96,PBE
# MGGA = 3: # MGGA = 3:
# Hybrid = 4: HF,B3LYP,PBE # Hybrid = 4: HF,B3LYP,PBE
1 S51 4 HF
# correlation rung: # correlation rung:
# Hartree = 0: H # Hartree = 0: H
# LDA = 1: PW92,VWN3,VWN5,eVWN5 # LDA = 1: PW92,VWN3,VWN5,eVWN5
# GGA = 2: LYP,PBE # GGA = 2: LYP,PBE
# MGGA = 3: # MGGA = 3:
# Hybrid = 4: HF,B3LYP,PBE # Hybrid = 4: HF,B3LYP,PBE
1 VWN5 4 HF
# quadrature grid SG-n # quadrature grid SG-n
0 0
# Number of states in ensemble (nEns) # Number of states in ensemble (nEns)
@ -28,10 +28,10 @@
1 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 1 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
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 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
1 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 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
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 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
# Ensemble weights: wEns(1),...,wEns(nEns-1) # Ensemble weights: wEns(1),...,wEns(nEns-1)
1.00 0.00 0.00 0.00 0.00 1.00
# N-centered? # N-centered?
F F
# Parameters for CC weight-dependent exchange functional # Parameters for CC weight-dependent exchange functional

View File

@ -1,9 +1,9 @@
# RHF UHF KS MOM # RHF UHF KS MOM
T F F 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)
F F T F F F F F
# drCCD rCCD lCCD pCCD # drCCD rCCD lCCD pCCD
F F F F F F F F
# CIS* CIS(D) CID CISD FCI # CIS* CIS(D) CID CISD FCI
@ -11,11 +11,11 @@
# RPA* RPAx* ppRPA # RPA* RPAx* ppRPA
F F F F F F
# G0F2* evGF2* qsGF2* G0F3 evGF3 # G0F2* evGF2* qsGF2* G0F3 evGF3
T F F F F F F F F F
# G0W0* evGW* qsGW* ufG0W0 ufGW # G0W0* evGW* qsGW* ufG0W0 ufGW
T F F F F F F F F F
# G0T0 evGT qsGT # G0T0 evGT qsGT
T F F F F F
# MCMP2 # MCMP2
F F
# * unrestricted version available # * unrestricted version available

View File

@ -5,7 +5,7 @@
# CC: maxSCF thresh DIIS n_diis # CC: maxSCF thresh DIIS n_diis
64 0.0000000001 T 5 64 0.0000000001 T 5
# spin: TDA singlet triplet spin_conserved spin_flip # spin: TDA singlet triplet spin_conserved spin_flip
F T T T T F T F T T
# GF: maxSCF thresh DIIS n_diis lin eta renorm # GF: maxSCF thresh DIIS n_diis lin eta renorm
256 0.00001 T 5 T 0.00367493 3 256 0.00001 T 5 T 0.00367493 3
# GW/GT: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0 # GW/GT: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0

View File

@ -1,4 +1,4 @@
2 2
H 0. 0. 0. H 0. 0. 0.
H 0. 0. 0.740848 H 0. -0.740848 0.740848

View File

@ -62,7 +62,7 @@ subroutine unrestricted_correlation_individual_energy(rung,DFA,LDA_centered,nEns
case(4) case(4)
call print_warning('!!! Individual energies NYI for hybrids !!!') call unrestricted_hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,Ec)
end select end select

View File

@ -29,13 +29,6 @@ subroutine unrestricted_exchange_individual_energy(rung,DFA,LDA_centered,nEns,wE
logical,intent(in) :: doNcentered logical,intent(in) :: doNcentered
double precision,intent(in) :: kappa double precision,intent(in) :: kappa
! Local variables
double precision :: ExLDA
double precision :: ExGGA
double precision :: ExMGGA
double precision :: ExHF
! Output variables ! Output variables
double precision,intent(out) :: Ex double precision,intent(out) :: Ex
@ -53,32 +46,25 @@ subroutine unrestricted_exchange_individual_energy(rung,DFA,LDA_centered,nEns,wE
case(1) case(1)
call unrestricted_lda_exchange_individual_energy(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,& call unrestricted_lda_exchange_individual_energy(DFA,LDA_centered,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,&
rhow,rho,Cx_choice,doNcentered,kappa,ExLDA) rhow,rho,Cx_choice,doNcentered,kappa,Ex)
Ex = ExLDA
! GGA functionals ! GGA functionals
case(2) case(2)
call unrestricted_gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,ExGGA) call unrestricted_gga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,Ex)
Ex = ExGGA
! MGGA functionals ! MGGA functionals
case(3) case(3)
call unrestricted_mgga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,ExMGGA) call unrestricted_mgga_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,Ex)
Ex = ExMGGA
! Hybrid functionals ! Hybrid functionals
case(4) case(4)
! call unrestricted_hybrid_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,nBas,P,FxHF,rho,drho,Ex) call unrestricted_hybrid_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,nBas,ERI,Pw,P,rhow,drhow,rho,drho,Ex)
call print_warning('!!! Individual energies NYI for Hybrids !!!')
end select end select

View File

@ -1,6 +1,6 @@
subroutine unrestricted_fock_exchange_individual_energy(nBas,Pw,P,ERI,Ex) subroutine unrestricted_fock_exchange_individual_energy(nBas,Pw,P,ERI,Ex)
! Compute the Fock exchange potential ! Compute the HF individual energy in the unrestricted formalism
implicit none implicit none
@ -24,8 +24,9 @@ subroutine unrestricted_fock_exchange_individual_energy(nBas,Pw,P,ERI,Ex)
allocate(Fx(nBas,nBas)) allocate(Fx(nBas,nBas))
call unrestricted_fock_exchange_potential(nBas,Pw(:,:),ERI(:,:,:,:),Fx(:,:)) call unrestricted_fock_exchange_potential(nBas,Pw,ERI,Fx)
Ex = trace_matrix(nBas,matmul(P(:,:),Fx(:,:))) &
- 0.5d0*trace_matrix(nBas,matmul(Pw(:,:),Fx(:,:))) Ex = trace_matrix(nBas,matmul(P ,Fx)) &
- 0.5d0*trace_matrix(nBas,matmul(Pw,Fx))
end subroutine unrestricted_fock_exchange_individual_energy end subroutine unrestricted_fock_exchange_individual_energy

View File

@ -0,0 +1,39 @@
subroutine unrestricted_hybrid_correlation_individual_energy(DFA,nEns,wEns,nGrid,weight,rhow,drhow,rho,drho,Ec)
! Compute the hybrid correlation energy for individual states
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: DFA
integer,intent(in) :: nEns
double precision,intent(in) :: wEns(nEns)
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rhow(nGrid)
double precision,intent(in) :: drhow(ncart,nGrid)
double precision,intent(in) :: rho(nGrid)
double precision,intent(in) :: drho(ncart,nGrid)
! Output variables
double precision :: Ec(nsp)
! Select correlation functional
select case (DFA)
case (1)
Ec(:) = 0d0
case default
call print_warning('!!! Hybrid correlation individual energy not available !!!')
stop
end select
end subroutine unrestricted_hybrid_correlation_individual_energy

View File

@ -0,0 +1,44 @@
subroutine unrestricted_hybrid_exchange_individual_energy(DFA,nEns,wEns,nGrid,weight,nBas,ERI,Pw,P,rhow,drhow,rho,drho,Ex)
! Compute the hybrid exchange energy for individual states
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: DFA
integer,intent(in) :: nEns
double precision,intent(in) :: wEns(nEns)
integer,intent(in) :: nGrid
double precision,intent(in) :: weight(nGrid)
double precision,intent(in) :: rhow(nGrid)
double precision,intent(in) :: drhow(ncart,nGrid)
double precision,intent(in) :: rho(nGrid)
double precision,intent(in) :: drho(ncart,nGrid)
integer,intent(in) :: nBas
double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas)
double precision,intent(in) :: Pw(nBas,nBas)
double precision,intent(in) :: P(nBas,nBas)
! Output variables
double precision :: Ex
! Select correlation functional
select case (DFA)
case (1)
call unrestricted_fock_exchange_individual_energy(nBas,Pw,P,ERI,Ex)
case default
call print_warning('!!! Hybrid exchange individual energy not available !!!')
stop
end select
end subroutine unrestricted_hybrid_exchange_individual_energy