The van der Waals interaction potentials of the argon and magnesium di
mers are calculated by the complete fourth-order Moller-Plesset pertur
bation theory (MP4) with a large basis set incorporated with midbond f
unctions. Preliminary calculations are carried out to test the saturat
ion and stability of the midbond functions with respect to the change
in size and position of the midbond function set. It is found that as
midbond functions are gradually added to a moderately polarized basis
set the calculated interaction energy converges quickly and is highly
insensitive to the displacement of midbond functions. Midbond function
s are confirmed to reproduce the intersystem correlation energy achiev
ed traditionally by nucleus-centred polarization functions, especially
by diffuse polarization functions. The calculated interaction potenti
als of the two dimers are in good agreement with experiment. For Ar2 t
he calculation recovers over 92% of the experimental well depth and pr
edicts an equilibrium internuclear distance within 0.1 a0 of experimen
t. The calculated vibrational frequency is also within 1 cm-1 of exper
iment. For Mg2 similar accuracy is achieved provided that the effect o
f core electron correlations is taken into account.