From b18613c763f0c4755c812312aae52807be1c3c97 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Thu, 23 May 2019 09:53:23 +0200 Subject: [PATCH] TDHF Ec --- input/basis | 40 ++++++---------------------- input/methods | 8 +++--- input/molecule | 4 +-- input/options | 2 +- input/weight | 34 +++++------------------- src/QuAcK/G0W0.f90 | 3 ++- src/QuAcK/QuAcK.f90 | 4 +-- src/QuAcK/TDHF.f90 | 49 ++++++++++++++++++++++++----------- src/QuAcK/linear_response.f90 | 8 ++++++ 9 files changed, 68 insertions(+), 84 deletions(-) diff --git a/input/basis b/input/basis index 9c24319..b9ca7b5 100644 --- a/input/basis +++ b/input/basis @@ -1,33 +1,9 @@ -1 16 +1 3 +S 3 1.00 + 38.3600000 0.0238090 + 5.7700000 0.1548910 + 1.2400000 0.4699870 S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 -S 1 1.00 - 1.0000000 1.0000000 + 0.2976000 1.0000000 +P 1 1.00 + 1.2750000 1.0000000 diff --git a/input/methods b/input/methods index ca18179..8204ed8 100644 --- a/input/methods +++ b/input/methods @@ -1,14 +1,14 @@ # RHF UHF MOM T F F # MP2 MP3 MP2-F12 - T F F + F F F # CCD CCSD CCSD(T) F F F # CIS TDHF ADC - T T F + F T F # GF2 GF3 - T F + F F # G0W0 evGW qsGW - T T F + T F F # MCMP2 F diff --git a/input/molecule b/input/molecule index 41e84ba..c78e87e 100644 --- a/input/molecule +++ b/input/molecule @@ -1,4 +1,4 @@ # nAt nEla nElb nCore nRyd - 1 1 1 0 0 + 1 1 1 0 0 # Znuc x y z - X 0.0 0.0 0.0 + He 0.0 0.0 0.0 diff --git a/input/options b/input/options index 0113ebb..86d7547 100644 --- a/input/options +++ b/input/options @@ -9,6 +9,6 @@ # GF: maxSCF thresh DIIS n_diis renormalization 64 0.00001 T 10 3 # GW: maxSCF thresh DIIS n_diis COHSEX SOSEX BSE TDA G0W GW0 linearize - 64 0.00001 T 10 F F T F F F F + 64 0.00001 T 20 F F T F F F F # MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift 1000000 100000 10 0.3 10000 1234 T diff --git a/input/weight b/input/weight index e220e53..b9ca7b5 100644 --- a/input/weight +++ b/input/weight @@ -1,29 +1,9 @@ -1 6 -S 8 1.00 - 2940.0000000 0.0006800 - 441.2000000 0.0052360 - 100.5000000 0.0266060 - 28.4300000 0.0999930 - 9.1690000 0.2697020 - 3.1960000 0.4514690 - 1.1590000 0.2950740 - 0.1811000 0.0125870 -S 8 1.00 - 2940.0000000 -0.0001230 - 441.2000000 -0.0009660 - 100.5000000 -0.0048310 - 28.4300000 -0.0193140 - 9.1690000 -0.0532800 - 3.1960000 -0.1207230 - 1.1590000 -0.1334350 - 0.1811000 0.5307670 +1 3 +S 3 1.00 + 38.3600000 0.0238090 + 5.7700000 0.1548910 + 1.2400000 0.4699870 S 1 1.00 - 0.0589000 1.0000000 -P 3 1.00 - 3.6190000 0.0291110 - 0.7110000 0.1693650 - 0.1951000 0.5134580 + 0.2976000 1.0000000 P 1 1.00 - 0.0601800 1.0000000 -D 1 1.00 - 0.2380000 1.0000000 + 1.2750000 1.0000000 diff --git a/src/QuAcK/G0W0.f90 b/src/QuAcK/G0W0.f90 index f7b4394..ba8cc44 100644 --- a/src/QuAcK/G0W0.f90 +++ b/src/QuAcK/G0W0.f90 @@ -15,7 +15,8 @@ subroutine G0W0(COHSEX,SOSEX,BSE,TDA,singlet_manifold,triplet_manifold, & logical,intent(in) :: singlet_manifold logical,intent(in) :: triplet_manifold integer,intent(in) :: nBas,nC,nO,nV,nR,nS - double precision,intent(in) :: ENuc,ERHF + double precision,intent(in) :: ENuc + double precision,intent(in) :: ERHF double precision,intent(in) :: eHF(nBas) double precision,intent(in) :: cHF(nBas,nBas) double precision,intent(in) :: PHF(nBas,nBas) diff --git a/src/QuAcK/QuAcK.f90 b/src/QuAcK/QuAcK.f90 index 310f82c..01e0bae 100644 --- a/src/QuAcK/QuAcK.f90 +++ b/src/QuAcK/QuAcK.f90 @@ -90,7 +90,7 @@ program QuAcK ! Spherium calculation? - doSph = .true. + doSph = .false. call cpu_time(start_QuAcK) @@ -386,7 +386,7 @@ program QuAcK if(doTDHF) then call cpu_time(start_TDHF) - call TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ERI_MO_basis,eHF) + call TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI_MO_basis,eHF) call cpu_time(end_TDHF) t_TDHF = end_TDHF - start_TDHF diff --git a/src/QuAcK/TDHF.f90 b/src/QuAcK/TDHF.f90 index 1999792..de05458 100644 --- a/src/QuAcK/TDHF.f90 +++ b/src/QuAcK/TDHF.f90 @@ -1,4 +1,4 @@ -subroutine TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ERI,e) +subroutine TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ENuc,ERHF,ERI,e) ! Perform random phase approximation calculation @@ -7,18 +7,30 @@ subroutine TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ERI,e) ! Input variables - logical,intent(in) :: singlet_manifold,triplet_manifold - integer,intent(in) :: nBas,nC,nO,nV,nR,nS - double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas),e(nBas) + logical,intent(in) :: singlet_manifold + logical,intent(in) :: triplet_manifold + integer,intent(in) :: nBas + integer,intent(in) :: nC + integer,intent(in) :: nO + integer,intent(in) :: nV + integer,intent(in) :: nR + integer,intent(in) :: nS + double precision,intent(in) :: ENuc + double precision,intent(in) :: ERHF + double precision,intent(in) :: e(nBas) + double precision,intent(in) :: ERI(nBas,nBas,nBas,nBas) ! Local variables - logical :: dRPA,TDA,BSE + logical :: dRPA + logical :: TDA + logical :: BSE integer :: ispin - double precision,allocatable :: Omega(:,:),XpY(:,:,:) + double precision,allocatable :: Omega(:,:) + double precision,allocatable :: XpY(:,:,:) double precision :: rho - double precision :: EcRPA + double precision :: EcRPA(nspin) ! Hello world @@ -28,6 +40,10 @@ subroutine TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ERI,e) write(*,*)'************************************************' write(*,*) +! Initialization + + EcRPA(:) = 0d0 + ! Switch on exchange for TDHF dRPA = .false. @@ -51,17 +67,11 @@ subroutine TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ERI,e) ispin = 1 call linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI, & - rho,EcRPA,Omega(:,ispin),XpY(:,:,ispin)) + rho,EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin)) call print_excitation('TDHF ',ispin,nS,Omega(:,ispin)) endif - write(*,*)'-------------------------------------------------------------------------------' - write(*,'(2X,A27,F15.6)') 'RPA correlation energy =',EcRPA - write(*,*)'-------------------------------------------------------------------------------' - write(*,*) - - ! Triplet manifold if(triplet_manifold) then @@ -69,9 +79,18 @@ subroutine TDHF(singlet_manifold,triplet_manifold,nBas,nC,nO,nV,nR,nS,ERI,e) ispin = 2 call linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI, & - rho,EcRPA,Omega(:,ispin),XpY(:,:,ispin)) + rho,EcRPA(ispin),Omega(:,ispin),XpY(:,:,ispin)) call print_excitation('TDHF ',ispin,nS,Omega(:,ispin)) endif + write(*,*) + write(*,*)'-------------------------------------------------------------------------------' + write(*,'(2X,A40,F15.6)') 'RPA@TDHF correlation energy (singlet) =',EcRPA(1) + write(*,'(2X,A40,F15.6)') 'RPA@TDHF correlation energy (triplet) =',EcRPA(2) + write(*,'(2X,A40,F15.6)') 'RPA@TDHF correlation energy =',EcRPA(1) + EcRPA(2) + write(*,'(2X,A40,F15.6)') 'RPA@TDHF total energy =',ENuc + ERHF + EcRPA(1) + EcRPA(2) + write(*,*)'-------------------------------------------------------------------------------' + write(*,*) + end subroutine TDHF diff --git a/src/QuAcK/linear_response.f90 b/src/QuAcK/linear_response.f90 index 5675a2f..3d86ddc 100644 --- a/src/QuAcK/linear_response.f90 +++ b/src/QuAcK/linear_response.f90 @@ -46,6 +46,12 @@ subroutine linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI,rho,EcRP ApB = A + B AmB = A - B +! print*,'A' +! call matout(nS,nS,A) + +! print*,'B' +! call matout(nS,nS,B) + ! print*,'A+B' ! call matout(nS,nS,ApB) @@ -84,4 +90,6 @@ subroutine linear_response(ispin,dRPA,TDA,BSE,nBas,nC,nO,nV,nR,nS,e,ERI,rho,EcRP EcRPA = 0.5d0*(sum(Omega) - trace_matrix(nS,A)) +! print*,'EcRPA = ',EcRPA + end subroutine linear_response