4
1
mirror of https://github.com/pfloos/quack synced 2024-11-19 12:32:36 +01:00

cleaning up AOtoMO transformation for RHF and UHF

This commit is contained in:
Pierre-Francois Loos 2023-11-22 16:20:14 +01:00
parent 05d11b3f26
commit fc0d471481
13 changed files with 30 additions and 30 deletions

View File

@ -1,15 +1,15 @@
subroutine AOtoMO_ERI(bra1,bra2,ket1,ket2,nBas,c,ERI_AO,ERI_MO) subroutine AOtoMO_ERI(bra,ket,nBas,c,ERI_AO,ERI_MO)
! AO to MO transformation of two-electron integrals via the semi-direct O(N^5) algorithm ! AO to MO transformation of two-electron integrals via the semi-direct O(N^5) algorithm
! bra and ket are the spin of (bra1 bra2|ket1 ket2) = <bra1 ket1|bra2 ket2> ! bra and ket are the spin of (bra|ket) = (bra bra|ket ket) = <bra ket|bra ket>
implicit none implicit none
include 'parameters.h' include 'parameters.h'
! Input variables ! Input variables
integer,intent(in) :: bra1,bra2 integer,intent(in) :: bra
integer,intent(in) :: ket1,ket2 integer,intent(in) :: ket
integer,intent(in) :: nBas integer,intent(in) :: nBas
double precision,intent(in) :: ERI_AO(nBas,nBas,nBas,nBas),c(nBas,nBas,nspin) double precision,intent(in) :: ERI_AO(nBas,nBas,nBas,nBas),c(nBas,nBas,nspin)
@ -28,12 +28,12 @@ subroutine AOtoMO_ERI(bra1,bra2,ket1,ket2,nBas,c,ERI_AO,ERI_MO)
! Four-index transform via semi-direct O(N^5) algorithm ! Four-index transform via semi-direct O(N^5) algorithm
call dgemm ('T', 'N', nBas**3, nBas, nBas, 1d0, ERI_AO, nBas, c(1,1,bra2), size(c,1), 0d0, scr, nBas**3) call dgemm ('T','N',nBas**3,nBas,nBas,1d0,ERI_AO,nBas,c(1,1,bra),size(c,1),0d0,scr,nBas**3)
call dgemm ('T', 'N', nBas**3, nBas, nBas, 1d0, scr, nBas, c(1,1,ket2), size(c,1), 0d0, ERI_MO, nBas**3) call dgemm ('T','N',nBas**3,nBas,nBas,1d0,scr,nBas,c(1,1,ket),size(c,1),0d0,ERI_MO,nBas**3)
call dgemm ('T', 'N', nBas**3, nBas, nBas, 1d0, ERI_MO, nBas, c(1,1,bra1), size(c,1), 0d0, scr, nBas**3) call dgemm ('T','N',nBas**3,nBas,nBas,1d0,ERI_MO,nBas,c(1,1,bra),size(c,1),0d0,scr,nBas**3)
call dgemm ('T', 'N', nBas**3, nBas, nBas, 1d0, scr, nBas, c(1,1,ket1), size(c,1), 0d0, ERI_MO, nBas**3) call dgemm ('T','N',nBas**3,nBas,nBas,1d0,scr,nBas,c(1,1,ket),size(c,1),0d0,ERI_MO,nBas**3)
end subroutine end subroutine

View File

@ -143,7 +143,7 @@ subroutine qsRGF2(dotest,maxSCF,thresh,max_diis,dophBSE,doppBSE,TDA,dBSE,dTDA,si
! AO to MO transformation of two-electron integrals ! AO to MO transformation of two-electron integrals
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_MO)
! Compute self-energy and renormalization factor ! Compute self-energy and renormalization factor

View File

@ -166,15 +166,15 @@ subroutine qsUGF2(dotest,maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,spin_conserved
! 4-index transform for (aa|aa) block ! 4-index transform for (aa|aa) block
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_aaaa)
! 4-index transform for (aa|bb) block ! 4-index transform for (aa|bb) block
call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) call AOtoMO_ERI(1,2,nBas,c,ERI_AO,ERI_aabb)
! 4-index transform for (bb|bb) block ! 4-index transform for (bb|bb) block
call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) call AOtoMO_ERI(2,2,nBas,c,ERI_AO,ERI_bbbb)
!------------------------------------------------! !------------------------------------------------!
! Compute self-energy and renormalization factor ! ! Compute self-energy and renormalization factor !

View File

@ -169,7 +169,7 @@ subroutine qsRGTeh(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,d
! AO to MO transformation of two-electron integrals ! AO to MO transformation of two-electron integrals
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_MO)
! Compute linear response ! Compute linear response

View File

@ -182,7 +182,7 @@ subroutine qsRGTpp(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,d
! AO to MO transformation of two-electron integrals ! AO to MO transformation of two-electron integrals
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_MO)
! Compute linear response ! Compute linear response

