<p>Noncollinear magnets are notoriously difficult to describe within first-principles approaches based on density-functional theory (DFT) because of the presence of low-lying spin excitations. At the level of ground-state calculations, several methods exist to constrain the magnetic moments to a predetermined configuration, and thereby accelerate convergence towards self-consistency. Their use in a perturbative context, however, remains very limited. Here we present a general methodological framework to achieve parametric control over the local spin moments at the linear-response level. Our strategy builds on the concept of Legendre transform to switch between various flavors of magnetic functionals, and to relate their second derivatives via simple linear-algebra operations. Thereby, we can address an arbitrary response function at the time-dependent DFT level of theory with optimal accuracy and minimal computational effort. In the low frequency limit, we identify the leading correction to the existing adiabatic formulation of the problem [S. Ren , Phys. Rev. X 14, 011041 (2024)], consisting in a renormalization of the phonon and magnon masses due to electron inertia. As a demonstration, we apply our methodology to the THz optical response of bulk CrI3 and Cr2O3, where we identify contributions from hybrid (electro)magnons with mixed spin-lattice character. </p>
<p>This dataset contains the input and output files used to produce the results presented in sections V and VI of the manuscript.</p>
<p> </p>