mirror of
https://github.com/pfloos/quack
synced 2025-01-03 18:16:18 +01:00
bit of cleanup in qsUGW but still bug
This commit is contained in:
parent
77a54456e9
commit
de2ace91fc
@ -9,7 +9,7 @@
|
|||||||
# GF: maxSCF thresh DIIS lin eta renorm reg
|
# GF: maxSCF thresh DIIS lin eta renorm reg
|
||||||
256 0.00001 5 F 0.0 0 F
|
256 0.00001 5 F 0.0 0 F
|
||||||
# GW: maxSCF thresh DIIS lin eta TDA_W reg
|
# GW: maxSCF thresh DIIS lin eta TDA_W reg
|
||||||
256 0.00001 5 F 0.0 F F
|
10 0.00001 5 F 0.0 F F
|
||||||
# GT: maxSCF thresh DIIS lin eta TDA_T reg
|
# GT: maxSCF thresh DIIS lin eta TDA_T reg
|
||||||
256 0.00001 5 F 0.0 F F
|
256 0.00001 5 F 0.0 F F
|
||||||
# ACFDT: AC Kx XBS
|
# ACFDT: AC Kx XBS
|
||||||
|
@ -21,6 +21,7 @@ subroutine MOtoAO_transform(nBas,S,c,B,A)
|
|||||||
double precision,intent(out) :: A(nBas,nBas)
|
double precision,intent(out) :: A(nBas,nBas)
|
||||||
|
|
||||||
! Memory allocation
|
! Memory allocation
|
||||||
|
|
||||||
allocate(Sc(nBas,nBas))
|
allocate(Sc(nBas,nBas))
|
||||||
|
|
||||||
Sc = matmul(S,c)
|
Sc = matmul(S,c)
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
subroutine print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,cGW,Ov, &
|
subroutine print_qsUGW(nBas,nO,nSCF,Conv,thresh,eHF,eGW,cGW,Ov,ENuc,ET,EV,EJ,Ex,EcGM,EcRPA,EqsGW,SigC,Z,dipole)
|
||||||
ENuc,ET,EV,EJ,Ex,EcGM,EcRPA,EqsGW,SigC,Z,dipole)
|
|
||||||
|
|
||||||
! Print one-electron energies and other stuff for qsUGW
|
! Print one-electron energies and other stuff for qsUGW
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do
|
|||||||
|
|
||||||
logical :: dRPA = .true.
|
logical :: dRPA = .true.
|
||||||
logical :: print_W = .false.
|
logical :: print_W = .false.
|
||||||
double precision,allocatable :: error_diis(:,:)
|
double precision,allocatable :: err_diis(:,:)
|
||||||
double precision,allocatable :: F_diis(:,:)
|
double precision,allocatable :: F_diis(:,:)
|
||||||
double precision,allocatable :: Aph(:,:)
|
double precision,allocatable :: Aph(:,:)
|
||||||
double precision,allocatable :: Bph(:,:)
|
double precision,allocatable :: Bph(:,:)
|
||||||
@ -93,7 +93,7 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do
|
|||||||
double precision,allocatable :: SigC(:,:)
|
double precision,allocatable :: SigC(:,:)
|
||||||
double precision,allocatable :: SigCp(:,:)
|
double precision,allocatable :: SigCp(:,:)
|
||||||
double precision,allocatable :: Z(:)
|
double precision,allocatable :: Z(:)
|
||||||
double precision,allocatable :: error(:,:)
|
double precision,allocatable :: err(:,:)
|
||||||
|
|
||||||
! Hello world
|
! Hello world
|
||||||
|
|
||||||
@ -131,20 +131,20 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do
|
|||||||
allocate(eGW(nBas),c(nBas,nBas),cp(nBas,nBas),P(nBas,nBas),F(nBas,nBas),Fp(nBas,nBas), &
|
allocate(eGW(nBas),c(nBas,nBas),cp(nBas,nBas),P(nBas,nBas),F(nBas,nBas),Fp(nBas,nBas), &
|
||||||
J(nBas,nBas),K(nBas,nBas),SigC(nBas,nBas),SigCp(nBas,nBas),Z(nBas), &
|
J(nBas,nBas),K(nBas,nBas),SigC(nBas,nBas),SigCp(nBas,nBas),Z(nBas), &
|
||||||
Aph(nS,nS),Bph(nS,nS),Om(nS),XpY(nS,nS),XmY(nS,nS),rho(nBas,nBas,nS), &
|
Aph(nS,nS),Bph(nS,nS),Om(nS),XpY(nS,nS),XmY(nS,nS),rho(nBas,nBas,nS), &
|
||||||
error(nBas,nBas),error_diis(nBasSq,max_diis),F_diis(nBasSq,max_diis))
|
err(nBas,nBas),err_diis(nBasSq,max_diis),F_diis(nBasSq,max_diis))
|
||||||
|
|
||||||
! Initialization
|
! Initialization
|
||||||
|
|
||||||
nSCF = -1
|
nSCF = -1
|
||||||
n_diis = 0
|
n_diis = 0
|
||||||
ispin = 1
|
ispin = 1
|
||||||
Conv = 1d0
|
Conv = 1d0
|
||||||
P(:,:) = PHF(:,:)
|
P(:,:) = PHF(:,:)
|
||||||
eGW(:) = eHF(:)
|
eGW(:) = eHF(:)
|
||||||
c(:,:) = cHF(:,:)
|
c(:,:) = cHF(:,:)
|
||||||
F_diis(:,:) = 0d0
|
F_diis(:,:) = 0d0
|
||||||
error_diis(:,:) = 0d0
|
err_diis(:,:) = 0d0
|
||||||
rcond = 0d0
|
rcond = 0d0
|
||||||
|
|
||||||
!------------------------------------------------------------------------
|
!------------------------------------------------------------------------
|
||||||
! Main loop
|
! Main loop
|
||||||
@ -200,15 +200,15 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do
|
|||||||
|
|
||||||
! Compute commutator and convergence criteria
|
! Compute commutator and convergence criteria
|
||||||
|
|
||||||
error = matmul(F,matmul(P,S)) - matmul(matmul(S,P),F)
|
err = matmul(F,matmul(P,S)) - matmul(matmul(S,P),F)
|
||||||
|
|
||||||
if(nSCF > 1) Conv = maxval(abs(error))
|
if(nSCF > 1) Conv = maxval(abs(err))
|
||||||
|
|
||||||
! DIIS extrapolation
|
! DIIS extrapolation
|
||||||
|
|
||||||
if(max_diis > 1) then
|
if(max_diis > 1) then
|
||||||
n_diis = min(n_diis+1,max_diis)
|
n_diis = min(n_diis+1,max_diis)
|
||||||
call DIIS_extrapolation(rcond,nBasSq,nBasSq,n_diis,error_diis,F_diis,error,F)
|
call DIIS_extrapolation(rcond,nBasSq,nBasSq,n_diis,err_diis,F_diis,err,F)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
! Diagonalize Hamiltonian in AO basis
|
! Diagonalize Hamiltonian in AO basis
|
||||||
@ -273,7 +273,7 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do
|
|||||||
|
|
||||||
! Deallocate memory
|
! Deallocate memory
|
||||||
|
|
||||||
deallocate(c,cp,P,F,Fp,J,K,SigC,SigCp,Z,Om,XpY,XmY,rho,error,error_diis,F_diis)
|
deallocate(c,cp,P,F,Fp,J,K,SigC,SigCp,Z,Om,XpY,XmY,rho,err,err_diis,F_diis)
|
||||||
|
|
||||||
! Perform BSE calculation
|
! Perform BSE calculation
|
||||||
|
|
||||||
|
@ -241,15 +241,19 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_W,
|
|||||||
err(:,:,is) = matmul(F(:,:,is),matmul(P(:,:,is),S(:,:))) - matmul(matmul(S(:,:),P(:,:,is)),F(:,:,is))
|
err(:,:,is) = matmul(F(:,:,is),matmul(P(:,:,is),S(:,:))) - matmul(matmul(S(:,:),P(:,:,is)),F(:,:,is))
|
||||||
end do
|
end do
|
||||||
|
|
||||||
if(nSCF > 1) Conv = maxval(abs(err(:,:,:)))
|
if(nSCF > 1) Conv = maxval(abs(err))
|
||||||
|
|
||||||
! DIIS extrapolation
|
! DIIS extrapolation
|
||||||
|
|
||||||
n_diis = min(n_diis+1,max_diis)
|
if(max_diis > 1) then
|
||||||
do is=1,nspin
|
|
||||||
if(nO(is) > 1) call DIIS_extrapolation(rcond(is),nBasSq,nBasSq,n_diis,err_diis(:,1:n_diis,is), &
|
n_diis = min(n_diis+1,max_diis)
|
||||||
F_diis(:,1:n_diis,is),err(:,:,is),F(:,:,is))
|
do is=1,nspin
|
||||||
end do
|
if(nO(is) > 1) call DIIS_extrapolation(rcond(is),nBasSq,nBasSq,n_diis,err_diis(:,1:n_diis,is), &
|
||||||
|
F_diis(:,1:n_diis,is),err(:,:,is),F(:,:,is))
|
||||||
|
end do
|
||||||
|
|
||||||
|
end if
|
||||||
|
|
||||||
! Transform Fock matrix in orthogonal basis
|
! Transform Fock matrix in orthogonal basis
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user