  In the ongoing intense quest to increase the photoconversion efficiencies of
lead halide perovskites, it has become evident that optimizing the morphology
of the material is essential to achieve high peformance. Despite the fact that
nucleation plays a key role in controlling the crystal morphology, very little
is known about the nucleation and crystal growth processes. Here, we perform
metadynamics simulations of nucleation of methylammonium lead triiodide (MAPI)
in order to unravel the atomistic details of perovskite crystallization from a
$\gamma$-butyrolactone solution. The metadynamics trajectories show that the
nucleation process takes place in several stages. Initially, dense amorphous
clusters mainly consisting of lead and iodide appear from the homogeneous
solution. These clusters evolve into lead iodide (PbI$_{2}$) like structures.
Subsequently, methylammonium (MA$^{+}$) ions diffuse into this PbI$_{2}$-like
aggregates triggering the transformation into a perovskite crystal through a
solid-solid transformation. Demonstrating the crucial role of the monovalent
cations in crystallization, our simulations provide key insights into the
evolution of the perovskite microstructure which is essential to make
high-quality perovskite based solar cells and optoelectronics.
