From 821265a7aa6c55fec71003ad71c69087d20bf10c Mon Sep 17 00:00:00 2001 From: pfloos Date: Fri, 10 Nov 2023 17:22:51 +0100 Subject: [PATCH] rename AOtoMO and MOtoAO --- .../{AOtoMO_transform.f90 => AOtoMO.f90} | 13 +++++++--- ..._integral_transform.f90 => AOtoMO_ERI.f90} | 2 +- ...l_transform_GHF.f90 => AOtoMO_ERI_GHF.f90} | 2 +- ...OtoMO_transform_GHF.f90 => AOtoMO_GHF.f90} | 15 ++++++++--- .../{MOtoAO_transform.f90 => MOtoAO.f90} | 13 +++++----- ...OtoAO_transform_GHF.f90 => MOtoAO_GHF.f90} | 17 +++++++----- src/GF/qsGF2.f90 | 4 +-- src/GF/qsUGF2.f90 | 8 +++--- src/GT/qsGTeh.f90 | 4 +-- src/GT/qsGTpp.f90 | 4 +-- src/GT/qsUGTpp.f90 | 8 +++--- src/GW/SRG_qsGW.f90 | 8 +++--- src/GW/qsGGW.f90 | 14 +++++----- src/GW/qsRGW.f90 | 8 +++--- src/GW/qsUGW.f90 | 14 +++++----- src/HF/GHF_search.f90 | 8 +++--- src/HF/RHF_search.f90 | 2 +- src/HF/ROHF_fock_matrix.f90 | 26 ++++++++++++------- src/HF/UHF_search.f90 | 6 ++--- src/QuAcK/GQuAcK.f90 | 10 +++---- src/QuAcK/RQuAcK.f90 | 4 +-- src/QuAcK/UQuAcK.f90 | 10 +++---- 22 files changed, 114 insertions(+), 86 deletions(-) rename src/AOtoMO/{AOtoMO_transform.f90 => AOtoMO.f90} (56%) rename src/AOtoMO/{AOtoMO_integral_transform.f90 => AOtoMO_ERI.f90} (93%) rename src/AOtoMO/{AOtoMO_integral_transform_GHF.f90 => AOtoMO_ERI_GHF.f90} (95%) rename src/AOtoMO/{AOtoMO_transform_GHF.f90 => AOtoMO_GHF.f90} (63%) rename src/AOtoMO/{MOtoAO_transform.f90 => MOtoAO.f90} (61%) rename src/AOtoMO/{MOtoAO_transform_GHF.f90 => MOtoAO_GHF.f90} (61%) diff --git a/src/AOtoMO/AOtoMO_transform.f90 b/src/AOtoMO/AOtoMO.f90 similarity index 56% rename from src/AOtoMO/AOtoMO_transform.f90 rename to src/AOtoMO/AOtoMO.f90 index 5c4b710..2192bc7 100644 --- a/src/AOtoMO/AOtoMO_transform.f90 +++ b/src/AOtoMO/AOtoMO.f90 @@ -1,4 +1,4 @@ -subroutine AOtoMO_transform(nBas,c,A,B) +subroutine AOtoMO(nBas,C,A,B) ! Perform AO to MO transformation of a matrix A for given coefficients c @@ -7,13 +7,20 @@ subroutine AOtoMO_transform(nBas,c,A,B) ! Input variables integer,intent(in) :: nBas - double precision,intent(in) :: c(nBas,nBas) + double precision,intent(in) :: C(nBas,nBas) double precision,intent(in) :: A(nBas,nBas) +! Local variables + + double precision,allocatable :: AC(:,:) + ! Output variables double precision,intent(out) :: B(nBas,nBas) - B = matmul(transpose(c),matmul(A,c)) + allocate(AC(nBas,nBas)) + + AC = matmul(A,C) + B = matmul(transpose(C),AC) end subroutine diff --git a/src/AOtoMO/AOtoMO_integral_transform.f90 b/src/AOtoMO/AOtoMO_ERI.f90 similarity index 93% rename from src/AOtoMO/AOtoMO_integral_transform.f90 rename to src/AOtoMO/AOtoMO_ERI.f90 index 8a77b3f..aba7361 100644 --- a/src/AOtoMO/AOtoMO_integral_transform.f90 +++ b/src/AOtoMO/AOtoMO_ERI.f90 @@ -1,4 +1,4 @@ -subroutine AOtoMO_integral_transform(bra1,bra2,ket1,ket2,nBas,c,ERI_AO,ERI_MO) +subroutine AOtoMO_ERI(bra1,bra2,ket1,ket2,nBas,c,ERI_AO,ERI_MO) ! 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) = diff --git a/src/AOtoMO/AOtoMO_integral_transform_GHF.f90 b/src/AOtoMO/AOtoMO_ERI_GHF.f90 similarity index 95% rename from src/AOtoMO/AOtoMO_integral_transform_GHF.f90 rename to src/AOtoMO/AOtoMO_ERI_GHF.f90 index e11e689..b0e027a 100644 --- a/src/AOtoMO/AOtoMO_integral_transform_GHF.f90 +++ b/src/AOtoMO/AOtoMO_ERI_GHF.f90 @@ -1,4 +1,4 @@ -subroutine AOtoMO_integral_transform_GHF(nBas,nBas2,c1,c2,c3,c4,ERI_AO_basis,ERI_MO_basis) +subroutine AOtoMO_ERI_GHF(nBas,nBas2,c1,c2,c3,c4,ERI_AO_basis,ERI_MO_basis) ! 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) diff --git a/src/AOtoMO/AOtoMO_transform_GHF.f90 b/src/AOtoMO/AOtoMO_GHF.f90 similarity index 63% rename from src/AOtoMO/AOtoMO_transform_GHF.f90 rename to src/AOtoMO/AOtoMO_GHF.f90 index 67fc4be..0338a42 100644 --- a/src/AOtoMO/AOtoMO_transform_GHF.f90 +++ b/src/AOtoMO/AOtoMO_GHF.f90 @@ -1,4 +1,4 @@ -subroutine AOtoMO_transform_GHF(nBas,nBas2,Ca,Cb,A,B) +subroutine AOtoMO_GHF(nBas,nBas2,Ca,Cb,A,B) ! Perform AO to MO transformation of a matrix A for given coefficients c @@ -12,11 +12,20 @@ subroutine AOtoMO_transform_GHF(nBas,nBas2,Ca,Cb,A,B) double precision,intent(in) :: Cb(nBas,nBas2) double precision,intent(in) :: A(nBas,nBas) +! Local variables + + double precision,allocatable :: AC(:,:) + ! Output variables double precision,intent(out) :: B(nBas2,nBas2) - B = matmul(transpose(Ca),matmul(A,Ca)) & - + matmul(transpose(Cb),matmul(A,Cb)) + allocate(AC(nBas,nBas2)) + + AC = matmul(A,Ca) + B = matmul(transpose(Ca),AC) + + AC = matmul(A,Cb) + B = B + matmul(transpose(Cb),AC) end subroutine diff --git a/src/AOtoMO/MOtoAO_transform.f90 b/src/AOtoMO/MOtoAO.f90 similarity index 61% rename from src/AOtoMO/MOtoAO_transform.f90 rename to src/AOtoMO/MOtoAO.f90 index 177b231..faffa92 100644 --- a/src/AOtoMO/MOtoAO_transform.f90 +++ b/src/AOtoMO/MOtoAO.f90 @@ -1,4 +1,4 @@ -subroutine MOtoAO_transform(nBas,S,c,B,A) +subroutine MOtoAO(nBas,S,C,B,A) ! Perform MO to AO transformation of a matrix A for a given metric S ! and coefficients c @@ -9,12 +9,12 @@ subroutine MOtoAO_transform(nBas,S,c,B,A) integer,intent(in) :: nBas double precision,intent(in) :: S(nBas,nBas) - double precision,intent(in) :: c(nBas,nBas) + double precision,intent(in) :: C(nBas,nBas) double precision,intent(in) :: B(nBas,nBas) ! Local variables - double precision,allocatable :: Sc(:,:) + double precision,allocatable :: SC(:,:),BSC(:,:) ! Output variables @@ -22,9 +22,10 @@ subroutine MOtoAO_transform(nBas,S,c,B,A) ! Memory allocation - allocate(Sc(nBas,nBas)) + allocate(SC(nBas,nBas),BSC(nBas,nBas)) - Sc = matmul(S,c) - A = matmul(Sc,matmul(B,transpose(Sc))) + SC = matmul(S,C) + BSC = matmul(B,transpose(SC)) + A = matmul(SC,BSC) end subroutine diff --git a/src/AOtoMO/MOtoAO_transform_GHF.f90 b/src/AOtoMO/MOtoAO_GHF.f90 similarity index 61% rename from src/AOtoMO/MOtoAO_transform_GHF.f90 rename to src/AOtoMO/MOtoAO_GHF.f90 index 9f91884..6a014b8 100644 --- a/src/AOtoMO/MOtoAO_transform_GHF.f90 +++ b/src/AOtoMO/MOtoAO_GHF.f90 @@ -1,4 +1,4 @@ -subroutine MOtoAO_transform_GHF(nBas2,nBas,S,Ca,Cb,B,A) +subroutine MOtoAO_GHF(nBas2,nBas,S,Ca,Cb,B,A) ! Perform MO to AO transformation of a matrix A for a given metric S ! and coefficients c @@ -16,7 +16,8 @@ subroutine MOtoAO_transform_GHF(nBas2,nBas,S,Ca,Cb,B,A) ! Local variables - double precision,allocatable :: Sc(:,:) + double precision,allocatable :: SC(:,:) + double precision,allocatable :: BSC(:,:) ! Output variables @@ -24,12 +25,14 @@ subroutine MOtoAO_transform_GHF(nBas2,nBas,S,Ca,Cb,B,A) ! Memory allocation - allocate(Sc(nBas,nBas2)) + allocate(SC(nBas,nBas2),BSC(nBas2,nBas)) - Sc = matmul(S,Ca) - A = matmul(Sc,matmul(B,transpose(Sc))) + SC = matmul(S,Ca) + BSC = matmul(B,transpose(SC)) + A = matmul(SC,BSC) - Sc = matmul(S,Cb) - A = A + matmul(Sc,matmul(B,transpose(Sc))) + SC = matmul(S,Cb) + BSC = matmul(B,transpose(SC)) + A = A + matmul(SC,BSc) end subroutine diff --git a/src/GF/qsGF2.f90 b/src/GF/qsGF2.f90 index 76e0542..508958c 100644 --- a/src/GF/qsGF2.f90 +++ b/src/GF/qsGF2.f90 @@ -140,7 +140,7 @@ subroutine qsGF2(maxSCF,thresh,max_diis,dophBSE,doppBSE,TDA,dBSE,dTDA,singlet,tr ! AO to MO transformation of two-electron integrals - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) ! Compute self-energy and renormalization factor @@ -158,7 +158,7 @@ subroutine qsGF2(maxSCF,thresh,max_diis,dophBSE,doppBSE,TDA,dBSE,dTDA,singlet,tr SigC = 0.5d0*(SigC + transpose(SigC)) - call MOtoAO_transform(nBas,S,c,SigC,SigCp) + call MOtoAO(nBas,S,c,SigC,SigCp) ! Solve the quasi-particle equation diff --git a/src/GF/qsUGF2.f90 b/src/GF/qsUGF2.f90 index d53b753..5ba102c 100644 --- a/src/GF/qsUGF2.f90 +++ b/src/GF/qsUGF2.f90 @@ -163,15 +163,15 @@ subroutine qsUGF2(maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,spin_conserved,spin_f ! 4-index transform for (aa|aa) block - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) ! 4-index transform for (aa|bb) block - call AOtoMO_integral_transform(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) + call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) ! 4-index transform for (bb|bb) block - call AOtoMO_integral_transform(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) + call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) !------------------------------------------------! ! Compute self-energy and renormalization factor ! @@ -194,7 +194,7 @@ subroutine qsUGF2(maxSCF,thresh,max_diis,BSE,TDA,dBSE,dTDA,spin_conserved,spin_f end do do is=1,nspin - call MOtoAO_transform(nBas,S,c(:,:,is),SigC(:,:,is),SigCp(:,:,is)) + call MOtoAO(nBas,S,c(:,:,is),SigC(:,:,is),SigCp(:,:,is)) end do ! Solve the quasi-particle equation diff --git a/src/GT/qsGTeh.f90 b/src/GT/qsGTeh.f90 index 5c7690b..7b7ff6c 100644 --- a/src/GT/qsGTeh.f90 +++ b/src/GT/qsGTeh.f90 @@ -167,7 +167,7 @@ subroutine qsGTeh(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,d ! AO to MO transformation of two-electron integrals - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) ! Compute linear response @@ -190,7 +190,7 @@ subroutine qsGTeh(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,d Sig = 0.5d0*(Sig + transpose(Sig)) - call MOtoAO_transform(nBas,S,c,Sig,Sigp) + call MOtoAO(nBas,S,c,Sig,Sigp) ! Solve the quasi-particle equation diff --git a/src/GT/qsGTpp.f90 b/src/GT/qsGTpp.f90 index 7c6a481..118ae13 100644 --- a/src/GT/qsGTpp.f90 +++ b/src/GT/qsGTpp.f90 @@ -181,7 +181,7 @@ subroutine qsGTpp(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,T ! AO to MO transformation of two-electron integrals - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) ! Compute linear response @@ -234,7 +234,7 @@ subroutine qsGTpp(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,T Sig = 0.5d0*(Sig + transpose(Sig)) - call MOtoAO_transform(nBas,S,c,Sig,Sigp) + call MOtoAO(nBas,S,c,Sig,Sigp) ! Solve the quasi-particle equation diff --git a/src/GT/qsUGTpp.f90 b/src/GT/qsUGTpp.f90 index 4f35488..390f1dc 100644 --- a/src/GT/qsUGTpp.f90 +++ b/src/GT/qsUGTpp.f90 @@ -187,15 +187,15 @@ subroutine qsUGTpp(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE, & ! 4-index transform for (aa|aa) block - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) ! 4-index transform for (aa|bb) block - call AOtoMO_integral_transform(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) + call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) ! 4-index transform for (bb|bb) block - call AOtoMO_integral_transform(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) + call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) !---------------------------------------------- ! alpha-beta block @@ -277,7 +277,7 @@ subroutine qsUGTpp(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE, & end do do ispin=1,nspin - call MOtoAO_transform(nBas,S,c(:,:,ispin),SigT(:,:,ispin),SigTp(:,:,ispin)) + call MOtoAO(nBas,S,c(:,:,ispin),SigT(:,:,ispin),SigTp(:,:,ispin)) end do ! Solve the quasi-particle equation diff --git a/src/GW/SRG_qsGW.f90 b/src/GW/SRG_qsGW.f90 index 53d16e7..7f525bf 100644 --- a/src/GW/SRG_qsGW.f90 +++ b/src/GW/SRG_qsGW.f90 @@ -171,10 +171,10 @@ subroutine SRG_qsGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,BSE call wall_time(tao1) do ixyz=1,ncart - call AOtoMO_transform(nBas,cHF,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) + call AOtoMO(nBas,cHF,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) end do - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call wall_time(tao2) @@ -214,7 +214,7 @@ subroutine SRG_qsGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,BSE ! Make correlation self-energy Hermitian and transform it back to AO basis call wall_time(tmo1) - call MOtoAO_transform(nBas,S,c,SigC,SigCp) + call MOtoAO(nBas,S,c,SigC,SigCp) call wall_time(tmo2) tmo = tmo + tmo2 - tmo1 ! Solve the quasi-particle equation @@ -241,7 +241,7 @@ subroutine SRG_qsGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,BSE call diagonalize_matrix(nBas,cp,eGW) c = matmul(X,cp) - call AOtoMO_transform(nBas,c,SigCp,SigC) + call AOtoMO(nBas,c,SigCp,SigC) ! Compute new density matrix in the AO basis diff --git a/src/GW/qsGGW.f90 b/src/GW/qsGGW.f90 index 7849ce0..709739e 100644 --- a/src/GW/qsGGW.f90 +++ b/src/GW/qsGGW.f90 @@ -232,19 +232,19 @@ subroutine qsGGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do Cb(:,:) = C(nBas+1:nBas2,1:nBas2) do ixyz=1,ncart - call AOtoMO_transform_GHF(nBas,nBas2,Ca,Cb,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) + call AOtoMO_GHF(nBas,nBas2,Ca,Cb,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) end do - call AOtoMO_integral_transform_GHF(nBas,nBas2,Ca,Ca,Ca,Ca,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Ca,Ca,Ca,Ca,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Ca,Cb,Ca,Cb,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Ca,Cb,Ca,Cb,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Cb,Ca,Cb,Ca,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Cb,Ca,Cb,Ca,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Cb,Cb,Cb,Cb,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Cb,Cb,Cb,Cb,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) deallocate(ERI_tmp) @@ -269,7 +269,7 @@ subroutine qsGGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do SigC = 0.5d0*(SigC + transpose(SigC)) - call MOtoAO_transform_GHF(nBas2,nBas,S,Ca,Cb,SigC,SigCp) + call MOtoAO_GHF(nBas2,nBas,S,Ca,Cb,SigC,SigCp) ! ... and add self-energy @@ -301,7 +301,7 @@ subroutine qsGGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do C(:,:) = matmul(X,Cp) - call AOtoMO_transform_GHF(nBas,nBas2,Ca,Cb,SigCp,SigC) + call AOtoMO_GHF(nBas,nBas2,Ca,Cb,SigCp,SigC) ! Form super density matrix diff --git a/src/GW/qsRGW.f90 b/src/GW/qsRGW.f90 index c480fcd..06b1a0f 100644 --- a/src/GW/qsRGW.f90 +++ b/src/GW/qsRGW.f90 @@ -167,10 +167,10 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do ! AO to MO transformation of two-electron integrals do ixyz=1,ncart - call AOtoMO_transform(nBas,c,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) + call AOtoMO(nBas,c,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) end do - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) ! Compute linear response @@ -192,7 +192,7 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do SigC = 0.5d0*(SigC + transpose(SigC)) - call MOtoAO_transform(nBas,S,c,SigC,SigCp) + call MOtoAO(nBas,S,c,SigC,SigCp) ! Solve the quasi-particle equation @@ -217,7 +217,7 @@ subroutine qsRGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,dophBSE,do cp(:,:) = Fp(:,:) call diagonalize_matrix(nBas,cp,eGW) c = matmul(X,cp) - call AOtoMO_transform(nBas,c,SigCp,SigC) + call AOtoMO(nBas,c,SigCp,SigC) ! Compute new density matrix in the AO basis diff --git a/src/GW/qsUGW.f90 b/src/GW/qsUGW.f90 index 8f3ca4b..35ed010 100644 --- a/src/GW/qsUGW.f90 +++ b/src/GW/qsUGW.f90 @@ -183,21 +183,21 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_W, !-------------------------------------------------- do ixyz=1,ncart - call AOtoMO_transform(nBas,c(:,:,1),dipole_int_AO(:,:,ixyz),dipole_int_aa(:,:,ixyz)) - call AOtoMO_transform(nBas,c(:,:,2),dipole_int_AO(:,:,ixyz),dipole_int_bb(:,:,ixyz)) + call AOtoMO(nBas,c(:,:,1),dipole_int_AO(:,:,ixyz),dipole_int_aa(:,:,ixyz)) + call AOtoMO(nBas,c(:,:,2),dipole_int_AO(:,:,ixyz),dipole_int_bb(:,:,ixyz)) end do ! 4-index transform for (aa|aa) block - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) ! 4-index transform for (aa|bb) block - call AOtoMO_integral_transform(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) + call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) ! 4-index transform for (bb|bb) block - call AOtoMO_integral_transform(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) + call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) ! Compute linear response @@ -231,7 +231,7 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_W, end do do is=1,nspin - call MOtoAO_transform(nBas,S,c(:,:,is),SigC(:,:,is),SigCp(:,:,is)) + call MOtoAO(nBas,S,c(:,:,is),SigC(:,:,is),SigCp(:,:,is)) end do ! Solve the quasi-particle equation @@ -282,7 +282,7 @@ subroutine qsUGW(maxSCF,thresh,max_diis,doACFDT,exchange_kernel,doXBS,BSE,TDA_W, ! Back-transform self-energy do is=1,nspin - call AOtoMO_transform(nBas,c(:,:,is),SigCp(:,:,is),SigC(:,:,is)) + call AOtoMO(nBas,c(:,:,is),SigCp(:,:,is),SigC(:,:,is)) end do ! Compute density matrix diff --git a/src/HF/GHF_search.f90 b/src/HF/GHF_search.f90 index ce2143c..e8082f7 100644 --- a/src/HF/GHF_search.f90 +++ b/src/HF/GHF_search.f90 @@ -122,16 +122,16 @@ subroutine GHF_search(maxSCF,thresh,max_diis,guess_type,mix,level_shift,nNuc,ZNu ! 4-index transform - call AOtoMO_integral_transform_GHF(nBas,nBas2,Ca,Ca,Ca,Ca,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Ca,Ca,Ca,Ca,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Ca,Cb,Ca,Cb,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Ca,Cb,Ca,Cb,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Cb,Ca,Cb,Ca,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Cb,Ca,Cb,Ca,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Cb,Cb,Cb,Cb,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Cb,Cb,Cb,Cb,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) deallocate(Ca,Cb,ERI_tmp) diff --git a/src/HF/RHF_search.f90 b/src/HF/RHF_search.f90 index 3debdc3..337b244 100644 --- a/src/HF/RHF_search.f90 +++ b/src/HF/RHF_search.f90 @@ -107,7 +107,7 @@ subroutine RHF_search(maxSCF,thresh,max_diis,guess_type,level_shift,nNuc,ZNuc,rN write(*,*) write(*,*) 'AO to MO transformation... Please be patient' write(*,*) - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_MO) call wall_time(end_AOtoMO) t_AOtoMO = end_AOtoMO - start_AOtoMO diff --git a/src/HF/ROHF_fock_matrix.f90 b/src/HF/ROHF_fock_matrix.f90 index 9272ef3..bb23662 100644 --- a/src/HF/ROHF_fock_matrix.f90 +++ b/src/HF/ROHF_fock_matrix.f90 @@ -1,4 +1,4 @@ -subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,Fa,Fb,F) +subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,FaAO,FbAO,FAO) ! Construct the ROHF Fock matrix in the AO basis ! For open shells, the ROHF Fock matrix in the MO basis reads @@ -23,8 +23,8 @@ subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,Fa,Fb,F) double precision,intent(in) :: S(nBas,nBas) double precision,intent(in) :: c(nBas,nBas) - double precision,intent(inout):: Fa(nBas,nBas) - double precision,intent(inout):: Fb(nBas,nBas) + double precision,intent(inout):: FaAO(nBas,nBas) + double precision,intent(inout):: FbAO(nBas,nBas) ! Local variables @@ -36,9 +36,17 @@ subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,Fa,Fb,F) integer :: nO integer :: nV + double precision,allocatable :: F(:,:) + double precision,allocatable :: Fa(:,:) + double precision,allocatable :: Fb(:,:) + ! Output variables - double precision,intent(out) :: F(nBas,nBas) + double precision,intent(out) :: FAO(nBas,nBas) + +! Memory allocation + + allocate(F(nBas,nBas),Fa(nBas,nBas),Fb(nBas,nBas)) ! Roothan canonicalization parameters @@ -59,8 +67,8 @@ subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,Fa,Fb,F) ! Block-by-block Fock matrix - Fa = matmul(transpose(c),matmul(Fa,c)) - Fb = matmul(transpose(c),matmul(Fb,c)) + call AOtoMO(nBas,c,FaAO,Fa) + call AOtoMO(nBas,c,FbAO,Fb) F(1:nC, 1:nC ) = aC*Fa(1:nC, 1:nC ) + bC*Fb(1:nC, 1:nC ) F(1:nC, nC+1:nC+nO ) = Fb(1:nC, nC+1:nC+nO ) @@ -74,8 +82,8 @@ subroutine ROHF_fock_matrix(nBas,nOa,nOb,S,c,Fa,Fb,F) F(nO+nC+1:nC+nO+nV, nC+1:nC+nO ) = Fa(nO+nC+1:nC+nO+nV, nC+1:nC+nO ) F(nO+nC+1:nC+nO+nV,nO+nC+1:nC+nO+nV) = aV*Fa(nO+nC+1:nC+nO+nV,nO+nC+1:nC+nO+nV) + bV*Fb(nO+nC+1:nC+nO+nV,nO+nC+1:nC+nO+nV) - call MOtoAO_transform(nBas,S,c,F,F) - call MOtoAO_transform(nBas,S,c,Fa,Fa) - call MOtoAO_transform(nBas,S,c,Fb,Fb) + call MOtoAO(nBas,S,c,F,FAO) + call MOtoAO(nBas,S,c,Fa,FaAO) + call MOtoAO(nBas,S,c,Fb,FbAO) end subroutine diff --git a/src/HF/UHF_search.f90 b/src/HF/UHF_search.f90 index 511dbcb..0ea95c2 100644 --- a/src/HF/UHF_search.f90 +++ b/src/HF/UHF_search.f90 @@ -120,13 +120,13 @@ subroutine UHF_search(maxSCF,thresh,max_diis,guess_type,mix,level_shift,nNuc,ZNu write(*,*) ! 4-index transform for (aa|aa) block - call AOtoMO_integral_transform(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) + call AOtoMO_ERI(1,1,1,1,nBas,c,ERI_AO,ERI_aaaa) ! 4-index transform for (aa|bb) block - call AOtoMO_integral_transform(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) + call AOtoMO_ERI(1,1,2,2,nBas,c,ERI_AO,ERI_aabb) ! 4-index transform for (bb|bb) block - call AOtoMO_integral_transform(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) + call AOtoMO_ERI(2,2,2,2,nBas,c,ERI_AO,ERI_bbbb) call wall_time(end_AOtoMO) diff --git a/src/QuAcK/GQuAcK.f90 b/src/QuAcK/GQuAcK.f90 index 773b41b..2d1f0f2 100644 --- a/src/QuAcK/GQuAcK.f90 +++ b/src/QuAcK/GQuAcK.f90 @@ -129,21 +129,21 @@ subroutine GQuAcK(doGHF,dostab,dosearch,doMP2,doMP3,dophRPA,dophRPAx,doppRPA, ! Transform dipole-related integrals do ixyz=1,ncart - call AOtoMO_transform_GHF(nBas,nBas2,Ca,Cb,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) + call AOtoMO_GHF(nBas,nBas2,Ca,Cb,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) end do ! 4-index transform - call AOtoMO_integral_transform_GHF(nBas,nBas2,Ca,Ca,Ca,Ca,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Ca,Ca,Ca,Ca,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Ca,Cb,Ca,Cb,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Ca,Cb,Ca,Cb,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Cb,Ca,Cb,Ca,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Cb,Ca,Cb,Ca,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) - call AOtoMO_integral_transform_GHF(nBas,nBas2,Cb,Cb,Cb,Cb,ERI_AO,ERI_tmp) + call AOtoMO_ERI_GHF(nBas,nBas2,Cb,Cb,Cb,Cb,ERI_AO,ERI_tmp) ERI_MO(:,:,:,:) = ERI_MO(:,:,:,:) + ERI_tmp(:,:,:,:) deallocate(Ca,Cb,ERI_tmp) diff --git a/src/QuAcK/RQuAcK.f90 b/src/QuAcK/RQuAcK.f90 index 57ce1ef..7a69992 100644 --- a/src/QuAcK/RQuAcK.f90 +++ b/src/QuAcK/RQuAcK.f90 @@ -151,12 +151,12 @@ subroutine RQuAcK(doRHF,doROHF,dostab,dosearch,doMP2,doMP3,doCCD,dopCCD,doDCD,do ! Read and transform dipole-related integrals do ixyz=1,ncart - call AOtoMO_transform(nBas,cHF,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) + call AOtoMO(nBas,cHF,dipole_int_AO(:,:,ixyz),dipole_int_MO(:,:,ixyz)) end do ! 4-index transform - call AOtoMO_integral_transform(1,1,1,1,nBas,cHF,ERI_AO,ERI_MO) + call AOtoMO_ERI(1,1,1,1,nBas,cHF,ERI_AO,ERI_MO) call wall_time(end_AOtoMO) diff --git a/src/QuAcK/UQuAcK.f90 b/src/QuAcK/UQuAcK.f90 index 4903872..b764366 100644 --- a/src/QuAcK/UQuAcK.f90 +++ b/src/QuAcK/UQuAcK.f90 @@ -158,21 +158,21 @@ subroutine UQuAcK(doUHF,dostab,dosearch,doMP2,doMP3,doCCD,dopCCD,doDCD,doCCSD,do ! Read and transform dipole-related integrals do ixyz=1,ncart - call AOtoMO_transform(nBas,cHF(:,:,1),dipole_int_AO(:,:,ixyz),dipole_int_aa(:,:,ixyz)) - call AOtoMO_transform(nBas,cHF(:,:,2),dipole_int_AO(:,:,ixyz),dipole_int_bb(:,:,ixyz)) + call AOtoMO(nBas,cHF(:,:,1),dipole_int_AO(:,:,ixyz),dipole_int_aa(:,:,ixyz)) + call AOtoMO(nBas,cHF(:,:,2),dipole_int_AO(:,:,ixyz),dipole_int_bb(:,:,ixyz)) end do ! 4-index transform for (aa|aa) block - call AOtoMO_integral_transform(1,1,1,1,nBas,cHF,ERI_AO,ERI_aaaa) + call AOtoMO_ERI(1,1,1,1,nBas,cHF,ERI_AO,ERI_aaaa) ! 4-index transform for (aa|bb) block - call AOtoMO_integral_transform(1,1,2,2,nBas,cHF,ERI_AO,ERI_aabb) + call AOtoMO_ERI(1,1,2,2,nBas,cHF,ERI_AO,ERI_aabb) ! 4-index transform for (bb|bb) block - call AOtoMO_integral_transform(2,2,2,2,nBas,cHF,ERI_AO,ERI_bbbb) + call AOtoMO_ERI(2,2,2,2,nBas,cHF,ERI_AO,ERI_bbbb) call wall_time(end_AOtoMO)