This script merges the contributions of different rotated configurations to obtain the full exchange tensor. It can deal with non-collinear systems.
The algorithm is as follows:
Let $J_{ij}$ be the exchange tensor and $R_i$, $R_j$ the matrices that rotate the local magnetic moments into the $z$-axis. We obtain $J_{ij}' = R_i J_{ji} R_j^T$. Then, we set all the $z$ components to zero and recover the exchange tensor with
$\hat{J_{ij}} = R_i^T J_{ij}' R_j$.
In other to preserve the condition $J_{ij}(\mathbf{d}) = J_{ij}^T(-\mathbf{d})$, we need to repeat the process with the matrices $R_i$ and $R_j$ interchanged. That is, we calculate $\hat{J_{ij}}' = R_j \hat{J_{ij}} R_i^T$ and then discard all of its $z$ components. Finally, we obtain
$\tilde{J_{ij}} = R_j^T \hat{J_{ij}}' R_i$.
This script merges the contributions of different rotated configurations to obtain the full exchange tensor. It can deal with non-collinear systems.
The algorithm is as follows:
Let $
J_{ij}
$ be the exchange tensor and $R_i
$, $R_j
$ the matrices that rotate the local magnetic moments into the $z
$-axis. We obtain $J_{ij}' = R_i J_{ji} R_j^T
$. Then, we set all the $z
$ components to zero and recover the exchange tensor with $\hat{J_{ij}} = R_i^T J_{ij}' R_j
$.In other to preserve the condition $
J_{ij}(\mathbf{d}) = J_{ij}^T(-\mathbf{d})
$, we need to repeat the process with the matrices $R_i
$ and $R_j
$ interchanged. That is, we calculate $\hat{J_{ij}}' = R_j \hat{J_{ij}} R_i^T
$ and then discard all of its $z
$ components. Finally, we obtain $\tilde{J_{ij}} = R_j^T \hat{J_{ij}}' R_i
$.