magnopy-optimize-sd#
This scenario optimizes classical energy of the spin Hamiltonian and finds the spin directions that describe a local minima of the energy landscape.
Arguments of the script#
To get the best description of the input parameters that correspond to the magnopy version that you have installed run the command
magnopy-optimize-sd --help
That should output something similar to
usage: magnopy-optimize-sd [-h] -sf filename -ss name [-sv [S1 S2 S3 ... ...]]
[-et ENERGY_TOLERANCE] [-tt TORQUE_TOLERANCE]
[-mf MAGNETIC_FIELD MAGNETIC_FIELD MAGNETIC_FIELD]
[-of OUTPUT_FOLDER]
[-msdi xa_1 xa_2 xa_3 xa_1 xa_2 xa_3 xa_1 xa_2 xa_3]
███╗ ███╗ █████╗ ██████╗ ███╗ ██╗ ██████╗ ██████╗ ██╗ ██╗
████╗ ████║ ██╔══██╗ ██╔════╝ ████╗ ██║ ██╔═══██╗ ██╔══██╗ ╚██╗ ██╔╝
██╔████╔██║ ███████║ ██║ ███╗ ██╔██╗ ██║ ██║ ██║ ██████╔╝ ╚████╔╝
██║╚██╔╝██║ ██╔══██║ ██║ ╚██║ ██║╚██╗██║ ██║ ██║ ██╔═══╝ ╚██╔╝
██║ ╚═╝ ██║ ██║ ██║ ╚██████╔╝ ██║ ╚████║ ╚██████╔╝ ██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝
▄ ▄
Version: 0.1.8 █▀█▀█
Documentation: magnopy.org █▄█▄█
Release date: 26 June 2025 ███ ▄▄
License: GNU GPLv3 ████ █ █
Copyright (C) 2023-2025 Magnopy Team ████ █
▀▀▀▀▀▀▀▀
This script optimizes classical energy of the spin Hamiltonian and finds the spin directions that describe a local minima of the energy landscape.
options:
-h, --help show this help message and exit
-sf, --spinham-filename filename
Path to the spin Hamiltonian file, from where the
parameters would be read.
-ss, --spinham-source name
Source of the spin Hamiltonian. Either "GROGU" or
"TB2J"
-sv, --spin-values [S1 S2 S3 ... ...]
In the case when the parameters of spin Hamiltonian
comes from TB2J, one might want to change the values
of spins to be closer to half-integers. This option
allows that. Order of the M numbers should match the
order of magnetic atoms in the spin Hamiltonian. Note
that those numbers are always positive. To specify AFM
order use opposite spin directions and not spin values
of the opposite sign.
-et, --energy-tolerance ENERGY_TOLERANCE
Tolerance parameter. Difference between classical
energies of two consecutive optimization steps.
-tt, --torque-tolerance TORQUE_TOLERANCE
Maximum torque among all spins.
-mf, --magnetic-field MAGNETIC_FIELD MAGNETIC_FIELD MAGNETIC_FIELD
Vector of external magnetic field, given in the units
of Tesla.
-of, --output-folder OUTPUT_FOLDER
Folder where all output files of magnopy wil be saved.
-msdi, --make-sd-image xa_1 xa_2 xa_3 xa_1 xa_2 xa_3 xa_1 xa_2 xa_3
Plots optimized spin directions and saves it in .html
file, that can be viewed within any modern browser.
Expects three integers as an input - the supercell
that will be plotted. Pass 1 1 1 to plot only the unit
cell.
At the very beginning there is a syntax for the usage of the script, where required arguments are given without brackets and optional arguments are written with brackets. Then there is a logo of magnopy, followed by the list of supported arguments with their short and long names and explanation of what they represent.
For example, for the filename with the parameters of the spin Hamiltonian one can use a keyword argument with short name "-sf" or with its long name "--spinham-filename" like
magnopy-optimize-sd -sf spinHamiltonian.txt
Interpretation of the output#
The script print in the console the progress of the calculation. Use the stream redirect to save it to a file
magnopy-optimize-sd ... > output.txt
Some of the data and pictures will be saved in the folder with the name defined by the
value of -of, --output-folder argument.