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, quantum_correction=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 theoutput_folder.- Parameters:
- spinham
SpinHamiltonian 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, thenos.path.abspath(pathname)is used to show full paths to the output and input files. IfTrue, then onlypathnameis used.- quantum_correctionbool, default False
Whether to include quantum correction to the energy in the optimization. If
True, then it optimizesEnergy.E_0()+Energy.E_corr(). IfFalse, then it optimizesEnergy.E_0()only.Warning
This option is experimental. Will be improved and tested in future releases. Use with caution.
- spinham
- Raises:
- ValueError
If
len(supercell) != 3.- ValueError
If
supercell[0] < 1orsupercell[1] < 1orsupercell[2] < 1.