  We have performed ab-initio molecular dynamics simulations to elucidate the
mechanism of the phase transition at high pressure from hexagonal graphite (HG)
to hexagonal diamond (HD) or to cubic diamond (CD). The transition from HG to
HD is found to occur swiftly in very small time of 0.2 ps, with large
cooperative displacements of all the atoms. We observe that alternate layers of
atoms in HG slide in opposite directions by (1/3, 1/6, 0) and (-1/3, -1/6, 0),
respectively, which is about 0.7 {\AA} along the pm[2, 1, 0] direction, while
simultaneously puckering by about pm0.25 {\AA} perpendicular to the a-b plane.
The transition from HG to CD occurred with more complex cooperative
displacements. In this case, six successive HG layers slide in pairs by 1/3
along [0, 1, 0], [-1, -1, 0] and [1, 0, 0], respectively along with the
puckering as above. We have also performed calculations of the phonon spectrum
in HG at high pressure, which reveal soft phonon modes that may facilitate the
phase transition involving the sliding and puckering of the HG layers. The
zero-point vibrational energy and the vibrational entropy are found to have
important role in stabilizing HG up to higher pressures (>10 GPa) and
temperatures than that estimated (<6 GPa) from previous enthalpy calculations.
