magnopy.scenarios.optimize_sd#

magnopy.scenarios.optimize_sd(spinham, supercell=(1, 1, 1), magnetic_field=None, energy_tolerance=1e-05, torque_tolerance=1e-05, output_folder='magnopy-results', comment=None, no_html=False, hide_personal_data=False) None[source]#

Optimizes classical energy of spin Hamiltonian and finds a set of spin directions that describes local minima of the energy landscape.

Progress of calculation is shown in the standard output (print()). A bunch of the output files is created and saved on the disk inside the output_folder.

Parameters:
spinhamSpinHamiltonian

Spin Hamiltonian object.

supercell(3, ) tuple of int, default (1, 1, 1)

Added in version 0.2.0.

Tuple with number of repetitions of the unit cell along each lattice vector. Spin directions are varied within the supercell during the optimization. By default, optimization is done within the unit cell.

magnetic_field(3, ) array-like

Vector of external magnetic field (magnetic flux density, B), given in Tesla.

energy_tolerancefloat, default 1e-5

Tolerance parameter. Difference between classical energies of two consecutive optimization steps.

torque_tolerancefloat, default 1e-5

Tolerance parameter. Maximum torque among all spins at the current optimization step.

output_folderstr, default "magnopy-results"

Name for the folder where to save the output files. The folder is created if it does not exist.

commentstr, optional

Any comment, that will be shown in the standard output right after the magnopy's logo.

no_htmlbool, default False

Added in version 0.2.0.

Whether to produce .html files. If no_html = False, then Plotly is expected to be available.

hide_personal_databool, default False

Added in version 0.2.0.

If False, then os.path.abspath(pathname) is used to show full paths to the output and input files. If True, then only pathname is used.

Raises:
ValueError

If len(supercell) != 3.

ValueError

If supercell[0] < 1 or supercell[1] < 1 or supercell[2] < 1.