spirit-code / spirit

Atomistic Spin Simulation Framework
http://spirit-code.github.io
MIT License
118 stars 52 forks source link

Defining anisotropies #570

Open davidcortesortuno opened 4 years ago

davidcortesortuno commented 4 years ago

Hi, is it possible to add more than a single uniaxial anisotropy in the inpute file? Or is it possible through the Python API? Can I also add a cubic anisotropy? I could not find any information in the docs, I only saw that there is a way to specify anisotropy from a file.

MSallermann commented 4 years ago

Hi, in the input file you can specify multiple uniaxial anisotropies by a syntax like this:

n_anisotropy 2
i Kx Ky Kz K
0  0  0  1  2
1  1  0  0  1

The feature is briefly described in here https://spirit-docs.readthedocs.io/en/latest/core/docs/Input.html. The first column is the index of the spin in the basis cell to which the anisotropy is applied. Then we have the components of the normalized direction vector and lastly the strength of the anisotropy. Unfortunately, a cubic aniostropy is not implemented at this time.

Zeleznyj commented 4 years ago

Hi, I've implemented a cubic anisotropy, based on suggestions provided by @GPMueller. You can check the code here, I've tested it and it seems to be working fine. It is a fairly old version of Spirit though, I've implemented it a year ago and did not update to the newest version.

GPMueller commented 4 years ago

@Zeleznyj if you'd like you could try to branch from the most recent develop version and create a pull request, would be cool to have cubic anisotropy in Spirit.