Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge algorithm for non-collinear systems #49

Merged
merged 12 commits into from
Apr 18, 2024
Merged

Conversation

antelmor
Copy link
Contributor

Consider the anisotropic exchange tensor $J_{ij}$ describing the interaction between two magnetic sites with local magnetic moments $\mathbf{m}_i$ and $\mathbf{m}_j$. Let $\hat{\mathbf{u}}_{ij}$ be a unit vector that is normal to both $\mathbf{m}_i$ and $\mathbf{m}_j$. Then, we can only obtain the projection $\hat{\mathbf{u}}^T J_{ij} \hat{\mathbf{u}}$ with a single TB2J calculation. The latter can be written as

$\hat{\mathbf{u}}^T J_{ij} \hat{\mathbf{u}} = \hat{J}_{ij}^{xx} u_x^2 + \hat{J}_{ij}^{yy} u_y^2 + \hat{J}_{ij}^{zz} u_z^2 + 2\hat{J}_{ij}^{xy} u_x u_y + 2\hat{J}_{ij}^{yz} u_y u_z + 2\hat{J}_{ij}^{zx} u_z u_x$,

where we considered $J_{ij}$ to be symmetric.

If we perform six calculations such that $\hat{\mathbf{u}}_{ij}$ lies along six different directions, then we obtain six linear equations which can be solved for the six independent unknown components of $J_{ij}$.

When $\mathbf{m}_i$ and $\mathbf{m}_j$ are parallel to each other, then we can use the components of $J_{ij}$ along the plane orthogonal to both $\mathbf{m}_i$ and $\mathbf{m}_j$ . Thus, with six different calculations, we could obtain more than six equations for the six components of $J_{ij}$ . In this case, we can obtain the tensor components by a least squares method.

@mailhexu
Copy link
Owner

Hello Andres,
@antelmor Thank you!

  • Could you keep the legacy TB2J_merge.py and put the new script into TB2J_merge2.py, so that when $m_i$ and $m_j$ are parallel, we don't need to redo all the calculations. Or do you think even in these cases, the six-state method should replace the legacy one?
  • Could you add a simple tutorial in doc/src/rotate_and_merge.rst?
  • How do we get the infomation of the magnetic moments, by the user input or by reading the siesta/openmx/abacus output? I don't think the Wannier functions work well with the strong non-collinear case in the current implementation so perhaps we don't need to worry about how to read from other codes for the moment.
    Best wishes,
    HeXu

@antelmor
Copy link
Contributor Author

Hello @mailhexu.

  • This new script is a generalization of the legacy TB2J_merge.py. It also works for the collinear cases in which we only need three configurations. The script doesn't require a specific number of rotated configurations; it always gives the best result considering all the configurations given to the script. If we give too few configurations, the results will have a large error. In the case of a collinear system, we need to provide at least three non-parallel configurations; whereas for a non-collinear system, we need at least six. In the most recent commit, I added a warning message that tells the user when more configurations are required. Furthermore, this script works the same if the configurations are spin-rotated or structure-rotated. This differs from the legacy script, where the user had to tell which rotation type was used.
  • I will add a tutorial considering both a collinear and a non-collinear system.
  • The script gets the magnetic moments from the TB2J.pickle of each finished calculation. So far I have only tested the script with Siesta-TB2J calculations. Could this change if we use Wannier-TB2J calculations?

@mailhexu
Copy link
Owner

Hello Andres,
Thanks!
Don't worry about the Wannier-TB2J calculation for the non-collinear cases. For now I will add that the Wannier-TB2J interface is dis-encouraged in the documentation if the spin is not almost collinear.
I will check again and merge when the documentation is ready.
Best regard,
HeXu

@antelmor
Copy link
Contributor Author

Hello @mailhexu.

I have modified the script to rotate the structures; it can now generate the structures required for a noncollinear system. Moreover, I have created an additional script for the TB2J-SIESTA calculations, where you can globally rotate the magnetic moments contained in the density matrix file of an SIESTA calculation. This is helpful when a user wants to rotate the spins instead of the structure. Finally, I have updated the rotate_and_merge.rst file with the required documentation for all the scripts.

Best,
Andres.

@mailhexu mailhexu merged commit c339bcb into mailhexu:master Apr 18, 2024
1 check passed
@mailhexu
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants