In order to construct the coupling matrix, we need the explicit form of matrix elements of \( {W}^{Jp}_{\gamma, \gamma'}(R) \).
Matrix elements of the interaction potential are given as
Here, \( v_{\boldsymbol{\lambda},\gamma,\gamma'} (R) \) denotes the radial coupling terms of the potential energy surface:
i.e. the 3D molecule - atom PES, \( V(R, r, \theta) \), averaged over Legendre polynomials, \( P_{\lambda} (\cos\theta)\), and rovibrational wave functions of the isolated molecule, \( \chi_{\eta}(r) \), where \( \eta = v, j\). Note that they are independent of \( J \) and \( p \).
\( g_{{\lambda},\gamma,\gamma'}^{Jp} \) are the algebraic coefficients of the expansion which stem from matrix elements of Legendre polynomials, \( P_{\lambda} (\cos\theta) \) in the \( \gamma \) basis. They are given as
where quantities in brackets are the 3-j symbols.
Algebraic coefficients are \(R\)-independent and are calculated only once per each block. Note that they are block-diagonal with respect to \(\bar{\Omega}\).
Procedure check_nonzero_pes_matrix_elements first checks how many matrix elements fulfill the \( \delta_{\bar{\Omega},\bar{\Omega}'} \) condition - this is saved in the number_of_nonzero_pes_matrix_elements variable. On top of that, for each non-zero matrix element, the number of non-zero terms in the sum over \(\lambda\) is checked and saved in number_of_nonzero_algebraic_coefficients variable. The coefficients are calculated with prepare_pes_matrix_elements procedure and saved in the nonzero_coupling_coefficients variable. The corresponding \( \lambda \) indices are written indirectly in nonzero_legendre_indices array which holds indices to legendre_indices.
The centrifugal term, \( \mathbf{L}^{2\,Jp}_{\gamma, \gamma'} \), is block-diagonal with respect to the rotational quantum number \( j \). Terms diagonal with respect to \( \bar{\Omega} \) are given as
The centrifugal term additionally introduces couplings with \( \bar{\Omega} \) and \( \bar{\Omega}' = \bar{\Omega} \pm 1 \) blocks