From 86f501cb78f952a7c3b5772287656d6d7d185ee3 Mon Sep 17 00:00:00 2001 From: EnzoMonino Date: Tue, 15 Feb 2022 13:51:18 +0100 Subject: [PATCH] ppURPA --- input/methods | 6 +- input/options | 6 +- src/LR/print_excitation.f90 | 3 +- src/LR/unrestricted_linear_response_B_pp.f90 | 13 +-- src/LR/unrestricted_linear_response_C_pp.f90 | 13 +-- src/LR/unrestricted_linear_response_D_pp.f90 | 15 +-- src/RPA/ppURPA.f90 | 98 +++++++++----------- 7 files changed, 62 insertions(+), 92 deletions(-) diff --git a/input/methods b/input/methods index 07cc57d..866c5e2 100644 --- a/input/methods +++ b/input/methods @@ -1,5 +1,5 @@ # RHF UHF KS MOM - T F F F + F T F F # MP2* MP3 MP2-F12 F F F # CCD pCCD DCD CCSD CCSD(T) @@ -13,9 +13,9 @@ # G0F2* evGF2* qsGF2* G0F3 evGF3 F F F F F # G0W0* evGW* qsGW* ufG0W0 ufGW - F F F F F + T F F F F # G0T0 evGT qsGT - T F F + F F F # MCMP2 F # * unrestricted version available diff --git a/input/options b/input/options index 1a4eae7..dd35a73 100644 --- a/input/options +++ b/input/options @@ -1,11 +1,11 @@ # HF: maxSCF thresh DIIS n_diis guess_type ortho_type mix_guess level_shift stability - 256 0.0000001 T 5 2 1 F 0.0 F + 256 0.0000001 T 5 1 1 T 0.0 F # MP: # CC: maxSCF thresh DIIS n_diis 64 0.00001 T 5 # spin: TDA singlet triplet spin_conserved spin_flip - F T T T T + T T T T T # GF: maxSCF thresh DIIS n_diis lin eta renorm reg 256 0.00001 T 5 T 0.0 3 F # GW: maxSCF thresh DIIS n_diis lin eta COHSEX SOSEX TDA_W G0W GW0 reg @@ -15,6 +15,6 @@ # ACFDT: AC Kx XBS F F T # BSE: BSE dBSE dTDA evDyn - F F T F + T F F F # MCMP2: nMC nEq nWalk dt nPrint iSeed doDrift 1000000 100000 10 0.3 10000 1234 T diff --git a/src/LR/print_excitation.f90 b/src/LR/print_excitation.f90 index 1720300..d746cd6 100644 --- a/src/LR/print_excitation.f90 +++ b/src/LR/print_excitation.f90 @@ -20,9 +20,10 @@ subroutine print_excitation(method,ispin,nS,Omega) if(ispin == 1) spin_manifold = 'singlet' if(ispin == 2) spin_manifold = 'triplet' if(ispin == 3) spin_manifold = 'alpha-beta' - if(ispin == 4) spin_manifold = 'alpha-alpha' + if(ispin == 4) spin_manifold = 'alpha-alpha' if(ispin == 5) spin_manifold = 'spin-conserved' if(ispin == 6) spin_manifold = 'spin-flip' + if(ispin == 7) spin_manifold = 'beta-beta' write(*,*) write(*,*)'-------------------------------------------------------------' diff --git a/src/LR/unrestricted_linear_response_B_pp.f90 b/src/LR/unrestricted_linear_response_B_pp.f90 index 6f5db5b..e1c57bc 100644 --- a/src/LR/unrestricted_linear_response_B_pp.f90 +++ b/src/LR/unrestricted_linear_response_B_pp.f90 @@ -41,11 +41,7 @@ subroutine unrestricted_linear_response_B_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nP eF = 0d0 -!----------------------------------------------- -! Build B matrix for spin-conserved transitions -!----------------------------------------------- - - if(ispin == 1) then + if(ispin == 3) then ! abab block @@ -67,11 +63,8 @@ subroutine unrestricted_linear_response_B_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nP end if -!----------------------------------------------- -! Build B matrix for spin-flip transitions -!----------------------------------------------- - if(ispin == 2) then + if(ispin == 4) then ! aaaa block @@ -92,7 +85,7 @@ subroutine unrestricted_linear_response_B_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nP end do end if - if (ispin == 3) then + if (ispin == 7) then ! bbbb block diff --git a/src/LR/unrestricted_linear_response_C_pp.f90 b/src/LR/unrestricted_linear_response_C_pp.f90 index 7e37f78..dd14c72 100644 --- a/src/LR/unrestricted_linear_response_C_pp.f90 +++ b/src/LR/unrestricted_linear_response_C_pp.f90 @@ -37,11 +37,8 @@ subroutine unrestricted_linear_response_C_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nP eF = 0d0 -!----------------------------------------------- -! Build C matrix for spin-conserved transitions -!----------------------------------------------- - if(ispin == 1) then + if(ispin == 3) then ! abab block @@ -62,11 +59,7 @@ subroutine unrestricted_linear_response_C_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nP end if -!----------------------------------------------- -! Build C matrix for spin-flip transitions -!----------------------------------------------- - - if(ispin == 2) then + if(ispin == 4) then ! aaaa block @@ -90,7 +83,7 @@ subroutine unrestricted_linear_response_C_pp(ispin,nBas,nC,nO,nV,nR,nPaa,nPab,nP end if - if (ispin == 3) then + if (ispin == 7) then ! bbbb block diff --git a/src/LR/unrestricted_linear_response_D_pp.f90 b/src/LR/unrestricted_linear_response_D_pp.f90 index 3d7c10e..28c4c78 100644 --- a/src/LR/unrestricted_linear_response_D_pp.f90 +++ b/src/LR/unrestricted_linear_response_D_pp.f90 @@ -38,11 +38,7 @@ subroutine unrestricted_linear_response_D_pp(ispin,nBas,nC,nO,nV,nR,nHaa,nHab,nH eF = 0d0 -!----------------------------------------------- -! Build D matrix for spin-conserved transitions -!----------------------------------------------- - - if(ispin == 1) then + if(ispin == 3) then ! abab block @@ -63,12 +59,7 @@ subroutine unrestricted_linear_response_D_pp(ispin,nBas,nC,nO,nV,nR,nHaa,nHab,nH end if - -!----------------------------------------------- -! Build D matrix for spin-flip transitions -!----------------------------------------------- - - if(ispin == 2) then + if(ispin == 4) then ! aaaa block @@ -91,7 +82,7 @@ subroutine unrestricted_linear_response_D_pp(ispin,nBas,nC,nO,nV,nR,nHaa,nHab,nH end do end if - if (ispin == 3) then + if (ispin == 7) then ! bbbb block diff --git a/src/RPA/ppURPA.f90 b/src/RPA/ppURPA.f90 index 75b0dd4..752e98d 100644 --- a/src/RPA/ppURPA.f90 +++ b/src/RPA/ppURPA.f90 @@ -51,82 +51,75 @@ subroutine ppURPA(TDA,doACFDT,spin_conserved,spin_flip,nBas,nC,nO,nV,nR,ENuc,EUH Ec_ppURPA(:) = 0d0 EcAC(:) = 0d0 -! Spin-conserved manifold +!alpha-beta block - if(spin_conserved) then + ispin = 1 + iblock = 3 - ispin = 1 - iblock = 1 + nPab = nV(1)*nV(2) + nHab = nO(1)*nO(2) -!Spin-conserved quantities - - nPab = nV(1)*nV(2) - nHab = nO(1)*nO(2) - - nP_sc = nPab - nH_sc = nHab + nP_sc = nPab + nH_sc = nHab ! Memory allocation - allocate(Omega1sc(nP_sc),X1sc(nP_sc,nP_sc),Y1sc(nH_sc,nP_sc), & - Omega2sc(nH_sc),X2sc(nP_sc,nH_sc),Y2sc(nH_sc,nH_sc)) + allocate(Omega1sc(nP_sc),X1sc(nP_sc,nP_sc),Y1sc(nH_sc,nP_sc), & + Omega2sc(nH_sc),X2sc(nP_sc,nH_sc),Y2sc(nH_sc,nH_sc)) - call unrestricted_linear_response_pp(iblock,TDA,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb, & - nP_sc,nHaa,nHab,nHbb,nH_sc,1d0,e,ERI_aaaa, & - ERI_aabb,ERI_bbbb,Omega1sc,X1sc,Y1sc, & - Omega2sc,X2sc,Y2sc,Ec_ppURPA(ispin)) + call unrestricted_linear_response_pp(iblock,TDA,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb, & + nP_sc,nHaa,nHab,nHbb,nH_sc,1d0,e,ERI_aaaa, & + ERI_aabb,ERI_bbbb,Omega1sc,X1sc,Y1sc, & + Omega2sc,X2sc,Y2sc,Ec_ppURPA(ispin)) - call print_excitation('pp-RPA (N+2)',5,nP_sc,Omega1sc) - call print_excitation('pp-RPA (N-2)',5,nH_sc,Omega2sc) + call print_excitation('pp-RPA (N+2)',iblock,nP_sc,Omega1sc) + call print_excitation('pp-RPA (N-2)',iblock,nH_sc,Omega2sc) - endif +!alpha-alpha block -! Spin-flip manifold + ispin = 2 + iblock = 4 - if(spin_flip) then + nPaa = nV(1)*(nV(1)-1)/2 + nPbb = nV(2)*(nV(2)-1)/2 - ispin = 2 - iblock = 2 + nP_sf = nPaa -!Spin-flip quantities + nHaa = nO(1)*(nO(1)-1)/2 + nHbb = nO(2)*(nO(2)-1)/2 - nPaa = nV(1)*(nV(1)-1)/2 - nPbb = nV(2)*(nV(2)-1)/2 + nH_sf = nHaa - nP_sf = nPaa + allocate(Omega1sf(nP_sf),X1sf(nP_sf,nP_sf),Y1sf(nH_sf,nP_sf), & + Omega2sf(nH_sf),X2sf(nP_sf,nH_sf),Y2sf(nH_sf,nH_sf)) - nHaa = nO(1)*(nO(1)-1)/2 - nHbb = nO(2)*(nO(2)-1)/2 + call unrestricted_linear_response_pp(iblock,TDA,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb, & + nP_sf,nHaa,nHab,nHbb,nH_sf,1d0,e,ERI_aaaa, & + ERI_aabb,ERI_bbbb,Omega1sf,X1sf,Y1sf, & + Omega2sf,X2sf,Y2sf,Ec_ppURPA(ispin)) - nH_sf = nHaa + call print_excitation('pp-RPA (N+2)',iblock,nP_sf,Omega1sf) + call print_excitation('pp-RPA (N-2)',iblock,nH_sf,Omega2sf) - allocate(Omega1sf(nP_sf),X1sf(nP_sf,nP_sf),Y1sf(nH_sf,nP_sf), & - Omega2sf(nH_sf),X2sf(nP_sf,nH_sf),Y2sf(nH_sf,nH_sf)) + deallocate(Omega1sf,X1sf,Y1sf,Omega2sf,X2sf,Y2sf) - call unrestricted_linear_response_pp(iblock,TDA,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb, & - nP_sf,nHaa,nHab,nHbb,nH_sf,1d0,e,ERI_aaaa, & - ERI_aabb,ERI_bbbb,Omega1sf,X1sf,Y1sf, & - Omega2sf,X2sf,Y2sf,Ec_ppURPA(ispin)) +!beta-beta block - deallocate(Omega1sf,X1sf,Y1sf,Omega2sf,X2sf,Y2sf) + iblock = 7 - iblock = 3 + nP_sf = nPbb + nH_sf = nHbb - nP_sf = nPbb - nH_sf = nHbb + allocate(Omega1sf(nP_sf),X1sf(nP_sf,nP_sf),Y1sf(nH_sf,nP_sf), & + Omega2sf(nH_sf),X2sf(nP_sf,nH_sf),Y2sf(nH_sf,nH_sf)) - allocate(Omega1sf(nP_sf),X1sf(nP_sf,nP_sf),Y1sf(nH_sf,nP_sf), & - Omega2sf(nH_sf),X2sf(nP_sf,nH_sf),Y2sf(nH_sf,nH_sf)) + call unrestricted_linear_response_pp(iblock,TDA,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb,& + nP_sf,nHaa,nHab,nHbb,nH_sf,1d0,e,ERI_aaaa,& + ERI_aabb,ERI_bbbb,Omega1sf,X1sf,Y1sf,& + Omega2sf,X2sf,Y2sf,Ec_ppURPA(ispin)) - call unrestricted_linear_response_pp(iblock,TDA,nBas,nC,nO,nV,nR,nPaa,nPab,nPbb,& - nP_sf,nHaa,nHab,nHbb,nH_sf,1d0,e,ERI_aaaa,& - ERI_aabb,ERI_bbbb,Omega1sf,X1sf,Y1sf,& - Omega2sf,X2sf,Y2sf,Ec_ppURPA(ispin)) - - call print_excitation('pp-RPA (N+2)',6,nP_sf,Omega1sf) - call print_excitation('pp-RPA (N-2)',6,nH_sf,Omega2sf) - - endif + call print_excitation('pp-RPA (N+2)',iblock,nP_sf,Omega1sf) + call print_excitation('pp-RPA (N-2)',iblock,nH_sf,Omega2sf) write(*,*) write(*,*)'-------------------------------------------------------------------------------' @@ -159,5 +152,4 @@ subroutine ppURPA(TDA,doACFDT,spin_conserved,spin_flip,nBas,nC,nO,nV,nR,ENuc,EUH ! end if - end subroutine ppURPA