1 Introduction

For the last few years we have centered our efforts in the study of reactions that occur at very low temperatures, which are relevant in the interstellar medium (ISM) [1,2,3], and in reactions that take place at high temperatures, as is the case of combustion reactions [4,5,6]. The theoretical calculation of thermal rate constants is the base to elucidate complex reaction mechanisms in these two extreme regimes. Both situations require a robust theory that incorporates quantum effects into the reactions that occur at very low temperatures, as well as anharmonicity and conformational freedom in flexible molecules at high temperature.

Variational transition state theory (VTST) [7,8,9,10] has shown to provide accurate results when compared against fully quantum methods for a large set of atom-diatom reactions [11], and polyatomic systems [12]. The advantage of VTST is that it can be applied to large systems because the rate constant calculations can be performed with a very limited knowledge from the potential energy surface (PES). In most situations, it is enough to evaluate the minimum energy path (MEP) of the reaction [13], together with Hessian calculations at some points along this path. This allows extracting variational and quantum effects employing canonical variational transition state theory (CVT) [14, 15] [which is based on a canonical ensemble (at constant temperature)] with small-curvature tunneling (SCT) corrections [16,17,18]. Both are ideal approximations to automate thermal rate constant calculations.

For an elementary reaction, the CVT/SCT thermal rate constant is given by:

$$\begin{aligned} k^\mathrm{CVT/SCT} (T) = \gamma ^\mathrm{CVT/SCT}(T) \cdot B(T) \cdot \frac{Q^{\ddagger }_{\textrm{rv}}(T)}{Q_{\textrm{rv, R}}(T)} \cdot \exp {[-\beta V_0]} \end{aligned}$$
(1)

where \(\gamma (T)\) is the product of two contributions

$$\begin{aligned} \gamma ^\mathrm{CVT/SCT}(T)=\Gamma ^\textrm{CVT}(T) \cdot \kappa ^\mathrm{CVT/SCT}(T) \end{aligned}$$
(2)

being \(\Gamma ^\textrm{CVT}(T)\) the variational coefficient that accounts for recrossing effects, and \(\kappa ^\mathrm{CVT/SCT}(T)\) the tunneling transmission coefficient calculated by the SCT approximation. Notice that \(\Gamma ^\textrm{CVT}(T)\le 1\) and \(\kappa ^\mathrm{CVT/SCT}(T)\ge 1\). In the limiting case that both coefficients are the unity CVT/SCT reduces to conventional transition state theory (TST). Therefore, the relation between the CVT/SCT and TST rate constants is

$$\begin{aligned} k^\mathrm{CVT/SCT} (T) = \gamma ^\mathrm{CVT/SCT}(T) \cdot k^\textrm{TST} (T) \end{aligned}$$
(3)

and the latter is given by:

$$\begin{aligned} k^\textrm{TST} (T) = B(T) \cdot \frac{Q^{\ddagger }_{\textrm{rv}}(T)}{Q_\textrm{rv, R}(T)} \cdot \exp {[-\beta V_0]} \end{aligned}$$
(4)

where \(\beta = (k_{\textrm{B}}T)^{-1}\), \(k_{\textrm{B}}\) is the Boltzmann’s constant and T is the temperature; \(V_0\) is the difference in energy between reactants and the transition state; \(Q_\textrm{rv, R}(T)\) and \(Q^{\ddagger }_{\textrm{rv}}(T)\) are the rotation-vibration (rovibrational) partition functions of the reactants (R) and the transition state (\(\ddagger\)), respectively; and the factor B(T), given by:

$$\begin{aligned} B(T) = \frac{1}{\hbar \beta }\frac{Q_{e}^{\ddagger }}{Q_\textrm{e,R}}\frac{1}{\Phi _{\textrm{rel}}(T)} \end{aligned}$$
(5)

collects Dirac’s constant \(\hbar\) (Planck’s constant divided by 2\(\pi\)), the electronic partition functions, \(Q_e\), of reactants and the transition state, and \(\Phi _{\textrm{rel}}(T)\), which incorporates the relative translational motion of reactants.

In this work, we present the Cathedral Package (CathPkg) [19], a collection of three programs coded in Python focused on the automated simulation of complex reaction networks consisting in elementary reactions that are analyzed employing VTST. As an additional complication, the stationary points of a set of these elementary reactions may present multiple conformations. Currently, CathPkg includes the following programs:

  • Q2DTor calculates accurate partition functions for molecular systems with two coupled hindered rotors [20].

  • Torsiflex finds all conformations of a given flexible molecule [21, 22].

  • Pilgrim evaluates the thermal rate constants by VTST and simulates complex reaction networks by Kinetic Monte Carlo (KMC) [23].

In the following sections, we describe how to employ the above programs, to obtain rovibrational partition functions for the stationary points in the case of multiple conformations (multistructural partition functions) [24,25,26,27,28,29], to incorporate these features into VTST, and to collect this information to simulate kinetic mechanisms.

2 Conformational search

It has been shown that chemical reactions involving molecules with multiple conformations that can be reached by torsional motions are not well represented by a unique structure [24,25,26,27,28,29], even if this structure corresponds to the absolute minimum. Therefore, prior to the evaluation of a multistructural partition function of a given reactant, we need to carry out a conformational search of all minima that can be reached by internal rotations. The program designated to carry out this task is Torsiflex, and the searching procedure is schematically illustrated by the flowchart presented in Fig. 1.

Fig. 1
figure 1

Scheme showing the flowchart of Torsiflex

Torsiflex reads the SMILES line specification of a given molecular species and transforms it into a Cartesian coordinates geometry with RDKit [30]. From the Cartesian coordinates it is possible to generate, applying Graph Theory, the appropriate Z-Matrix geometry as the input for the electronic structure program. This Z-Matrix specifies the torsions of interest in an unambiguous manner, that is, the internal rotation about a given bond is only specified once. At the moment Torsiflex is compatible with Gaussian09 [31] and Gaussian16 [32], which carry out the geometry optimization.

The searching algorithm combines two strategies: initially, it performs a preconditioned search based on chemical knowledge (for instance, a molecule with two contiguous sp\(^3\) carbon atoms tends to have conformations at anti and gauche configurations), subsequently it carries out an stochastic search that maps unexplored regions of the PES. During the search procedure Torsiflex runs a series of unexpensive tests that store the new conformers and avoid redundancies [like exploration of regions close to the already located minima or their enantiomers (if any), which are automatically provided by the program]. This search is carried out at a low electronic structure level (LL). All the located conformers are stored and reoptimized at a high level (HL) by the program. The files associated with each conformer can be directly read by Pilgrim, which is the program that evaluates the multistructural partition functions.

Torsiflex can also be applied to locate conformations of transition state structures. In this case, the construction of the Z-Matrix is more involved. As an example, we have set up a protocol to generate initial transition state structures for hydrogen abstraction reactions from the different isomers of butanol by atomic hydrogen [33].

3 Multistructural rovibrational partition functions

The most common method to treat rotational and vibrational motions, albeit the crudest, is the rigid-rotor harmonic oscillator (RRHO) approximation. The rovibrational partition function for a single-structure, \(Q^\mathrm{SS-HO}\), is simply the product of the two partition functionsFootnote 1:

$$\begin{aligned} Q^\mathrm{SS-HO} = Q_{\textrm{r}}^\textrm{RR} \cdot Q_{\textrm{v}}^\textrm{HO} \end{aligned}$$
(6)

where \(Q_{\textrm{r}}^\textrm{RR}\) and \(Q_{\textrm{v}}^\textrm{HO}\) are the rigid-rotor and harmonic oscillator partition functions for rotation and vibration, respectively.

The natural extension of the RRHO to multiple conformations is to apply this approximation to each of the indistinguishable conformers, leading to the multistructural RRHO partition function, \(Q^\mathrm{MS-HO}\). For a stationary point with n conformers, it is given by:

$$\begin{aligned} Q^\mathrm{MS-HO} = \sum _{j=0}^{n-1} Q^\mathrm{SS-HO}_{j}\exp {[-\beta U_j]} \end{aligned}$$
(7)

where \(U_j\) is the relative energy of the j-th conformer. Notice that, for convenience, the conformers are sorted in increasing order of energy, so \(U_0 = 0\) and

$$\begin{aligned} U_j \le U_{j'} \;\; \forall j < j' \;\; \mid \;\; j,j' \in {\mathbb {N}} \end{aligned}$$
(8)

It is common to multiply the vibrational frequencies by a parametrized scaling factor [34], \(\lambda\), that accounts for zero-point energy (ZPE) anharmonicity and is the product of two independent contributions:

$$\begin{aligned} \lambda =\lambda ^\textrm{H}\lambda ^\textrm{ZPE} \end{aligned}$$
(9)

The first contribution on the right-hand side of Eq. 9 reflects the inexactness of the electronic structure method; it is system independent but is determined by both the electronic structure method and the basis set. The second contribution is due to anharmonicity in the ZPE; it is independent of the electronic structure method but system dependent. There are databases with standard values for \(\lambda\) and \(\lambda ^\textrm{H}\) [35]. However, as \(\lambda ^\textrm{ZPE}\) is system dependent, its parameterized value may be inadequate for some stationary points (mainly transition state structures) of our particular chemical reaction. Some anharmonicity methods allow incorporating specific reaction scaling factors that provide accurate values for the ZPE anharmonicity. For instance, the hybrid degeneracy-corrected [36] second-order vibrational perturbation theory [37] (HDCVPT2) is a good alternative to the tabulated scaling factors. The latter are parametrized factors that depend on the basis set and the electronic structure method but are independent of the molecular system [35].

The vibrational partition function that incorporates a scaling factor is usually referred as quasi-harmonic (QH). Therefore, the QH partition function is the same as the HO one but with the harmonic normal mode frequencies, \(\omega ^\textrm{H}\), multiplied by the \(\lambda\) scaling factor

$$\begin{aligned} \omega ^\textrm{QH}=\lambda \cdot \omega ^\textrm{H} \end{aligned}$$
(10)

Additionally, the treatment of torsional modes as harmonic oscillators is approximate because the conformers can interconvert between them by internal hindered rotations. For flexible molecules with multiple torsions an accurate treatment of torsional anharmonicity should include the coupling between them. These modes can be separated from the non-torsional modes by transforming the force constants matrix from Cartesian to internal coordinates by employing an adequate set of non-redundant internal coordinates or, in a recent treatment, a set of redundant coordinates [38]. One of the most accurate and inexpensive methods to treat coupled multiple torsions is the multistructural torsional method with coupled potential [MS-T(C)] which only requires information of the conformational minima [29]. Its partition function is given by:

$$\begin{aligned} Q^\mathrm{MS-T(C)} = \sum _{j=0}^{n-1} Q^\mathrm{SS-HO}_{j}F^\mathrm{MS-T(C)}_{\textrm{cl},j} \end{aligned}$$
(11)

where \(F^\mathrm{MS-T(C)}_{\textrm{cl},j}\) is a factor that accounts for the product of the ratios between the reference classical and harmonic oscillator classical partition functions of each of the torsions, \(\eta\). The former includes torsional anharmonicity and couplings between the torsions so the quotient between partition functions incorporates these deviations from the harmonic oscillator approximation. For a system with t torsions, this is:

$$\begin{aligned} F^\mathrm{MS-T(C)}_{\textrm{cl},j}=\prod _{\eta =1}^\textrm{t}\frac{q_{j,\eta }^\mathrm{RC(C)}}{q_{j,\eta }^\mathrm{CHO(C)}} \end{aligned}$$
(12)

The reference classical partition function approximates the accurate classical partition function considering a local potential about the conformer with just one cosine term. In this case, it is possible to calculate the partition function analytically, so the approximation is very convenient when several torsions are involved.

In systems with only two coupled torsions, it is possible to build an extended two-dimensional torsional (E2DT) partition function [39]. In this method, the rovibrational partition function is the product of two factors

$$\begin{aligned} Q^\textrm{E2DT} = F^\mathrm{2D-NS}Q^\textrm{EHR} \end{aligned}$$
(13)

The first factor on the right-hand side of Eq. 13 is the ratio between the quantum (q) and classical (cl) two-dimensional non-separable (2D-NS) partition functions:

$$\begin{aligned} F^\mathrm{2D-NS}=\frac{Q_{\textrm{q}}^\mathrm{2D-NS}}{Q_{\textrm{cl}}^\mathrm{2D-NS}} \end{aligned}$$
(14)

whereas the second factor is the extended hindered rotor (EHR) partition function.

Fig. 2
figure 2

Scheme showing the flowchart of Q2DTor

The E2DT partition function can be calculated with the Q2DTor program as indicated in Fig. 2. In this case, all calculations are performed at high level. In a first stage, the program performs an scan over the two torsions (usually every 10 degrees) and a partial optimization of the rest of the geometric parameters. The stored geometries are employed to calculate the reduced moments of inertia employing the methodology developed by Kilpatrick and Pitzer [40]. The potential energy (V) and the reduced moments of inertia (I) at these geometries are fitted to Fourier series, so the two-dimensional Schrödinger equation can be solved by the variational method. The calculated energy levels and the resulting wavefunctions can be employed as a tool to extract information about the torsional motion in the molecule.

Specifically, for systems with two or more conformers with the same energy, torsional tunneling splittings are sometimes large enough to be observed, and they can be directly compared with the theoretical results [41,42,43,44]. One of us has applied the 2D-NS method to calculate the torsional splitting in benzyl alcohol, 3-fluorobenzyl alcohol, and 4-fluorobenzyl alcohol [45]. For instance, in the case of benzyl alcohol there are 4 minima with the same energy, two of them above the phenyl group ring and two below, and the signals could split into a quadruplet due to the internal rotation. However, only a doublet is observed with a reported splitting of 492.82 MHz [42], and our calculations show that it is due to the rotation of the hydrogen atom of the OH group either above the phenyl group plane or either below that plane. The calculated tunneling splitting amounted to 453 MHz.

The evaluation of the E2DT partition function requires a global knowledge of the torsional PES, whereas only local information about the minima is needed in the MS-T(C) method. Therefore, the former method is computationally more demanding than the latter. Both methods can be employed to obtain accurate thermochemical data.

4 Multistructural and multi-path VTST

The multistructural partition functions allow calculating thermal rate constants for reactions that present multiple conformers in both the reactants and the transition state. It is possible to express the multistructural transition state theory (MS-TST) as a function of the single-structure one (SS-TST hereafter, Eq. 4) through a multiplicative factor that accounts for the contribution of conformations:

$$\begin{aligned} k^\mathrm{MS-TST} =F^\mathrm{MS-QH} \cdot k^\mathrm{SS-TST} \end{aligned}$$
(15)

where

$$\begin{aligned} F^\mathrm{MS-QH}=\frac{F^\mathrm{MS-QH}_{\ddagger }}{F^\mathrm{MS-QH}_{\textrm{R}}} \end{aligned}$$
(16)

and

$$\begin{aligned} F^\mathrm{MS-QH}_{\textrm{X}} = \frac{Q^\mathrm{MS-QH}_{\textrm{X}}}{Q^\mathrm{SS-QH}_{\textrm{X}}} \end{aligned}$$
(17)

where X = R or \(\ddagger\) stands for reactants or the transition state, respectively.

Therefore, the multistructural QH version of TST is:

$$\begin{aligned} k^\mathrm{MS-TST} =F^\mathrm{MS-QH} \cdot B(T) \cdot \frac{Q^\mathrm{SS-QH}_{\ddagger }}{Q_{\textrm{R}}^\mathrm{SS-QH}}\exp {[-\beta V_0]} \end{aligned}$$
(18)

where the single-structure partition functions refer to the absolute minimum of reactants and the most stable structure of the transition state, and \(V_0\) is the barrier height between them. Equation 18 can also be written as:

$$\begin{aligned} k^\mathrm{MS-TST} =B(T) \cdot \frac{Q^\mathrm{MS-QH}_{\ddagger }}{Q_\textrm{R}^\mathrm{MS-QH}}\exp {[-\beta V_0]} \end{aligned}$$
(19)

For the anharmonic (Anh) version of MS-TST we introduce another factor \(F^\textrm{Anh}\) that accounts for torsional anharmonicity, and it is given by:

$$\begin{aligned} F^\textrm{Anh}=\frac{F^\textrm{Anh}_{\ddagger }}{F^\textrm{Anh}_{\textrm{R}}} \end{aligned}$$
(20)

and

$$\begin{aligned} F^\textrm{Anh}_{\textrm{X}} = \frac{Q^\textrm{Anh}_{\textrm{X}}}{Q^\mathrm{MS-QH}_\textrm{X}} \end{aligned}$$
(21)

where the method to include torsional anharmonicity could be, for instance, MS-T(C) or E2DT. Notice that \(Q^\textrm{Anh}_{\textrm{X}}\) is also a quasi-harmonic partition function [see Eqs (9) and (10)] to which we have added torsional anharmonicity.

Therefore, the anharmonic version of MS-TST can be written as:

$$\begin{aligned} k^\mathrm{MS-TST}_{\textrm{Anh}} =F^\textrm{Anh} \cdot k^\mathrm{MS-TST} \end{aligned}$$
(22)

or as a function of the SS-TST:

$$\begin{aligned} k^\mathrm{MS-TST}_{\textrm{Anh}} =F^\textrm{Anh} \cdot F^\mathrm{MS-QH} \cdot k^\mathrm{SS-TST} \end{aligned}$$
(23)

The procedure to obtain the rate constants by Eq. 23 consists of the following steps:(i) executing Torsiflex to locate all conformers of the reactants and the transition state; (ii) running MsTor to obtain the MS-T(C) partition functions; and (iii) running Pilgrim to calculate the MS-TST thermal rate constants. For systems with just two torsions, steps (i) and (ii) can be substituted by executing Q2DTor.

The next step is to incorporate variational and SCT tunneling effects into the MS-TST rate constant. On the one hand, if we consider that these two effects are well represented by the ones obtained by employing the transition state conformation with the lowest energy (\(\gamma _0^\mathrm{CVT/SCT}\)), we have the multistructural CVT/SCT rate constant (MS-CVT/SCT), which is given by:

$$\begin{aligned} k^\mathrm{MS-CVT/SCT} =\gamma _0^\mathrm{CVT/SCT} k^\mathrm{MS-TST} \end{aligned}$$
(24)

On the other hand, if variational and tunneling effects are calculated for each of the \(n^\ddagger\) transition state structures, we have the multi-path CVT/SCT rate constant (MP-CVT/SCT), which is given by:

$$\begin{aligned} k^\mathrm{MP-CVT/SCT} =\langle \gamma ^\mathrm{CVT/SCT}\rangle \cdot k^\mathrm{MS-TST} \end{aligned}$$
(25)

where \(\langle \gamma ^\mathrm{CVT/SCT}\rangle\) represents the Boltzmann average of the variational and tunneling contributions of each of the transition state structures, that is,

$$\begin{aligned} \langle \gamma ^\mathrm{CVT/SCT}\rangle =\sum _{j_{\ddagger }= 0}^{n^\ddagger -1}\Gamma ^\textrm{CVT}_{j_{\ddagger }}\kappa ^\mathrm{CVT/SCT}_{j_{\ddagger }}\chi ^\textrm{QH}_{j_{\ddagger }} \end{aligned}$$
(26)

where the Boltzmann factor for the \(j^\ddagger\)-th transition state structure is given by:

$$\begin{aligned} \chi ^\textrm{QH}_{j_{\ddagger }}=\frac{Q^\mathrm{SS-QH}_{j_{\ddagger }}}{Q^\mathrm{MS-QH}_\ddagger }e^{-\beta U_{j_{\ddagger }}} \end{aligned}$$
(27)

Pilgrim can deal with all these flavors of variational transition state theory following the scheme displayed in Fig. 3. Once the MS-TST rate constant is calculated, the MEP is run starting from just the lowest TST, so the MS-CVT/SCT rate constant is obtained, or is run starting on each of the transition state structures, so the MP-CVT/SCT rate constant can be calculated.

Fig. 3
figure 3

Scheme showing the flowchart of Pilgrim

4.1 Kinetic isotope effects

Pilgrim can also be used to evaluate kinetic isotope effects (KIEs) within multi-path variational transition state theory. For instance, we have analyzed different deuterium substitutions in the ethanol molecule employing this methodology and our calculated results were in good agreement with experiment [46, 47]. Ethanol presents two distinguishable conformers and the hydrogen/deuterium abstraction by atomic hydrogen/deuterium also leads to several transition state conformations. For a given isotopic substitution, the KIE is simply:

$$\begin{aligned} \eta ^\mathrm{MP-CVT/SCT}=\frac{k^\mathrm{MP-CVT/SCT}_{\textrm{H}}}{k^\mathrm{MP-CVT/SCT}_{\textrm{D}}} \end{aligned}$$
(28)

where \(k^\mathrm{MP-CVT/SCT}_{\textrm{H}}\) and \(k^\mathrm{MP-CVT/SCT}_{\textrm{D}}\) are the MP-CVT/SCT rate constants for the root and isotopically substituted species, respectively. It is possible to analyze the contribution of each transition state conformer to the final KIE by employing the following expression:

$$\begin{aligned} \eta ^\mathrm{MP-CVT/SCT}=\sum _{j_{\ddagger }= 0}^{n^\ddagger -1}\eta _{j_{\ddagger }} \end{aligned}$$
(29)

where \(\eta _{j_{\ddagger }}\) accounts for the contribution of each reaction path to the total KIE. Each of these individual contributions can be split as a product of a weighting factor that depends exclusively on the isotopic substitution and an individual transition state contribution to the KIE. Pilgrim provides the MP-CVT/SCT thermal rate constants for each of the isotopes, as well as the resulting KIEs.

5 Kinetic Monte–Carlo

Typically, a reaction mechanism encompasses various elementary steps, denoted as \(R_i\). With the aid of Pilgrim, it is possible to evaluate the rate constant of each elementary step separately and track the system’s evolution over time using the kinetic Monte Carlo (KMC) algorithm. It relies on Gillespie’s direct method [48, 49], and can be employed to determine the branching ratios of products and its temperature dependence. This is particularly advantageous in investigations involving numerous elementary reactions, such as those encountered in combustion processes. For example, we have applied this method to examine the thermal decomposition of 1-propanol radicals in one of our studies [6].

The propensity function, \(a_i\), linked to each elementary reaction, \(R_i\), depends on the current population of the reaction reactant(s) and the corresponding rate constant. Precisely, in the infinitesimal time interval \([t,t+dt]\), \(a_i dt\) signifies the likelihood, at time t, that reaction \(R_i\) will transpire within a particular volume V. During every step of the KMC simulation, a distinct elementary step \(R_i\) is selected, and the population of the involved species are modified, assuming that a given time (\(\tau\)) has elapsed.

The reaction is selected employing the nonuniform distribution of propensities with tower sampling, which is a rejection-free approach. More explicitly, for a single random number \(r_1 \in [0,1]\), the algorithm selects the \(R_i\) reaction that meets the following condition:

$$\begin{aligned} \sum _{j=1}^{i-1} a_j < r_1 \cdot \sum _{j=1} a_j \le \sum _{j=1}^{i} a_j \end{aligned}$$
(30)

The elapsed time is determined by a second single random number, \(r_2 \in [0,1]\), through:

$$\begin{aligned} \tau = - \frac{\log (r_2)}{\sum _{i=1} a_i} \end{aligned}$$
(31)

The Pilgrim program executes the algorithm either until the population of the initial reactive species is depleted or until the population of each species reaches the equilibrium.

6 Conclusion

We have devoted our efforts to the development of integrated computational codes that enable non-expert users to perform theoretical studies on chemical kinetics. Our accomplishment, the Cathedral package, is accessible on Github [19] and comprises the following programs:

  • Torsiflex, which identifies all the conformational isomers of flexible acyclic molecules;

  • Q2DTor, which employs the extended two-dimensional torsional (E2DT) approach to handle torsional anharmonicity in flexible molecules with two coupled torsions; and

  • Pilgrim, which utilizes direct-dynamics to compute thermal rate constants of chemical reactions and simulates chemical kinetics mechanisms.

These programs can be applied in numerous fields such as organometallic catalysis, gas-phase mass spectrometry, the simulation of microwave spectra, the calculation of thermodynamic properties, and the study of several chemical reactions that occur in the gas phase. In our research, we concentrate on utilizing these codes for combustion chemistry and the study of processes occurring at ultra-low temperatures.