  Anisotropic magnetic exchange interactions lead to a surprisingly rich
variety of the magnetic properties. Considering the spin orbit coupling (SOC)
as perturbation, we extract the general expression of a bilinear spin
Hamiltonian, including isotropic exchange interaction, antisymmetric
Dzyaloshinskii-Moriya (DM) interaction and symmetric $\Gamma $ term. Though it
is commonly believed that the magnitude of the DM and $\Gamma $ interaction
correspond to the first and second order of SOC strength $% \lambda $
respectively, we clarify that the term proportional to $\lambda ^{2}$ also has
contribution to DM interaction. Based on combining magnetic force theorem and
linear-response approach, we have presented the method of calculating
anisotropic magnetic interactions, which now has been implemented in the open
source software WienJ. Furthermore, we introduce another method which could
calculate the first and second order SOC contribution to the DM interaction
separately, and overcome some shortcomings of previous methods. Our methods are
successfully applied to several typical weak ferromagnets for $3d$, $4d$ and
$5d$ transition metal oxides. We also predict the conditions where the DM
interactions proportional to $\lambda $ are symmetrically forbidden while the
DM interactions proportional to $\lambda ^{2}$ are nonzero, and believe that it
is widespread in certain magnetic materials.
