Skip to content

Commit 0c012dc

Browse files
author
lburth
committed
transition vectors for restricted rpa on mom
1 parent f066573 commit 0c012dc

File tree

7 files changed

+139
-64
lines changed

7 files changed

+139
-64
lines changed

src/HF/MOM_RHF.f90

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ subroutine MOM_RHF(dotest,doaordm,maxSCF,thresh,max_diis,guess_type,level_shift,
243243

244244
end if
245245

246+
call dipole_moment(nBas,P,nNuc,ZNuc,rNuc,dipole_int,dipole)
246247
call print_MOM_RHF(nBas,nOrb,nO,eHF,c,ENuc,ET,EV,EJ,EK,ERHF,dipole,occupations)
247248

248249
! Print the 1-RDM and 2-RDM in AO basis
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
subroutine CVS_phLR_oscillator_strength(nOrb,nC,nO,nV,nR,nS,nCVS,nFC,maxS,occupations,virtuals,dipole_int,Om,XpY,XmY,os)
2+
3+
! Compute oscillator strength from a ph linear response calculation
4+
5+
implicit none
6+
include 'parameters.h'
7+
8+
! Input variables
9+
10+
integer,intent(in) :: nOrb
11+
integer,intent(in) :: nC
12+
integer,intent(in) :: nO
13+
integer,intent(in) :: nV
14+
integer,intent(in) :: nR
15+
integer,intent(in) :: nS
16+
integer,intent(in) :: nCVS,nFC
17+
integer,intent(in) :: occupations(nO-nFC),virtuals(nOrb-nO)
18+
integer,intent(in) :: maxS
19+
double precision :: dipole_int(nOrb,nOrb,ncart)
20+
double precision,intent(in) :: Om(nS)
21+
double precision,intent(in) :: XpY(nS,nS)
22+
double precision,intent(in) :: XmY(nS,nS)
23+
24+
! Local variables
25+
26+
integer :: m,jb,i,j,a,b
27+
integer :: ixyz
28+
29+
double precision,allocatable :: f(:,:)
30+
31+
! Output variables
32+
33+
double precision,intent(out) :: os(nS)
34+
35+
! Memory allocation
36+
37+
allocate(f(maxS,ncart))
38+
39+
! Initialization
40+
41+
f(:,:) = 0d0
42+
43+
! Compute dipole moments and oscillator strengths
44+
45+
do m=1,maxS
46+
do ixyz=1,ncart
47+
jb = 0
48+
do j=1,nO-nFC
49+
do b=nCVS+1,nOrb-nO
50+
jb = jb + 1
51+
f(m,ixyz) = f(m,ixyz) + dipole_int(occupations(j),virtuals(b),ixyz)*XpY(m,jb)
52+
end do
53+
end do
54+
end do
55+
end do
56+
f(:,:) = sqrt(2d0)*f(:,:)
57+
58+
do m=1,maxS
59+
os(m) = 2d0/3d0*Om(m)*sum(f(m,:)**2)
60+
end do
61+
62+
write(*,*) '---------------------------------------------------------------'
63+
write(*,*) ' Transition dipole moment (au) '
64+
write(*,*) '---------------------------------------------------------------'
65+
write(*,'(A3,5A12)') '#','X','Y','Z','dip. str.','osc. str.'
66+
write(*,*) '---------------------------------------------------------------'
67+
do m=1,maxS
68+
write(*,'(I3,5F12.6)') m,(f(m,ixyz),ixyz=1,ncart),sum(f(m,:)**2),os(m)
69+
end do
70+
write(*,*) '---------------------------------------------------------------'
71+
write(*,*)
72+
73+
end subroutine
Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
subroutine CVS_phLR_transition_vectors(spin_allowed,nOrb,nC,nO,nV,nR,nS,dipole_int,Om,XpY,XmY)
1+
subroutine CVS_phLR_transition_vectors(spin_allowed,nOrb,nC,nO,nV,nR,nS,nCVS,nFC,occupations,virtuals,dipole_int,Om,XpY,XmY)
22

33
! Print transition vectors for linear response calculation
44

@@ -14,6 +14,8 @@ subroutine CVS_phLR_transition_vectors(spin_allowed,nOrb,nC,nO,nV,nR,nS,dipole_i
1414
integer,intent(in) :: nV
1515
integer,intent(in) :: nR
1616
integer,intent(in) :: nS
17+
integer,intent(in) :: nCVS,nFC
18+
integer,intent(in) :: occupations(nO-nFC),virtuals(nOrb-nO)
1719
double precision :: dipole_int(nOrb,nOrb,ncart)
1820
double precision,intent(in) :: Om(nS)
1921
double precision,intent(in) :: XpY(nS,nS)
@@ -22,66 +24,65 @@ subroutine CVS_phLR_transition_vectors(spin_allowed,nOrb,nC,nO,nV,nR,nS,dipole_i
2224
! Local variables
2325

2426
integer :: ia,jb,j,b
25-
integer :: maxS = 30
27+
integer :: maxS = 10
2628
double precision :: S2
2729
double precision,parameter :: thres_vec = 0.1d0
2830
double precision,allocatable :: X(:)
2931
double precision,allocatable :: Y(:)
3032
double precision,allocatable :: os(:)
3133

32-
print *, "Transistion vectors for this method not implemented yet, sry..."
33-
!! Memory allocation
34-
!
35-
! maxS = min(nS,maxS)
36-
! allocate(X(nS),Y(nS),os(maxS))
37-
!
38-
!! Compute oscillator strengths
39-
!
40-
! os(:) = 0d0
41-
! if(spin_allowed) call phLR_oscillator_strength(nOrb,nC,nO,nV,nR,nS,maxS,dipole_int,Om,XpY,XmY,os)
42-
!
43-
!! Print details about excitations
44-
!
45-
! do ia=1,maxS
46-
!
47-
! X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
48-
! Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
49-
!
50-
! ! <S**2> values
51-
!
52-
! if(spin_allowed) then
53-
! S2 = 0d0
54-
! else
55-
! S2 = 2d0
56-
! end if
57-
!
58-
! print*,'-------------------------------------------------------------'
59-
! write(*,'(A15,I3,A2,F10.6,A3,A6,F6.4,A11,F6.4)') &
60-
! ' Excitation n. ',ia,': ',Om(ia)*HaToeV,' eV',' f = ',os(ia),' <S**2> = ',S2
61-
! print*,'-------------------------------------------------------------'
62-
!
63-
! jb = 0
64-
! do j=nC+1,nO
65-
! do b=nO+1,nOrb-nR
66-
! jb = jb + 1
67-
! if(abs(X(jb)) > thres_vec) write(*,'(I3,A4,I3,A3,F10.6)') j,' -> ',b,' = ',X(jb)/sqrt(2d0)
68-
! end do
69-
! end do
70-
!
71-
! jb = 0
72-
! do j=nC+1,nO
73-
! do b=nO+1,nOrb-nR
74-
! jb = jb + 1
75-
! if(abs(Y(jb)) > thres_vec) write(*,'(I3,A4,I3,A3,F10.6)') j,' <- ',b,' = ',Y(jb)/sqrt(2d0)
76-
! end do
77-
! end do
78-
! write(*,*)
79-
!
80-
! end do
81-
!
82-
!! Thomas-Reiche-Kuhn sum rule
83-
!
84-
! write(*,'(A30,F10.6)') 'Thomas-Reiche-Kuhn sum rule = ',sum(os(:))
85-
! write(*,*)
34+
! Memory allocation
35+
36+
maxS = min(nS,maxS)
37+
allocate(X(nS),Y(nS),os(maxS))
38+
39+
! Compute oscillator strengths
40+
41+
os(:) = 0d0
42+
if(spin_allowed) call CVS_phLR_oscillator_strength(nOrb,nC,nO,nV,nR,nS,nCVS,nFC,maxS,occupations,virtuals,dipole_int,Om,XpY,XmY,os)
43+
44+
! Print details about excitations
45+
46+
do ia=1,maxS
47+
48+
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
49+
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
50+
51+
! <S**2> values
52+
53+
if(spin_allowed) then
54+
S2 = 0d0
55+
else
56+
S2 = 2d0
57+
end if
58+
59+
print*,'-------------------------------------------------------------'
60+
write(*,'(A15,I3,A2,F10.6,A3,A6,F6.4,A11,F6.4)') &
61+
' Excitation n. ',ia,': ',Om(ia)*HaToeV,' eV',' f = ',os(ia),' <S**2> = ',S2
62+
print*,'-------------------------------------------------------------'
63+
64+
jb = 0
65+
do j=1,nO-nFC
66+
do b=nCVS+1,nOrb-nO
67+
jb = jb + 1
68+
if(abs(X(jb)) > thres_vec) write(*,'(I3,A4,I3,A3,F10.6)') occupations(j),' -> ',virtuals(b),' = ',X(jb)/sqrt(2d0)
69+
end do
70+
end do
71+
72+
jb = 0
73+
do j=1,nO-nFC
74+
do b=nCVS+1,nOrb-nO
75+
jb = jb + 1
76+
if(abs(Y(jb)) > thres_vec) write(*,'(I3,A4,I3,A3,F10.6)') occupations(j),' <- ',virtuals(b),' = ',Y(jb)/sqrt(2d0)
77+
end do
78+
end do
79+
write(*,*)
80+
81+
end do
82+
83+
! Thomas-Reiche-Kuhn sum rule
84+
85+
write(*,'(A30,F10.6)') 'Thomas-Reiche-Kuhn sum rule = ',sum(os(:))
86+
write(*,*)
8687

8788
end subroutine

src/RPA/CVS_phRRPA.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ subroutine CVS_phRRPA(dotest,TDA,doACFDT,exchange_kernel,singlet,triplet,nBas,nC
121121

122122
call CVS_phRLR(TDA,nSCVS,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
123123
call print_excitation_energies('phRPA@RHF','singlet',nSCVS,Om)
124-
call CVS_phLR_transition_vectors(.true.,nBas,nC,nO,nV,nR,nSCVS,dipole_int,Om,XpY,XmY)
124+
call CVS_phLR_transition_vectors(.true.,nBas,nC,nO,nV,nR,nSCVS,nCVS,nFC,occupations_fc,virtuals,dipole_int,Om,XpY,XmY)
125125

126126
end if
127127

@@ -136,7 +136,7 @@ subroutine CVS_phRRPA(dotest,TDA,doACFDT,exchange_kernel,singlet,triplet,nBas,nC
136136

137137
call CVS_phRLR(TDA,nSCVS,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
138138
call print_excitation_energies('phRPA@RHF','triplet',nSCVS,Om)
139-
call CVS_phLR_transition_vectors(.false.,nBas,nC,nO,nV,nR,nSCVS,dipole_int,Om,XpY,XmY)
139+
call CVS_phLR_transition_vectors(.false.,nBas,nC,nO,nV,nR,nSCVS,nCVS,nFC,occupations_fc,virtuals,dipole_int,Om,XpY,XmY)
140140

141141
end if
142142

src/RPA/CVS_phRRPAx.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ subroutine CVS_phRRPAx(dotest,TDA,doACFDT,exchange_kernel,singlet,triplet,nBas,n
121121

122122
call CVS_phRLR(TDA,nSCVS,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
123123
call print_excitation_energies('phRPAx@RHF','singlet',nSCVS,Om)
124-
call CVS_phLR_transition_vectors(.true.,nBas,nC,nO,nV,nR,nSCVS,dipole_int,Om,XpY,XmY)
124+
call CVS_phLR_transition_vectors(.true.,nBas,nC,nO,nV,nR,nSCVS,nCVS,nFC,occupations_fc,virtuals,dipole_int,Om,XpY,XmY)
125125

126126
end if
127127

@@ -136,7 +136,7 @@ subroutine CVS_phRRPAx(dotest,TDA,doACFDT,exchange_kernel,singlet,triplet,nBas,n
136136

137137
call CVS_phRLR(TDA,nSCVS,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
138138
call print_excitation_energies('phRPAx@RHF','triplet',nSCVS,Om)
139-
call CVS_phLR_transition_vectors(.false.,nBas,nC,nO,nV,nR,nSCVS,dipole_int,Om,XpY,XmY)
139+
call CVS_phLR_transition_vectors(.false.,nBas,nC,nO,nV,nR,nSCVS,nCVS,nFC,occupations_fc,virtuals,dipole_int,Om,XpY,XmY)
140140

141141
end if
142142

src/RPA/CVS_phURPA.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ subroutine CVS_phURPA(dotest,TDA,doACFDT,exchange_kernel,spin_conserved,spin_fli
140140
call CVS_phULR(TDA,nSa,nSb,nSt,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
141141
call print_excitation_energies('phRPA@UHF','spin-conserved',nSt,Om)
142142
call CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,nCVS,nFC, &
143-
occupations,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
143+
occupations_fc,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
144144

145145
deallocate(Aph,Bph,Om,XpY,XmY)
146146

@@ -168,7 +168,7 @@ subroutine CVS_phURPA(dotest,TDA,doACFDT,exchange_kernel,spin_conserved,spin_fli
168168
call CVS_phULR(TDA,nSa,nSa,nSt,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
169169
call print_excitation_energies('phRPA@UHF','spin-flip',nSt,Om)
170170
call CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,nCVS,nFC, &
171-
occupations,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
171+
occupations_fc,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
172172

173173
deallocate(Aph,Bph,Om,XpY,XmY)
174174

src/RPA/CVS_phURPAx.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ subroutine CVS_phURPAx(dotest,TDA,doACFDT,exchange_kernel,spin_conserved,spin_fl
140140
call CVS_phULR(TDA,nSa,nSb,nSt,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
141141
call print_excitation_energies('phRPAx@UHF','spin-conserved',nSt,Om)
142142
call CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,nCVS,nFC, &
143-
occupations,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
143+
occupations_fc,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
144144

145145
deallocate(Aph,Bph,Om,XpY,XmY)
146146

@@ -168,7 +168,7 @@ subroutine CVS_phURPAx(dotest,TDA,doACFDT,exchange_kernel,spin_conserved,spin_fl
168168
call CVS_phULR(TDA,nSa,nSb,nSt,Aph,Bph,EcRPA(ispin),Om,XpY,XmY)
169169
call print_excitation_energies('phRPAx@UHF','spin-flip',nSt,Om)
170170
call CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,nCVS,nFC, &
171-
occupations,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
171+
occupations_fc,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
172172

173173
deallocate(Aph,Bph,Om,XpY,XmY)
174174

0 commit comments

Comments
 (0)