{'fraction_non_alphanumeric': 0.031235481219398877, 'fraction_numerical': 0.015331832314785033, 'mean_word_length': 4.523489932885906, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The chemistry of AlF and CaF production in buffer gas sources

In this work, we explore the role of chemical reactions on the properties of buffer gas-cooled molecular beams. In particular, we focus on scenarios relevant to the formation of AlF and CaF via chemical reactions between the Ca and Al atoms ablated from a solid target in an atmosphere of a fluorine-containing gas, in this case, SF6 and NF3. Reactions are studied following an ab initio molecular dynamics approach, and the results are rationalized following a tree-shaped reaction model based on Bayesian inference. We find that NF3 reacts more efficiently with hot metal atoms to form monofluoride molecules than SF6. In addition, when using NF3, the reaction products have lower kinetic energy, requiring fewer collisions to thermalize with the cryogenic helium. Furthermore, we find that the reaction probability for AlF formation is much higher than for CaF across a broad range of temperatures.


I. INTRODUCTION
All routes to ultracold molecules require and produce molecules in a small and well-defined number of internal states. Experiments generally separate into those using indirect or direct cooling techniques. Indirect cooling techniques refer to scenarios in which ultracold atoms are bound together to form an ultracold molecule via photoassociation [1][2][3][4] or magnetoassociation [5,6], which is customary for ultracold bi-alkali molecules. Direct cooling techniques involve producing molecules in a source and extracting them into a molecular beam that is slowed and captured in a trap. The manipulation techniques involved include Stark deceleration [7], Zeeman slowing [8], centrifuge deceleration [9] and laser and optoelectrical cooling [10,11]. Similarly, heat dissipation can be obtained by bringing an ensemble of molecules in contact with a cold reservoir, typically He atoms, known as buffer gas cooling [12][13][14][15], or sympathetic cooling, in which direct cooling of an ensemble of one species facilitates cooling of another [16][17][18].
Production of diatomic molecules in a cryogenic buffer gas is a versatile method to create an ensemble of molecules in its lowest internal states and has been applied to many molecular species. The thus produced cold molecules can be directly trapped in a magnetic field [12], for instance, or cold molecules emanating from the buffer gas source in an effusive beam can be used for further cooling, deceleration, and trapping experiments. In many of these buffer gas sources, molecules are produced in a chemical reaction of laser-ablated atoms -that have an initial temperature of several thousand Kelvin -with a reactant gas. The molecules subsequently thermalize with the cryogenic buffer gas. This process spans several orders of magnitude in energy, involves complex reaction kinetics, and is thus far not well understood. Indeed, only recently, molecular beams emerging from a buffer gas source have been successfully simulated based on general physical properties [15,19,20]. However, to the best of our knowledge, the impact of the reactive gas where ablation occurs in buffer gas sources remains unexplored, both experimentally and theoretically. Furthermore, properties of the molecular beam such as its overall yield, short-and long-term stability, and phase-space distribution ultimately determine which downstream experiments are possible. Therefore, it is mandatory to understand the chemistry in buffer gas cells to design brighter and colder molecular beams facilitating the application of subsequent cooling techniques.
This paper presents a first principle study to understand the role of chemical reactions in a cryogenic buffer gas source. As an example, we focus on the formation efficiency of AlF/CaF after laser-ablating Al/Ca in two distinct fluorine-donor gases: NF 3 and SF 6 . Recently, we have demonstrated that a molecular beam of AlF [21] is about an order of magnitude brighter as compared to a beam of CaF [22]. The aim is to understand the reaction in more detail and analyze the impact of the specific fluorine donor gas on the molecular beam properties. After performing molecular dynamics simulations, we demonstrate that the number and kinetic energy of the product molecules depends on the nature of the fluorine donor gas as much as on the intensity of the ablating laser, which sets the reaction temperature. Tree-shaped reaction models are constructed to understand further the impact of stereochemistry in these reactions to reveal critical intermediate states and their transitions in the reaction channels. These results establish the basis for a more detailed understanding of the properties of buffer gas molecular beams, which will aid in their future design and optimization.

II. COMPUTATIONAL DETAILS AND METHODOLOGY
In a buffer gas cell, highly energetic ablated metal atoms collide with lower energy fluorine-containing molecules present.
This scenario defines a nonequilibrium system. Therefore, it requires formulating arXiv:2205.04206v1 [physics.comp-ph] 9 May 2022 the problem in the grand canonical ensemble, which is theoretically cumbersome and computationally extremely expensive. Nevertheless, since the temperature of the ablated atoms is much higher than the buffer gas temperature, the atom temperature is a good approximation for the reaction temperature [23]. In this scenario, we launch N t trajectories according to a given temperature via the Maxwell-Boltzmann distribution. The time evolution of each of these trajectories is computed via ab initio molecular dynamics (AIMD) to elucidate the reaction dynamics for Al/Ca+NF 3 /SF 6 reactions within the microcanonical ensemble -also known as the NVE ensemble since the number of particles, volume and energy are conserved quantities-using the hybrid BHLYP functional [24,25], previously reported to reproduce the experimental rate constants for Al + SF 6 reaction [26]. In this work, we also include the D3 dispersion correction [27] to reach a better description of the ubiquitous long-range interactions. All these calculations are performed employing the def2-TZVP basis set [28][29][30], as implemented in the Gaussian 16 package [31].

A. Initial conditions
For each of the N t trajectories, the initial position of the metal atom is randomly selected from a sphere of radius 7Å, centered at atom (N/S) of the target molecule (NF 3 /SF 6 ), as it is shown in Fig.1. We use the molecule's symmetry to reduce the angular degrees of freedom range to improve the sampling efficiency. The magnitude of the metal atoms' velocity satisfies a Maxwell-Boltzmann distribution at corresponding temperatures, and its direction is randomly sampled following the polar and azimuthal angles in spherical coordinates to ensure a collision with the target molecule as sketched by the pink surface in Fig.1.

B. Reaction probability
The main descriptor of a chemical process is the reaction probability, defined as the probability that the reactants end up in a particular product state. Mathematically, the reaction probability is defined as where N r denotes the number of trajectories leading to a given reaction product. In particular, we take N t = 1000 up to a final state in which the metal atom is at a distance larger than 7Å from the N or S atom for each temperature and colliding species. Each of these trajectories takes, on average, 4.5 hours to run on 40 processors.

C. Reaction model
Reaction models, providing a microscopic understanding of reaction mechanism, are prerequisites for sensitivity analysis and reaction route design [32][33][34][35][36][37][38][39][40][41][42][43]. To construct such models, generally one considers the thermodynamic properties of the chemical species at the elementary steps in the reaction, including the equilibrium geometries and transition states. In this case, transition probabilities between these species are calculated by the transition state theory. As a result, the mean-field reaction probability of each reaction step can be obtained from Eyring's theory under the equilibrium hypothesis [44]. However, for reactions at finite temperature, like the ones in this work, for which the collision energy of the system is high, the system may go through reaction pathways that deviate from minimal energy paths so that the transition state theory can no longer apply [45][46][47].
On the other hand, trajectory-based AIMD simulations provide direct information about reaction pathways, including temperature effects and transition probabilities between the sampled species. Indeed, AIMDsimulated reaction trajectories have been featured in a discrete structural space to construct reaction models [48]. In addition, to further understand the impact of temperature and stereochemistry in these reactions, we have developed a tree-shaped reaction model revealing the relevance of intermediate states and transitions in every reaction channel. Such a reaction model relies on identifying the most characteristic states of the reaction and estimating the transition probabilities between each of them via Bayesian inference [49]. In our reaction model, a molecular structure is represented in terms of the vector g of atom-pairs-inversedistances, where r i represents the Cartesian coordinates of the ith MD step. As a result, a trajectory can be expressed as . . , g n }, with n being the number of MD time steps. Next, using a regular pace clustering algorithm [50], for each reaction studied, we identify 13 states. The clustered trajectory can be represented as Calculating the transition probabilities among the 13 states requires a prior distribution, and in this case, we assume a Bernoulli distribution given by the following mass function where δ x is the Kronecker delta function, which equals to 1 when state x is observed and p = 0.5. The probability of a successful transition to each of the states is the same. Then, the transition matrix T can be defined as where p ij is the posterior probability of state i to successfully transfer into state j, and it is calculated via Markov chain Monte Carlo (MCMC) implemented in PyMC3 [51]. In addition, it is worth mentioning that the present reaction model is essentially a Bayesian network [52], since the posterior probabilities are trained by feeding the clus- To analyze in detail the product selectivity, we further consider the states that determine the products, i.e., states 9 to 12. The vector g , which is the inverse distances between N/S atom and F atoms, is calculated as where r N i , r S i and r F i are the Cartesian coordinates of N, S and F atoms, respectively. Another relevant indicator is, CN i : the numbers of coordinated F atoms around Al/Ca, and it is also calculated for each configuration i. Therefore, an alternative characterization is in which state 9, the state previous to any product state, is further clustered into 6 sub-states. In this way, we gain more detailed informa-tion about the reaction mechanism.