View File

@ -190,15 +190,15 @@ subroutine qsUGTpp(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,B
! 4-index transform for (aa|aa) block ! 4-index transform for (aa|aa) block
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_aaaa)
! 4-index transform for (aa|bb) block ! 4-index transform for (aa|bb) block
call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) call AOtoMO_ERI(1,2,nBas,c,ERI_AO,ERI_aabb)
! 4-index transform for (bb|bb) block ! 4-index transform for (bb|bb) block
call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) call AOtoMO_ERI(2,2,nBas,c,ERI_AO,ERI_bbbb)
!---------------------------------------------- !----------------------------------------------
! alpha-beta block ! alpha-beta block

View File

@ -176,7 +176,7 @@ subroutine SRG_qsGW(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,
call AOtoMO(nBas,cHF,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) call AOtoMO(nBas,cHF,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz))
end do end do
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_MO)
call wall_time(tao2) call wall_time(tao2)

View File

@ -172,7 +172,7 @@ subroutine qsRGW(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dop
call AOtoMO(nBas,c,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) call AOtoMO(nBas,c,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz))
end do end do
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_MO)
! Compute linear response ! Compute linear response

View File

@ -191,15 +191,15 @@ subroutine qsUGW(dotest,maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE
! 4-index transform for (aa|aa) block ! 4-index transform for (aa|aa) block
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_aaaa)
! 4-index transform for (aa|bb) block ! 4-index transform for (aa|bb) block
call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) call AOtoMO_ERI(1,2,nBas,c,ERI_AO,ERI_aabb)
! 4-index transform for (bb|bb) block ! 4-index transform for (bb|bb) block
call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) call AOtoMO_ERI(2,2,nBas,c,ERI_AO,ERI_bbbb)
! Compute linear response ! Compute linear response

View File

@ -107,7 +107,7 @@ subroutine RHF_search(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rN
write(*,*) write(*,*)
write(*,*) 'AO to MO transformation... Please be patient' write(*,*) 'AO to MO transformation... Please be patient'
write(*,*) write(*,*)
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_MO)
call wall_time(end_AOtoMO) call wall_time(end_AOtoMO)
t_AOtoMO = end_AOtoMO - start_AOtoMO t_AOtoMO = end_AOtoMO - start_AOtoMO

View File

@ -120,13 +120,13 @@ subroutine UHF_search(maxSCF,thresh,max_diis,guess_type,mix,level_shift,nNuc,ZNu
write(*,*) write(*,*)
! 4-index transform for (aa|aa) block ! 4-index transform for (aa|aa) block
call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) call AOtoMO_ERI(1,1,nBas,c,ERI_AO,ERI_aaaa)
! 4-index transform for (aa|bb) block ! 4-index transform for (aa|bb) block
call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) call AOtoMO_ERI(1,2,nBas,c,ERI_AO,ERI_aabb)
! 4-index transform for (bb|bb) block ! 4-index transform for (bb|bb) block
call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) call AOtoMO_ERI(2,2,nBas,c,ERI_AO,ERI_bbbb)
call wall_time(end_AOtoMO) call wall_time(end_AOtoMO)

View File

@ -158,7 +158,7 @@ subroutine RQuAcK(dotest,doRHF,doROHF,dostab,dosearch,doMP2,doMP3,doCCD,dopCCD,d
! 4-index transform ! 4-index transform
call AOtoMO_ERI(1,1,1,1,nBas,cHF,ERI_AO,ERI_MO) call AOtoMO_ERI(1,1,nBas,cHF,ERI_AO,ERI_MO)
call wall_time(end_AOtoMO) call wall_time(end_AOtoMO)

View File

@ -167,15 +167,15 @@ subroutine UQuAcK(dotest,doUHF,dostab,dosearch,doMP2,doMP3,doCCD,dopCCD,doDCD,do
! 4-index transform for (aa|aa) block ! 4-index transform for (aa|aa) block
call AOtoMO_ERI(1,1,1,1,nBas,cHF,ERI_AO,ERI_aaaa) call AOtoMO_ERI(1,1,nBas,cHF,ERI_AO,ERI_aaaa)
! 4-index transform for (aa|bb) block ! 4-index transform for (aa|bb) block
call AOtoMO_ERI(1,1,2,2,nBas,cHF,ERI_AO,ERI_aabb) call AOtoMO_ERI(1,2,nBas,cHF,ERI_AO,ERI_aabb)
! 4-index transform for (bb|bb) block ! 4-index transform for (bb|bb) block
call AOtoMO_ERI(2,2,2,2,nBas,cHF,ERI_AO,ERI_bbbb) call AOtoMO_ERI(2,2,nBas,cHF,ERI_AO,ERI_bbbb)
call wall_time(end_AOtoMO) call wall_time(end_AOtoMO)