Note that the implementation of XMS in OpenMolcas is not completely invariant even though the original theory is. This is because the internal contraction scheme used is the so-called single-state single-reference (SS-SR) one, in which the zeroth-order Hamiltonian (specifically, QSD and QTQ••• in Eq. ( )) and the first-order wavefunction are state-specific and parameterized according to Eq. ( ). In contrast, the multistate MR (MS-MR) scheme, used in the original XMS method, defines the first-order wavefunction as