Second-order Møller–Plesset Perturbation Theory (MP2) corrects errors introduced by the mean-field ansatz of the Hartree–Fock (HF) theory, the perturbation operator is just the difference of the exact and the HF Hamiltonian. One straightforward obtains the MP2 energy:

| (9.1) |

with the t-amplitudes

| (9.2) |

i and j denote occupied, a and b virtual orbitals, ϵ_{p} are the corresponding orbital energies,
⟨ij||ab⟩ = ⟨ij|ab⟩-⟨ij|ba⟩ are four-center-two-electron integrals in a commonly used
notation.

MP2 gradients (necessary for optimisation of structure parameters at the MP2 level) are
calculated as analytical derivatives of the MP2 energy with respect to nuclear coordinates;
calulation of these derivatives also yields the first order perturbed wave function,
expressed as "MP2 density matrix", in analogy to the HF density matrix. MP2 corrections
of properties like electric moments or atomic populations are obtained in the same way as
for the HF level, the HF density matrix is just replaced by the MP2 density matrix.

The "resolution of the identity (RI) approximation" means expansion of products of
virtual and occupied orbitals by expansions of so-called "auxiliary functions".
Calculation and transformation of four-center-two-electron integrals (see above) is
replaced by that of three-center integrals, which leads to computational savings of
rimp2 (compared to mpgrad) by a factor of ca. 5 (small basis sets like SVP) to
ca. 10 (large basis sets like TZVPP) or more (for cc-pVQZ basis sets). The errors
(differences to mpgrad) of rimp2 in connection with optimised auxliliary basis
sets are small and well documented [9,107]. The use of the mpgrad modul is
recommended rather for reference calculations or if suitable auxiliary basis sets are not
available.