The electronic energy is an exact functional of the 1-RDM and 2-RDM

$$E=\frac{1}{2}\sum _{pqrs}{\mathrm{\Gamma}}_{pqrs}{g}_{pqrs}+\sum _{pq}{D}_{pq}{h}_{pq},$$ | (6.48) |

Given the 1- and 2-PDMs, the generalized Fock matrices may be generated for this MCSCF.
The derivation and further details are neatly described by Helgaker, Jorgensen, and
Olsen ^{Helgaker:2000b}, but the key results are summarized here.
In the following, $m,n,p,q,\mathrm{\dots}$ are general indices, $i,j,k,\mathrm{\dots}$ are inactive
indices, $t,u,v,w,\mathrm{\dots}$ are active indices, and $a,b,c,\mathrm{\dots}$ are virtual indices.

The generalized Fock matrix is defined as:

${F}_{mn}={\displaystyle \sum _{q}}{D}_{pq}{h}_{pq}+{\displaystyle \sum _{qrs}}{\mathrm{\Gamma}}_{mqrs}{g}_{nqrs}$ | (6.49) |

where ${h}_{pq}$ are the 1-electron integrals and ${g}_{nqrs}$ are the 2-electron integrals and all indices run over all orbital classes (inactive, active, and virtual). This, generally non-symmetric, matrix can be simplified by taking advantage of the fact that the form of the density matrices when some indices are inactive or virtual are much simpler than when the indices are active. When the first index of the generalized Fock matrix is inactive and the second is general:

${F}_{in}=2({}^{I}F_{ni}+{}^{A}F_{ni})$ | (6.50) |

where the inactive and active Fock matrices are

${}^{I}F_{mn}$ | $={h}_{mn}+{\displaystyle \sum _{i}}(2{g}_{mnii}-{g}_{miin})$ | (6.51) | ||

${}^{A}F_{mn}$ | $={\displaystyle \sum _{vw}}{D}_{vw}({g}_{mnvw}-{g}_{mwvn})$ | (6.52) |

In other words, the inactive Fock matrix is the Fock matrix formed from using only the inactive density and the active Fock matrix is sum of J and K matrices built from the active space 1-PDM. When the first index is active, and the second index is general, we have

${F}_{tn}={\displaystyle \sum _{u}}{}^{I}F_{nu}{D}_{vu}+{Q}_{tn}$ | (6.53) |

where the auxiliary Q matrix is

${Q}_{tm}={\displaystyle \sum _{u,v,w}}{\mathrm{\Gamma}}_{tuvw}{g}_{muvw}$ | (6.54) |

and finally, if the first index is virtual then ${F}_{an}=0$. This formulation of the generalized Fock matrix is quite useful because it only requires density matrices with all indices active and two-electron integrals in the MO basis with three indices active and one general index, greatly reducing the storage and computational cost of the MO transformation.

The orbital gradient is then given by

$\frac{\partial E}{\partial {\mathrm{\Delta}}_{pq}}}=2({F}_{pq}-{F}_{qp})$ | (6.55) |