  The metastable hexagonal-diamond phase of Si and Ge (and of SiGe alloys)
displays superior optical properties with respect to the cubic-diamond one. The
latter is the most stable and popular one: growing hexagonal-diamond Si or Ge
without working at extreme conditions proved not to be trivial. Recently,
however, the possibility of growing hexagonal-diamond group-IV nanowires has
been demonstrated, attracting attention on such systems. Based on
first-principle calculations we show that the surface energy of the typical
facets exposed in Si and Ge nanowires is lower in the hexagonal-diamond phase
than in cubic ones. By exploiting a synergic approach based also on a recent
state-of-the-art interatomic potential and on a simple geometrical model, we
investigate the relative stability of nanowires in the two phases up to few
tens of nm in radius, highlighting the surface-related driving force and
discussing its relevance in recent experiments. We also explore the stability
of Si and Ge core-shell nanowires with hexagonal cores (made of GaP for Si
nanowires, of GaAs for Ge nanowires). In this case, the stability of the
hexagonal shell over the cubic one is also favored by the energy cost
associated with the interface linking the two phases. Interestingly, our
calculations indicate a critical radius of the hexagonal shell much lower than
the one reported in recent experiments, indicating the presence of a large
kinetic barrier allowing for the enlargement of the wire in a metastable phase.
