  The local environment of a barium monofluoride (BaF) molecule embedded in an
argon matrix is calculated. A substitution of a BaF molecule for four Ar atoms
is found to be strongly favoured compared to substitutions for other numbers of
Ar atoms. The equilibrium positions of the BaF molecule and its nearby Ar
neighbours are found by minimizing the total energy. The potential barrier that
prevents the migration of the BaF molecule within the solid and the barrier
that prevents its rotation are calculated. At the cryogenic temperatures used
by the EDM$^3$ collaboration, these barriers are sufficiently large to fix the
position and orientation of the molecule. Knowledge of the local environment of
matrix-isolated BaF molecules is essential for the EDM$^3$ collaboration, which
is using them in a precision measurement of the electron electric dipole
moment.