III. RESULTS AND DISCUSSION
Metal-fluorine diatomic molecules are used for many precision spectroscopy and laser cooling applications. Such molecules can be produced by a chemical reaction between hot ablated metal atoms and a fluorinecontaining gas. Here, we analyze the two most-commonly used fluorine-donor reaction gases, NF 3 and SF 6 and compare the reaction efficiencies to form AlF and CaF.
Reaction probability of (a) AlF/CaF and (b) AlFn/CaFn by-products for hot collisions of Al/Ca with SF6 and NF3 gases as a function of the temperature.

A. Reaction probability
The formation of AlF and CaF molecules in Al/Ca + SF 6 /NF 3 collisions have been studied, and the results are shown in Fig. 2. This figure displays the reaction probability for different products as a function of the temperature. At all temperatures considered, AlF is produced more efficiently than CaF irrespective of the type of reactant gas used in the reaction. Indeed, this behavior has been experimentally observed when comparing the brightness of CaF and AlF beams emerging from a buffer gas cell [14,21]. However, in the case of by-products, as shown in panel (b) of Fig. 2, CaF 2 is produced more efficiently than AlF 2 and AlF 3 in both gases. At higher tem- peratures, the reaction probability of producing AlF and CaF is more prominent than at lower ones, as expected in the case of reactions with a barrier. However, for the entire range of temperatures under consideration, the reaction probability for AlF and CaF via NF 3 is higher than in the case of SF 6 , as shown in panel (b) of Fig. 2. In particular, in the case of AlF formation, this difference is as large as an order of magnitude for particular temperatures. Therefore, Al/Ca + NF 3 →NF 2 + AlF/CaF reactions have a lower reaction barrier than Al/Ca + SF 6 →SF 5 + AlF/CaF and Al/Ca reactions. Indeed, the activation energy for Al + SF 6 and Al + NF 3 reactions have been experimentally determined and they have a value of 9.5 kcal/mol (4781 K) and 5.99 kcal/mol (2990 K) [26], respectively. Consequently, the use of NF 3 in the buffer gas cell should lead to a brighter beam than using SF 6 . Moreover, using NF 3 reduces the number of by-products and possible contamination of the buffer gas cell.
One reason for the higher reaction probability to produce AlF or CaF molecules when using NF 3 is due to the difference in bond energy of F-atoms in NF 3 and SF 6 . For NF 3 the bond energy is (2.9 eV) [53], which is 1.1 eV lower than the bond energy of F-atoms in SF 6 [54] (4.0 eV). Therefore, it is easier to remove a fluorine atom from NF 3 than from SF 6 , leading to a higher reaction probability at a given temperature. In addition, the probability of formation of AlF molecules is higher than CaF because the bond energy of AlF (6.9 eV) is 1.4 eV larger than that of CaF (5.5 eV). This simple picture is substantiated in Section III B which discusses the role of stereochemistry.
A more detailed treatment of the temperature dependence is presented in panels (a-b) and (d-e) of Fig. 3. Here, we display the reaction probability as a function of collision energy and initial angle of the metal atom, as introduced in Fig.1. In the case of SF 6 , the reaction producing either AlF or by-products generally occurs at relatively high collision energies ( 0.8 eV∼9300 K). On the contrary, AlF is produced at much lower collision energies of 0.4 eV ∼4600 K when NF 3 is used. Reaction by-products appear only at very high energies 1.6 eV (∼18600 K) in both SF 6 and NF 3 . This suggests that such reactions require the activation of F atoms promoted by the collision with an Al atom. However, the production of by-products requires more F atoms to be activated. This is in stark contrast to reactions that involve Ca atoms, for which the production of CaF or CaF 2 requires a similar collision energy ( 0.8 eV) when reacting with SF 6 . Moreover, this reaction preferentially produces CaF 2 and not CaF. Unlike Al, in the reaction of Ca + NF 3 , CaF is produced also at high collision energies 1.2 eV (∼13900 K), while the production of CaF 2 occurs at a wider range of collision energies. These phenomena suggest that Al and Ca experience very different reaction mechanisms when reacting with SF 6 and NF 3 .

