diff --git a/mol/GW20/Ar.xyz b/mol/GW20/Ar.xyz deleted file mode 100644 index cc7c90f..0000000 --- a/mol/GW20/Ar.xyz +++ /dev/null @@ -1,3 +0,0 @@ -1 -Argon; atom; s -Ar 0.0 0.0 0.0 diff --git a/mol/GW20/BF.xyz b/mol/GW20/BF.xyz deleted file mode 100644 index 6c5f116..0000000 --- a/mol/GW20/BF.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Fluoroborane; experimental structure from HCP92; s -B 0.0000 0.0000 0.0000 -F 0.0000 0.0000 1.2626 diff --git a/mol/GW20/BH3.xyz b/mol/GW20/BH3.xyz deleted file mode 100644 index 5a56085..0000000 --- a/mol/GW20/BH3.xyz +++ /dev/null @@ -1,6 +0,0 @@ -4 -Borane; experimental structure from HCP92; s -B 0.0000 0.0000 0.0000 -H 0.0000 0.0000 1.19 -H 0.0000 1.0306 -0.595 -H 0.0000 -1.0306 -0.595 diff --git a/mol/GW20/BN.xyz b/mol/GW20/BN.xyz deleted file mode 100644 index 47257d3..0000000 --- a/mol/GW20/BN.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Boron nitride; experimental structure from HCP92; s -B 0.0000 0.0000 0.0000 -N 0.0000 0.0000 1.281 diff --git a/mol/GW20/BeO.xyz b/mol/GW20/BeO.xyz deleted file mode 100644 index b443ac2..0000000 --- a/mol/GW20/BeO.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Beryllium monoxide; experimental structure from HCP92; s -Be 0.0000 0.0000 0.0000 -O 0.0000 0.0000 1.3308 diff --git a/mol/GW20/CH4.xyz b/mol/GW20/CH4.xyz deleted file mode 100644 index 2f8dc8c..0000000 --- a/mol/GW20/CH4.xyz +++ /dev/null @@ -1,7 +0,0 @@ -5 -Methane; experimental structure from HCP92; m -C 0.0000 0.0000 0.0000 -H 0.6276 -0.6275 0.6276 -H -0.6276 0.6276 0.6276 -H -0.6276 -0.6276 -0.6276 -H 0.6276 0.6276 -0.6276 diff --git a/mol/GW20/CO.xyz b/mol/GW20/CO.xyz deleted file mode 100644 index 0485aa3..0000000 --- a/mol/GW20/CO.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Carbon monoxide; experimental structure from HCP92; s -C 0.0000 0.0000 0.0000 -O 0.0000 0.0000 1.283 diff --git a/mol/GW20/Cu2.xyz b/mol/GW20/Cu2.xyz deleted file mode 100644 index 4a12699..0000000 --- a/mol/GW20/Cu2.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Copper dimer; experimental structure form HCP92; s -Cu 0.0 0.0 0.0 -Cu 0.0 0.0 2.2197 diff --git a/mol/GW20/F2.xyz b/mol/GW20/F2.xyz deleted file mode 100644 index 3316685..0000000 --- a/mol/GW20/F2.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Fluorine; experimental structure from HCP92; s -F 0.0000 0.0000 0.0000 -F 0.0000 0.0000 1.4119 diff --git a/mol/GW20/H2.xyz b/mol/GW20/H2.xyz deleted file mode 100644 index 55105ed..0000000 --- a/mol/GW20/H2.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Hydrogen; experimental structure from HCP92; s -H 0.0000 0.0000 0.0000 -H 0.0000 0.0000 0.74144 diff --git a/mol/GW20/H2O.xyz b/mol/GW20/H2O.xyz deleted file mode 100644 index 4e1148e..0000000 --- a/mol/GW20/H2O.xyz +++ /dev/null @@ -1,5 +0,0 @@ -3 -Water; experimental structure from HCP92; s -O 0.0000 0.0000 0.0000 -H 0.7571 0.0000 0.5861 -H -0.7571 0.0000 0.5861 diff --git a/mol/GW20/HCl.xyz b/mol/GW20/HCl.xyz deleted file mode 100644 index ef7c213..0000000 --- a/mol/GW20/HCl.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Hydrogen chloride; experimental structure from HCP92; s -H 0.0000 0.0000 0.0000 -Cl 0.0000 0.0000 1.2746 diff --git a/mol/GW20/HF.xyz b/mol/GW20/HF.xyz deleted file mode 100644 index 2b500c4..0000000 --- a/mol/GW20/HF.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Hydrogen fluoride; experimental structure from HCP92; s -H 0.0000 0.0000 0.0000 -F 0.0000 0.0000 0.9169 diff --git a/mol/GW20/He.xyz b/mol/GW20/He.xyz deleted file mode 100644 index 4feac49..0000000 --- a/mol/GW20/He.xyz +++ /dev/null @@ -1,3 +0,0 @@ -1 -Helium; atom; s -He 0.0 0.0 0.0 diff --git a/mol/GW20/Li2.xyz b/mol/GW20/Li2.xyz deleted file mode 100644 index ac00597..0000000 --- a/mol/GW20/Li2.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Lithium dimer; experimental structure from HCP92; s -Li 0.0000 0.0000 0.0000 -Li 0.0000 0.0000 2.6729 diff --git a/mol/GW20/LiF.xyz b/mol/GW20/LiF.xyz deleted file mode 100644 index 10e6fe1..0000000 --- a/mol/GW20/LiF.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Lithium fluoride; experimental structure from HCP92; s -Li 0.0000 0.0000 0.0000 -F 0.0000 0.0000 1.5639 diff --git a/mol/GW20/LiH.xyz b/mol/GW20/LiH.xyz deleted file mode 100644 index 6c56774..0000000 --- a/mol/GW20/LiH.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Lithium hydride; experimental structure from HCP92; s -Li 0.0000 0.0000 0.0000 -H 0.0000 0.0000 1.5949 diff --git a/mol/GW20/N2.xyz b/mol/GW20/N2.xyz deleted file mode 100644 index 9498bee..0000000 --- a/mol/GW20/N2.xyz +++ /dev/null @@ -1,4 +0,0 @@ -2 -Nitrogen; experimental structure from HCP92; s -N 0.0000 0.0000 0.0000 -N 0.0000 0.0000 1.0977 diff --git a/mol/GW20/NH3.xyz b/mol/GW20/NH3.xyz deleted file mode 100644 index 595067d..0000000 --- a/mol/GW20/NH3.xyz +++ /dev/null @@ -1,6 +0,0 @@ -4 -Amonia; experimental structure from HCP92; s -N 0.0000 0.0000 0.0000 -H 0.0000 -0.9377 -0.3816 -H 0.8121 0.4689 -0.3816 -H -0.8121 0.4689 -0.3816 diff --git a/mol/GW20/Ne.xyz b/mol/GW20/Ne.xyz deleted file mode 100644 index f148885..0000000 --- a/mol/GW20/Ne.xyz +++ /dev/null @@ -1,3 +0,0 @@ -1 -Neon; atom; s -Ne 0.0 0.0 0.0 diff --git a/mol/GW20/O3.xyz b/mol/GW20/O3.xyz deleted file mode 100644 index 17a9481..0000000 --- a/mol/GW20/O3.xyz +++ /dev/null @@ -1,5 +0,0 @@ -3 -Ozon; experimental structure from HCP92; s -O 0.0000 0.0000 0.0000 -O 1.0869 0.0000 0.6600 -O -1.0869 0.0000 0.6600 diff --git a/mol/GW20/SH2.xyz b/mol/GW20/SH2.xyz deleted file mode 100644 index f4069dc..0000000 --- a/mol/GW20/SH2.xyz +++ /dev/null @@ -1,5 +0,0 @@ -3 -Hydrogen sulfide; experimental structure from HCP92; s -S 0.0000 0.0000 0.0000 -H 0.9617 0.0000 0.9268 -H -0.9617 0.0000 0.9268 diff --git a/src/GF/RGF2_ppBSE2_static_kernel_C.f90 b/src/GF/RGF2_ppBSE2_static_kernel_C.f90 index 80ac15f..7ffeadb 100644 --- a/src/GF/RGF2_ppBSE2_static_kernel_C.f90 +++ b/src/GF/RGF2_ppBSE2_static_kernel_C.f90 @@ -25,8 +25,11 @@ subroutine RGF2_ppBSE2_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nVV,lambda,ERI double precision :: dem,num integer :: m integer :: a,b,c,d,e - integer :: ab,cd + integer :: a0,aa,ab,cd + double precision :: eta2 + double precision, allocatable :: Om_tmp(:,:) + ! Output variables double precision,intent(out) :: KC_sta(nVV,nVV) @@ -34,15 +37,39 @@ subroutine RGF2_ppBSE2_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nVV,lambda,ERI ! Initialization KC_sta(:,:) = 0d0 + eta2 = eta * eta + allocate(Om_tmp(nO,nV)) + + ! Compute the energy differences and denominator once and store them in a temporary array + !$OMP PARALLEL DEFAULT(NONE) PRIVATE(m,e,dem) SHARED(nC,nO,nBas,nR, eta2, eGF, Om_tmp) + !$OMP DO + do m=nC+1,nO + do e=nO+1,nBas-nR + dem = eGF(m) - eGF(e) + Om_tmp(m,e) = dem / (dem*dem + eta2) + enddo + enddo + !$OMP END DO + !$OMP END PARALLEL + ! Second-order correlation kernel for the block C of the singlet manifold +! --- --- --- +! OpenMP implementation +! --- --- --- + if(ispin == 1) then - ab = 0 + a0 = nBas - nR - nO + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PRIVATE(a, b, aa, ab, c, d, cd, m, e, num) & + !$OMP SHARED(nO, nBas, nR, nC, a0, ERI, Om_tmp, KC_sta, lambda) + !$OMP DO do a=nO+1,nBas-nR + aa = a0 * (a - nO - 1) - (a - nO - 1) * (a - nO) / 2 - nO do b=a,nBas-nR - ab = ab + 1 + ab = aa + b cd = 0 do c=nO+1,nBas-nR @@ -52,39 +79,91 @@ subroutine RGF2_ppBSE2_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nVV,lambda,ERI do m=nC+1,nO do e=nO+1,nBas-nR - dem = eGF(m) - eGF(e) num = 2d0*ERI(a,m,c,e)*ERI(b,e,d,m) - ERI(a,m,c,e)*ERI(b,e,m,d) & - ERI(a,m,e,c)*ERI(b,e,d,m) - ERI(a,m,e,c)*ERI(b,e,m,d) - KC_sta(ab,cd) = KC_sta(ab,cd) + num*dem/(dem**2 + eta**2) + KC_sta(ab,cd) = KC_sta(ab,cd) + num * Om_tmp(m,e) - dem = eGF(m) - eGF(e) num = 2d0*ERI(b,m,c,e)*ERI(a,e,d,m) - ERI(b,m,c,e)*ERI(a,e,m,d) & - ERI(b,m,e,c)*ERI(a,e,d,m) - ERI(b,m,e,c)*ERI(a,e,m,d) - KC_sta(ab,cd) = KC_sta(ab,cd) + num*dem/(dem**2 + eta**2) + KC_sta(ab,cd) = KC_sta(ab,cd) + num * Om_tmp(m,e) end do - end do + end do - KC_sta(ab,cd) = 2d0*lambda*KC_sta(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) + KC_sta(ab,cd) = 2d0*lambda*KC_sta(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) - end do - end do + end do + end do end do end do + !$OMP END DO + !$OMP END PARALLEL end if +! --- --- --- +! Naive implementation +! --- --- --- +! if(ispin == 1) then + +! ab = 0 +! do a=nO+1,nBas-nR +! do b=a,nBas-nR +! ab = ab + 1 + +! cd = 0 +! do c=nO+1,nBas-nR +! do d=c,nBas-nR +! cd = cd + 1 + +! do m=nC+1,nO +! do e=nO+1,nBas-nR + +! dem = eGF(m) - eGF(e) +! num = 2d0*ERI(a,m,c,e)*ERI(b,e,d,m) - ERI(a,m,c,e)*ERI(b,e,m,d) & +! - ERI(a,m,e,c)*ERI(b,e,d,m) - ERI(a,m,e,c)*ERI(b,e,m,d) + +! KC_sta(ab,cd) = KC_sta(ab,cd) + num*dem/(dem**2 + eta**2) + +! dem = eGF(m) - eGF(e) +! num = 2d0*ERI(b,m,c,e)*ERI(a,e,d,m) - ERI(b,m,c,e)*ERI(a,e,m,d) & +! - ERI(b,m,e,c)*ERI(a,e,d,m) - ERI(b,m,e,c)*ERI(a,e,m,d) + +! KC_sta(ab,cd) = KC_sta(ab,cd) + num*dem/(dem**2 + eta**2) + +! end do +! end do + +! KC_sta(ab,cd) = 2d0*lambda*KC_sta(ab,cd)/sqrt((1d0 + Kronecker_delta(a,b))*(1d0 + Kronecker_delta(c,d))) + +! end do +! end do + +! end do +! end do + +! end if + ! Second-order correlation kernel for the block C of the triplet manifold +! --- --- --- +! OpenMP implementation +! --- --- --- + if(ispin == 2) then - ab = 0 - do a=nO+1,nBas-nR - do b=a+1,nBas-nR - ab = ab + 1 + a0 = nBas - nR - nO - 1 + !$OMP PARALLEL DEFAULT(NONE) & + !$OMP PRIVATE(a, b, aa, ab, c, d, cd, m, e, num) & + !$OMP SHARED(nO, nBas, nR, nC, a0, ERI, Om_tmp, KC_sta) + !$OMP DO + do a = nO+1, nBas-nR + aa = a0 * (a - nO - 1) - (a - nO - 1) * (a - nO) / 2 - nO - 1 + do b = a+1, nBas-nR + ab = aa + b cd = 0 do c=nO+1,nBas-nR @@ -94,17 +173,15 @@ subroutine RGF2_ppBSE2_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nVV,lambda,ERI do m=nC+1,nO do e=nO+1,nBas-nR - dem = eGF(m) - eGF(e) num = 2d0*ERI(a,m,c,e)*ERI(b,e,d,m) - ERI(a,m,c,e)*ERI(b,e,m,d) & - ERI(a,m,e,c)*ERI(b,e,d,m) + ERI(a,m,e,c)*ERI(b,e,m,d) - KC_sta(ab,cd) = KC_sta(ab,cd) + 2d0*num*dem/(dem**2 + eta**2) + KC_sta(ab,cd) = KC_sta(ab,cd) + 2d0 * num * Om_tmp(m,e) - dem = eGF(m) - eGF(e) num = 2d0*ERI(b,m,c,e)*ERI(a,e,d,m) - ERI(b,m,c,e)*ERI(a,e,m,d) & - ERI(b,m,e,c)*ERI(a,e,d,m) + ERI(b,m,e,c)*ERI(a,e,m,d) - KC_sta(ab,cd) = KC_sta(ab,cd) - 2d0*num*dem/(dem**2 + eta**2) + KC_sta(ab,cd) = KC_sta(ab,cd) - 2d0 * num * Om_tmp(m,e) end do end do @@ -114,7 +191,54 @@ subroutine RGF2_ppBSE2_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nVV,lambda,ERI end do end do + !$OMP END DO + !$OMP END PARALLEL end if + +! --- --- --- +! Naive implementation +! --- --- --- +! if(ispin == 2) then + +! ab = 0 +! do a=nO+1,nBas-nR +! do b=a+1,nBas-nR +! ab = ab + 1 + +! cd = 0 +! do c=nO+1,nBas-nR +! do d=c+1,nBas-nR +! cd = cd + 1 + +! do m=nC+1,nO +! do e=nO+1,nBas-nR + +! dem = eGF(m) - eGF(e) +! num = 2d0*ERI(a,m,c,e)*ERI(b,e,d,m) - ERI(a,m,c,e)*ERI(b,e,m,d) & +! - ERI(a,m,e,c)*ERI(b,e,d,m) + ERI(a,m,e,c)*ERI(b,e,m,d) + +! KC_sta(ab,cd) = KC_sta(ab,cd) + 2d0*num*dem/(dem**2 + eta**2) + +! dem = eGF(m) - eGF(e) +! num = 2d0*ERI(b,m,c,e)*ERI(a,e,d,m) - ERI(b,m,c,e)*ERI(a,e,m,d) & +! - ERI(b,m,e,c)*ERI(a,e,d,m) + ERI(b,m,e,c)*ERI(a,e,m,d) + +! KC_sta(ab,cd) = KC_sta(ab,cd) - 2d0*num*dem/(dem**2 + eta**2) + +! end do +! end do + +! end do +! end do + +! end do +! end do + + ! end if + + + deallocate(Om_tmp) + end subroutine diff --git a/src/GF/ufRG0F02.f90 b/src/GF/ufRG0F02.f90 index c5ea84f..5719022 100644 --- a/src/GF/ufRG0F02.f90 +++ b/src/GF/ufRG0F02.f90 @@ -71,7 +71,7 @@ subroutine ufRG0F02(dotest,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,eHF) ! Main loop over orbitals ! !-------------------------! - do p=nO-1,nO + do p=nO-3,nO H(:,:) = 0d0 Reigv(:,:) = 0d0 diff --git a/src/GW/RGW_ppBSE.f90 b/src/GW/RGW_ppBSE.f90 index 0df6c35..7963b9a 100644 --- a/src/GW/RGW_ppBSE.f90 +++ b/src/GW/RGW_ppBSE.f90 @@ -61,7 +61,7 @@ subroutine RGW_ppBSE(TDA_W,TDA,dBSE,dTDA,singlet,triplet,eta,nBas,nC,nO,nV,nR,nS double precision,allocatable :: KB_sta(:,:) double precision,allocatable :: KC_sta(:,:) double precision,allocatable :: KD_sta(:,:) - + ! Output variables double precision,intent(out) :: EcBSE(nspin) @@ -114,7 +114,7 @@ subroutine RGW_ppBSE(TDA_W,TDA,dBSE,dTDA,singlet,triplet,eta,nBas,nC,nO,nV,nR,nS call RGW_ppBSE_static_kernel_C(ispin,eta,nBas,nC,nO,nV,nR,nS,nVV,1d0,ERI,OmRPA,rho_RPA,KC_sta) call RGW_ppBSE_static_kernel_D(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,1d0,ERI,OmRPA,rho_RPA,KD_sta) if(.not.TDA) call RGW_ppBSE_static_kernel_B(ispin,eta,nBas,nC,nO,nV,nR,nS,nOO,nVV,1d0,ERI,OmRPA,rho_RPA,KB_sta) - + call ppLR_C(ispin,nBas,nC,nO,nV,nR,nVV,1d0,eGW,ERI,Cpp) call ppLR_D(ispin,nBas,nC,nO,nV,nR,nOO,1d0,eGW,ERI,Dpp) if(.not.TDA) call ppLR_B(ispin,nBas,nC,nO,nV,nR,nOO,nVV,1d0,ERI,Bpp) diff --git a/src/LR/ppLR_transition_vectors.f90 b/src/LR/ppLR_transition_vectors.f90 index 2c29aa7..d4155fd 100644 --- a/src/LR/ppLR_transition_vectors.f90 +++ b/src/LR/ppLR_transition_vectors.f90 @@ -117,8 +117,8 @@ subroutine ppLR_transition_vectors(spin_allowed,nBas,nC,nO,nV,nR,nOO,nVV,dipole_ ! Thomas-Reiche-Kuhn sum rule - if(nVV > 0) write(*,'(A50,F10.6)') 'Thomas-Reiche-Kuhn sum rule for p-p sector = ',sum(os1(:)) - write(*,*) +! if(nVV > 0) write(*,'(A50,F10.6)') 'Thomas-Reiche-Kuhn sum rule for p-p sector = ',sum(os1(:)) +! write(*,*) !-----------------------------------------------! ! Print details about excitations for hh sector ! @@ -188,7 +188,7 @@ subroutine ppLR_transition_vectors(spin_allowed,nBas,nC,nO,nV,nR,nOO,nVV,dipole_ ! Thomas-Reiche-Kuhn sum rule - if(nOO > 0) write(*,'(A50,F10.6)') 'Thomas-Reiche-Kuhn sum rule for h-h sector = ',sum(os2(:)) - write(*,*) +! if(nOO > 0) write(*,'(A50,F10.6)') 'Thomas-Reiche-Kuhn sum rule for h-h sector = ',sum(os2(:)) +! write(*,*) end subroutine diff --git a/src/make_ninja.py b/src/make_ninja.py index a5e6e84..c97e979 100755 --- a/src/make_ninja.py +++ b/src/make_ninja.py @@ -88,9 +88,9 @@ FIX_ORDER_OF_LIBS=-Wl,--start-group """ if sys.platform in ["linux", "linux2"]: -# compiler = compile_gfortran_linux - compiler = compile_ifort_linux -# compiler = compile_olympe +# compiler = compile_gfortran_linux +# compiler = compile_ifort_linux + compiler = compile_olympe elif sys.platform == "darwin": compiler = compile_gfortran_mac else: