From 986caedeac38cfcc55fc556325814aa427b84bd5 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Thu, 4 Jun 2020 22:40:14 +0200 Subject: [PATCH] clean dBSE code --- input/basis | 119 +++++++++--------- input/methods | 4 +- input/molecule | 5 +- input/molecule.xyz | 5 +- src/QuAcK/BSE2_ZA_matrix_dynamic.f90 | 66 ---------- .../Bethe_Salpeter_AB_matrix_dynamic.f90 | 21 ++-- src/QuAcK/Bethe_Salpeter_A_matrix_dynamic.f90 | 11 +- .../Bethe_Salpeter_ZAB_matrix_dynamic.f90 | 16 +-- .../Bethe_Salpeter_ZA_matrix_dynamic.f90 | 8 +- 9 files changed, 97 insertions(+), 158 deletions(-) delete mode 100644 src/QuAcK/BSE2_ZA_matrix_dynamic.f90 diff --git a/input/basis b/input/basis index 27669ff..bbe0bfe 100644 --- a/input/basis +++ b/input/basis @@ -1,66 +1,71 @@ -1 21 -S 10 - 1 54620.0000000 0.0000180 - 2 8180.0000000 0.0001380 - 3 1862.0000000 0.0007230 - 4 527.3000000 0.0030390 - 5 172.0000000 0.0109080 - 6 62.1000000 0.0340350 - 7 24.2100000 0.0911930 - 8 9.9930000 0.1992680 - 9 4.3050000 0.3293550 - 10 1.9210000 0.3404890 -S 10 - 1 54620.0000000 -0.0000030 - 2 8180.0000000 -0.0000250 - 3 1862.0000000 -0.0001310 - 4 527.3000000 -0.0005580 - 5 172.0000000 -0.0019880 - 6 62.1000000 -0.0063700 - 7 24.2100000 -0.0172170 - 8 9.9930000 -0.0408580 - 9 4.3050000 -0.0742370 - 10 1.9210000 -0.1192340 +1 9 +S 8 + 1 9046.0000000 0.0007000 + 2 1357.0000000 0.0053890 + 3 309.3000000 0.0274060 + 4 87.7300000 0.1032070 + 5 28.5600000 0.2787230 + 6 10.2100000 0.4485400 + 7 3.8380000 0.2782380 + 8 0.7466000 0.0154400 +S 8 + 1 9046.0000000 -0.0001530 + 2 1357.0000000 -0.0012080 + 3 309.3000000 -0.0059920 + 4 87.7300000 -0.0245440 + 5 28.5600000 -0.0674590 + 6 10.2100000 -0.1580780 + 7 3.8380000 -0.1218310 + 8 0.7466000 0.5490030 S 1 - 1 0.8663000 1.0000000 + 1 0.2248000 1.0000000 S 1 - 1 0.2475000 1.0000000 + 1 0.0612400 1.0000000 +P 3 + 1 13.5500000 0.0399190 + 2 2.9170000 0.2171690 + 3 0.7973000 0.5103190 +P 1 + 1 0.2185000 1.0000000 +P 1 + 1 0.0561100 1.0000000 +D 1 + 1 0.8170000 1.0000000 +D 1 + 1 0.2300000 1.0000000 +2 9 +S 8 + 1 9046.0000000 0.0007000 + 2 1357.0000000 0.0053890 + 3 309.3000000 0.0274060 + 4 87.7300000 0.1032070 + 5 28.5600000 0.2787230 + 6 10.2100000 0.4485400 + 7 3.8380000 0.2782380 + 8 0.7466000 0.0154400 +S 8 + 1 9046.0000000 -0.0001530 + 2 1357.0000000 -0.0012080 + 3 309.3000000 -0.0059920 + 4 87.7300000 -0.0245440 + 5 28.5600000 -0.0674590 + 6 10.2100000 -0.1580780 + 7 3.8380000 -0.1218310 + 8 0.7466000 0.5490030 S 1 - 1 0.1009000 1.0000000 + 1 0.2248000 1.0000000 S 1 - 1 0.0412900 1.0000000 -P 4 - 1 43.7500000 0.0006330 - 2 10.3300000 0.0048080 - 3 3.2260000 0.0205270 - 4 1.1270000 0.0678160 + 1 0.0612400 1.0000000 +P 3 + 1 13.5500000 0.0399190 + 2 2.9170000 0.2171690 + 3 0.7973000 0.5103190 P 1 - 1 0.4334000 1.0000000 + 1 0.2185000 1.0000000 P 1 - 1 0.1808000 1.0000000 -P 1 - 1 0.0782700 1.0000000 -P 1 - 1 0.0337200 1.0000000 + 1 0.0561100 1.0000000 D 1 - 1 1.6350000 1.0000000 + 1 0.8170000 1.0000000 D 1 - 1 0.7410000 1.0000000 -D 1 - 1 0.3350000 1.0000000 -D 1 - 1 0.1519000 1.0000000 -F 1 - 1 0.6860000 1.0000000 -F 1 - 1 0.4010000 1.0000000 -F 1 - 1 0.2350000 1.0000000 -G 1 - 1 0.6030000 1.0000000 -G 1 - 1 0.3240000 1.0000000 -H 1 - 1 0.5100000 1.0000000 - + 1 0.2300000 1.0000000 diff --git a/input/methods b/input/methods index c48703f..63c03d4 100644 --- a/input/methods +++ b/input/methods @@ -11,9 +11,9 @@ # RPA RPAx ppRPA F F F # G0F2 evGF2 G0F3 evGF3 - T F F F + F F F F # G0W0 evGW qsGW - F F F + T F F # G0T0 evGT qsGT F F F # MCMP2 diff --git a/input/molecule b/input/molecule index 6a6f6d1..76ebcdf 100644 --- a/input/molecule +++ b/input/molecule @@ -1,4 +1,5 @@ # nAt nEla nElb nCore nRyd - 1 2 2 0 0 + 2 7 7 0 0 # Znuc x y z - Be 0.0 0.0 0.0 + N 0. 0. -1.04008632 + N 0. 0. +1.04008632 diff --git a/input/molecule.xyz b/input/molecule.xyz index 8023e37..e1773f0 100644 --- a/input/molecule.xyz +++ b/input/molecule.xyz @@ -1,3 +1,4 @@ - 1 + 2 - Be 0.0000000000 0.0000000000 0.0000000000 + N 0.0000000000 0.0000000000 -0.5503900175 + N 0.0000000000 0.0000000000 0.5503900175 diff --git a/src/QuAcK/BSE2_ZA_matrix_dynamic.f90 b/src/QuAcK/BSE2_ZA_matrix_dynamic.f90 deleted file mode 100644 index a7be783..0000000 --- a/src/QuAcK/BSE2_ZA_matrix_dynamic.f90 +++ /dev/null @@ -1,66 +0,0 @@ -subroutine BSE2_ZA_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,OmRPA,OmBSE,rho,ZA_dyn) - -! Compute the dynamic part of the Bethe-Salpeter equation matrices - - implicit none - include 'parameters.h' - -! Input variables - - integer,intent(in) :: nBas,nC,nO,nV,nR,nS - double precision,intent(in) :: eta - double precision,intent(in) :: lambda - double precision,intent(in) :: eGW(nBas) - double precision,intent(in) :: OmRPA(nS) - double precision,intent(in) :: OmBSE - double precision,intent(in) :: rho(nBas,nBas,nS) - -! Local variables - - integer :: maxS - double precision :: chi - double precision :: eps - integer :: i,j,a,b,ia,jb,kc - -! Output variables - - double precision,intent(out) :: ZA_dyn(nS,nS) - -! Initialization - - ZA_dyn(:,:) = 0d0 - -! Number of poles taken into account - - maxS = nS - -! Build dynamic A matrix - - ia = 0 - do i=nC+1,nO - do a=nO+1,nBas-nR - ia = ia + 1 - jb = 0 - do j=nC+1,nO - do b=nO+1,nBas-nR - jb = jb + 1 - - chi = 0d0 - do kc=1,maxS - - eps = (OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*((OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))/eps)**2 - - eps = (OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*((OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))/eps)**2 - - enddo - - ZA_dyn(ia,jb) = ZA_dyn(ia,jb) + 2d0*lambda*chi - - enddo - enddo - enddo - enddo - -end subroutine BSE2_ZA_matrix_dynamic diff --git a/src/QuAcK/Bethe_Salpeter_AB_matrix_dynamic.f90 b/src/QuAcK/Bethe_Salpeter_AB_matrix_dynamic.f90 index a3bcc02..0e6cde2 100644 --- a/src/QuAcK/Bethe_Salpeter_AB_matrix_dynamic.f90 +++ b/src/QuAcK/Bethe_Salpeter_AB_matrix_dynamic.f90 @@ -51,9 +51,8 @@ subroutine Bethe_Salpeter_AB_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,O do kc=1,maxS - eps = OmRPA(kc)**2 + eta**2 - chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*OmRPA(kc)/eps - chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*OmRPA(kc)/eps + chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*OmRPA(kc)/OmRPA(kc)**2 + eta**2 + chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*OmRPA(kc)/OmRPA(kc)**2 + eta**2 enddo @@ -65,17 +64,17 @@ subroutine Bethe_Salpeter_AB_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,O do kc=1,maxS - eps_A = (+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))**2 + eta**2 - chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*(+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))/eps_A + eps_A = + OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)) + chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*eps_A/(eps_A**2 + eta**2) - eps_A = (+ OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))**2 + eta**2 - chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*(+ OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))/eps_A + eps_A = + OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)) + chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*eps_A/(eps_A**2 + eta**2) - eps_B = (+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(b)))**2 + eta**2 - chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*(+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(b)))/eps_B + eps_B = + OmBSE - OmRPA(kc) - (eGW(a) - eGW(b)) + chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*eps_B/(eps_B**2 + eta**2) - eps_B = (+ OmBSE - OmRPA(kc) - (eGW(j) - eGW(i)))**2 + eta**2 - chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*(+ OmBSE - OmRPA(kc) - (eGW(j) - eGW(i)))/eps_B + eps_B = + OmBSE - OmRPA(kc) - (eGW(j) - eGW(i)) + chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*eps_B/(eps_B**2 + eta**2) enddo diff --git a/src/QuAcK/Bethe_Salpeter_A_matrix_dynamic.f90 b/src/QuAcK/Bethe_Salpeter_A_matrix_dynamic.f90 index 100d9ea..1d8f891 100644 --- a/src/QuAcK/Bethe_Salpeter_A_matrix_dynamic.f90 +++ b/src/QuAcK/Bethe_Salpeter_A_matrix_dynamic.f90 @@ -48,8 +48,7 @@ subroutine Bethe_Salpeter_A_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,Om chi = 0d0 do kc=1,maxS - eps = OmRPA(kc)**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*OmRPA(kc)/eps + chi = chi + rho(i,j,kc)*rho(a,b,kc)*OmRPA(kc)/(OmRPA(kc)**2 + eta**2) enddo @@ -58,11 +57,11 @@ subroutine Bethe_Salpeter_A_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,Om chi = 0d0 do kc=1,maxS - eps = (OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*(OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))/eps + eps = OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)) + chi = chi + rho(i,j,kc)*rho(a,b,kc)*eps/(eps**2 + eta**2) - eps = (OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*(OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))/eps + eps = OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)) + chi = chi + rho(i,j,kc)*rho(a,b,kc)*eps/(eps**2 + eta**2) enddo diff --git a/src/QuAcK/Bethe_Salpeter_ZAB_matrix_dynamic.f90 b/src/QuAcK/Bethe_Salpeter_ZAB_matrix_dynamic.f90 index 4bacbcc..26fa9db 100644 --- a/src/QuAcK/Bethe_Salpeter_ZAB_matrix_dynamic.f90 +++ b/src/QuAcK/Bethe_Salpeter_ZAB_matrix_dynamic.f90 @@ -52,17 +52,17 @@ subroutine Bethe_Salpeter_ZAB_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW, do kc=1,maxS - eps_A = (+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))**2 + eta**2 - chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*((+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))/eps_A)**2 + eps_A = + OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)) + chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*(eps_A**2 - eta**2)/(eps_A**2 + eta**2)**2 - eps_A = (+ OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))**2 + eta**2 - chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*((+ OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))/eps_A)**2 + eps_A = + OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)) + chi_A = chi_A + rho(i,j,kc)*rho(a,b,kc)*(eps_A**2 - eta**2)/(eps_A**2 + eta**2)**2 - eps_B = (+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(b)))**2 + eta**2 - chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*((+ OmBSE - OmRPA(kc) - (eGW(a) - eGW(b)))/eps_B)**2 + eps_B = + OmBSE - OmRPA(kc) - (eGW(a) - eGW(b)) + chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*(eps_B**2 - eta**2)/(eps_B**2 + eta**2)**2 - eps_B = (+ OmBSE - OmRPA(kc) - (eGW(j) - eGW(i)))**2 + eta**2 - chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*((+ OmBSE - OmRPA(kc) - (eGW(j) - eGW(i)))/eps_B)**2 + eps_B = + OmBSE - OmRPA(kc) - (eGW(j) - eGW(i)) + chi_B = chi_B + rho(i,b,kc)*rho(a,j,kc)*(eps_B**2 - eta**2)/(eps_B**2 + eta**2)**2 enddo diff --git a/src/QuAcK/Bethe_Salpeter_ZA_matrix_dynamic.f90 b/src/QuAcK/Bethe_Salpeter_ZA_matrix_dynamic.f90 index 43dbf71..3e2f245 100644 --- a/src/QuAcK/Bethe_Salpeter_ZA_matrix_dynamic.f90 +++ b/src/QuAcK/Bethe_Salpeter_ZA_matrix_dynamic.f90 @@ -48,11 +48,11 @@ subroutine Bethe_Salpeter_ZA_matrix_dynamic(eta,nBas,nC,nO,nV,nR,nS,lambda,eGW,O chi = 0d0 do kc=1,maxS - eps = (OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*((OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)))/eps)**2 + eps = OmBSE - OmRPA(kc) - (eGW(a) - eGW(j)) + chi = chi + rho(i,j,kc)*rho(a,b,kc)*(eps**2 - eta**2)/(eps**2 + eta**2)**2 - eps = (OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))**2 + eta**2 - chi = chi + rho(i,j,kc)*rho(a,b,kc)*((OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)))/eps)**2 + eps = OmBSE - OmRPA(kc) - (eGW(b) - eGW(i)) + chi = chi + rho(i,j,kc)*rho(a,b,kc)*(eps**2 - eta**2)/(eps**2 + eta**2)**2 enddo