The incorporation of nitrogen atoms into cyclic compounds
is essential
for terrestrial life; nitrogen-containing (N-)heterocycles make up
DNA and RNA nucleobases, several amino acids, B vitamins, porphyrins,
and other components of biomolecules. The discovery of these molecules
on meteorites with non-terrestrial isotopic abundances supports the
hypothesis of exogenous delivery of prebiotic material to early Earth;
however, there has been no detection of these species in interstellar
environments, indicating that there is a need for greater knowledge
of their astrochemical formation and destruction pathways. Here, we
present results of simulations of gas-phase pyrrole and pyridine formation
from an ab initio nanoreactor, a first-principles
molecular dynamics simulation method that accelerates reaction discovery
by applying non-equilibrium forces that are agnostic to individual
reaction coordinates. Using the nanoreactor in a retrosynthetic mode,
starting with the N-heterocycle of interest and a radical leaving
group, then considering the discovered reaction pathways in reverse,
a rich landscape of N-heterocycle-forming reactivity can be found.
Several of these reaction pathways, when mapped to their corresponding
minimum energy paths, correspond to novel barrierless formation pathways
for pyridine and pyrrole, starting from both detected and hypothesized
astrochemical precursors. This study demonstrates how first-principles
reaction discovery can build mechanistic knowledge in astrochemical
environments as well as in early Earth models such as Titan’s
atmosphere where N-heterocycles have been tentatively detected.