  Even though nucleation is ubiquitous in different science and engineering
problems, investigating nucleation is extremely difficult due to the
complicated ranges of time and length scales involved. In this work, we
simulate NaCl nucleation in both molten and aqueous environments using enhanced
sampling all-atom molecular dynamics with deep learning-based estimation of
reaction coordinates. By incorporating various structural order parameters and
learning the reaction coordinate as a function thereof, we achieve
significantly improved sampling relative to traditional ad hoc descriptions of
what drives nucleation, particularly in the aqueous medium. Our results reveal
a one-step nucleation mechanism in both environments, with reaction coordinate
analysis highlighting the importance of local ion density in distinguishing
solid and liquid states. However, while fluctuations in the local ion density
are necessary to drive nucleation, they are not sufficient. Our analysis shows
that near the transition states, descriptors such as enthalpy and local
structure become crucial. Our protocol proposed here enables robust nucleation
analysis and phase sampling, and could offer insights into nucleation
mechanisms for generic small molecules in different environments.
