-
Notifications
You must be signed in to change notification settings - Fork 1
/
ci_blocks_pol.f90
203 lines (158 loc) · 5.49 KB
/
ci_blocks_pol.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
module ci_blocks_pol
use globals
use misc
use mat_element_pol
implicit none
contains
! the following functions needed to construct the CI matrix
!
! main blocks:
! function main_1h1p (a) result(mat)
! function main_2h2p (a, b, csf_type, nrow, ncol) result (mat)
!
! coupling blocks:
! function coupling_1h1p_2h2p (a, b, csf_type, nrow, ncol) result (mat)
! function coupling_2h2p_2h2p (a, b, csf_type_1, csf_type_2, nrow) result (mat)
!
! =================
! MAIN BLOCKS
! =================
! -----------------
! 1h1p
! -----------------
function main_1h1p (a) result(mat)
integer :: i, j, a
integer :: ov1, ov2
double precision, dimension(n_ov, n_ov) :: mat
do i = 1, n_ov
ov1 = i + h_f_min-1
do j = 1, n_ov
ov2 = j + h_f_min-1
mat(i, j) = mat_el_1h1p (ov1, a, ov2, a)
end do
end do
end function main_1h1p
! -----------------
! 2h2p
! -----------------
function main_2h2p (a, b, csf_type, nrow, ncol) result (mat)
integer :: i, j, k, l
integer :: a, b
integer :: ov1, ov2, ov3, ov4, nrow, ncol
integer :: csf_type
double precision, dimension(nrow, ncol) :: mat
if (csf_type == 1) then
do i = 1, n_ov
ov1 = i + h_f_min-1
! print*,mat_el_test(ov1, a, b)
! print*,emo(ov1),emo(a),emo(b)
do j = 1, n_ov
ov2 = j + h_f_min-1
mat(i, j) = mat_el_2h2p_11 (ov1, a, b, ov2, a, b)
end do
end do
else if (csf_type == 2) then
do i = 1, n_config
ov1 = config_2h (i, 1)
ov2 = config_2h (i, 2)
! print*,ov1,ov2,a,b,mat_el_2h2p_a_test(ov1,ov2,a,b)
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_2h2p_AA (ov1, ov2, a, b, ov3, ov4, a)
end do
end do
else if (csf_type == 3) then
do i = 1, n_config
ov1 = config_2h (i, 1)
ov2 = config_2h (i, 2)
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_2h2p_BB (ov1, ov2, a, b, ov3, ov4, a)
end do
end do
end if
end function main_2h2p
! =================
! COUPLING BLOCKS
! =================
! -----------------
! 1h1p / 2h2p
! -----------------
function coupling_1h1p_2h2p (a, b, csf_type, nrow, ncol) result (mat)
integer :: i, j, k
integer :: a, b
integer :: ov1, ov2, ov3, ov4, nrow, ncol
integer :: csf_type
double precision, dimension(nrow, ncol) :: mat
if (csf_type == 1) then
do i = 1, n_ov
ov1 = i + h_f_min - 1
do j = 1, n_ov
ov2 = j + h_f_min - 1
mat(i, j) = mat_el_1h1p_2h2p_1 (ov1, b, ov2, a, b)
end do
end do
else if (csf_type == 2) then
do i = 1, n_ov
ov1 = i + h_f_min - 1
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_1h1p_2h2p_A (ov1, b, ov3, ov4, a, b)
end do
end do
else if (csf_type == 3) then
do i = 1, n_ov
ov1 = i + h_f_min - 1
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_1h1p_2h2p_B (ov1, b, ov3, ov4, a, b)
end do
end do
end if
end function coupling_1h1p_2h2p
! -----------------
! 2h2p / 2h2p
! -----------------
function coupling_2h2p_2h2p (a, b, csf_type_1, csf_type_2, nrow) result (mat)
integer :: i, j
integer :: a, b
integer :: ov1, ov2, ov3, ov4, nrow
integer :: csf_type_1, csf_type_2
double precision, dimension (nrow, nrow) :: mat
if (csf_type_1 == 1) then
if (csf_type_2 == 2) then
do i = 1, n_ov
ov1 = h_f_min + i - 1
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_2h2p_1A(ov1, a, b, ov3, ov4, a)
end do
end do
else if (csf_type_2 == 3) then
do i = 1, n_ov
ov1 = h_f_min + i - 1
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_2h2p_1B(ov1, a, b, ov3, ov4, a)
end do
end do
end if
else if (csf_type_1 == 2) then
do i = 1, n_config
ov1 = config_2h(i, 1)
ov2 = config_2h(i, 2)
do j = 1, n_config
ov3 = config_2h(j, 1)
ov4 = config_2h(j, 2)
mat(i, j) = mat_el_2h2p_AB(ov1, ov2, a, b, ov3, ov4, a)
end do
end do
end if
end function coupling_2h2p_2h2p
end module ci_blocks_pol