The gradient g x α and NAC h x αβ vectors are the derivatives of the diagonal and off-diagonal elements of the diagonalized effective Hamiltonian, so the algorithm for computing g x α can be used for h x αβ as well. For RASSCF and RASPT2, the independent orbital rotation is differently defined.