3
\brief Enter brief description of file here
7
#include <libdpd/dpd.h>
8
#include <libchkpt/chkpt.h>
12
double **Build_R(void);
13
double **Build_U(void);
15
void analyze(char *pert, char *cart, int irrep, double omega)
17
int nirreps, h, i, j, a, b, ij, ab, u, v;
18
int position, num_div, tot1, tot2, nvir, nso, nocc;
19
double width, max, min, value, value2;
21
double **tmp, **T2trans, **T1trans;
27
nirreps = moinfo.nirreps;
31
width = (max-min) / (num_div);
34
sprintf(lbl, "X_%s_%1s_%5.3f", pert, cart, omega);
35
ffile(&efile, lbl, 1);
36
amp_array = init_array(num_div);
38
nvir = moinfo.virtpi[0];
39
nocc = moinfo.occpi[0];
42
sprintf(lbl, "X_%s_%1s_IjAb (%5.3f)", pert, cart, omega);
43
dpd_buf4_init(&T2, CC_LR, 0, 0, 5, 0, 5, 0, lbl);
44
dpd_buf4_mat_irrep_init(&T2, 0);
45
dpd_buf4_mat_irrep_rd(&T2, 0);
46
T2trans = block_matrix(nocc*nocc, nso*nso);
47
tmp = block_matrix(nvir, nso);
50
for(ij=0; ij<T2.params->rowtot[0]; ij++) {
52
C_DGEMM('n', 't', nvir, nso, nvir, 1.0, &(T2.matrix[0][ij][0]), nvir,
53
&(moinfo.C[0][0][0]), nvir, 0.0, &(tmp[0][0]), nso);
54
C_DGEMM('n', 'n', nso, nso, nvir, 1.0, &(moinfo.C[0][0][0]), nvir,
55
tmp[0], nso, 0.0, T2trans[ij], nso);
57
for(ab=0; ab<nso*nso; ab++) {
58
value = fabs(log10(fabs(T2trans[ij][ab])));
60
if ((value >= max) && (value <= (max+width))) {
61
amp_array[num_div-1]++;
64
else if ((value <= min) && (value >= (min-width))) {
68
else if ((value < max) && (value > min)) {
69
position = floor((value-min)/width);
70
amp_array[position]++;
75
dpd_buf4_mat_irrep_close(&T2, 0);
81
for (i = num_div-1; i >= 0; i--) {
82
value = amp_array[i] / tot1;
84
fprintf(efile, "%10.5lf %lf\n", -((i)*width)-min, value);
87
fprintf(outfile, "Total number of converged T2 amplitudes = %d\n", tot2);
88
fprintf(outfile, "Number of T2 amplitudes in analysis= %d\n", tot1);
94
width = (max-min) / (num_div);
96
sprintf(lbl, "X1_%s_%1s_%5.3f", pert, cart, omega);
97
ffile(&efile, lbl, 1);
98
amp_array = init_array(num_div);
100
sprintf(lbl, "X_%s_%1s_IA (%5.3f)", pert, cart, omega);
101
dpd_file2_init(&T1, CC_OEI, 0, 0, 1, lbl);
102
dpd_file2_print(&T1, outfile);
103
dpd_file2_mat_init(&T1);
104
dpd_file2_mat_rd(&T1);
107
T1trans = block_matrix(nocc, nso);
109
C_DGEMM('n','t', nocc, nso, nvir, 1.0, &(T1.matrix[0][0][0]), nvir,
110
&(moinfo.C[0][0][0]), nvir, 0.0, &(T1trans[0][0]), nso);
114
for(i=0; i < nocc; i++) {
115
for(a=0; a < nso; a++) {
116
/* value = fabs(log10(fabs(T1trans[i][a]))); */
117
value = log10(fabs(T1.matrix[0][i][a]));
119
if ((value >= max) && (value <= (max+width))) {
120
amp_array[num_div-1]++;
123
else if ((value <= min) && (value >= (min-width))) {
127
else if ((value < max) && (value > min)) {
128
position = floor((value-min)/width);
129
amp_array[position]++;
134
/* free_block(T1trans); */
136
dpd_file2_mat_close(&T1);
137
dpd_file2_close(&T1);
140
for (i = num_div-1; i >= 0; i--) {
141
value = amp_array[i] / tot1;
143
fprintf(efile, "%10.5lf %lf\n", ((i)*width)-min, value);