# A Neural Network-Inspired Matrix Formulation of Chemical Kinetics for Acceleration on GPUs
## 2 Methodology
### Reaction Decomposition and Classification  
As mentioned in Section 2.1, not all reactions need to be reversible in a given mechanism. Oftentimes, Arrhenius parameters for _reverse_ rate constants are provided directly, in which case a physically reversible reaction is supplied to the user through the mechanism files as two irreversible (forward) reactions parameterized by the corresponding Arrhenius constants. In this scenario, the computation of the equilibrium rate constant (Equation (9)) for one reaction is effectively traded for an additional Arrhenius rate constant evaluation (Equation (6)). With this in mind, any given reaction matrix \(\mathbf{A}\) initialized as a contiguous column-major matrix of size \(N_{C}\times N_{R}\) is constructed such that it decomposes into two sub-matrices: one for _irreversible_ reactions and the other for _reversible_ reactions. More formally, in general, there are \(N_{R,irv}\) and \(N_{R,rev}\) irreversible and reversible reactions, respectively, where \(N_{R}=N_{R,irv}+N_{R,rev}\). The matrix \(\mathbf{A}\) is then partitioned into two smaller matrices along the reaction axis as \(\mathbf{A}=[\mathbf{A}_{irv};\mathbf{A}_{rev}]\), where \(\mathbf{A}_{irv}\) is the \(N_{C}\times N_{R,irv}\) sub-matrix of \(\mathbf{A}\) corresponding to irreversible reactions, \(\mathbf{A}_{rev}\) is the \(N_{C}\times N_{R,rev}\) sub-matrix corresponding to  
Figure 2: (**a**) Interpretations of a matrix in column major (**left**) and row major (**right**) formats. The gray shapes within the matrices show the storage method as a stacking of \(N_{R}\) column vectors (for column major) or \(N_{C}\) row vectors (for row major). (**b**) Decomposition of a reaction matrix into \(N_{R,irv}\) irreversible and \(N_{R,rev}\) reversible sub-matrices, each with another set of sub-matrices corresponding to standard, falloff, and pressure-log reaction types. reversible reactions, and \([;]\) is a concatenation operator. This separation is advantageous in practice because additional matrix operations are required for reversible reactions (i.e., the equilibrium rate constant evaluations of Equation (9)) that are absent from irreversible reactions. Since these operations are expensive, performing them on the full matrix \(\mathbf{A}\) is wasteful for mechanisms that observe a large number of irreversible reactions. Furthermore, the column-major data structure ensures that the two sub-matrices \(\mathbf{A}_{irv}\) and \(\mathbf{A}_{rev}\) are still contiguous in memory, a necessary requirement for GPU-optimized matrix multiplication algorithms. As a result, the arrangement of a reaction matrix as two concatenated sub-matrices allows for efficient matrix operations on both subsets, or the full matrix, whenever necessary. In a similar process, each sub-matrix \(\mathbf{A}_{irv}\) and \(\mathbf{A}_{rev}\) can again be decomposed into a set of smaller sub-matrices categorized by specific reaction types. As mentioned above, in this work, the three most commonly encountered reaction types are considered:  
1. _Standard reactions_ utilize the standard Arrhenius equation for the forward rate constant (Equation (6)). They may or may not include third body contributions. 2. _Falloff reactions_ employ significantly more complex expressions of the forward rate constant computation for reactions involving third bodies. Falloff reactions can be Lindemann, Troe, or SRI type, each with slightly different implementations. The reader is referred to the Cantera [26] or Chemkin [27] documentation for mathematical details. 3. _Pressure-log reactions_ add pressure dependence into the computation of the forward rate constant through an interpolation routine. They may or may not include third body contributions. The reader is referred to the Cantera or Chemkin documentation for mathematical details.