  We propose a data-driven approach for constructing machine-learning
interatomic potentials (MLIPs) trained under a regularization with the aim of
avoiding nonphysical heat flux. Specifically, we introduce a regularization
term for the heat flux into the cost function of MLIPs to be minimized. Since
the treatment of heat flux using MLIPs with regularization can be decomposed
into elemental contributions or conducted in frequency space, this approach is
expected to be useful for investigating the origin of thermal conductivity
obtained from the Green-Kubo formula. However, the strength of regularization
needs to be appropriately set because it may reduce not only the nonphysical
part but also the intrinsic heat flux one. To this end, we investigated the
conditions for constructing MLIPs that can reproduce the power spectra of heat
flux associated with the empirical interatomic potential of Ag$_2$Se, which
consists of pairwise functions and do not contain a nonphysical heat flux. The
appropriate strength could be estimated from the variation of the magnitude of
regularization term as well as root mean square errors for total potential
energy, atomic force, and virial stress with respect to the strengths, without
reference spectrum data. As an application example, we explored the differences
in power spectra between superionic and nonsuperionic conducting phases based
on the heat flux regularization to MLIPs trained with the first-principles
calculation data of Ag$_2$S. Furthermore, our results demonstrate that training
with the regularization improves the robustness of MLIPs as well as the
reduction of the nonphysical heat flux.
