mirror of
https://github.com/pfloos/quack
synced 2024-11-03 20:53:53 +01:00
fix KS
This commit is contained in:
parent
da8c1c691e
commit
722d74ae17
@ -317,8 +317,8 @@ program QuAcK
|
|||||||
|
|
||||||
call cpu_time(start_KS)
|
call cpu_time(start_KS)
|
||||||
call eDFT(maxSCF_HF,thresh_HF,n_diis_HF,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,nEl,nC, &
|
call eDFT(maxSCF_HF,thresh_HF,n_diis_HF,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,nEl,nC, &
|
||||||
nO,nV,nR,nShell,TotAngMomShell,CenterShell,KShell,DShell,ExpShell, &
|
nO,nV,nR,nShell,TotAngMomShell,CenterShell,KShell,DShell,ExpShell, &
|
||||||
max_ang_mom,min_exponent,max_exponent,S,T,V,Hc,X,ERI_AO,dipole_int_AO)
|
max_ang_mom,min_exponent,max_exponent,S,T,V,Hc,X,ERI_AO,dipole_int_AO,EUHF,eHF,cHF,PHF)
|
||||||
|
|
||||||
call cpu_time(end_KS)
|
call cpu_time(end_KS)
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
subroutine eDFT(maxSCF,thresh,max_diis,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,nEl,nC,nO,nV,nR, &
|
subroutine eDFT(maxSCF,thresh,max_diis,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,nEl,nC,nO,nV,nR, &
|
||||||
nShell,TotAngMomShell,CenterShell,KShell,DShell,ExpShell, &
|
nShell,TotAngMomShell,CenterShell,KShell,DShell,ExpShell, &
|
||||||
max_ang_mom,min_exponent,max_exponent,S,T,V,Hc,X,ERI,dipole_int)
|
max_ang_mom,min_exponent,max_exponent,S,T,V,Hc,X,ERI,dipole_int,Ew,eKS,cKS,PKS)
|
||||||
|
|
||||||
! exchange-correlation density-functional theory calculations
|
! exchange-correlation density-functional theory calculations
|
||||||
|
|
||||||
@ -50,7 +50,6 @@ subroutine eDFT(maxSCF,thresh,max_diis,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,n
|
|||||||
|
|
||||||
! Local variables
|
! Local variables
|
||||||
|
|
||||||
double precision :: Ew
|
|
||||||
double precision,allocatable :: c(:,:)
|
double precision,allocatable :: c(:,:)
|
||||||
|
|
||||||
character(len=8) :: method
|
character(len=8) :: method
|
||||||
@ -83,6 +82,14 @@ subroutine eDFT(maxSCF,thresh,max_diis,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,n
|
|||||||
|
|
||||||
integer :: i,vmajor,vminor,vmicro
|
integer :: i,vmajor,vminor,vmicro
|
||||||
|
|
||||||
|
! Output variables
|
||||||
|
|
||||||
|
double precision,intent(out) :: Ew
|
||||||
|
double precision,intent(out) :: eKS(nBas,nspin)
|
||||||
|
double precision,intent(out) :: cKS(nBas,nBas,nspin)
|
||||||
|
double precision,intent(out) :: PKS(nBas,nBas,nspin)
|
||||||
|
|
||||||
|
|
||||||
! Hello World
|
! Hello World
|
||||||
|
|
||||||
write(*,*)
|
write(*,*)
|
||||||
@ -209,7 +216,7 @@ subroutine eDFT(maxSCF,thresh,max_diis,guess_type,mix,nNuc,ZNuc,rNuc,ENuc,nBas,n
|
|||||||
|
|
||||||
call cpu_time(start_KS)
|
call cpu_time(start_KS)
|
||||||
call eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight(:),maxSCF,thresh,max_diis,guess_type,mix, &
|
call eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight(:),maxSCF,thresh,max_diis,guess_type,mix, &
|
||||||
nBas,AO,dAO,S,T,V,Hc,ERI,X,ENuc,Ew,occnum,Cx_choice,doNcentered)
|
nBas,AO,dAO,S,T,V,Hc,ERI,X,ENuc,occnum,Cx_choice,doNcentered,Ew,eKS,cKS,PKS)
|
||||||
call cpu_time(end_KS)
|
call cpu_time(end_KS)
|
||||||
|
|
||||||
t_KS = end_KS - start_KS
|
t_KS = end_KS - start_KS
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,maxSCF,thresh,max_diis,guess_type,mix, &
|
subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weight,maxSCF,thresh,max_diis,guess_type,mix, &
|
||||||
nBas,AO,dAO,S,T,V,Hc,ERI,X,ENuc,Ew,occnum,Cx_choice,doNcentered)
|
nBas,AO,dAO,S,T,V,Hc,ERI,X,ENuc,occnum,Cx_choice,doNcentered,Ew,eps,c,Pw)
|
||||||
|
|
||||||
! Perform unrestricted Kohn-Sham calculation for ensembles
|
! Perform unrestricted Kohn-Sham calculation for ensembles
|
||||||
|
|
||||||
@ -48,10 +48,7 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weig
|
|||||||
double precision :: EJ(nsp)
|
double precision :: EJ(nsp)
|
||||||
double precision :: Ex(nspin)
|
double precision :: Ex(nspin)
|
||||||
double precision :: Ec(nsp)
|
double precision :: Ec(nsp)
|
||||||
double precision :: Ew
|
|
||||||
|
|
||||||
double precision,allocatable :: eps(:,:)
|
|
||||||
double precision,allocatable :: c(:,:,:)
|
|
||||||
double precision,allocatable :: cp(:,:,:)
|
double precision,allocatable :: cp(:,:,:)
|
||||||
double precision,allocatable :: J(:,:,:)
|
double precision,allocatable :: J(:,:,:)
|
||||||
double precision,allocatable :: F(:,:,:)
|
double precision,allocatable :: F(:,:,:)
|
||||||
@ -65,7 +62,6 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weig
|
|||||||
double precision,external :: trace_matrix
|
double precision,external :: trace_matrix
|
||||||
double precision,external :: electron_number
|
double precision,external :: electron_number
|
||||||
|
|
||||||
double precision,allocatable :: Pw(:,:,:)
|
|
||||||
double precision,allocatable :: rhow(:,:)
|
double precision,allocatable :: rhow(:,:)
|
||||||
double precision,allocatable :: drhow(:,:,:)
|
double precision,allocatable :: drhow(:,:,:)
|
||||||
double precision :: nEl(nspin)
|
double precision :: nEl(nspin)
|
||||||
@ -79,6 +75,13 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weig
|
|||||||
|
|
||||||
integer :: ispin,iEns,iBas
|
integer :: ispin,iEns,iBas
|
||||||
|
|
||||||
|
! Output variables
|
||||||
|
|
||||||
|
double precision,intent(out) :: Ew
|
||||||
|
double precision,intent(out) :: eps(nBas,nspin)
|
||||||
|
double precision,intent(out) :: Pw(nBas,nBas,nspin)
|
||||||
|
double precision,intent(out) :: c(nBAs,nBas,nspin)
|
||||||
|
|
||||||
! Hello world
|
! Hello world
|
||||||
|
|
||||||
write(*,*)
|
write(*,*)
|
||||||
@ -120,16 +123,14 @@ subroutine eDFT_UKS(x_rung,x_DFA,c_rung,c_DFA,nEns,wEns,aCC_w1,aCC_w2,nGrid,weig
|
|||||||
|
|
||||||
! Memory allocation
|
! Memory allocation
|
||||||
|
|
||||||
allocate(eps(nBas,nspin),c(nBas,nBas,nspin),cp(nBas,nBas,nspin), &
|
allocate(cp(nBas,nBas,nspin),J(nBas,nBas,nspin),F(nBas,nBas,nspin),Fp(nBas,nBas,nspin), &
|
||||||
J(nBas,nBas,nspin),F(nBas,nBas,nspin),Fp(nBas,nBas,nspin), &
|
|
||||||
Fx(nBas,nBas,nspin),FxHF(nBas,nBas,nspin),Fc(nBas,nBas,nspin),err(nBas,nBas,nspin), &
|
Fx(nBas,nBas,nspin),FxHF(nBas,nBas,nspin),Fc(nBas,nBas,nspin),err(nBas,nBas,nspin), &
|
||||||
Pw(nBas,nBas,nspin),rhow(nGrid,nspin),drhow(ncart,nGrid,nspin), &
|
rhow(nGrid,nspin),drhow(ncart,nGrid,nspin), &
|
||||||
err_diis(nBasSq,max_diis,nspin),F_diis(nBasSq,max_diis,nspin), &
|
err_diis(nBasSq,max_diis,nspin),F_diis(nBasSq,max_diis,nspin), &
|
||||||
P(nBas,nBas,nspin,nEns),rho(nGrid,nspin,nEns),drho(ncart,nGrid,nspin,nEns))
|
P(nBas,nBas,nspin,nEns),rho(nGrid,nspin,nEns),drho(ncart,nGrid,nspin,nEns))
|
||||||
|
|
||||||
! Guess coefficients and eigenvalues
|
! Guess coefficients and eigenvalues
|
||||||
|
|
||||||
|
|
||||||
if(guess_type == 1) then
|
if(guess_type == 1) then
|
||||||
|
|
||||||
do ispin=1,nspin
|
do ispin=1,nspin
|
||||||
|
@ -43,23 +43,18 @@ subroutine unrestricted_correlation_derivative_discontinuity(rung,DFA,nEns,wEns,
|
|||||||
case(2)
|
case(2)
|
||||||
|
|
||||||
call print_warning('!!! derivative discontinuity NYI for GGAs !!!')
|
call print_warning('!!! derivative discontinuity NYI for GGAs !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
! MGGA functionals
|
! MGGA functionals
|
||||||
|
|
||||||
case(3)
|
case(3)
|
||||||
|
|
||||||
call print_warning('!!! derivative discontinuity NYI for MGGAs !!!')
|
call print_warning('!!! derivative discontinuity NYI for MGGAs !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
! Hybrid functionals
|
! Hybrid functionals
|
||||||
|
|
||||||
case(4)
|
case(4)
|
||||||
|
|
||||||
call print_warning('!!! derivative discontinuity NYI for hybrids !!!')
|
call print_warning('!!! derivative discontinuity NYI for hybrids !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
aC = 0.81d0
|
|
||||||
|
|
||||||
end select
|
end select
|
||||||
|
|
||||||
|
@ -48,23 +48,18 @@ subroutine unrestricted_correlation_individual_energy(rung,DFA,LDA_centered,nEns
|
|||||||
case(2)
|
case(2)
|
||||||
|
|
||||||
call print_warning('!!! Individual energies NYI for GGAs !!!')
|
call print_warning('!!! Individual energies NYI for GGAs !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
! MGGA functionals
|
! MGGA functionals
|
||||||
|
|
||||||
case(3)
|
case(3)
|
||||||
|
|
||||||
call print_warning('!!! Individual energies NYI for MGGAs !!!')
|
call print_warning('!!! Individual energies NYI for MGGAs !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
! Hybrid functionals
|
! Hybrid functionals
|
||||||
|
|
||||||
case(4)
|
case(4)
|
||||||
|
|
||||||
call print_warning('!!! Individual energies NYI for hybrids !!!')
|
call print_warning('!!! Individual energies NYI for hybrids !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
aC = 0.81d0
|
|
||||||
|
|
||||||
end select
|
end select
|
||||||
|
|
||||||
|
@ -60,7 +60,6 @@ subroutine unrestricted_exchange_derivative_discontinuity(rung,DFA,nEns,wEns,aCC
|
|||||||
case(4)
|
case(4)
|
||||||
|
|
||||||
call print_warning('!!! exchange part of derivative discontinuity NYI for hybrids !!!')
|
call print_warning('!!! exchange part of derivative discontinuity NYI for hybrids !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
end select
|
end select
|
||||||
|
|
||||||
|
@ -78,7 +78,6 @@ subroutine unrestricted_exchange_individual_energy(rung,DFA,LDA_centered,nEns,wE
|
|||||||
case(4)
|
case(4)
|
||||||
|
|
||||||
call print_warning('!!! Individual energies NYI for Hybrids !!!')
|
call print_warning('!!! Individual energies NYI for Hybrids !!!')
|
||||||
stop
|
|
||||||
|
|
||||||
end select
|
end select
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user