spirit-code / spirit

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

Core: give maximum force component without dt #438

Open GPMueller opened 6 years ago

GPMueller commented 6 years ago

In the API, the max. force should be returned with the dt-scaling removed. Also, the convergence should probably be checked accordingly, as a smaller time-step may otherwise lead to earlier convergence than with a rough time-step, irrespective of the actual precision of the convergence.

Question: how to do the temperature-dependent force contributions?

GPMueller commented 3 years ago

For the case of energy-minimisation and GNEB-calculations, the case is clear:


For dynamics calculations according to the equation grafik convergence can be defined in the same way as above, but there are additional considerations:


For Monte Carlo calculations, I know of no use-case which would make use of energy gradients as a convergence criterion, but it is conceivable that the maximum torque norm could be a useful quantity to calculate.

Conclusion

The max. force is meant mainly as an indicator for convergence in the given energy landscape. For single systems (LLG/MC/MMF) the quantity to be logged and provided in the API should be the maximum norm of the gradient torques, while for the GNEB method it should be that of the total torque (gradient plus virtual forces).

For dynamics simulations the thremal and spin-current torques may each be interesting quantities for a user to know, in particular in relation to the damping torque. However, it is probably not worth the effort to calculate them on each iteration. It would be nice (but not necessary) to log their values at each step and provide an API-function to get their values (an additional bonus would be to be able to get the contributions to the gradient-force).

Unfortunately, for the LLG method, the fields are only turned into torques after being added together, so that the calculation of the max. torque will require additional orthogonalisations which will cost some runtime.