# TB2J: A python package for computing magnetic interaction parameters

## Description

We present TB2J, a Python package for the automatic computation of magnetic interactions, including exchange and Dzyaloshinskii-Moriya, between atoms of magnetic crystals from the results of density functional calculations. The program is based on the Green’s function method with the local rigid spin rotation treated as a perturbation. As input, the package uses the output of either Wannier90, which is interfaced with many density functional theory packages, or of codes based on localized orbitals. One of the main interest of the code is that it requires only one first-principles electronic structure calculation in the non-relativistic case (or three in the relativistic case) and from the primitive cell only to obtain the magnetic interactions up to long distances, instead of first-principles calculations of many different magnetic configurations and large supercells. The output of TB2J can be used directly for the adiabatic magnon band structure and spin dynamics calculations. A minimal user input is needed, which allows for easy integration into high-throughput workflows.