Formation of diamond from the liquid phase of carbon