Skip to content

Commit 1380207

Browse files
author
lburth
committed
Add transistion vectors in unrestricted MOM rpas
1 parent aaaadf5 commit 1380207

File tree

6 files changed

+227
-137
lines changed

6 files changed

+227
-137
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
subroutine CVS_phULR_oscillator_strength(nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,nCVS,nFC,maxS,occupations,virtuals,dipole_int_aa,dipole_int_bb,Omega,XpY,XmY,os)
2+
3+
! Compute linear response
4+
5+
implicit none
6+
include 'parameters.h'
7+
8+
! Input variables
9+
10+
11+
integer,intent(in) :: nBas
12+
integer,intent(in) :: nC(nspin)
13+
integer,intent(in) :: nO(nspin)
14+
integer,intent(in) :: nV(nspin)
15+
integer,intent(in) :: nR(nspin)
16+
integer,intent(in) :: nS(nspin)
17+
integer,intent(in) :: nSa
18+
integer,intent(in) :: nSb
19+
integer,intent(in) :: nSt
20+
integer,intent(in) :: maxS
21+
integer,intent(in) :: nCVS(nspin),nFC(nspin)
22+
integer,intent(in) :: occupations(maxval(nO),nspin)
23+
integer,intent(in) :: virtuals(nBas - minval(nO),nspin)
24+
double precision :: dipole_int_aa(nBas,nBas,ncart)
25+
double precision :: dipole_int_bb(nBas,nBas,ncart)
26+
double precision,intent(in) :: Omega(nSt)
27+
double precision,intent(in) :: XpY(nSt,nSt)
28+
double precision,intent(in) :: XmY(nSt,nSt)
29+
30+
! Local variables
31+
32+
integer :: ia,jb,i,j,a,b
33+
integer :: ixyz
34+
35+
double precision,allocatable :: f(:,:)
36+
37+
! Output variables
38+
39+
double precision :: os(maxS)
40+
41+
! Memory allocation
42+
43+
allocate(f(maxS,ncart))
44+
45+
! Initialization
46+
47+
f(:,:) = 0d0
48+
49+
! Compute dipole moments and oscillator strengths
50+
51+
do ia=1,maxS
52+
do ixyz=1,ncart
53+
54+
jb = 0
55+
do j=1,nO(1) - nFC(1)
56+
do b=nCVS(1) +1,nBas-nO(1)
57+
jb = jb + 1
58+
f(ia,ixyz) = f(ia,ixyz) + dipole_int_aa(occupations(j,1),virtuals(b,1),ixyz)*XpY(ia,jb)
59+
end do
60+
end do
61+
62+
jb = 0
63+
do j=1,nO(2) - nFC(2)
64+
do b=nCVS(2)+1,nBas-nO(2)
65+
jb = jb + 1
66+
f(ia,ixyz) = f(ia,ixyz) + dipole_int_bb(occupations(j,2),virtuals(b,2),ixyz)*XpY(ia,nSa+jb)
67+
end do
68+
end do
69+
70+
end do
71+
end do
72+
73+
do ia=1,maxS
74+
os(ia) = 2d0/3d0*Omega(ia)*sum(f(ia,:)**2)
75+
end do
76+
77+
write(*,*) '---------------------------------------------------------------'
78+
write(*,*) ' Transition dipole moment (au) '
79+
write(*,*) '---------------------------------------------------------------'
80+
write(*,'(A3,5A12)') '#','X','Y','Z','dip. str.','osc. str.'
81+
write(*,*) '---------------------------------------------------------------'
82+
do ia=1,maxS
83+
write(*,'(I3,5F12.6)') ia,(f(ia,ixyz),ixyz=1,ncart),sum(f(ia,:)**2),os(ia)
84+
end do
85+
write(*,*) '---------------------------------------------------------------'
86+
write(*,*)
87+
88+
end subroutine
Lines changed: 129 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
subroutine CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,&
2-
nCVS,occupations,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
2+
nCVS,nFC,occupations,virtuals,dipole_int_aa,dipole_int_bb,c,S,Om,XpY,XmY)
33