B. Stereochemistry
The orientation of the reactants affects the reactivity of a given chemical reaction. These effects are due to subtleties in the underlying energy landscape of every molecular interaction, such as geometry effects or local equilibrium states. Here, by looking into the reaction probability as a function of the atom's angle of incidence, we can evaluate selectivity effects based on the orientation of the interacting partners, as presented in panels (a), (b), (d), and (e) of Fig. 3. Concretely, it informs us about the anisotropy of the interaction and the geometry effects on the interaction energy.
First, one notices that the production of AlF/CaF via NF 3 occurs over a wider range of angles than in the case of SF 6 , indicating a more isotropic interaction. Similarly, when comparing the production of CaF and AlF in SF 6 , we notice that CaF is formed only at incident angles close to 30 • , whereas AlF is formed over a range of angles between 10 • and 45 • . The same effect, although not as pronounced, is observed in the case of NF 3 . AlF is produced at angles between 0 and 90 • , and CaF for angles between 20 • and 90 • . Therefore, AlF formation is less selective than CaF, which may impact the reaction probability.

C. Velocity distribution of the products
The generation of AlF and CaF with either reactant gas releases several thousand kelvins of energy, comparable to or larger than the collision energy. This must be carried away either in translational motion of the products or by their internal (electronic, vibrational, and rotational) energy and subsequently cooled by the buffer gas. The results for the velocity distribution of AlF and CaF are shown in panels (c) and (f) of Fig. 3. In particular, we notice that SF 6 leads to a narrower velocity distribution than NF 3 independent of the colliding atom since the bond energy of F-atoms in SF 6 is 1.1 eV larger than in NF 3 , leading to a lower exothermicity. In addition, we notice that NF 3 as a reactant leads to a more significant number of molecules at low velocities. This behavior may be correlated with the stereochemistry of the reaction: low incident angles lead to a significant reaction probability in Al/Ca + NF 3 reactions, whereas Al/Ca +SF 6 reactions show the most considerable reaction probability at larger incident angles. Indeed, a lower incident angle means a more efficient energy transfer be- tween the metal atom and the F atom as opposed to the case of large incident angles, in which different F atoms and internal excitation of the F-containing molecule can play a role in the dynamics. Therefore, it is preferable to use NF 3 to obtain colder beams from a buffer gas cell. Finally, we realize that the temperature has only a subtle influence on the most probable velocity (or distribution mode). This is expected, since the temperature has only a minimal impact on the reaction channels.

