  Topological semimetals in BaAl4-type structure show many interesting
behaviors, such as charge density wave (CDW) in SrAl4 and EuAl4, but not the
isostructural and isovalent BaAl4, SrGa4 and BaGa4. Here using Wannier
functions based on density functional theory, we calculate the susceptibility
functions with millions of k-points to reach the small q-vector and study the
origin and driving force behind the CDW. Our comparative study reveals that the
origin of the CDW in SrAl4 and EuAl4 is the strong electron-phonon coupling
interaction for the transverse acoustic mode at small q-vector along the
\{Gamma}-Z direction besides the maximum of the real part of the susceptibility
function from the nested Fermi surfaces of the Dirac-like bands, which explains
well the absence of CDW in the other closely related compounds in a good
agreement with experiment. We also connect the different CDW behaviors in the
Al compounds to the macroscopic elastic properties.
