4
1
mirror of https://github.com/pfloos/quack synced 2024-12-22 20:35:36 +01:00

CIS(D) sligntly faster

This commit is contained in:
Pierre-Francois Loos 2020-10-02 13:42:21 +02:00
parent 69a0b5193d
commit c15ea00351
16 changed files with 91 additions and 23 deletions

View File

@ -11,8 +11,8 @@
# GW/GT: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0
256 0.00001 T 5 T 0.0 F F F F F
# ACFDT: AC Kx XBS
F F T
T F T
# BSE: BSE dBSE dTDA evDyn
T T T F
T F T F
# MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift
1000000 100000 10 0.3 10000 1234 T

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=ADC.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=AOtoMO.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=BasCor.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=CC.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -42,6 +42,9 @@ subroutine D_correction(ispin,nBasin,nCin,nOin,nVin,nRin,nSin,maxS,eHF,ERI,w,X)
double precision,allocatable :: OOOV(:,:,:,:)
double precision,allocatable :: OOVV(:,:,:,:)
double precision,allocatable :: OVVV(:,:,:,:)
double precision,allocatable :: X1(:,:)
double precision,allocatable :: X2(:,:)
double precision,allocatable :: X3(:,:)
double precision,allocatable :: u(:,:,:,:)
double precision,allocatable :: v(:,:)
@ -98,6 +101,8 @@ subroutine D_correction(ispin,nBasin,nCin,nOin,nVin,nRin,nSin,maxS,eHF,ERI,w,X)
allocate(t(nO,nO,nV,nV),r(nO,nV),u(nO,nO,nV,nV),v(nO,nV))
allocate(X1(nV,nV),X2(nO,nO),X3(nO,nV))
! MP2 guess amplitudes
t(:,:,:,:) = -OOVV(:,:,:,:)/delta(:,:,:,:)
@ -173,22 +178,70 @@ subroutine D_correction(ispin,nBasin,nCin,nOin,nVin,nRin,nSin,maxS,eHF,ERI,w,X)
end do
end do
! Compute v array
! Compute intermediate arrays
v(:,:) = 0d0
X1(:,:) = 0d0
do i=nC+1,nO
do j=nC+1,nO
do k=nC+1,nO
do a=1,nV-nR
do b=1,nV-nR
do c=1,nV-nR
v(i,a) = v(i,a) + OOVV(j,k,b,c)*(r(i,b)*t(j,k,c,a) + r(j,a)*t(i,k,c,b) + 2d0*r(j,b)*t(i,k,a,c))
X1(a,b) = X1(a,b) + OOVV(j,k,b,c)*t(j,k,c,a)
end do
end do
end do
end do
end do
X2(:,:) = 0d0
do i=nC+1,nO
do j=nC+1,nO
do k=nC+1,nO
do b=1,nV-nR
do c=1,nV-nR
X2(i,j) = X2(i,j) + OOVV(j,k,b,c)*t(i,k,c,b)
end do
end do
end do
end do
end do
X3(:,:) = 0d0
do j=nC+1,nO
do k=nC+1,nO
do b=1,nV-nR
do c=1,nV-nR
X3(k,c) = X3(k,c) + 2d0*OOVV(j,k,b,c)*r(j,b)
end do
end do
end do
end do
! Compute v array
v(:,:) = 0d0
do i=nC+1,nO
do a=1,nV-nR
do b=1,nV-nR
v(i,a) = v(i,a) + r(i,b)*X1(a,b)
end do
do j=nC+1,nO
v(i,a) = v(i,a) + r(j,a)*X2(i,j)
end do
do k=nC+1,nO
do c=1,nV-nR
v(i,a) = v(i,a) + X3(k,c)*t(i,k,a,c)
end do
end do
end do
end do
v(:,:) = 0.5d0*v(:,:)

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=CI.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=HF.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=MBPT.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=MC.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=MP.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -19,7 +19,9 @@ LIB_DIRS=$(filter-out $(MAIN_DIRS), $(ALL_DIRS))
FORCE:
$(SDIR)/%/Makefile: FORCE
@(echo TARGET=$*.a > $*/Makefile && echo include $$QUACK_ROOT/src/Makefile.include >> $@)
@(echo QUACK_ROOT=$(QUACK_ROOT) > $@)
@(echo TARGET=$*.a >> $@)
@(echo 'include $$(QUACK_ROOT)/src/Makefile.include' >> $@)
$(LDIR)/%.a: FORCE $(SDIR)/%/Makefile $(MOD_DIRS)
$(MAKE) -C $(SDIR)/$* lib

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=QuAcK.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=RPA.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=eDFT.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include

View File

@ -1,2 +1,3 @@
QUACK_ROOT=/Users/loos/Dropbox/quack
TARGET=utils.a
include /Users/loos/Dropbox/quack/src/Makefile.include
include $(QUACK_ROOT)/src/Makefile.include