  We have performed extensive ab initio calculations to investigate phonon
dynamics and their possible role in superconductivity in BaFe2As2 and related
systems. The calculations are compared to inelastic neutron scattering data
that offer improved resolution over published data [Mittal et al., PRB 78
104514 (2008)], in particular at low frequencies. Effects of structural phase
transition and full/partial structural relaxation, with and without magnetic
ordering, on the calculated vibrational density of states are reported. Phonons
are best reproduced using either the relaxed magnetic structures or the
experimental cell. Several phonon branches are affected by the subtle
structural changes associated with the transition from the tetragonal to the
orthorhombic phase. Effects of phonon induced distortions on the electronic and
spin structure have been investigated. It is found that for some vibrational
modes, there is a significant change of the electronic distribution and spin
populations around the Fermi level. A peak at 20 meV in the experimental data
falls into the pseudo-gap region of the calculation. This was also the case
reported in our recent work combined with an empirical parametric calculation
[Mittal et al., PRB 78 104514 (2008)]. The combined evidence for the coupling
of electronic and spin degrees of freedom with phonons is relevant to the
current interest in superconductivity in BaFe2As2 and related systems.