44
! Print transition vectors for linear response calculation
55

@@ -19,6 +19,7 @@ subroutine CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,&
1919
integer,intent(in) :: nSb
2020
integer,intent(in) :: nSt
2121
integer,intent(in) :: nCVS(nspin)
22+
integer,intent(in) :: nFC(nspin)
2223
integer,intent(in) :: occupations(maxval(nO),nspin)
2324
integer,intent(in) :: virtuals(nBas - minval(nO),nspin)
2425
double precision :: dipole_int_aa(nBas,nBas,ncart)
@@ -32,142 +33,141 @@ subroutine CVS_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,&
3233
! Local variables
3334

3435
integer :: ia,jb,j,b
35-
integer :: maxS = 30
36+
integer :: maxS = 10
3637
double precision,parameter :: thres_vec = 0.1d0
3738
double precision,allocatable :: X(:)
3839
double precision,allocatable :: Y(:)
3940
double precision,allocatable :: os(:)
4041
double precision,allocatable :: S2(:)
4142

4243
! Memory allocation
43-
print *, "Transistion vectors not yet implemented for CVS !"
44-
! maxS = min(nSt,maxS)
45-
! allocate(X(nSt),Y(nSt),os(maxS),S2(maxS))
46-
!
47-
!! Compute oscillator strengths
48-
!
49-
! os(:) = 0d0
50-
! if(ispin == 1) call phULR_oscillator_strength(nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,maxS, &
51-
! dipole_int_aa,dipole_int_bb,Om,XpY,XmY,os)
52-
!
44+
maxS = min(nSt,maxS)
45+
allocate(X(nSt),Y(nSt),os(maxS),S2(maxS))
46+
47+
! Compute oscillator strengths
48+
49+
os(:) = 0d0
50+
if(ispin == 1) call CVS_phULR_oscillator_strength(nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,nCVS,nFC,maxS, &
51+
occupations,virtuals,dipole_int_aa,dipole_int_bb,Om,XpY,XmY,os)
52+
5353
!! Compute <S**2>
5454
!
5555
! call S2_expval(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nSt,maxS,c,S,Om,XpY,XmY,S2)
56-
!
57-
!! Print details about spin-conserved excitations
58-
!
59-
! if(ispin == 1) then
60-
!
61-
! do ia=1,maxS
62-
!
63-
! X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
64-
! Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
65-
!
66-
! print*,'-------------------------------------------------------------'
67-
! write(*,'(A15,I3,A2,F10.6,A3,A6,F6.4,A11,F6.4)') &
68-
! ' Excitation n. ',ia,': ',Om(ia)*HaToeV,' eV',' f = ',os(ia),' <S**2> = ',S2(ia)
69-
! print*,'-------------------------------------------------------------'
70-
!
71-
! ! Spin-up transitions
72-
!
73-
! jb = 0
74-
! do j=nC(1)+1,nO(1)
75-
! do b=nO(1)+1,nBas-nR(1)
76-
! jb = jb + 1
77-
! if(abs(X(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'A -> ',b,'A = ',X(jb)
78-
! end do
79-
! end do
80-
!
81-
! jb = 0
82-
! do j=nC(1)+1,nO(1)
83-
! do b=nO(1)+1,nBas-nR(1)
84-
! jb = jb + 1
85-
! if(abs(Y(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'A <- ',b,'A = ',Y(jb)
86-
! end do
87-
! end do
88-
!
89-
! ! Spin-down transitions
90-
!
91-
! jb = 0
92-
! do j=nC(2)+1,nO(2)
93-
! do b=nO(2)+1,nBas-nR(2)
94-
! jb = jb + 1
95-
! if(abs(X(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'B -> ',b,'B = ',X(nSa+jb)
96-
! end do
97-
! end do
98-
!
99-
! jb = 0
100-
! do j=nC(2)+1,nO(2)
101-
! do b=nO(2)+1,nBas-nR(2)
102-
! jb = jb + 1
103-
! if(abs(Y(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'B <- ',b,'B = ',Y(nSa+jb)
104-
! end do
105-
! end do
106-
! write(*,*)
107-
!
108-
! end do
109-
!
110-
! end if
111-
!
112-
!! Print details about spin-flip excitations
113-
!
114-
! if(ispin == 2) then
115-
!
116-
! do ia=1,maxS
117-
!
118-
! X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
119-
! Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
120-
!
121-
!
122-
! print*,'-------------------------------------------------------------'
123-
! write(*,'(A15,I3,A2,F10.6,A3,A6,F6.4,A11,F6.4)') &
124-
! ' Excitation n. ',ia,': ',Om(ia)*HaToeV,' eV',' f = ',os(ia),' <S**2> = ',S2(ia)
125-
! print*,'-------------------------------------------------------------'
126-
!
127-
! ! Spin-up transitions
128-
!
129-
! jb = 0
130-
! do j=nC(1)+1,nO(1)
131-
! do b=nO(2)+1,nBas-nR(2)
132-
! jb = jb + 1
133-
! if(abs(X(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'A -> ',b,'B = ',X(jb)
134-
! end do
135-
! end do
136-
!
137-
! jb = 0
138-
! do j=nC(1)+1,nO(1)
139-
! do b=nO(2)+1,nBas-nR(2)
140-
! jb = jb + 1
141-
! if(abs(Y(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'A <- ',b,'B = ',Y(jb)
142-
! end do
143-
! end do
144-
!
145-
! ! Spin-down transitions
146-
!
147-
! jb = 0
148-
! do j=nC(2)+1,nO(2)
149-
! do b=nO(1)+1,nBas-nR(1)
150-
! jb = jb + 1
151-
! if(abs(X(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'A -> ',b,'B = ',X(nSa+jb)
152-
! end do
153-
! end do
154-
!
155-
! jb = 0
156-
! do j=nC(2)+1,nO(2)
157-
! do b=nO(1)+1,nBas-nR(1)
158-
! jb = jb + 1
159-
! if(abs(Y(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') j,'A <- ',b,'B = ',Y(nSa+jb)
160-
! end do
161-
! end do
162-
! write(*,*)
163-
!
164-
! end do
165-
!
166-
! end if
167-
!
168-
!! Thomas-Reiche-Kuhn sum rule
169-
!
170-
! write(*,'(A30,F10.6)') 'Thomas-Reiche-Kuhn sum rule = ',sum(os(:))
171-
! write(*,*)
172-
!
56+
57+
! Print details about spin-conserved excitations
58+
59+
if(ispin == 1) then
60+
61+
do ia=1,maxS
62+
63+
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
64+
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
65+
66+
print*,'-------------------------------------------------------------'
67+
write(*,'(A15,I3,A2,F10.6,A3,A6,F6.4,A11,F6.4)') &
68+
' Excitation n. ',ia,': ',Om(ia)*HaToeV,' eV',' f = ',os(ia)!,' <S**2> = ',S2(ia)
69+
print*,'-------------------------------------------------------------'
70+
71+
! Spin-up transitions
72+
73+
jb = 0
74+
do j=1,nO(1)-nFC(1)
75+
do b=nCVS(1)+1,nBas-nO(1)
76+
jb = jb + 1
77+
if(abs(X(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,1),'A -> ',virtuals(b,1),'A = ',X(jb)
78+
end do
79+
end do
80+
81+
jb = 0
82+
do j=1,nO(1)-nFC(1)
83+
do b=nCVS(1)+1,nBas-nO(1)
84+
jb = jb + 1
85+
if(abs(Y(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,1),'A <- ',virtuals(b,1),'A = ',Y(jb)
86+
end do
87+
end do
88+
89+
! Spin-down transitions
90+
91+
jb = 0
92+
do j=1,nO(2) - nFC(2)
93+
do b=nCVS(2)+1,nBas-nO(2)
94+
jb = jb + 1
95+
if(abs(X(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,2),'B -> ',virtuals(b,2),'B = ',X(nSa+jb)
96+
end do
97+
end do
98+
99+
jb = 0
100+
do j=1,nO(2)-nFC(2)
101+
do b=nCVS(2)+1,nBas-nO(2)
102+
jb = jb + 1
103+
if(abs(Y(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,2),'B <- ',virtuals(b,2),'B = ',Y(nSa+jb)
104+
end do
105+
end do
106+
write(*,*)
107+
108+
end do
109+
110+
end if
111+
112+
! Print details about spin-flip excitations
113+
114+
if(ispin == 2) then
115+
116+
do ia=1,maxS
117+
118+
X(:) = 0.5d0*(XpY(ia,:) + XmY(ia,:))
119+
Y(:) = 0.5d0*(XpY(ia,:) - XmY(ia,:))
120+
121+
122+
print*,'-------------------------------------------------------------'
123+
write(*,'(A15,I3,A2,F10.6,A3,A6,F6.4,A11,F6.4)') &
124+
' Excitation n. ',ia,': ',Om(ia)*HaToeV,' eV',' f = ',os(ia)!,' <S**2> = ',S2(ia)
125+
print*,'-------------------------------------------------------------'
126+
127+
! Spin-up transitions
128+
129+
jb = 0
130+
do j=1,nO(1)-nFC(1)
131+
do b=nCVS(2)+1,nBas-nO(2)
132+
jb = jb + 1
133+
if(abs(X(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,1),'A -> ',virtuals(b,2),'B = ',X(jb)
134+
end do
135+
end do
136+
137+
jb = 0
138+
do j=1,nO(1)-nFC(1)
139+
do b=nCVS(2)+1,nBas-nO(2)
140+
jb = jb + 1
141+
if(abs(Y(jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,1),'A <- ',virtuals(b,2),'B = ',Y(jb)
142+
end do
143+
end do
144+
145+
! Spin-down transitions
146+
147+
jb = 0
148+
do j=1,nO(2)-nFC(2)
149+
do b=nCVS(1)+1,nBas-nO(1)
150+
jb = jb + 1
151+
if(abs(X(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,2),'A -> ',virtuals(b,1),'B = ',X(nSa+jb)
152+
end do
153+
end do
154+
155+
jb = 0
156+
do j=1,nO(2)-nFC(2)
157+
do b=nCVS(1)+1,nBas-nO(1)
158+
jb = jb + 1
159+
if(abs(Y(nSa+jb)) > thres_vec) write(*,'(I3,A5,I3,A4,F10.6)') occupations(j,2),'A <- ',virtuals(b,1),'B = ',Y(nSa+jb)
160+
end do
161+
end do
162+
write(*,*)
163+
164+
end do
165+
166+
end if
167+
168+
! Thomas-Reiche-Kuhn sum rule
169+
170+
write(*,'(A30,F10.6)') 'Thomas-Reiche-Kuhn sum rule = ',sum(os(:))
171+
write(*,*)
172+
173173
end subroutine

src/LR/complex_phLR_transition_vectors.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ subroutine complex_phLR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,&
2626
! Local variables
2727

2828
integer :: ia,jb,j,b
29-
integer :: maxS = 30
29+
integer :: maxS = 10
3030
double precision,parameter :: thres_vec = 0.1d0
3131
complex*16,allocatable :: X(:)
3232
complex*16,allocatable :: Y(:)

src/LR/complex_phULR_transition_vectors.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ subroutine complex_phULR_transition_vectors(ispin,nBas,nC,nO,nV,nR,nS,nSa,nSb,nS
3333
! Local variables
3434

3535
integer :: ia,jb,j,b
36-
integer :: maxS = 30
36+
integer :: maxS = 10
3737
double precision,parameter :: thres_vec = 0.1d0
3838
complex*16,allocatable :: X(:)
3939
complex*16,allocatable :: Y(:)

0 commit comments

Comments
 (0)