D. By-products
In this section, we explore the production of byproducts in Al + SF 6 /NF 3 and Ca + SF 6 /NF 3 reactions. The former reaction may produce AlF 2 and AlF 3 molecules as by-products, whereas the latter leads to CaF 2 . The results are summarized in Fig. 6. In this figure, we notice that the reaction probabilities for the formation of by-products behave differently for AlF and CaF. For instance, reactions with SF 6 show a higher reaction probability to form by-products than in the case of NF 3 , which may be related to the fact that SF 6 provides more F atoms than NF 3 . Similarly, we observe that Ca reactions lead to a higher probability of by-products than reactions involving Al. Indeed, as discussed in sec-tion III E, the transition probability to CaF 2 is higher than CaF. Therefore, CaF 2 is the main product of the reactions involving Ca.
Reactions with Al show a lower threshold energy for the formation of by-products than in the case of Ca reactions, as it is shown in Fig. 6. As expected, the collision energy required to form AlF 2 is higher than for the formation of AlF but lower than for AlF 3 . On the contrary, the collision energy required to form CaF 2 is lower than CaF. As discussed in Sec. III E, CaF is mainly formed through the dissociation of CaF 2 , which can be promoted when the kinetic energy of CaF 2 increases. Similar phenomena can also be observed in the reactions involving NF 3 , as shown in Figs. 3 and 6.

