4
/* FOLD(): Fold the Fock matrix contributions to the energy (or energy
5
** derivative) into the two-particle density matrix. Here we are
6
** trying to convert from an energy expression of the form:
8
** E = sum_pq Dpq fpq + 1/4 sum_pqrs Gpqrs <pq||rs>
12
** E = sum_pq Dpq hpq + 1/4 sum_pqrs Gpqrs <pq||rs>
14
** We do this by shifting some one-particle density matrix components
15
** into appropriate two-particle density matrix components:
17
** G'pmrm = Dpr + 4 * Gpmrm
19
** One problem is that we need to make sure the resulting density,
20
** G'pqrs, is still antisymmetric to permutation of p and q or r and
21
** s. So, for example, for the Gimkm component we compute:
23
** G'pmrm = Dpr + Gpmrm
24
** G'mprm = Dpr - Gmprm
25
** G'pmmr = Dpr - Gpmmr
26
** G'mpmr = Dpr + Gmpmr
29
void fold_ROHF(struct RHO_Params rho_params);
30
void fold_UHF(struct RHO_Params rho_params);
32
void fold(struct RHO_Params rho_params)
34
if(params.ref == 0 || params.ref == 1) fold_ROHF(rho_params);
35
else if(params.ref == 2) fold_UHF(rho_params);