magnopy.Energy.optimize_generator#

method

Energy.optimize_generator(initial_guess=None, energy_tolerance=1e-05, torque_tolerance=1e-05)[source]#

Optimize classical energy by varying the directions of spins in the unit cell.

Added in version 0.2.0.

Parameters:
initial_guess(M, 3) or (3,) array-like, optional

Initial guess for the direction of the spin vectors.

energy_tolerancefloat, default 1e-5

Energy tolerance for the two consecutive steps of the optimization.

torque_tolerancefloat, default 1e-5

Torque tolerance for the two consecutive steps of the optimization.

Yields:
energyfloat

Classical energy of the iteration step

gradient(M, 3) numpy.ndarray

Gradient vectors for each spin of the iteration step.

spin_directions(M, 3) numpy.ndarray

Directions of the spin vectors of the iteration step.

See also

optimize