E. Tree-shaped reaction model
So far, we have identified that the collision energy and angle of incidence play a relevant role in the reaction probability to produce AlF/CaF and by-products via SF 6 and NF 3 . This section presents models for these reactions which help to elucidate the underlying reaction mechanisms hidden in the AIMD simulations. These models are presented for a temperature of 10000 K, although they are readily extensible to any temperature. A chemical reaction can be modeled by looking into different reaction channels weighted by corresponding transition probabilities. In particular, every chemical reaction under consideration is modeled by a tree-shaped model using 13 states. Consequently, the backward transitions should be considered independent of the forward transitions. The results for Al + SF 6 collisions are shown in Fig. 4. This reaction is sequential since only one major forward transition appears. In other words, no significant competition exists between transition branches in the product nodes. All states apart from state 8 show a backward and forward transition probability. As a result, backward transitions are only observed before the system evolves into state 8: these trajectories constitute elastic events. Provided the system reaches state 8, it will experience either a reactive or inelastic scattering process. The relative long distance between state 8 and state 9 indicates that the products AlF x (x=2,3) have been separated from target molecules, and the state 9 will continue to evolve, producing AlF and by-products: AlF 2 or AlF 3 .
In the Al+SF 6 reaction, S -F distances of the intermediate states correlates with the activity of F atoms, as shown in the inset of Fig. 4, where the state 9 has been further clustered into 6 sub-clusters with increasing r S−F . From state 9.0 to state 9.5, r S−F becomes larger, suggesting that more F atoms are activated. Furthermore, there are significant transitions between states from 9.2 to 9.5, which can be considered as a resonance between the SF 6 molecule with fewer or more activated F atoms during the generation of products from the target molecule. Transitions between the products and sub-clusters of state 9 show that AlF is produced from state 9.3 and 9.4, while by-products, AlF 2 and AlF 3 , are produced from state 9.5. Comparing r S−F of state 9.3 and 9.4 with the one of state 9.5, it can be concluded that AlF is produced from the state with fewer F atoms activated, while AlF 2 and AlF 3 are produced from states with more F atoms activated. Therefore, the activation of F atoms in SF 6 is crucial for the selectivity of the reaction, which is in agreement with the reaction probability-collision energy relationships shown in Fig. 6 (a)-(b). As discussed in section III A, AlF is produced more efficiently at relatively low collision energies compared with AlF 2 and AlF 3 . Indeed, lower collision energy will activate relative fewer F atoms and therefore produce more AlF. On the contrary, higher collision energies will activate more F atoms, thus, producing AlF 2 or AlF 3 .
Interestingly enough, the above discussion regarding Al +SF 6 reactions is applicable to the Al + NF 3 reaction, as shown in Fig. 5, but it is unsuited to reactions involving Ca. Fig. 7 shows a tree-shaped reaction model for Ca + SF 6 , which is similar to Al + SF 6 . However, unlike Al + SF 6 , Ca + SF 6 collisions end up producing CaF 2 , showing the highest reaction probability, as shown in section III B, over by-products. Indeed, CaF and CaF 3 are produced from further reaction of CaF 2 , which is supported by significant transitions between CaF 2 , CaF and CaF 3 shown in the inset of Fig. 7. The preference towards producing CaF 2 is also observed in Ca + NF 3 reaction shown in Fig. 8. Therefore, Ca atom strongly prefers to establishes a chemical bond with two F atoms rather than with a single one, which can be related with the fact that CaF is a radical as opposed to a stable molecule as AlF. Further interactions between CaF 2 and SF 4 /NF will make CaF 2 lose or capture one F atom. Finally, our reaction model seems to indicate that reactions involving Ca atoms will lead to a larger number of by-products and a larger degree of contamination of the buffer gas cell.

