The energy in the Hartree-Fock approximation is given as:
$$E_{HF}=\left<\psi_{HF} \left| \hat{H} \right| \psi_{HF} \right>=\sum_{i,j}P_{i,j}H_{i,j}^{core}+\frac{1}{2}\sum_{i,j,k,l}P_{i,j}P_{l,k}(ij||kl)+V_{NN} \tag{1}$$
The geometrical derivative of the Hartree-Fock energy can be shown to be [1]:
$$\frac{\partial E_{HF}}{\partial X_A}=\sum_{i,j}P_{i,j}\frac{\partial H_{i,j}^{core}}{\partial X_A}+\frac{1}{2}\sum_{i,j,k,l}P_{i,j}P_{l,k}\frac{\partial (ij||kl)}{\partial X_A}-\sum_{i,j}Q_{i,j}\frac{\partial S_{i,j}}{\partial X_A}+\frac{\partial V_{NN}}{\partial X_A} \tag{2}$$
The Hellmann-Feynman Theorem states:
$$\frac{dE}{d X_A}=\left<\psi \left| \frac{d\hat{H}}{d X_A} \right| \psi \right>$$
The Hellmann-Feynman Theorem implies that the energy derivative only depends on the parts of the Hamiltonian that have a dependency on the derivative. This leads to the geometrical derivative being equal to:
$$\frac{dE}{d X_A}=\left<\psi \left| \frac{d\hat{V}_{NN}}{d X_A} + \frac{d\hat{V}_{Ne}}{d X_A} \right| \psi \right> = \left<\psi \left| \frac{d\hat{V}_{NN}}{d X_A} \right| \psi \right> + \left<\psi \left| \frac{d\hat{V}_{Ne}}{d X_A} \right| \psi \right>=\left<\psi \left| Z_A\sum_B\frac{Z_B(X_B-X_A)}{R^3_{AB}} \right| \psi \right> + \left<\psi \left| -Z_A\sum_i\frac{X_i-X_A}{r^3_{iA}} \right| \psi \right>$$
Now the Hellmann-Feynman theorem can be applied to find the derivative geometrical of the Hartree-Fock energy:
$$\frac{\partial E_{HF,\ce{Hellmann-Feynman}}}{\partial X_A}=\left<\psi_{HF} \left| \frac{\partial\hat{H}}{\partial X_A} \right| \psi_{HF} \right>=\sum_{i,j}P_{i,j}\frac{\partial V_{Ne,ij}}{\partial X_A}+\frac{\partial V_{NN}}{\partial X_A} \tag{3}$$
I tried to implement equation $(2)$ and equation $(3)$, and used them to calculate, the force between H and Li for different distances, with cc-pVDZ and cc-pVTZ. and got the following:
Hartree-Fock refers to equation $(2)$ and Hellmann-Feynman refers to equation $(3)$. I have read that the Hellmann-Feynman theorem is only valid for exact solutions, but should become a better and better approximation, when going towards the Hartree-Fock limit. As can be seen in the picture, equation $(3)$ performs worse with the larger basisset cc-pVTZ. This now leads me to my question, were am I wrong in my understanding of the application of the Hellmann-Feynman theorem to the Hartree-Fock approximation?
[1] Attila Szabo, Neil S. Ostlund; Modern Quantum Chemistry: Introduction to Advanced Electronic Structure Theory; equation C. 12

This makes it clear that a complete basis is needed for the Hellmann-Feynman theorem to hold. Also, one thing which I don't quite understand, but seems to be necessary is that the AOs are not supposed to remain centered on the atoms as the geometry is distorted. Thus, you are always calculating in reference to the original geometry, and convergence is necessarily slower.
– jheindel Aug 17 '17 at 04:43