3
\brief Enter brief description of file here
7
#include <libciomr/libciomr.h>
8
#include <libdpd/dpd.h>
15
namespace psi { namespace cchbar {
17
double rhf_energy(void);
18
double rohf_energy(void);
19
double uhf_energy(void);
24
if(params.ref == 0) energy = (rhf_energy());
25
else if(params.ref == 1) energy = (rohf_energy());
26
else if(params.ref == 2) energy = (uhf_energy());
28
psio_write_entry(CC_HBAR, "Reference expectation value", (char *) &energy,
30
fprintf(outfile,"Reference expectation value computed: %20.15lf\n", energy);
33
double rhf_energy(void)
35
double tauIjAb_energy, tIA_energy;
37
dpdbuf4 tauIjAb, D, E;
39
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
40
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
41
tIA_energy = 2.0 * dpd_file2_dot(&fIA, &tIA);
42
dpd_file2_close(&fIA);
43
dpd_file2_close(&tIA);
45
dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D 2<ij|ab> - <ij|ba>");
46
dpd_buf4_init(&tauIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tauIjAb");
47
tauIjAb_energy = dpd_buf4_dot(&D, &tauIjAb);
48
dpd_buf4_close(&tauIjAb);
52
fprintf(outfile, "Two AB Energy = %20.14f\n", tauIjAb_energy);
55
return (tauIjAb_energy+tIA_energy);
58
double rohf_energy(void)
60
double tIA_energy, tia_energy, tauIJAB_energy, tauijab_energy, tauIjAb_energy;
61
dpdfile2 tIA, tia, fIA, fia;
62
dpdbuf4 tauIJAB, tauijab, tauIjAb, D;
64
dpd_file2_init(&fIA, CC_OEI, 0, 0, 1, "fIA");
65
dpd_file2_init(&tIA, CC_OEI, 0, 0, 1, "tIA");
66
tIA_energy = dpd_file2_dot(&fIA, &tIA);
67
dpd_file2_close(&fIA);
68
dpd_file2_close(&tIA);
70
dpd_file2_init(&fia, CC_OEI, 0, 0, 1, "fia");
71
dpd_file2_init(&tia, CC_OEI, 0, 0, 1, "tia");
72
tia_energy = dpd_file2_dot(&fia, &tia);
73
dpd_file2_close(&fia);
74
dpd_file2_close(&tia);
76
dpd_buf4_init(&D, CC_DINTS, 0, 2, 7, 2, 7, 0, "D <ij||ab> (i>j,a>b)");
77
dpd_buf4_init(&tauIJAB, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tauIJAB");
78
tauIJAB_energy = dpd_buf4_dot(&D, &tauIJAB);
79
dpd_buf4_close(&tauIJAB);
80
dpd_buf4_init(&tauijab, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tauijab");
81
tauijab_energy = dpd_buf4_dot(&D, &tauijab);
82
dpd_buf4_close(&tauijab);
85
dpd_buf4_init(&D, CC_DINTS, 0, 0, 5, 0, 5, 0, "D <ij|ab>");
86
dpd_buf4_init(&tauIjAb, CC_TAMPS, 0, 0, 5, 0, 5, 0, "tauIjAb");
87
tauIjAb_energy = dpd_buf4_dot(&D, &tauIjAb);
88
dpd_buf4_close(&tauIjAb);
92
fprintf(outfile, "One A Energy = %20.14f\n", tIA_energy);
93
fprintf(outfile, "One B Energy = %20.14f\n", tia_energy);
94
fprintf(outfile, "Two AA Energy = %20.14f\n", tauIJAB_energy);
95
fprintf(outfile, "Two BB Energy = %20.14f\n", tauijab_energy);
96
fprintf(outfile, "Two AB Energy = %20.14f\n", tauIjAb_energy);
99
return (tIA_energy + tia_energy +
100
tauIJAB_energy + tauijab_energy + tauIjAb_energy);
103
double uhf_energy(void)
105
double E2AA, E2BB, E2AB, T1A, T1B;
109
dpd_file2_init(&F, CC_OEI, 0, 0, 1, "fIA");
110
dpd_file2_init(&T1, CC_OEI, 0, 0, 1, "tIA");
111
T1A = dpd_file2_dot(&F, &T1);
113
dpd_file2_close(&T1);
115
dpd_file2_init(&F, CC_OEI, 0, 2, 3, "fia");
116
dpd_file2_init(&T1, CC_OEI, 0, 2, 3, "tia");
117
T1B = dpd_file2_dot(&F, &T1);
119
dpd_file2_close(&T1);
121
dpd_buf4_init(&T2, CC_TAMPS, 0, 2, 7, 2, 7, 0, "tauIJAB");
122
dpd_buf4_init(&D, CC_DINTS, 0, 2, 7, 2, 7, 0, "D <IJ||AB> (I>J,A>B)");
123
E2AA = dpd_buf4_dot(&D, &T2);
127
dpd_buf4_init(&T2, CC_TAMPS, 0, 12, 17, 12, 17, 0, "tauijab");
128
dpd_buf4_init(&D, CC_DINTS, 0, 12, 17, 12, 17, 0, "D <ij||ab> (i>j,a>b)");
129
E2BB = dpd_buf4_dot(&D, &T2);
133
dpd_buf4_init(&T2, CC_TAMPS, 0, 22, 28, 22, 28, 0, "tauIjAb");
134
dpd_buf4_init(&D, CC_DINTS, 0, 22, 28, 22, 28, 0, "D <Ij|Ab>");
135
E2AB = dpd_buf4_dot(&D, &T2);
140
fprintf(outfile, "One A Energy = %20.14f\n", T1A);
141
fprintf(outfile, "One B Energy = %20.14f\n", T1B);
142
fprintf(outfile, "Two AA Energy = %20.14f\n", E2AA);
143
fprintf(outfile, "Two BB Energy = %20.14f\n", E2BB);
144
fprintf(outfile, "Two AB Energy = %20.14f\n", E2AB);
147
return(T1A + T1B + E2AA + E2BB + E2AB);
150
}} // namespace psi::cchbar