IV. CONCLUSIONS AND OUTLOOK
In this work, we have shown that the reaction probability of forming AlF and CaF via ablation of metal atoms in an F-containing reactant gas is higher when using NF 3 as a reactant gas than in the case of SF 6 . Indeed, this effect seems to relate to the reaction's exothermicity: the more significant the difference between the binding energy of the product (AlF/CaF) and the bond energy of fluorine into the reactant molecule, the larger the reaction probability is. In particular, the exothermicity for AlF from NF 3 , AlF from SF 6 , CaF from NF 3 and CaF from SF 6 is given by 4.0 eV, 2.9 eV, 2.6 eV and 1.5 eV, respectively, in line with the observed probabilities shown in panel (a) of Fig. 2. These are further depicted in Fig. 9, in which the exothermic energy corresponds to the length of the arrows. Therefore, it is easier for a hot metal atom to take a fluorine atom from an NF 3 than from an SF 6 molecule. Moreover, Fig. 9 shows a detailed list of XF molecules, taken from Ref. [55] that can be formed via exothermic processes utilizing NF 3 and SF 6 gases. As a result, and concerning the lower binding energy of the N-F bond in NF 3 , many XF molecules could be formed in a buffer gas source. In other words, NF 3 , as the fluorinedonor gas, will help to explore more fluorine-containing diatomic molecules. Given this, XeF 2 is anticipated to be a good candidate as an F-atom donor based on its very low bond energy in comparison with AlF and CaF molecules.
We have shown that different fluorine-donor molecules in a buffer gas cell environment have an important impact on the target molecules' production efficiency and velocity distribution. In particular, we have demonstrated that the Ca/Al + NF 3 reaction is a more efficient route towards the production of CaF and AlF molecules than  Bond energy N-F in NF3 FIG. 9. The dissociation energy of diatomic monofluoride molecules XF, for different atoms X, taken from Ref. [55]. The two red lines denote the limits for the bond energy of S-F in SF6 whereas the black lines denote the same magnitude for NF3. The arrows indicate the exothermic energy of the reactions to form CaF and AlF.
the Ca/Al + SF 6 one. Indeed, the difference in reaction probability can be as large as one order of magnitude. In addition, we have identified the main reaction mechanisms for those reactions using a tree-shaped reaction model. Our results indicate that the buffer gas cell's amount of by-products and possible contamination depends on the fluorine-donor molecule. The velocity distribution of the products depends drastically on the reactants. For instance, we notice that Ca/Al + NF 3 lead to a broader velocity distribution than Ca/Al + SF 6 . The higher the reaction efficiency with NF 3 means that a significantly lower flow rate of reactants gas can be used. This reduces contamination and the build-up of ice in the cell, preventing efficient thermalization of the molecules with the cryogenic helium. In addition, the lower velocity of the reactants reduced the number of collisions required to cool the molecules. A lower helium flow reduces the overall gasload in the system and allows for a faster extraction from the cell, which is highly advantageous for experiments that are sensitive to collisions with helium or benefit from short molecular pulses. Finally, we can conclude that, in general, it would be better to use NF 3 as a fluorine-donor molecule than SF 6 for forming metal-fluorine molecules. It is worth emphasizing that a better understanding of the chemistry in a buffer gas helps design better buffer gas cells towards achieving brighter and colder molecular beams, which are necessary to exploit all the potential of ultracold molecules. Therefore, we hope our work motivates the community to explore more possibilities and new ways to obtain molecules in buffer gas sources.

VI. DATA AVAILABILITY STATEMENT
The data that support the findings of this study are available from the corresponding author upon reasonable request.