1
#include <libdpd/dpd.h>
3
#include <libciomr/libciomr.h>
8
void rhf_Zvector(void);
9
void uhf_Zvector(void);
10
void rhf_sf_Zvector(void);
11
void uhf_sf_Zvector(void);
16
if(params.ref == 0) rhf_sf_Zvector();
17
else if(params.ref == 2) uhf_sf_Zvector();
20
if(params.ref == 0) rhf_Zvector();
21
else if(params.ref == 2) uhf_Zvector();
25
void rhf_Zvector(void)
32
int a, i, num_ai, count;
37
dpd_file2_init(&L, CC_OEI, 0, 1, 0, "LAI");
38
dpd_file2_print(&L,outfile);
39
dpd_file2_mat_init(&L);
42
for(h=0; h < nirreps; h++)
43
num_ai += L.params->rowtot[h]*L.params->coltot[h];
45
Z = block_matrix(1,num_ai);
46
for(h=0,count=0; h < nirreps; h++)
47
for(a=0; a < L.params->rowtot[h]; a++)
48
for(i=0; i < L.params->coltot[h]; i++)
49
Z[0][count++] = -L.matrix[h][a][i];
51
dpd_file2_mat_close(&L);
54
dpd_buf4_init(&A, CC_MISC, 0, 11, 11, 11, 11, 0, "A(AI,BJ)");
55
dpd_buf4_mat_irrep_init(&A, 0);
56
dpd_buf4_mat_irrep_rd(&A, 0);
58
pople(A.matrix[0], Z[0], num_ai, 1, 1e-12, outfile, 0);
60
dpd_buf4_mat_irrep_close(&A, 0);
63
dpd_file2_init(&D, CC_OEI, 0, 1, 0, "DAI");
64
dpd_file2_mat_init(&D);
65
for(h=0,count=0; h < nirreps; h++)
66
for(a=0; a < D.params->rowtot[h]; a++)
67
for(i=0; i < D.params->coltot[h]; i++)
68
D.matrix[h][a][i] = Z[0][count++];
70
dpd_file2_mat_wrt(&D);
71
dpd_file2_mat_close(&D);
77
void uhf_Zvector(void)
82
void rhf_sf_Zvector(void)
87
int num_ai, h, nirreps, a, i, count;
91
/* Place all the elements of the orbital rotation gradient, X into a
93
dpd_file2_init(&X1, CC_MISC, 0, 1, 0, "X(A,I)");
94
dpd_file2_mat_init(&X1);
95
dpd_file2_mat_rd(&X1);
97
for(h=0; h < nirreps; h++)
98
num_ai += X1.params->rowtot[h]*X1.params->coltot[h];
100
Z = block_matrix(1,num_ai);
101
for(h=0,count=0; h < nirreps; h++)
102
for(a=0; a < X1.params->rowtot[h]; a++)
103
for(i=0; i < X1.params->coltot[h]; i++)
104
Z[0][count++] = -X1.matrix[h][a][i];
106
dpd_file2_mat_close(&X1);
107
dpd_file2_close(&X1);
109
/* Now, grab only irrep 0 of the orbital Hessian */
110
dpd_buf4_init(&A, CC_MISC, 0, 11, 11, 11, 11, 0, "A(EM,AI)");
111
dpd_buf4_mat_irrep_init(&A, 0);
112
dpd_buf4_mat_irrep_rd(&A, 0);
114
/* Trying out Matt's Pople code --- way to go, Matt! */
115
pople(A.matrix[0], Z[0], num_ai, 1, 1e-12, outfile, 0);
117
dpd_buf4_mat_irrep_close(&A, 0);
120
/* Build the orbital component of Dai --- we'll build these as separate
121
spin cases for future simplicity (e.g., UHF-based codes)*/
123
dpd_file2_init(&D, CC_OEI, 0, 1, 0, "D(orb)(A,I)");
124
dpd_file2_mat_init(&D);
125
for(h=0,count=0; h < nirreps; h++)
126
for(a=0; a < D.params->rowtot[h]; a++)
127
for(i=0; i < D.params->coltot[h]; i++)
128
D.matrix[h][a][i] = Z[0][count++];
129
dpd_file2_mat_wrt(&D);
130
dpd_file2_mat_close(&D);
133
dpd_file2_init(&D, CC_OEI, 0, 1, 0, "D(orb)(a,i)");
134
dpd_file2_mat_init(&D);
135
for(h=0,count=0; h < nirreps; h++)
136
for(a=0; a < D.params->rowtot[h]; a++)
137
for(i=0; i < D.params->coltot[h]; i++)
138
D.matrix[h][a][i] = Z[0][count++];
139
dpd_file2_mat_wrt(&D);
140
dpd_file2_mat_close(&D);
146
void uhf_sf_Zvector(void)